/* Portfolio — Makarin0
   Couleurs : Catppuccin Mocha (sombre) et Latte (clair), contrastes vérifiés AA. */

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

/* ---------- Jetons ---------- */
:root {
  --font: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --bg: #11111b;
  --bg-2: #181825;
  --card: #1e1e2e;
  --card-2: #24273a;
  --line: #313244;
  --line-2: #45475a;
  --text: #cdd6f4;
  --muted: #a6adc8;
  --faint: #9399b2;
  --mauve: #cba6f7;
  --red: #f38ba8;
  --peach: #fab387;
  --green: #a6e3a1;
  --blue: #89b4fa;
  --yellow: #f9e2af;
  --on-accent: #11111b;
  --glow: rgba(203, 166, 247, .16);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 20px 40px -24px rgba(0, 0, 0, .6);

  --term-bg: #11111b;
  --term-text: #cdd6f4;
  --term-user: #f9e2af;
  --term-muted: #9399b2;

  --r: 14px;
  --r-sm: 8px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --nav-h: 64px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eff1f5;
  --bg-2: #e6e9ef;
  --card: #ffffff;
  --card-2: #f5f6f9;
  --line: #dce0e8;
  --line-2: #bcc0cc;
  --text: #4c4f69;
  --muted: #5c5f77;
  --faint: #6c6f85;
  --mauve: #8839ef;
  --red: #d20f39;
  --peach: #b4470a;
  --green: #2d7a1d;
  --blue: #1e66f5;
  --yellow: #8a5a00;
  --on-accent: #ffffff;
  --glow: rgba(136, 57, 239, .10);
  --shadow: 0 1px 2px rgba(76, 79, 105, .06), 0 16px 32px -20px rgba(76, 79, 105, .25);

  /* le terminal reste sombre dans les deux thèmes */
  --term-bg: #1e1e2e;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.02em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
strong { font-weight: 600; color: var(--text); }
::selection { background: var(--mauve); color: var(--on-accent); }

:focus-visible { outline: 2px solid var(--mauve); outline-offset: 3px; border-radius: 6px; }

.sprite { position: absolute; }
.ic { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); font-size: .86em; }
.muted { color: var(--faint); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 28px; } }

.tone-red { --c: var(--red); }
.tone-peach { --c: var(--peach); }
.tone-green { --c: var(--green); }
.tone-mauve { --c: var(--mauve); }
.tone-blue { --c: var(--blue); }
.tone-yellow { --c: var(--yellow); }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  background: var(--mauve); color: var(--on-accent);
  padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600; text-decoration: none;
  transition: top .2s var(--ease);
}
.skip:focus { top: 12px; }

.progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--peach), var(--green)); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 46px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: .98rem; text-decoration: none; cursor: pointer;
  transition: transform .18s var(--ease), background-color .18s, border-color .18s, box-shadow .18s, color .18s;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--mauve); color: var(--on-accent); box-shadow: 0 8px 24px -10px var(--mauve); }
.btn-primary:hover { box-shadow: 0 10px 30px -8px var(--mauve); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--mauve); color: var(--mauve); }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 1.02rem; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--muted);
  transition: background-color .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--card); color: var(--text); border-color: var(--line); }
.icon-btn .ic { width: 20px; height: 20px; }
.icon-btn-sm { width: 36px; height: 36px; margin-left: auto; }

.link-btn { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; color: inherit; }
.link-btn:hover { color: var(--mauve); }

kbd {
  font-family: var(--mono); font-size: .8em;
  padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--card-2);
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav-in { height: 100%; display: flex; align-items: center; gap: 16px; }
.logo { font-family: var(--mono); font-weight: 600; font-size: 1rem; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.logo-prompt { color: var(--mauve); margin-right: 2px; }
.cursor { color: var(--mauve); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  position: relative; padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: var(--muted); font-size: .95rem; font-weight: 500;
  transition: color .15s, background-color .15s;
}
.nav-links a:hover { color: var(--text); background: var(--card); }
.nav-links a.is-active { color: var(--text); }
.nav-links a.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--mauve);
}
.nav-tools { display: flex; gap: 2px; }
.menu-btn { display: none; }
.ic-moon, .ic-close { display: none; }
:root[data-theme="light"] .ic-sun { display: none; }
:root[data-theme="light"] .ic-moon { display: block; }

@media (max-width: 860px) {
  .nav-tools { margin-left: auto; }
  .menu-btn { display: inline-grid; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0; padding: 8px 16px 20px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -20px rgba(0, 0, 0, .5);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: transform .2s var(--ease), opacity .2s, visibility 0s .2s;
  }
  .nav-links a { padding: 14px 8px; font-size: 1.05rem; border-radius: 8px; }
  .nav-links a.is-active::after { display: none; }
  .nav.is-open .nav-links { transform: none; opacity: 1; visibility: visible; transition: transform .2s var(--ease), opacity .2s; }
  .nav.is-open .ic-open { display: none; }
  .nav.is-open .ic-close { display: block; }
}

/* ---------- Accueil ---------- */
.hero { position: relative; overflow: hidden; padding: 56px 0 88px; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; z-index: -1; inset: -20% -10% auto auto; width: 720px; height: 720px;
  background: radial-gradient(closest-side, var(--glow), transparent 70%);
}
.rain {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%;
  opacity: .5; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
  mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
}
.hero-in { display: grid; gap: 48px; align-items: center; }
@media (min-width: 980px) {
  .hero { padding: 96px 0 120px; }
  .hero-in { grid-template-columns: 1.1fr .9fr; gap: 56px; }
}

.status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 12px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--green) 40%, transparent);
  background: color-mix(in srgb, var(--green) 10%, transparent);
  color: var(--green); font-size: .88rem; font-weight: 600;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 var(--green); animation: pulse 2.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 {
  margin: 22px 0 14px;
  font-size: clamp(2.9rem, 9vw, 5.6rem); font-weight: 700; letter-spacing: -.045em; line-height: .98;
  background: linear-gradient(120deg, var(--text) 30%, var(--mauve) 75%, var(--red));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.role { font-size: clamp(1.1rem, 2.4vw, 1.3rem); color: var(--muted); }
.lead { margin-top: 18px; max-width: 34em; font-size: clamp(1.05rem, 2vw, 1.18rem); color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.socials { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 26px; }
.socials a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  color: var(--muted); text-decoration: none; font-weight: 500;
  transition: color .15s;
}
.socials a:hover { color: var(--mauve); }
.socials-center { justify-content: center; }

/* ---------- Terminal ---------- */
.term-card {
  position: relative;
  background: var(--term-bg); color: var(--term-text);
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .02) inset;
  overflow: hidden; font-family: var(--mono);
}
:root[data-theme="light"] .term-card { border-color: #313244; }
.term-bar { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 8px 0 16px; border-bottom: 1px solid #313244; background: #181825; }
.term-bar > span { width: 11px; height: 11px; border-radius: 50%; background: #45475a; }
.term-bar > span:nth-child(1) { background: #f38ba8; }
.term-bar > span:nth-child(2) { background: #f9e2af; }
.term-bar > span:nth-child(3) { background: #a6e3a1; }
.term-bar p { margin-left: 10px; font-size: .8rem; color: var(--term-muted); }
.term-body { padding: 18px 20px 20px; font-size: .9rem; line-height: 1.75; min-height: 260px; }
.term-body p { white-space: pre-wrap; overflow-wrap: anywhere; }
.term-body .o { color: #bac2de; }
.u { color: var(--term-user); font-weight: 600; }
.p { color: #89b4fa; margin-right: .6ch; }
.t-red { color: #f38ba8; }
.t-peach { color: #fab387; }
.t-green { color: #a6e3a1; }
.t-mauve { color: #cba6f7; }
.t-blue { color: #89b4fa; }
.t-muted { color: #9399b2; }
.term-body .cursor { color: #cba6f7; }
.term-hint {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  min-height: 44px; border: 0; border-top: 1px solid #313244; background: #181825;
  color: #a6adc8; font-family: var(--mono); font-size: .8rem; cursor: pointer;
  transition: color .15s, background-color .15s;
}
.term-hint:hover { color: #cdd6f4; background: #1e1e2e; }
.term-hint kbd, .term-foot kbd { background: #313244; border-color: #45475a; color: #cdd6f4; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
@media (min-width: 980px) { .section { padding: 120px 0; } }
.section + .section { border-top: 1px solid var(--line); }
.sec-head { margin-bottom: 44px; max-width: 44em; }
.kicker { font-family: var(--mono); font-size: .85rem; color: var(--mauve); margin-bottom: 14px; }
.sec-head h2, .contact h2 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; }
.sec-sub { margin-top: 16px; color: var(--muted); font-size: 1.08rem; }

/* Approche */
.angles { display: grid; gap: 16px; }
@media (min-width: 760px) { .angles { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.angle {
  position: relative; padding: 28px 26px 30px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  overflow: hidden;
}
.angle::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c); }
.angle-ic {
  width: 44px; height: 44px; padding: 10px; border-radius: 12px; margin-bottom: 20px;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
}
.angle h3 { font-size: 1.45rem; margin-bottom: 10px; }
.angle p { color: var(--muted); }

/* Badges & tags */
.tag-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-family: var(--mono); font-size: .76rem; font-weight: 600;
  color: var(--muted); background: var(--card-2); border: 1px solid var(--line);
}
.badge-green { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.badge-peach { color: var(--peach); background: color-mix(in srgb, var(--peach) 12%, transparent); border-color: color-mix(in srgb, var(--peach) 35%, transparent); }
.badge-mauve { color: var(--mauve); background: color-mix(in srgb, var(--mauve) 12%, transparent); border-color: color-mix(in srgb, var(--mauve) 35%, transparent); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 4px 10px; border-radius: 7px; font-family: var(--mono); font-size: .78rem;
  color: var(--muted); background: var(--bg-2); border: 1px solid var(--line);
}

/* Projet phare */
.feature {
  display: grid; gap: 36px; padding: 28px 22px; border-radius: calc(var(--r) + 6px);
  background:
    radial-gradient(600px 300px at 100% 0%, var(--glow), transparent 70%),
    var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
@media (min-width: 640px) { .feature { padding: 40px; } }
@media (min-width: 980px) { .feature { grid-template-columns: 1.05fr .95fr; gap: 48px; padding: 52px; align-items: center; } }
.feature h3 { font-size: clamp(1.7rem, 3.6vw, 2.3rem); margin-bottom: 12px; }
.feature-text > p { color: var(--muted); font-size: 1.06rem; }
.checks { margin: 22px 0 26px; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 28px; color: var(--muted); }
.checks li::before {
  content: ""; position: absolute; left: 2px; top: .55em; width: 12px; height: 7px;
  border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg);
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 30px; }
.stats div { padding: 14px 6px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); text-align: center; }
.stats dd { margin: 0; font-size: 1.8rem; font-weight: 700; letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.stats dt { order: 2; font-family: var(--mono); font-size: .72rem; color: var(--faint); }
.stats div { display: flex; flex-direction: column-reverse; }

.feature-fig { margin: 0; }
.diagram { width: 100%; max-width: 440px; height: auto; margin: 0 auto; font-family: var(--mono); }
.diagram .zone { fill: none; stroke: var(--line-2); stroke-width: 1.5; stroke-dasharray: 6 6; }
.diagram .d-lbl { fill: var(--faint); font-size: 13px; }
.diagram .node rect { fill: var(--bg-2); stroke: var(--line-2); stroke-width: 1.5; }
.diagram .node-red rect { stroke: var(--red); fill: color-mix(in srgb, var(--red) 10%, var(--bg-2)); }
.diagram .node-green rect { stroke: var(--green); fill: color-mix(in srgb, var(--green) 10%, var(--bg-2)); }
.diagram .d-t { fill: var(--text); font-size: 15px; font-weight: 700; text-anchor: middle; }
.diagram .d-s { fill: var(--muted); font-size: 12.5px; text-anchor: middle; }
.diagram .ln-red { stroke: var(--red); stroke-width: 2; stroke-dasharray: 6 5; fill: none; }
.diagram .ln-green { stroke: var(--green); stroke-width: 2; fill: none; }
.diagram .f-red { fill: var(--red); }
.diagram .f-green { fill: var(--green); }
.diagram .pill rect { fill: var(--card); stroke: var(--red); stroke-width: 1.2; }
.diagram .pill text { fill: var(--red); font-size: 12.5px; text-anchor: middle; font-weight: 600; }
.diagram .pill-green rect { stroke: var(--green); }
.diagram .pill-green text { fill: var(--green); }
.feature-fig figcaption { margin-top: 14px; text-align: center; color: var(--faint); font-size: .88rem; }

.diagram .ln-red { animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -22; } }

/* Filtres */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 56px 0 22px; }
.chip {
  min-height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  font-size: .92rem; font-weight: 500;
  transition: background-color .15s, color .15s, border-color .15s;
}
.chip:hover { color: var(--text); border-color: var(--mauve); }
.chip[aria-pressed="true"] { background: var(--mauve); border-color: var(--mauve); color: var(--on-accent); font-weight: 600; }

/* Cartes */
.cards { display: grid; gap: 16px; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, 1fr); gap: 18px; } }
@media (min-width: 1040px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  display: flex; flex-direction: column; padding: 24px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: border-color .2s, transform .25s var(--ease);
}
.card:hover { border-color: color-mix(in srgb, var(--mauve) 50%, var(--line)); transform: translateY(-3px); }
.card[hidden] { display: none; }
.card-next { background: transparent; border-style: dashed; box-shadow: none; }
.card-next:hover { transform: none; }
.card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.card > p:not(.tag-line) { color: var(--muted); font-size: .98rem; margin-bottom: 18px; }
.card .tags { margin-top: auto; }
.card-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 10px;
  color: var(--mauve); font-weight: 600; text-decoration: none; font-size: .95rem;
}
.card-link .ic { transition: transform .2s var(--ease); }
.card-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.card-link:hover .ic { transform: translate(2px, -2px); }

/* Parcours */
.two-col { display: grid; gap: 24px; }
@media (min-width: 980px) { .two-col { grid-template-columns: .9fr 1.1fr; gap: 72px; align-items: start; } .two-col .sec-head { position: sticky; top: calc(var(--nav-h) + 32px); } }
.program { margin-top: 28px; }
.program .mono { margin-bottom: 10px; }
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--mauve), var(--line) 85%); border-radius: 2px; }
.timeline li { position: relative; padding: 0 0 36px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -29px; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--mauve);
}
.timeline li.is-next::before { background: var(--green); border-color: var(--green); box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 20%, transparent); }
.timeline li.is-future::before { border-style: dashed; border-color: var(--line-2); }
.when { font-family: var(--mono); font-size: .82rem; color: var(--mauve); margin-bottom: 6px; }
.is-next .when { color: var(--green); }
.is-future .when { color: var(--faint); }
.timeline h3 { font-size: 1.22rem; margin-bottom: 6px; }
.timeline li > p:last-child { color: var(--muted); }

/* Compétences */
.skills { display: grid; gap: 16px; }
@media (min-width: 700px) { .skills { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .skills { grid-template-columns: repeat(3, 1fr); } }
.skill { padding: 24px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.skill h3 { display: flex; align-items: center; gap: 10px; font-size: 1.12rem; margin-bottom: 16px; }
.sq { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.langs { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 28px; padding: 18px 22px; border-radius: var(--r); border: 1px dashed var(--line-2); }
.langs .mono { margin-right: 8px; }

/* CTF */
.ctf { display: grid; gap: 16px; }
@media (min-width: 760px) { .ctf { grid-template-columns: repeat(2, 1fr); } .ctf-team { grid-column: 1 / -1; } }
.ctf-team, .ctf-item { padding: 26px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ctf-team {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--mauve) 12%, transparent), transparent 55%),
    var(--card);
}
.ctf-team h3 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); margin-bottom: 10px; }
.ctf-team > p:not(.tag-line) { color: var(--muted); margin-bottom: 14px; }
.row-links { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 10px; }
.ctf-item .mono { margin-bottom: 8px; display: block; }
.ctf-item h3 { font-size: 1.25rem; margin-bottom: 8px; }
.ctf-item > p:last-child { color: var(--muted); font-size: .98rem; }

/* Contact */
.contact-box {
  text-align: center; padding: 56px 20px; border-radius: calc(var(--r) + 8px);
  background:
    radial-gradient(500px 260px at 50% 0%, var(--glow), transparent 75%),
    var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
@media (min-width: 640px) { .contact-box { padding: 72px 48px; } }
.contact-box .sec-sub { max-width: 36em; margin-left: auto; margin-right: auto; }
.contact-form { display: grid; gap: 18px; max-width: 640px; margin: 36px auto 26px; text-align: left; }
@media (min-width: 640px) { .contact-form { grid-template-columns: 1fr 1fr; } .field-full { grid-column: 1 / -1; } }
.field { display: grid; gap: 6px; align-content: start; }
.field label { font-weight: 600; font-size: .95rem; }
.opt { font-weight: 400; color: var(--faint); }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text);
  font: inherit; font-size: 16px; line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:hover, .field textarea:hover { border-color: var(--faint); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--mauve); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mauve) 25%, transparent); }
.field [aria-invalid="true"] { border-color: var(--red); }
.help { font-size: .82rem; color: var(--faint); font-family: var(--mono); }
.err { font-size: .88rem; color: var(--red); font-weight: 500; }
.err:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.form-note { flex: 1 1 240px; font-size: .86rem; color: var(--faint); }
.form-status { font-weight: 600; text-align: center; }
.form-status:empty { display: none; }
.form-status.is-ok { color: var(--green); }
.form-status.is-ko { color: var(--red); }
#f-submit[aria-busy="true"] { opacity: .7; cursor: progress; }

/* Pied de page */
.foot { border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: .92rem; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; }
.foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; }
.foot-links a, .foot-links .link-btn { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 3px; }
.foot a:hover { color: var(--mauve); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: .95rem;
  transition: opacity .2s, transform .25s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Terminal plein écran ---------- */
.term-dialog {
  width: min(760px, calc(100vw - 24px)); max-height: min(560px, calc(100dvh - 24px));
  padding: 0; border: 0; background: transparent; color: inherit; overflow: visible;
}
.term-dialog::backdrop { background: rgba(17, 17, 27, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.term-dialog[open] { animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.term-full { display: flex; flex-direction: column; height: min(560px, calc(100dvh - 24px)); }
.term-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 6px; overscroll-behavior: contain; }
.term-scroll a { color: #89b4fa; }
.term-input { display: flex; align-items: center; gap: 0; padding: 0 20px 6px; font-size: .9rem; }
.term-input label { flex: none; }
.term-input input {
  flex: 1; min-width: 0; height: 40px; padding: 0;
  border: 0; outline: 0; background: transparent; color: #cdd6f4;
  font-family: var(--mono); font-size: 16px; caret-color: #cba6f7;
}
.term-input:focus-within { box-shadow: inset 0 -1px 0 #45475a; }
.term-foot { padding: 10px 20px 14px; font-size: .75rem; color: #9399b2; border-top: 1px solid #313244; }
@media (max-width: 520px) { .term-foot { display: none; } .term-body { font-size: .84rem; padding: 16px; } .term-input { padding: 0 16px 8px; } }

/* ---------- Apparition au défilement ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .rain { display: none; }
}

@media print {
  .nav, .rain, .progress, .term-hint, .filters, .toast, .term-dialog { display: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
.t-yellow { color: #f9e2af; }

/* Page 404 */
.notfound { min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 22px; text-align: center; padding-top: 40px; padding-bottom: 40px; }
.notfound .term-card { width: min(560px, 100%); text-align: left; }
.notfound .term-body { min-height: 0; }
.notfound h1 { font-size: clamp(2rem, 6vw, 3rem); }
