/* ==========================================================
   Pierre Cavalier, site styles
   Dark "night sky" theme by default, light theme on toggle.
   ========================================================== */

:root {
  --bg: #070a12;
  --bg-2: #0c1120;
  --surface: #111829;
  --surface-2: #172036;
  --line: rgba(160, 180, 230, 0.12);
  --line-strong: rgba(160, 180, 230, 0.24);
  --text: #e8ecf6;
  --text-2: #a3adc4;
  --text-3: #7a85a0;        /* >= 4.5:1 on the cards */
  --accent: #ffb454;        /* star / signal */
  --accent-ink: #1a1206;
  --accent-soft: rgba(255, 180, 84, 0.12);
  --cool: #7cc4ff;          /* detector / data */
  --cool-soft: rgba(124, 196, 255, 0.12);
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --radius: 14px;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --max: 1120px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f4ef;
  --bg-2: #efece4;
  --surface: #ffffff;
  --surface-2: #f3f1ea;
  --line: rgba(20, 30, 60, 0.10);
  --line-strong: rgba(20, 30, 60, 0.20);
  --text: #141a2b;
  --text-2: #4a5470;
  --text-3: #626a80;
  --accent: #c76a00;
  --accent-ink: #ffffff;
  --accent-soft: rgba(199, 106, 0, 0.10);
  --cool: #1f6fb8;
  --cool-soft: rgba(31, 111, 184, 0.10);
  --shadow: 0 20px 40px -24px rgba(20, 30, 60, 0.35);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* Language switching: elements carry data-l="fr" or data-l="en" */
html[lang="fr"] [data-l="en"],
html[lang="en"] [data-l="fr"] { display: none !important; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 560px) { .wrap { padding: 0 16px; } }

.mono { font-family: var(--mono); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; }
.brand svg { width: 34px; height: 34px; }
.brand span { font-size: 15px; letter-spacing: .02em; }
.nav-links { display: flex; gap: 4px; margin-left: auto; list-style: none; padding: 0; margin-top: 0; margin-bottom: 0; }
.nav-links a {
  display: block; padding: 8px 12px; border-radius: 8px;
  font-size: 14px; color: var(--text-2); text-decoration: none;
  transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface); }
.nav-tools { display: flex; gap: 6px; }
.icon-btn {
  height: 34px; min-width: 34px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: transparent; color: var(--text-2);
  font: 500 12px var(--mono); cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--text-3); background: var(--surface); }
.icon-btn svg { width: 16px; height: 16px; }
.menu-btn { display: none; }

@media (max-width: 820px) {
  .menu-btn { display: inline-flex; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open .nav-links { display: flex; }
  .nav.open { background: var(--bg); }
  .nav-links a { padding: 12px; }
  .nav-tools { margin-left: auto; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 110px 0 140px;
  overflow: hidden;
  isolation: isolate;
}
#sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 160px; z-index: -1;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.eyebrow {
  font: 500 13px var(--mono); color: var(--accent);
  letter-spacing: .04em; margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(44px, 7vw, 84px); line-height: 1.0; letter-spacing: -0.03em;
  margin: 0 0 22px; font-weight: 700;
}
.hero .lede { font-size: clamp(18px, 2vw, 22px); color: var(--text-2); max-width: 34ch; margin: 0 0 14px; }
.hero .lede strong { color: var(--text); font-weight: 600; }
.status {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 13px var(--mono); color: var(--text-2);
  padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px;
  margin: 6px 0 28px; background: color-mix(in srgb, var(--bg) 60%, transparent);
}
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, .18); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 10px;
  font: 600 15px var(--font); text-decoration: none;
  border: 1px solid var(--line-strong); color: var(--text);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  transition: transform .15s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--text-3); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn svg { width: 17px; height: 17px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); padding: 12px 8px; }
.btn.ghost:hover { color: var(--text); transform: none; }

.portrait { position: relative; justify-self: center; width: min(320px, 70vw); aspect-ratio: 1; }
.portrait img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  border: 1px solid var(--line-strong);
  position: relative; z-index: 1;
}
.portrait .orbit {
  position: absolute; inset: -18px; border-radius: 50%;
  border: 1px dashed var(--line-strong);
  animation: spin 60s linear infinite;
}
.portrait .orbit::before {
  content: ""; position: absolute; top: 50%; left: -5px; width: 10px; height: 10px; margin-top: -5px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 18px var(--accent);
}
.portrait .orbit.o2 { inset: -42px; animation-duration: 95s; animation-direction: reverse; opacity: .6; }
.portrait .orbit.o2::before { background: var(--cool); box-shadow: 0 0 18px var(--cool); width: 7px; height: 7px; margin-top: -3.5px; left: -3.5px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .portrait .orbit { animation: none; } }

.scope-label {
  position: absolute; left: 24px; bottom: 28px; z-index: 1;
  font: 500 11px var(--mono); color: var(--text-3); letter-spacing: .05em;
  display: flex; gap: 16px; align-items: center;
}
.scope-label b { color: var(--cool); font-weight: 500; }

@media (max-width: 820px) {
  .hero { padding-top: 100px; padding-bottom: 120px; }
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .portrait { order: -1; width: 200px; justify-self: start; margin-left: 42px; }
  .scope-label { display: none; }
}

/* ---------- Sections ---------- */
section { padding: 110px 0; position: relative; }
@media (max-width: 560px) { section { padding: 80px 0; } }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 48px; flex-wrap: wrap; }
.section-head .kicker { font: 500 13px var(--mono); color: var(--accent); margin: 0 0 10px; }
.section-head h2 { font-size: clamp(32px, 4.4vw, 48px); line-height: 1.05; letter-spacing: -0.02em; margin: 0; }
.section-head p { color: var(--text-2); max-width: 46ch; margin: 0; }

/* ---------- Timeline ---------- */
.timeline { position: relative; display: grid; gap: 8px; }
.timeline::before {
  content: ""; position: absolute; left: 178px; top: 8px; bottom: 8px; width: 1px;
  background: linear-gradient(var(--line-strong), var(--line) 85%, transparent);
}
.t-item {
  display: grid; grid-template-columns: 156px 44px 1fr; align-items: start;
  padding: 18px 0;
}
.t-date { font: 500 13px var(--mono); color: var(--text-3); padding-top: 4px; text-align: right; }
/* inline SVG flags, the size of the text around them */
.flag { display: inline-block; width: 1.35em; height: .9em; vertical-align: -0.08em; border-radius: 2px; box-shadow: 0 0 0 1px var(--line-strong); }
/* short stays: year · months, on one line */
.t-months::before { content: " · "; }
.t-node { position: relative; height: 100%; }
.t-node::before {
  content: ""; position: absolute; left: 17.5px; top: 9px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--text-3);
}
.t-item.work .t-node::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.t-item.study .t-node::before { border-color: var(--cool); }
.t-body { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; }
.t-body h3 { margin: 0; font-size: 19px; line-height: 1.35; font-weight: 600; }
.t-body h3 a { text-decoration: none; }
.t-body h3 a:hover { color: var(--accent); }
.t-org { font-size: 14px; color: var(--text-2); }
.t-body p { grid-column: 1 / -1; margin: 6px 0 0; color: var(--text-2); font-size: 15px; max-width: 62ch; }
.t-logo {
  grid-row: 1 / 3; grid-column: 2;
  width: 52px; height: 52px; border-radius: 10px; padding: 7px;
  background: #fff; object-fit: contain; border: 1px solid var(--line);
}
.t-link {
  grid-column: 1 / -1; justify-self: start; margin-top: 8px;
  font: 500 12px var(--mono); color: var(--accent); text-decoration: none;
  border-bottom: 1px dashed transparent; transition: border-color .2s;
}
.t-link:hover { border-bottom-color: var(--accent); }
.feat:target { border-color: var(--accent); animation: target-glow 2.2s ease-out 1; }
@keyframes target-glow { 0% { box-shadow: 0 0 0 0 var(--accent-soft); } 30% { box-shadow: 0 0 0 10px var(--accent-soft); } 100% { box-shadow: 0 0 0 0 transparent; } }
.tag {
  display: inline-block; font: 500 11px var(--mono); letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 6px; margin-bottom: 6px;
}
.tag.work { color: var(--accent); background: var(--accent-soft); }
.tag.study { color: var(--cool); background: var(--cool-soft); }
.tag.trip { color: var(--text-2); background: var(--surface-2); }
.t-item.trip .t-node::before { border-color: var(--text-2); border-style: dashed; }
@media (max-width: 640px) {
  .timeline::before { left: 7px; }
  .t-item { grid-template-columns: 30px 1fr; }
  .t-date { grid-column: 2; text-align: left; order: -1; padding: 0 0 4px; }
  .t-node { grid-row: 1 / 3; grid-column: 1; }
  .t-node::before { left: 3px; top: 32px; }
  .t-body { grid-column: 2; }
  .t-logo { width: 40px; height: 40px; }
}

/* ---------- Projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -16px 0 36px; align-items: center; }
.filters .label { font: 500 12px var(--mono); color: var(--text-3); margin-right: 6px; }
.chip {
  font: 500 13px var(--mono); color: var(--text-2);
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-strong);
  transition: all .18s;
}
.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip .n { opacity: .6; margin-left: 4px; }
.filter-sep { width: 1px; height: 20px; background: var(--line-strong); margin: 0 6px; }
.chip-team[aria-pressed="true"] { background: var(--cool); border-color: var(--cool); color: #06121f; }

.featured { display: grid; gap: 22px; margin-bottom: 22px; }
.feat {
  display: grid; grid-template-columns: 1.1fr 1fr; min-height: 330px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: opacity .3s, transform .3s, border-color .3s;
}
.feat:nth-child(even) { grid-template-columns: 1fr 1.1fr; }
.feat:nth-child(even) .feat-media { order: 2; }
.feat-media { position: relative; overflow: hidden; background: #000; }
.feat-media img {
  width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0;
  filter: saturate(.85) contrast(1.05);
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}
.feat:hover .feat-media img { transform: scale(1.04); }
.feat-body { padding: 34px 36px; display: flex; flex-direction: column; gap: 14px; }
.feat-ctx { font: 500 12px var(--mono); color: var(--text-3); letter-spacing: .02em; }
.feat h3 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; }
.feat p { margin: 0; color: var(--text-2); font-size: 16px; }
.result {
  display: flex; gap: 12px; align-items: baseline;
  padding: 14px 16px; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.result .k { font: 600 12px var(--mono); color: var(--accent); white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; }
.result .v { font-size: 15px; color: var(--text); }
.stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.stack span {
  font: 500 12px var(--mono); color: var(--cool);
  padding: 3px 9px; border-radius: 6px; background: var(--cool-soft);
}
.links { display: flex; gap: 18px; padding-top: 4px; }
.links a {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 14px var(--font); color: var(--text-2); text-decoration: none;
  transition: color .2s;
}
.links a:hover { color: var(--accent); }
.links svg { width: 16px; height: 16px; }
@media (max-width: 820px) {
  .feat, .feat:nth-child(even) { grid-template-columns: 1fr; }
  .feat:nth-child(even) .feat-media { order: 0; }
  .feat-media { aspect-ratio: 6 / 5; } /* the drawn illustrations are almost square: do not crop them on phones */
  .feat-body { padding: 24px 22px; }
}

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  transition: opacity .3s, transform .3s, border-color .3s;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.card-top .feat-ctx { text-align: right; line-height: 1.5; }
.card-icon { flex: none;
  width: 42px; height: 42px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--accent);
}
.card-icon svg { width: 22px; height: 22px; }
.card h3 { margin: 0; font-size: 19px; line-height: 1.3; }
.card p { margin: 0; color: var(--text-2); font-size: 15px; }
.card .result { padding: 10px 12px; }
.card .result .v { font-size: 14px; }

.badge-wip {
  flex: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .06em;
  color: #4ade80; background: rgba(74, 222, 128, .1); padding: 3px 9px; border-radius: 999px;
}
.badge-wip .pulse { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; animation: wip 1.8s ease-in-out infinite; }
@keyframes wip { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .badge-wip .pulse { animation: none; } }
.card.wip { border-color: rgba(74, 222, 128, .28); }
.feat-now { border-color: rgba(74, 222, 128, .28); }
.feat-now .links { align-items: center; }
.lisa-art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lisa-art .beams line { stroke-dasharray: 6 8; animation: beam 1.4s linear infinite; }
@keyframes beam { to { stroke-dashoffset: -28; } }
.lisa-art .ripples circle { opacity: 0; animation: ripple 6s ease-out infinite; transform-origin: 480px -80px; transform-box: view-box; }
.lisa-art .ripples circle:nth-child(2) { animation-delay: 2s; }
.lisa-art .ripples circle:nth-child(3) { animation-delay: 4s; }
@keyframes ripple { 0% { opacity: .5; transform: scale(.2); } 100% { opacity: 0; transform: scale(9); } }
@media (prefers-reduced-motion: reduce) { .lisa-art .beams line, .lisa-art .ripples circle, .lisa-art .lisa-tri, .lisa-art .orbiting { animation: none; } .lisa-art .ripples circle { opacity: .15; } }
.kagra-art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.kagra-art .beams line { stroke-dasharray: 6 8; animation: beam 1.4s linear infinite; }
.kagra-art .back line { stroke-dasharray: 6 8; animation: beam-back 1.4s linear infinite; opacity: .85; }
@keyframes beam-back { to { stroke-dashoffset: 28; } }
.kagra-art .out line { stroke-dasharray: 3 5; animation: beam .9s linear infinite; }
.kagra-art .pd { animation: fringe 2.6s ease-in-out infinite; }
@keyframes fringe { 0%, 100% { opacity: .25; } 18% { opacity: 1; } 36% { opacity: .35; } 52% { opacity: .9; } 70% { opacity: .3; } }
.kagra-art .ripples circle { opacity: 0; animation: ripple 6s ease-out infinite; transform-origin: -90px -90px; transform-box: view-box; }
.kagra-art .ripples circle:nth-child(2) { animation-delay: 2s; }
.kagra-art .ripples circle:nth-child(3) { animation-delay: 4s; }
.kagra-art .susp { transform-box: view-box; animation: swing 3.2s ease-in-out infinite; }
.kagra-art .susp.s2 { animation-duration: 3.7s; animation-delay: -1s; }
@keyframes swing { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }
.kagra-art .wire { animation: violin .09s linear infinite alternate; }
@keyframes violin { from { transform: translateX(-.8px); } to { transform: translateX(.8px); } }

/* labels and the wire-to-peak link follow the peak's 5 s cycle */
.kagra-art .st-raw, .kagra-art .violin-link { animation: show-raw 5s ease-in-out infinite; }
.kagra-art .st-clean { animation: show-clean 5s ease-in-out infinite; }
@keyframes show-raw { 0%, 30% { opacity: 1; } 36%, 84% { opacity: 0; } 90%, 100% { opacity: 1; } }
@keyframes show-clean { 0%, 36% { opacity: 0; } 42%, 80% { opacity: 1; } 84%, 100% { opacity: 0; } }
.kagra-art .peak { transform-origin: 380px 63px; transform-box: view-box; animation: peak 5s ease-in-out infinite; }
@keyframes peak { 0%, 30% { transform: scaleY(1); opacity: 1; } 38%, 82% { transform: scaleY(.15); opacity: 0; } 90%, 100% { transform: scaleY(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .kagra-art .beams line, .kagra-art .back line, .kagra-art .out line, .kagra-art .pd, .kagra-art .ripples circle, .kagra-art .susp, .kagra-art .wire, .kagra-art .peak, .kagra-art .st-raw, .kagra-art .violin-link { animation: none; } .kagra-art .st-clean { opacity: 0; animation: none; } .kagra-art .ripples circle { opacity: .15; } }
.fink-art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* (the old photo overlay was removed: the illustrations are drawn and must not get a light haze in the light theme) */
/* one variation every 1.2 s: the star brightens in the new image, a residual appears in the difference, an alert leaves */
.fink-art .var-new { transform-origin: 230px 75px; transform-box: view-box; animation: brighten 2s ease-in-out infinite; }
@keyframes brighten { 0%, 20%, 80%, 100% { transform: scale(1); } 45% { transform: scale(2.2); } }
.fink-art .var-diff { opacity: 0; animation: residual 2s ease-in-out infinite; }
@keyframes residual { 0%, 25%, 80%, 100% { opacity: 0; } 45%, 60% { opacity: 1; } }
.fink-art .alert { opacity: 0; animation: fall 12s ease-in .7s infinite; }
.fink-art .alert.a1 { animation-delay: 2.7s; } .fink-art .alert.a2 { animation-delay: 4.7s; }
.fink-art .alert.a3 { animation-delay: 6.7s; } .fink-art .alert.a4 { animation-delay: 8.7s; } .fink-art .alert.a5 { animation-delay: 10.7s; }
.fink-art .anomaly { cursor: help; }
.fink-art .tip { opacity: 0; transition: opacity .2s; pointer-events: none; }
.fink-art .anomaly:hover .tip, .fink-art .anomaly:focus-within .tip { opacity: 1; }
@keyframes fall {
  0% { transform: translate(0, 0); opacity: 0; fill: #e8ecf6; }
  4% { transform: translate(0, 0); opacity: 1; fill: #e8ecf6; }
  /* the alert takes the colour of the class it is matched to as it reaches the graph */
  40% { transform: translate(var(--dx), var(--dy)); opacity: 1; fill: var(--c); }
  50%, 100% { transform: translate(var(--dx), var(--dy)); opacity: 0; fill: var(--c); }
}
.fink-art .nodes circle { animation: twinkle 4s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.fink-art .anomaly .ring { transform-origin: 335px 250px; transform-box: view-box; animation: alarm 2s ease-out infinite; }
@keyframes alarm { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fink-art .alert, .fink-art .nodes circle, .fink-art .anomaly .ring, .fink-art .var-new, .fink-art .var-diff { animation: none; } .fink-art .var-diff { opacity: 1; } }
.gulliver-art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }



/* ---------- Small animated banners on project cards ---------- */
.card-media {
  margin: -24px -24px 4px; aspect-ratio: 2 / 1; position: relative; overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0; background: #060912;
  border-bottom: 1px solid var(--line);
}
.card-media svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* climbing: holds get outlined one by one (segmentation), then a grade appears */
.climb-art .cl-other { animation: cl-dim 7s ease-in-out infinite; }
@keyframes cl-dim { 0%, 8% { opacity: .85; } 16%, 86% { opacity: .15; } 94%, 100% { opacity: .85; } }
.climb-art .cl-seg { opacity: 0; stroke-dasharray: 3 2; animation: cl-seg 7s ease-in-out infinite; }
@keyframes cl-seg { 0% { opacity: 0; } 6%, 82% { opacity: 1; } 92%, 100% { opacity: 0; } }
.climb-art .cl-grade { opacity: 0; animation: cl-grade 7s ease-in-out infinite; }
@keyframes cl-grade { 0%, 52% { opacity: 0; } 60%, 85% { opacity: 1; } 93%, 100% { opacity: 0; } }
/* data challenge: points appear, boundaries are drawn, score shows */
.data-art .dc-pt { opacity: 0; animation: dc-pop 7s ease-out infinite; }
@keyframes dc-pop { 0% { opacity: 0; } 5%, 88% { opacity: 1; } 96%, 100% { opacity: 0; } }
.data-art .dc-line { stroke-dashoffset: 1; animation: dc-draw 7s ease-in-out infinite; }
@keyframes dc-draw { 0%, 30% { stroke-dashoffset: 1; } 50%, 88% { stroke-dashoffset: 0; } 96%, 100% { stroke-dashoffset: 1; opacity: 0; } }
.data-art .dc-score { opacity: 0; animation: cl-grade 7s ease-in-out infinite; }
/* co-clustering: the matrix reorders into blocks */
.ltbm-art .lt-cell { animation: lt-sort 8s ease-in-out infinite; transform: translate(var(--x0), var(--y0)); }
@keyframes lt-sort { 0%, 22% { transform: translate(var(--x0), var(--y0)); } 45%, 80% { transform: translate(var(--x1), var(--y1)); } 100% { transform: translate(var(--x0), var(--y0)); } }
/* blob: the whole mesh starts uniform, then edges without flow shrink away while the ones carrying flow thicken */
.blob-art .bl-mesh { stroke-width: 1.3; animation: bl-prune 8s ease-in-out infinite; }
@keyframes bl-prune { 0%, 18% { stroke-width: 1.3; opacity: .7; } 60%, 86% { stroke-width: .2; opacity: 0; } 100% { stroke-width: 1.3; opacity: .7; } }
.blob-art .bl-flow { stroke-width: 1.3; opacity: .7; animation: bl-grow 8s ease-in-out infinite; }
.blob-art .bl-trunk { --w: 4.6; }
.blob-art .bl-branch { --w: 2.8; }
@keyframes bl-grow { 0%, 18% { stroke-width: 1.3; opacity: .7; } 60%, 86% { stroke-width: var(--w); opacity: 1; } 100% { stroke-width: 1.3; opacity: .7; } }
/* RL: values spread from the goal cell by cell, then the greedy path is drawn.
   Cells are switched on and off from site.js (no running animation per cell); the transition gives each one a soft fade. */
.rl-art .rl-cell { opacity: 0; transition: opacity .45s ease-out; }
.rl-art .rl-cell.on { opacity: 1; }
.rl-art .rl-path { stroke-dashoffset: 1; animation: rl-path 10s ease-in-out infinite; }
@keyframes rl-path { 0%, 34% { stroke-dashoffset: 1; opacity: 1; } 46%, 54% { stroke-dashoffset: 0; opacity: 1; } 60% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 1; opacity: 0; } }
/* discord: messages pop in, the bot types then answers */
.chat-art .ch-msg, .chat-art .ch-typing { opacity: 0; animation: ch-msg 9s ease-out infinite; }
/* yann answers 1.2 s later but the whole chat clears at the same time */
.chat-art .m2 { animation-name: ch-msg2; }
@keyframes ch-msg2 { 0%, 13% { opacity: 0; transform: translateY(6px); } 19%, 86% { opacity: 1; transform: none; } 94%, 100% { opacity: 0; } }
.chat-art .ch-typing { animation-name: ch-typing; animation-delay: 0s; }
.chat-art .m3 { animation-name: ch-bot; }
@keyframes ch-msg { 0% { opacity: 0; transform: translateY(6px); } 6%, 86% { opacity: 1; transform: none; } 94%, 100% { opacity: 0; } }
@keyframes ch-typing { 0%, 30% { opacity: 0; } 34%, 48% { opacity: 1; } 52%, 100% { opacity: 0; } }
@keyframes ch-bot { 0%, 50% { opacity: 0; transform: translateY(6px); } 56%, 86% { opacity: 1; transform: none; } 94%, 100% { opacity: 0; } }
/* movies: the user rates a film, then a recommendation lights up */
.movie-art .mv-star { opacity: 0; animation: mv-star 7s ease-out infinite; }
@keyframes mv-star { 0% { opacity: 0; transform: scale(.6); transform-box: fill-box; transform-origin: center; } 4%, 85% { opacity: 1; transform: none; } 93%, 100% { opacity: 0; } }
.movie-art .mv-ring, .movie-art .mv-reco { opacity: 0; animation: mv-reco 7s ease-in-out infinite; }
@keyframes mv-reco { 0%, 40% { opacity: 0; } 48%, 85% { opacity: 1; } 93%, 100% { opacity: 0; } }
.movie-art .mv-poster:not(.mv-pick) { animation: mv-dim 7s ease-in-out infinite; }
@keyframes mv-dim { 0%, 40% { opacity: 1; } 48%, 85% { opacity: .35; } 93%, 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .card-media * { animation: none !important; }
  .movie-art .mv-star, .movie-art .mv-ring, .movie-art .mv-reco { opacity: 1; }
  .climb-art .cl-seg, .climb-art .cl-grade, .data-art .dc-pt, .data-art .dc-score, .rl-art .rl-cell, .chat-art .ch-msg { opacity: 1; }
  .data-art .dc-line, .rl-art .rl-path { stroke-dashoffset: 0; }
  .blob-art .bl-mesh, .blob-art .bl-t { opacity: 0; }
  .blob-art .bl-flow { stroke-width: var(--w); opacity: 1; }
  .ltbm-art .lt-cell { transform: translate(var(--x1), var(--y1)); }
  .climb-art .cl-other { opacity: .15; }
}
.links .muted { font: 500 13px var(--mono); color: var(--text-3); }

.is-dim, .reveal.in.is-dim { opacity: .18; transform: scale(.985); }
.is-hit { border-color: var(--accent) !important; }

/* ---------- Toolbox ---------- */
.toolbox { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
@media (max-width: 900px) { .toolbox { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .toolbox { grid-template-columns: 1fr; } }
.tool-col { padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); }
.tool-col h3 { font: 500 12px var(--mono); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 14px; }
.tool-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tool-col li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.tool-col li img { width: 22px; height: 22px; object-fit: contain; }
/* the LaTeX logo is black: make it light on the dark theme */
:root:not([data-theme="light"]) .tool-col li img[src$="latex.png"] { filter: invert(.9); }
.t-logo-round { padding: 2px; }
.t-logo-svg { display: grid; place-items: center; }
.t-logo-svg svg { width: 100%; height: 100%; }
.t-item.now .t-node::before { animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent-soft), 0 0 0 0 rgba(255,180,84,.45); } 100% { box-shadow: 0 0 0 5px var(--accent-soft), 0 0 0 14px rgba(255,180,84,0); } }
@media (prefers-reduced-motion: reduce) { .t-item.now .t-node::before { animation: none; } }
.tool-col li small { margin-left: auto; font: 500 11px var(--mono); color: var(--text-3); }

/* ---------- Beyond ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { padding: 30px 26px; border-right: 1px solid var(--line); background: var(--surface); }
.stat:last-child { border-right: 0; }
.stat .num { font: 700 clamp(30px, 3.6vw, 42px) var(--font); letter-spacing: -0.02em; line-height: 1; color: var(--text); }
.stat .num small { font-size: .5em; color: var(--text-2); font-weight: 600; margin-left: 4px; }
.stat .what { font: 500 12px var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 6px; }
.stat .pct { font: 500 12px var(--mono); color: var(--cool); margin: -2px 0 8px; }
.section-head p a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.stat p { margin: 0; color: var(--text-2); font-size: 14px; }
.stat p a { color: var(--text-2); text-decoration-color: var(--line-strong); }
.stat p a:hover { color: var(--accent); }
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
}
.also { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px 28px; color: var(--text-2); font-size: 15px; }
.also b { color: var(--text); font-weight: 600; }

/* ---------- Contact ---------- */
.contact {
  text-align: center; padding: 130px 0 90px;
  background: radial-gradient(ellipse 60% 70% at 50% 100%, var(--accent-soft), transparent 70%);
}
.contact h2 { font-size: clamp(36px, 6vw, 64px); letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 18px; }
.contact p { color: var(--text-2); max-width: 48ch; margin: 0 auto 34px; }
.contact .actions { justify-content: center; }
.mail {
  display: inline-block; margin-top: 28px;
  font: 500 15px var(--mono); color: var(--text-2); text-decoration: none;
  border-bottom: 1px dashed var(--line-strong); padding-bottom: 2px;
}
.mail:hover { color: var(--accent); border-color: var(--accent); }

footer { border-top: 1px solid var(--line); padding: 26px 0; font: 500 12px var(--mono); color: var(--text-3); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--text-3); }
footer a:hover { color: var(--accent); }

/* ---------- Intro: black-hole merger ---------- */
html.intro body::before { /* covers the page until the intro canvas is in place */
  content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh; z-index: 200; background: var(--bg);
}
/* on phones, cover the largest viewport (behind the browser bars) so nothing shows below the intro */
.intro-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh; z-index: 200; transition: opacity .4s ease; }
.intro-overlay canvas { display: block; width: 100%; height: 100%; }
.intro-overlay.gone { opacity: 0; pointer-events: none; }
.intro-skip {
  position: absolute; right: 20px; bottom: 18px;
  font: 500 12px var(--mono); color: var(--text-3); letter-spacing: .06em;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; cursor: pointer;
}
.intro-skip:hover { color: var(--text); border-color: var(--line-strong); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
.no-js .reveal { opacity: 1; transform: none; }

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

/* Performance: illustrations that are off screen are paused (class set by site.js) */
.feat-media.off *, .card-media.off * { animation-play-state: paused !important; }
