/* =========================================================
   Tahar Amin Touzi — portfolio
   Tokens d'abord : aucune couleur en dur hors de ce bloc.
   ========================================================= */

/* Polices auto-hébergées (SIL OFL) : aucune requête vers un tiers. */
@font-face { font-family: "Geist"; src: url("../fonts/Geist-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/Geist-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/Geist-SemiBold.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/GeistMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/GeistMono-Medium.woff2") format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/InstrumentSerif-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  color-scheme: dark;

  /* Surfaces — sombre (thème par défaut) */
  --bg: oklch(0.16 0.004 60);
  --bg-2: oklch(0.185 0.005 60);
  --surface: oklch(0.205 0.005 60);
  --surface-2: oklch(0.245 0.006 60);
  --line: oklch(0.97 0.01 80 / 0.085);
  --line-strong: oklch(0.97 0.01 80 / 0.16);

  /* Texte */
  --text: oklch(0.965 0.006 80);
  --text-muted: oklch(0.76 0.008 70);
  --text-faint: oklch(0.6 0.008 70);

  /* Accent « braise » */
  --accent: oklch(0.77 0.155 55);
  --accent-strong: oklch(0.82 0.14 60);
  --accent-fg: oklch(0.2 0.03 50);
  --accent-soft: oklch(0.77 0.155 55 / 0.14);
  --accent-glow: oklch(0.72 0.17 45 / 0.22);

  /* États */
  --success: oklch(0.8 0.15 152);
  --info: oklch(0.78 0.11 245);
  --warn: oklch(0.84 0.13 85);
  --violet: oklch(0.66 0.17 295);
  --sun: oklch(0.86 0.17 95);

  /* Objets */
  --bezel: oklch(0.12 0 0);
  --shadow-lg: 0 1px 0 oklch(1 0 0 / 0.04) inset, 0 30px 80px -20px oklch(0 0 0 / 0.65), 0 12px 24px -12px oklch(0 0 0 / 0.5);
  --shadow-md: 0 18px 40px -18px oklch(0 0 0 / 0.6);
  --grain-opacity: 0.05;

  /* Formes & rythme */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1240px;
  --nav-h: 60px;

  /* Typo */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: "Instrument Serif", ui-serif, Georgia, serif;

  /* Mouvement */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: oklch(0.985 0.004 85);
    --bg-2: oklch(0.965 0.006 85);
    --surface: oklch(1 0 0);
    --surface-2: oklch(0.96 0.006 85);
    --line: oklch(0.25 0.01 60 / 0.1);
    --line-strong: oklch(0.25 0.01 60 / 0.2);
    --text: oklch(0.2 0.012 60);
    --text-muted: oklch(0.43 0.012 60);
    --text-faint: oklch(0.54 0.01 60);
    --accent: oklch(0.6 0.18 42);
    --accent-strong: oklch(0.55 0.18 40);
    --accent-fg: oklch(0.99 0.005 80);
    --accent-soft: oklch(0.6 0.18 42 / 0.1);
    --accent-glow: oklch(0.75 0.15 55 / 0.25);
    --success: oklch(0.56 0.15 152);
    --info: oklch(0.52 0.14 250);
    --warn: oklch(0.62 0.14 75);
    --shadow-lg: 0 30px 70px -28px oklch(0.3 0.03 60 / 0.35), 0 10px 22px -12px oklch(0.3 0.03 60 / 0.22);
    --shadow-md: 0 16px 34px -18px oklch(0.3 0.03 60 / 0.3);
    --grain-opacity: 0.035;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: oklch(0.985 0.004 85);
  --bg-2: oklch(0.965 0.006 85);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.96 0.006 85);
  --line: oklch(0.25 0.01 60 / 0.1);
  --line-strong: oklch(0.25 0.01 60 / 0.2);
  --text: oklch(0.2 0.012 60);
  --text-muted: oklch(0.43 0.012 60);
  --text-faint: oklch(0.54 0.01 60);
  --accent: oklch(0.6 0.18 42);
  --accent-strong: oklch(0.55 0.18 40);
  --accent-fg: oklch(0.99 0.005 80);
  --accent-soft: oklch(0.6 0.18 42 / 0.1);
  --accent-glow: oklch(0.75 0.15 55 / 0.25);
  --success: oklch(0.56 0.15 152);
  --info: oklch(0.52 0.14 250);
  --warn: oklch(0.62 0.14 75);
  --shadow-lg: 0 30px 70px -28px oklch(0.3 0.03 60 / 0.35), 0 10px 22px -12px oklch(0.3 0.03 60 / 0.22);
  --shadow-md: 0 16px 34px -18px oklch(0.3 0.03 60 / 0.3);
  --grain-opacity: 0.035;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
body::after { /* grain */
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; text-wrap: balance; }
p { text-wrap: pretty; }
strong { color: var(--text); font-weight: 600; }
code { font-family: var(--font-mono); font-size: 0.88em; padding: 0.1em 0.35em; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[id] { scroll-margin-top: calc(var(--nav-h) + 24px); }

.mono { font-family: var(--font-mono); font-feature-settings: normal; letter-spacing: 0; }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-fg); font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- Boutons ---------- */
.btn {
  --h: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font: 500 15px/1 var(--font-sans);
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out), color 160ms var(--ease-out);
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.fill { fill: currentColor; stroke: none; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-fg); font-weight: 600; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-small { --h: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: var(--text-faint); background: var(--surface-2); }
  .btn-primary:hover { background: var(--accent-strong); border-color: transparent; }
  .btn-ghost:hover { background: transparent; color: var(--text); }
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--text-muted);
  cursor: pointer; transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { color: var(--text); border-color: var(--line-strong); } }
.theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .theme-toggle .i-sun { display: none; } :root:not([data-theme="dark"]) .theme-toggle .i-moon { display: block; } }
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color 240ms var(--ease-out), border-color 240ms var(--ease-out), backdrop-filter 240ms;
}
.nav.scrolled {
  background: color-mix(in oklch, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom-color: var(--line);
}
.nav-inner { height: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; font-size: 15px; }
.brand-mark { width: 26px; height: 26px; }
.brand-mark rect { fill: var(--text); }
.brand-mark path { stroke: var(--bg); stroke-width: 3; stroke-linecap: round; fill: none; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { padding: 6px 12px; border-radius: 8px; font-size: 14px; color: var(--text-muted); transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover { color: var(--text); background: var(--surface-2); } }
.nav-actions { display: flex; align-items: center; gap: 8px; }
@media (max-width: 860px) { .nav-links { display: none; } .nav-actions { margin-left: auto; } }
@media (max-width: 380px) { .brand-name { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: calc(var(--nav-h) + clamp(40px, 6vw, 76px)); isolation: isolate; }
.hero-bg { position: absolute; inset: 0 0 auto 0; height: 100%; z-index: -1; overflow: hidden; pointer-events: none; }
.hero-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center -1px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 20%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 20%, black 20%, transparent 75%);
}
.hero-glow {
  position: absolute; width: 900px; height: 600px; right: -200px; top: -220px;
  background: radial-gradient(closest-side, var(--accent-glow), transparent);
  filter: blur(20px);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: color-mix(in oklch, var(--surface) 70%, transparent);
  font-size: 13.5px; color: var(--text-muted); font-weight: 500;
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--success); animation: pulse 2.4s var(--ease-out) infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: 0.7; } 70%, 100% { transform: scale(2.8); opacity: 0; } }

.hero-title {
  margin-top: clamp(20px, 3vw, 32px);
  font-size: clamp(3.4rem, 12.4vw, 9.6rem);
  font-weight: 600;
  letter-spacing: -0.058em;
  line-height: 0.9;
}
.hero-title .line { display: flex; align-items: flex-end; gap: 0.22em; overflow: hidden; padding: 0 0.08em 0.08em 0; margin-bottom: -0.04em; }
.hero-title .word { display: inline-block; }
.hero-title .serif { color: var(--accent); font-size: 1.08em; letter-spacing: -0.035em; padding-right: 0.06em; }
.hero-role {
  margin-left: auto; margin-bottom: 0.32em;
  font: 500 clamp(12px, 1.1vw, 14px)/1.5 var(--font-mono);
  letter-spacing: 0.06em; text-transform: uppercase; text-align: right;
  color: var(--text-muted);
}
@media (max-width: 720px) { .hero-role { display: none; } }

.hero-bottom { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); margin-top: clamp(28px, 4vw, 44px); align-items: end; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.32rem); line-height: 1.55; color: var(--text-muted); max-width: 40ch; letter-spacing: -0.012em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.now-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  background: color-mix(in oklch, var(--surface) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 18px 20px 12px;
}
.now-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 6px; }
.now-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.now-list li:first-child { border-top: 0; }
.now-list a { font-weight: 500; transition: color 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .now-list a:hover { color: var(--accent); } }
.now-kind { margin-left: auto; font: 12px var(--font-mono); color: var(--text-faint); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-live { background: var(--success); box-shadow: 0 0 0 3px color-mix(in oklch, var(--success) 22%, transparent); }
.dot-store { background: var(--info); box-shadow: 0 0 0 3px color-mix(in oklch, var(--info) 22%, transparent); }

@media (max-width: 860px) { .hero-bottom { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
  .cta-row .btn { flex: 1 1 auto; }
  .cta-row .btn-ghost { flex-basis: 100%; }
}

/* Bandeau de captures */
.reel {
  margin-top: clamp(56px, 8vw, 96px);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.reel-track { display: flex; width: max-content; animation: reel 80s linear infinite; }
.reel:hover .reel-track { animation-play-state: paused; }
.reel-group { display: flex; gap: 16px; padding-right: 16px; }
.reel-group li { width: clamp(250px, 26vw, 380px); flex: none; }
.reel figure img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top;
  border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--surface);
}
.reel figcaption { margin-top: 10px; font: 12px var(--font-mono); color: var(--text-faint); }
@keyframes reel { to { transform: translateX(-50%); } }

/* ---------- Chiffres ---------- */
.stats { padding-block: clamp(64px, 9vw, 112px) 0; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 8px; padding: 24px 20px 4px 0; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat dd { font-size: clamp(2.6rem, 4.6vw, 4rem); font-weight: 500; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .approx { color: var(--text-faint); font-weight: 400; }
.stat dt { font-size: 14px; color: var(--text-muted); line-height: 1.4; max-width: 18ch; }
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat, .stat + .stat { padding: 22px 16px 22px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .stat:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
  .stat:last-child { grid-column: 1 / -1; border-bottom: 0; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(88px, 12vw, 160px); position: relative; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: clamp(48px, 7vw, 88px); }
.kicker { font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.section-head h2 { font-size: clamp(2.3rem, 5.4vw, 4.4rem); letter-spacing: -0.045em; line-height: 1; }
.section-head h2 .serif, .contact-title .serif { color: var(--accent); }
.section-sub { margin-top: 20px; font-size: clamp(1.02rem, 1.4vw, 1.15rem); color: var(--text-muted); max-width: 56ch; }

/* ---------- Études de cas ---------- */
.case {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(32px, 5vw, 72px); align-items: start;
}
@media (min-width: 961px) { .case-media { position: sticky; top: calc(var(--nav-h) + 40px); } }
.case + .case { margin-top: clamp(96px, 13vw, 176px); }
.case-media { grid-column: 1 / span 7; position: relative; }
.case-body { grid-column: 8 / span 5; }
.case-flip .case-media { grid-column: 6 / span 7; order: 2; }
.case-flip .case-body { grid-column: 1 / span 5; order: 1; }
@media (max-width: 960px) {
  .case, .case-flip { grid-template-columns: minmax(0, 1fr); }
  .case-media, .case-body, .case-flip .case-media, .case-flip .case-body { grid-column: 1; order: 0; }
}

.case-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-faint); letter-spacing: 0.02em; }
.case-meta span { color: var(--accent); }
.case-title { font-size: clamp(2.2rem, 3.8vw, 3.3rem); letter-spacing: -0.05em; margin-top: 14px; }
.case-pitch { margin-top: 18px; font-size: 1.1rem; line-height: 1.55; color: var(--text); letter-spacing: -0.01em; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.badge {
  --c: var(--text-faint);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px 4px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  font: 500 12px/1.3 var(--font-mono); color: var(--text-muted);
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.badge-live { --c: var(--success); }
.badge-store { --c: var(--info); }
.badge-client { --c: var(--accent); }
.badge-oss { --c: var(--text); }
.badge-wip { --c: var(--warn); }
.badge-muted { --c: var(--text-faint); color: var(--text-faint); }

.points { margin-top: 22px; display: grid; gap: 10px; }
.points li { position: relative; padding-left: 22px; color: var(--text-muted); font-size: 15.5px; line-height: 1.55; }
.points li::before { content: ""; position: absolute; left: 2px; top: 0.78em; width: 10px; height: 1.5px; border-radius: 2px; background: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.chips li {
  padding: 5px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  font: 12.5px/1.2 var(--font-mono); color: var(--text-muted);
}
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 26px; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500; font-size: 15px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size 280ms var(--ease-out), color 160ms var(--ease-out);
}
.link-arrow::after { content: "↗"; font-size: 0.9em; color: var(--accent); transition: transform 200ms var(--ease-out); }
.link-arrow[href^="#"]::after { content: "↓"; }
@media (hover: hover) and (pointer: fine) {
  .link-arrow:hover { background-size: 100% 1px; }
  .link-arrow:hover::after { transform: translate(2px, -2px); }
}
.private { font-size: 12px; color: var(--text-faint); }

/* Cadres */
.browser {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.browser-bar { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.browser-bar > span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.browser-url { margin-inline: auto; transform: translateX(-24px); font-size: 12px; color: var(--text-faint); padding: 3px 12px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }

.phone {
  border-radius: var(--radius-xl);
  border: 5px solid var(--bezel);
  background: var(--bezel);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--line-strong);
  overflow: hidden;
}
.phone img { width: 100%; border-radius: calc(var(--radius-xl) - 5px); }
.case-media:has(.phone-float) { padding-bottom: 6%; }
.phone-float { position: absolute; width: 23%; right: -3%; bottom: -4%; }
@media (max-width: 960px) { .phone-float { right: 2%; width: 26%; } }

.phones-stage {
  --tint: var(--violet);
  position: relative; aspect-ratio: 5 / 4;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(90% 70% at 50% 100%, color-mix(in oklch, var(--tint) 45%, transparent), transparent 70%),
    radial-gradient(60% 50% at 50% 0%, color-mix(in oklch, var(--tint) 18%, transparent), transparent),
    var(--surface);
  overflow: hidden;
}
.phones-stage .phone { position: absolute; width: 30%; top: 12%; border-width: 4px; border-radius: 24px; }
.phones-stage .phone img { border-radius: 20px; }
.phones-stage .p-center { left: 35%; top: 9%; z-index: 2; width: 31%; }
.phones-stage .p-left { left: 9%; transform: rotate(-6deg) translateY(6%); }
.phones-stage .p-right { right: 9%; transform: rotate(6deg) translateY(6%); }
.app-icon { position: absolute; left: 20px; top: 20px; width: 52px; height: 52px; border-radius: 13px; box-shadow: var(--shadow-md); z-index: 3; }

.game-stack { position: relative; padding-bottom: 14%; }
.shot img { border-radius: var(--radius-lg); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); }
.shot-inset { position: absolute; width: 44%; right: -3%; bottom: 0; }
.shot-inset img { border-radius: var(--radius); }
@media (max-width: 960px) { .shot-inset { right: 2%; } }

/* Projets phares compacts */
.minis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: clamp(96px, 13vw, 176px); }
@media (max-width: 860px) { .minis { grid-template-columns: minmax(0, 1fr); } }
.mini {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  background: var(--surface);
}
.mini-visual {
  position: relative; height: 210px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.mini-body { padding: clamp(22px, 3vw, 30px); display: flex; flex-direction: column; flex: 1; }
.mini-body h3 { font-size: clamp(1.7rem, 2.6vw, 2.1rem); letter-spacing: -0.045em; margin-top: 12px; }
.mini-body > p:not(.case-meta):not(.links) { margin-top: 14px; color: var(--text); font-size: 15.5px; }
.mini .points li { font-size: 14.5px; }
.mini .chips { margin-top: 18px; }
.mini .links { margin-top: auto; padding-top: 22px; }

/* Visuel : chaîne de hachage */
.chain .block { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 11.5px; color: var(--text-faint); box-shadow: var(--shadow-md); }
.chain .block .h { color: var(--text); }
.chain .block-accent { border-color: var(--accent); background: var(--accent-soft); }
.chain .block-accent .h { color: var(--accent); }
.chain .link-line { width: 18px; height: 1.5px; background: var(--line-strong); flex: none; }
@media (max-width: 420px) { .chain .block:first-child, .chain .link-line:first-of-type { display: none; } }

/* Visuel : lignée */
.lineage { gap: 0; padding-inline: 16px; }
.lineage .step { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); min-width: 0; }
.lineage .step + .step { margin-left: 26px; position: relative; }
.lineage .step + .step::before { content: "→"; position: absolute; left: -21px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 14px; }
.lineage span { font-size: 11px; color: var(--text-faint); }
.lineage strong { font-size: 14px; letter-spacing: -0.02em; white-space: nowrap; }
.lineage em { font-style: normal; font-size: 12px; color: var(--text-muted); }
.lineage .step-accent { border-color: var(--accent); background: var(--accent-soft); }
.lineage .step-accent strong { color: var(--accent); }
@media (max-width: 440px) { .lineage .step:first-child { display: none; } }

/* Visuel : onde */
.wave { flex-direction: column; gap: 22px; }
.bars { display: flex; align-items: center; gap: 5px; height: 72px; }
.bars i { display: block; width: 5px; height: 100%; border-radius: 4px; background: var(--accent); transform-origin: center; transform: scaleY(0.2); animation: bar 1.6s var(--ease-in-out) infinite; }
.bars i:nth-child(3n) { animation-duration: 1.9s; }
.bars i:nth-child(4n) { animation-duration: 1.3s; }
.bars i:nth-child(5n+1) { opacity: 0.6; }
.bars i:nth-child(1) { animation-delay: -0.1s } .bars i:nth-child(2) { animation-delay: -0.3s } .bars i:nth-child(3) { animation-delay: -0.5s }
.bars i:nth-child(4) { animation-delay: -0.7s } .bars i:nth-child(5) { animation-delay: -0.9s } .bars i:nth-child(6) { animation-delay: -1.1s }
.bars i:nth-child(7) { animation-delay: -0.2s } .bars i:nth-child(8) { animation-delay: -0.4s } .bars i:nth-child(9) { animation-delay: -0.6s }
.bars i:nth-child(10) { animation-delay: -0.8s } .bars i:nth-child(11) { animation-delay: -1s } .bars i:nth-child(12) { animation-delay: -1.2s }
.bars i:nth-child(13) { animation-delay: -0.15s } .bars i:nth-child(14) { animation-delay: -0.35s } .bars i:nth-child(15) { animation-delay: -0.55s }
.bars i:nth-child(16) { animation-delay: -0.75s } .bars i:nth-child(17) { animation-delay: -0.95s } .bars i:nth-child(18) { animation-delay: -1.15s }
.bars i:nth-child(19) { animation-delay: -0.25s } .bars i:nth-child(20) { animation-delay: -0.45s } .bars i:nth-child(21) { animation-delay: -0.65s }
.bars i:nth-child(22) { animation-delay: -0.85s } .bars i:nth-child(23) { animation-delay: -1.05s } .bars i:nth-child(24) { animation-delay: -1.25s }
@keyframes bar { 0%, 100% { transform: scaleY(0.18); } 50% { transform: scaleY(1); } }
.kbd { display: flex; gap: 6px; }
kbd { font: 500 12px/1 var(--font-mono); padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface); color: var(--text-muted); }

/* Visuel : téléphones Tappy */
.phones-mini {
  --tint: var(--sun);
  gap: 0;
  background: radial-gradient(80% 90% at 50% 110%, color-mix(in oklch, var(--tint) 40%, transparent), transparent 70%), var(--bg-2);
}
.phones-mini { align-items: flex-start; padding-top: 26px; }
.phones-mini img { width: 26%; max-width: 112px; border-radius: 14px; border: 3px solid var(--bezel); box-shadow: var(--shadow-md); }
.phones-mini img:nth-child(1) { transform: translate(16%, 14px) rotate(-7deg); }
.phones-mini img:nth-child(2) { z-index: 1; }
.phones-mini img:nth-child(3) { transform: translate(-16%, 14px) rotate(7deg); }

/* Halo au survol (cartes) */
.spot { position: relative; }
.spot::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 60%);
  opacity: 0; transition: opacity 300ms var(--ease-out);
}
.spot > * { position: relative; z-index: 1; }
@media (hover: hover) and (pointer: fine) { .spot:hover::before { opacity: 1; } }

/* ---------- Index ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent;
  color: var(--text-muted); font: 500 14px/1 var(--font-sans); letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out), border-color 180ms var(--ease-out), transform 160ms var(--ease-out);
}
.chip-btn:active { transform: scale(0.96); }
.chip-btn .count { font: 11.5px var(--font-mono); color: var(--text-faint); }
.chip-btn[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip-btn[aria-pressed="true"] .count { color: color-mix(in oklch, var(--bg) 65%, transparent); }
@media (hover: hover) and (pointer: fine) { .chip-btn:not([aria-pressed="true"]):hover { color: var(--text); border-color: var(--text-faint); } }

.index-list { border-top: 1px solid var(--line-strong); }
.row {
  display: grid; grid-template-columns: 84px minmax(150px, 220px) minmax(0, 1fr) 170px;
  gap: 8px 24px; align-items: baseline;
  padding: 20px 8px; border-bottom: 1px solid var(--line);
  transition: background-color 200ms var(--ease-out);
}
.row.is-hidden { display: none; }
.row.is-entering { animation: rowIn 420ms var(--ease-out) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.row-date { font-size: 12.5px; color: var(--text-faint); }
.row-name { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.025em; transition: color 160ms var(--ease-out), transform 240ms var(--ease-out); display: inline-block; justify-self: start; }
a.row-name::after { content: " ↗"; font-weight: 400; font-size: 0.8em; color: var(--text-faint); }
a.row-name[href^="#"]::after { content: " ↓"; }
.row-desc { color: var(--text-muted); font-size: 15px; line-height: 1.5; }
.row-status { justify-self: end; }
@media (hover: hover) and (pointer: fine) {
  .row:hover { background: var(--surface); }
  .row:hover .row-name { transform: translateX(4px); }
  a.row-name:hover { color: var(--accent); }
}
@media (max-width: 760px) {
  .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date status" "name name" "desc desc"; padding: 18px 2px; gap: 6px 12px; }
  .row-date { grid-area: date; } .row-status { grid-area: status; } .row-name { grid-area: name; margin-top: 4px; } .row-desc { grid-area: desc; }
}
.index-empty { padding: 32px 0; color: var(--text-faint); }
.preview {
  position: fixed; left: 0; top: 0; z-index: 40;
  width: 300px; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top;
  border-radius: var(--radius); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
  pointer-events: none; opacity: 0;
  transform: translate3d(var(--px, 0), var(--py, 0), 0) scale(0.94);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.preview.on { opacity: 1; transform: translate3d(var(--px, 0), var(--py, 0), 0) scale(1); }
@media (hover: none), (pointer: coarse), (max-width: 900px) { .preview { display: none; } }

/* ---------- Compétences ---------- */
.skills {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px; background: var(--line-strong);
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg); overflow: hidden;
}
.skill { background: var(--bg); padding: clamp(22px, 2.6vw, 30px); }
.skill h3 { font-size: 16px; letter-spacing: -0.02em; }
.skill .chips { margin-top: 16px; }
.skill-note { margin-top: 16px; font-size: 13.5px; color: var(--text-faint); }
@media (max-width: 960px) { .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .skills { grid-template-columns: minmax(0, 1fr); } }

.method {
  display: flex; gap: 20px; align-items: flex-start;
  margin-top: 24px; padding: clamp(22px, 3vw, 32px);
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in oklch, var(--accent) 35%, transparent);
  background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface);
}
.method-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: var(--accent-fg); }
.method-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.method h3 { font-size: 1.2rem; }
.method p { margin-top: 10px; color: var(--text-muted); max-width: 80ch; }
@media (max-width: 520px) { .method { flex-direction: column; } }

/* ---------- Parcours ---------- */
.timeline { border-top: 1px solid var(--line-strong); }
.tl { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 12px 40px; padding: clamp(28px, 4vw, 44px) 0; border-bottom: 1px solid var(--line); }
.tl-date { font-size: 13.5px; color: var(--accent); padding-top: 6px; }
.tl h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); letter-spacing: -0.035em; }
.tl-org { margin-top: 8px; color: var(--text-faint); font-size: 15px; }
.tl-body > p:not(.tl-org) { margin-top: 14px; color: var(--text-muted); max-width: 70ch; }
.tl .points { margin-top: 18px; }
@media (max-width: 720px) { .tl { grid-template-columns: minmax(0, 1fr); } .tl-date { padding-top: 0; } }
.langs { margin-top: 32px; color: var(--text-muted); font-size: 15px; }
.langs .mono { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-right: 14px; }

/* ---------- Contact ---------- */
.contact { position: relative; padding-block: clamp(100px, 15vw, 200px); overflow: hidden; isolation: isolate; }
.contact::before {
  content: ""; position: absolute; z-index: -1; left: 50%; bottom: -380px; width: 1100px; height: 700px; transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--accent-glow), transparent);
}
.contact-title { font-size: clamp(2.8rem, 8.4vw, 7.4rem); letter-spacing: -0.055em; line-height: 0.95; max-width: 14ch; }
.contact .section-sub { margin-top: 24px; }
.contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: clamp(36px, 5vw, 56px); }
.email-big {
  font-size: clamp(1.45rem, 4.6vw, 3.2rem); font-weight: 500; letter-spacing: -0.04em; line-height: 1.1;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 2px no-repeat;
  padding-bottom: 6px;
  transition: color 180ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .email-big:hover { color: var(--accent); } }
.copy-btn[data-copied] { color: var(--success); border-color: var(--success); }

/* ---------- Pied de page ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 28px; font-size: 13.5px; color: var(--text-faint); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.footer .mono { font-size: 12px; }
.to-top { transition: color 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .to-top:hover { color: var(--text); } }

/* ---------- Apparitions ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .hero-title .word { transform: translateY(108%); transition: transform 1000ms var(--ease-out); }
.js .hero-title.in .word { transform: none; }
.js .hero-title .line:nth-child(1) .word:nth-child(2) { transition-delay: 70ms; }
.js .hero-title .line:nth-child(2) .word:nth-child(1) { transition-delay: 150ms; }
.js .hero-title .line:nth-child(2) .word:nth-child(2) { transition-delay: 260ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .hero-title .word { opacity: 1; transform: none; transition: none; }
  .pulse::after, .bars i { animation: none; }
  .bars i { transform: scaleY(0.55); }
  .bars i:nth-child(3n) { transform: scaleY(0.9); }
  .bars i:nth-child(4n) { transform: scaleY(0.35); }
  .reel { overflow-x: auto; mask-image: none; -webkit-mask-image: none; padding-inline: var(--gutter); }
  .reel-track { animation: none; }
  .reel-group[aria-hidden="true"] { display: none; }
  .row.is-entering { animation: none; }
  .btn, .chip-btn, .icon-btn { transition: none; }
}
