

:root {
  --bg: linear-gradient(to top right, #292A5E,#67C0D2);
  --surface: #ffffff;
  --ink: #0e1726;
  --muted: #FFFFFFF;
  --line: #cbd3df;
  --blue: #1d4ed8;
  --green: #0f8a5f;
  --amber: #b45309;
  --violet: #6d28d9;
  --cat: var(--blue);
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 10px;
  --header-h: 4.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: linear-gradient(to top right, #292A5E,#67C0D2);
    --surface: #121b2e;
    --ink: #e6ecf5;
    --muted: #FFFFFF;
    --line: #26324a;
    --blue: #7ea0ff;
    --green: #3dd6a0;
    --amber: #f5b04a;
    --violet: #b9a3ff;
    --btn : #292A5E;
  }
}

body[data-page="perso"] { --cat: var(--green); }
body[data-page="scolaire"] { --cat: var(--amber); }
body[data-page="badges"] { --cat: var(--violet); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg { max-width: 100%; }
a { color: inherit; text-underline-offset: 0.2em; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }

:focus-visible { outline: 3px solid var(--cat); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(72rem, 100% - 2.5rem); margin-inline: auto; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--ink); color: var(--bg);
  padding: 0.5rem 1rem; border-radius: var(--radius); z-index: 100;
}
.skip-link:focus { top: 0.75rem; }

/* ---------- En-tête ---------- */
#site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 1.5rem; min-height: var(--header-h); }
.brand {
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
  text-decoration: none; letter-spacing: -0.01em; margin-right: auto;
}
.nav-list { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  text-decoration: none; font-weight: 500; color: white;
  padding: 0.35rem 0; border-bottom: 2px solid transparent;
}
.nav-list a:hover { color: var(--ink); }
.nav-list a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--cat); }
.icon-link {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem;
  border: 1px solid var(--line); border-radius: 50%; color: var(--ink);
}
.icon-link:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.icon-link svg { width: 1.15rem; height: 1.15rem; }
.nav-toggle {
  display: none; width: 2.5rem; height: 2.5rem; padding: 0;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); cursor: pointer;
}
.nav-toggle svg { width: 1.3rem; height: 1.3rem; margin: auto; display: block; }

@media (max-width: 52rem) {
  .bar { flex-wrap: wrap; gap: 0.75rem; padding-block: 0.6rem; }
  .nav-toggle { display: block; order: 3; }
  .icon-link { order: 2; }
  nav { order: 4; width: 100%; display: none; }
  .nav-open nav { display: block; }
  .nav-list { flex-direction: column; gap: 0; padding-bottom: 0.5rem; }
  .nav-list a { display: block; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
}


.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--ink); color: var(--btn);
  border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 0.7rem 1.25rem; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); background: transparent; }
.btn-small { padding: 0.4rem 0.9rem; font-size: 0.95rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

/* ---------- Accueil ---------- */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero-grid { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 62rem) { .hero-grid { grid-template-columns: 1.1fr 0.9fr; } }

.hero h1 {
  font-size: clamp(3.4rem, 11vw, 7.5rem);
  font-weight: 800; letter-spacing: -0.04em; line-height: 0.92;
}
.hero h1 span { display: block; }
.hero .role {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem); margin: 1.75rem 0 0.35rem;
}
.hero .school { color: var(--muted); margin: 0; }
.hero .lead { max-width: 52ch; margin: 1.5rem 0 0; }

.topology { width: 100%; max-width: 28rem; justify-self: center; height: auto; overflow: visible; }
.topology .cable { fill: none; stroke-width: 3; stroke-linecap: round; }
.topology .c1 { stroke: var(--blue); }
.topology .c2 { stroke: var(--green); }
.topology .c3 { stroke: var(--amber); }
.topology .c4 { stroke: var(--violet); }
.topology .c5 { stroke: var(--ink); }
.topology .pill { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.topology .pill-text { fill: var(--ink); font: 600 13.5px var(--font-body); text-anchor: middle; dominant-baseline: central; }
.topology .hub { fill: var(--ink); }
.topology .hub-text { fill: var(--bg); font: 700 15px var(--font-display); text-anchor: middle; dominant-baseline: central; }
.topology .led { stroke: var(--surface); stroke-width: 2; }
.topology .led.c1 { fill: var(--blue); }
.topology .led.c2 { fill: var(--green); }
.topology .led.c3 { fill: var(--amber); }
.topology .led.c4 { fill: var(--violet); }
.topology .led.c5 { fill: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .topology .cable {
    stroke-dasharray: 1; stroke-dashoffset: 1;
    animation: draw 1.1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  .topology .cable:nth-of-type(2) { animation-delay: 0.12s; }
  .topology .cable:nth-of-type(3) { animation-delay: 0.24s; }
  .topology .cable:nth-of-type(4) { animation-delay: 0.36s; }
  .topology .cable:nth-of-type(5) { animation-delay: 0.48s; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--line); }
.section h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin-bottom: 1.25rem; }
.two-col { display: grid; gap: 2rem 4rem; }
@media (min-width: 58rem) { .two-col { grid-template-columns: 0.8fr 1.2fr; } }
.two-col p { margin: 0 0 1rem; max-width: 60ch; }

.skills { margin: 0; display: grid; gap: 1.25rem 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.skills dt { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.skills dd { margin: 0.2rem 0 0; color: var(--muted); }

.doors { display: grid; border-top: 2px solid var(--ink); }
.door {
  display: grid; gap: 0.25rem 2rem; padding: 1.4rem 0.25rem;
  border-bottom: 1px solid var(--line); text-decoration: none;
}
@media (min-width: 52rem) { .door { grid-template-columns: 14rem 1fr auto; align-items: baseline; } }
.door-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.door-text { color: var(--muted); }
.door-meta { color: var(--muted); font-size: 0.95rem; }
.door:hover .door-title { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.25em; }

.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 1.5rem; }
.page-head h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; letter-spacing: -0.035em; }
.page-head p { color: var(--muted); max-width: 58ch; margin: 1rem 0 0; }
.page-head::after { content: ""; display: block; width: 4.5rem; height: 5px; background: var(--cat); margin-top: 1.5rem; border-radius: 3px; }

.timeline { padding-bottom: 4rem; }
.year-group { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0 2rem; padding: 1.5rem 0 0; }
.year {
  font-size: 2rem; font-weight: 700; color: var(--cat);
  position: sticky; top: calc(var(--header-h) + 1rem); align-self: start;
}
.entries { border-left: 2px solid var(--line); padding-left: 2rem; }
.entry { position: relative; padding-bottom: 2.25rem; display: flex; gap: 1.5rem; justify-content: space-between; }
.entry::before {
  content: ""; position: absolute; left: calc(-2rem - 8px); top: 0.5rem;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--cat);
}
.entry.is-ongoing::before { background: var(--cat); }
.entry-date { margin: 0 0 0.2rem; color: var(--muted); font-size: 0.95rem; }
.entry h3 { font-size: 1.45rem; margin-bottom: 0.4rem; }
.entry-lines p { margin: 0; max-width: 62ch; }
.entry-lines p:first-child { font-weight: 500; }
.entry-lines p:not(:first-child) { color: var(--muted); }
.entry-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.9rem; }
.entry-media { width: 5.5rem; height: 5.5rem; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); flex: none; }
.chip {
  display: inline-block; margin-left: 0.5rem; padding: 0.05rem 0.6rem;
  background: var(--cat); color: var(--bg); border-radius: 99px;
  font-size: 0.82rem; font-weight: 600;
}
.empty { color: var(--muted); padding: 2rem 0; }

@media (max-width: 40rem) {
  .year-group { grid-template-columns: 1fr; }
  .year { position: static; margin-bottom: 0.75rem; }
  .entries { padding-left: 1.5rem; }
  .entry::before { left: calc(-1.5rem - 8px); }
  .entry { flex-direction: column-reverse; justify-content: flex-end; gap: 0.75rem; }
  .entry-media { width: 4.5rem; height: 4.5rem; }
}

.badge-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); padding-bottom: 1rem; }
.badge-tile {
  background: #fff; color: #0e1726; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 0.5rem; min-height: 18rem;
}
.badge-tile h3 { font-size: 1.05rem; }
.badge-meta { margin: 0; color: #52607a; font-size: 0.9rem; }
.badge-link { text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.badge-link:hover h3 { text-decoration: underline; }
.empty-state { border: 2px dashed var(--line); border-radius: var(--radius); padding: clamp(1.75rem, 5vw, 3.5rem); max-width: 42rem; }
.empty-state h2 { font-size: 1.8rem; margin-bottom: 0.75rem; }
.empty-state p { margin: 0; color: var(--muted); }

.contact-list { list-style: none; margin: 0; padding: 0; max-width: 40rem; border-top: 2px solid var(--ink); }
.contact-row { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 0.25rem; border-bottom: 1px solid var(--line); }
.contact-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); flex: none; }
.contact-icon svg { width: 1.2rem; height: 1.2rem; }
.contact-text { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.contact-text a, .contact-text span:last-child { overflow-wrap: anywhere; }
.contact-label { color: var(--muted); font-size: 0.9rem; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 0.4rem; background: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 0.4rem 0.8rem; font: inherit; font-size: 0.92rem; cursor: pointer;
}
.copy-btn:hover { border-color: var(--ink); }
.copy-btn svg { width: 1rem; height: 1rem; }

.detail { padding: clamp(2.5rem, 6vw, 4.5rem) 0 4rem; max-width: 46rem; }
.detail h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 1.5rem; }
.prose h2 { font-size: 1.6rem; margin: 2rem 0 0.75rem; }
.prose h3 { font-size: 1.25rem; margin: 1.5rem 0 0.5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }

#site-footer { border-top: 1px solid var(--line); margin-top: 2rem; color: var(--muted); font-size: 0.95rem; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; padding-block: 1.5rem; }
.foot p { margin: 0; }

.preview-banner { background: var(--amber); color: #fff; text-align: center; padding: 0.45rem 1rem; font-weight: 600; font-size: 0.95rem; }
.preview-banner a { color: inherit; }
