/* Portfolio traducteur : « édition bilingue ».
   Geist (interface) + EB Garamond (le texte traduit) + Geist Mono (chaînes de code).
   Un seul accent. Double enveloppe : plateau teinté (.shell) + noyau (.core).
   Règle de forme : boutons et nav en pilule, blocs en rayons concentriques 28 / 20, petits éléments 12. */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond";
  src: url("fonts/eb-garamond-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond";
  src: url("fonts/eb-garamond-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --wrap: 1120px;
  --r-shell: 28px;
  --r-core: 20px;
  --pad-shell: 8px;

  --z-nav: 20;
  --z-grain: 30;
  --z-skip: 40;

  /* clair : gris argenté froid, noyaux blanc cassé, un accent outremer */
  --bg: #f2f3f5;
  --band: #ebedf0;
  --core: #fcfcfd;
  --tray: rgba(18, 24, 38, 0.045);
  --ring: rgba(18, 24, 38, 0.07);
  --line: rgba(18, 24, 38, 0.1);
  --ink: #12151a;
  --text: #2b3039;
  --muted: #656c79;
  --accent: #3347cf;
  --wash: #e8ebfc;
  --glass: rgba(252, 252, 253, 0.72);
  --hi: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --shadow-core: 0 22px 44px -26px rgba(28, 40, 90, 0.26);
  --shadow-hover: 0 30px 56px -28px rgba(28, 40, 90, 0.34);
  --btn-ic: rgba(255, 255, 255, 0.16);
  --grain: 0.05;
  --glow: rgba(255, 255, 255, 0.95);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f13;
    --band: #101318;
    --core: #151920;
    --tray: rgba(255, 255, 255, 0.04);
    --ring: rgba(255, 255, 255, 0.08);
    --line: rgba(255, 255, 255, 0.1);
    --ink: #eef0f4;
    --text: #c7ccd6;
    --muted: #8d95a3;
    --accent: #98a6f2;
    --wash: #1a2040;
    --glass: rgba(21, 25, 32, 0.7);
    --hi: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    --shadow-core: 0 22px 44px -26px rgba(0, 0, 0, 0.7);
    --shadow-hover: 0 30px 56px -28px rgba(0, 0, 0, 0.8);
    --btn-ic: rgba(13, 15, 19, 0.16);
    --grain: 0.07;
    --glow: rgba(255, 255, 255, 0.04);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Lumière douce en haut à droite, fixe et derrière le contenu */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(60% 46% at 82% -6%, var(--glow), transparent 72%);
}
/* Grain : calque fixe, jamais sur un conteneur qui défile */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

img, svg { max-width: 100%; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-family: var(--sans); font-weight: 500; text-wrap: balance; }
h2 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.06; letter-spacing: -0.04em; }
h3 { font-size: 1.3rem; line-height: 1.2; letter-spacing: -0.02em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
section { padding: clamp(72px, 10vw, 144px) 0; }
.sec-head { max-width: 40rem; margin-bottom: clamp(36px, 5vw, 60px); }
.sec-head h2 { margin-bottom: 16px; }
.sec-head p { color: var(--muted); font-size: 1.08rem; max-width: 52ch; }

.skip {
  position: absolute; left: 12px; top: -64px; z-index: var(--z-skip);
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* Double enveloppe : plateau + noyau aux rayons concentriques */
.shell {
  padding: var(--pad-shell);
  border-radius: var(--r-shell);
  background: var(--tray);
  box-shadow: 0 0 0 1px var(--ring);
}
.core {
  border-radius: var(--r-core);
  background: var(--core);
  box-shadow: var(--hi), var(--shadow-core);
}
.core.wash { background: var(--wash); }

/* Navigation : pilule flottante en verre, détachée du bord */
.nav-wrap {
  position: fixed; top: 14px; left: 0; right: 0; z-index: var(--z-nav);
  display: flex; justify-content: center; padding: 0 12px; pointer-events: none;
}
.nav {
  pointer-events: auto;
  display: flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 6px 6px 6px 22px;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 0 0 1px var(--ring), var(--hi), 0 18px 40px -24px rgba(28, 40, 90, 0.35);
}
.brand { margin-right: 14px; color: var(--ink); font-weight: 560; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.links { display: flex; gap: 2px; margin: 0 6px 0 0; padding: 0; list-style: none; }
.links a {
  display: block; padding: 8px 13px; border-radius: 999px;
  color: var(--muted); font-size: 0.9rem; text-decoration: none;
  transition: color 0.4s var(--ease), background 0.4s var(--ease);
}
.links a:hover { color: var(--ink); }
.links a[aria-current="true"] { color: var(--ink); background: var(--tray); }
.lang {
  padding: 8px 14px; border-radius: 999px; color: var(--muted); font-size: 0.88rem; text-decoration: none;
  box-shadow: 0 0 0 1px var(--ring); transition: color 0.4s var(--ease);
}
.lang:hover { color: var(--ink); }

/* Boutons : pilule + icône imbriquée */
.btn {
  display: inline-flex; align-items: center; gap: 16px;
  padding: 7px 7px 7px 26px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font: 500 0.98rem/1 var(--sans); text-decoration: none; white-space: nowrap;
  transition: transform 0.5s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-ic {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--btn-ic);
  transition: transform 0.5s var(--ease);
}
.btn:hover .btn-ic { transform: translate(2px, -1px) scale(1.06); }
.btn-sm { gap: 10px; padding: 4px 4px 4px 18px; font-size: 0.9rem; }
.btn-sm .btn-ic { width: 32px; height: 32px; }
.arr { position: relative; display: block; width: 14px; height: 14px; }
.arr::before { content: ""; position: absolute; left: 0; right: 1px; top: 50%; height: 1.5px; background: currentColor; transform: translateY(-50%); }
.arr::after { content: ""; position: absolute; right: 1px; top: 50%; width: 7px; height: 7px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: translateY(-50%) rotate(45deg); }
.link {
  color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px;
  text-decoration-color: var(--line); transition: text-decoration-color 0.4s var(--ease);
}
.link:hover { text-decoration-color: var(--accent); }

/* Hero */
.hero { padding: 6.5rem 0 clamp(64px, 8vw, 112px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.eyebrow {
  display: inline-block; margin-bottom: 24px; padding: 6px 14px; border-radius: 999px;
  background: var(--tray); box-shadow: 0 0 0 1px var(--ring);
  color: var(--muted); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
}
.hero h1 { font-size: clamp(2.5rem, 4.7vw, 4.3rem); line-height: 1.02; letter-spacing: -0.045em; margin-bottom: 24px; }
.lead { max-width: 30em; color: var(--text); font-size: clamp(1.08rem, 1.5vw, 1.25rem); line-height: 1.55; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 36px; }

.exhibit { margin: 0; }
.exhibit .core { padding: clamp(26px, 3vw, 40px); }
.line .lbl { display: block; margin-bottom: 12px; color: var(--muted); font: 500 0.76rem/1 var(--mono); }
.line p { margin: 0; font-family: var(--serif); font-size: clamp(1.55rem, 2.5vw, 2.15rem); line-height: 1.18; letter-spacing: -0.01em; }
.line-src p { color: var(--muted); }
.line-tgt { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.line-tgt p { color: var(--ink); }
.hl { position: relative; white-space: nowrap; }
.hl::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.04em; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; animation: draw 1.1s var(--ease) 1.7s forwards;
}
.exhibit figcaption { margin: 16px 8px 0; color: var(--muted); font-size: 0.88rem; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { transform: scaleX(1); } }
.rise { animation: rise 0.9s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms); }
.line-tgt.rise { animation-delay: 1.15s; }

/* Services : bento asymétrique, cellules en double enveloppe */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.cell { display: flex; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.cell .shell { display: flex; width: 100%; transition: transform 0.6s var(--ease); }
.cell:hover .shell { transform: translateY(-3px); }
.cell .core {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  width: 100%; min-height: 290px; padding: clamp(24px, 3vw, 34px);
  transition: box-shadow 0.6s var(--ease);
}
.cell:hover .core { box-shadow: var(--hi), var(--shadow-hover); }
.mark {
  position: absolute; top: 4px; right: 22px; color: var(--accent); opacity: 0.16;
  font-family: var(--serif); font-style: italic; font-size: 7rem; line-height: 1;
  pointer-events: none; user-select: none;
}
.cell h3 { max-width: 15em; margin-bottom: 10px; }
.cell p { max-width: 34em; color: var(--muted); font-size: 0.97rem; }

/* Échantillons : deux pages face à face */
.samples { background: var(--band); }
.spread { margin-bottom: clamp(44px, 6vw, 80px); }
.spread:last-child { margin-bottom: 0; }
.spread-head { max-width: 44rem; margin: 0 0 24px; }
.spread-head h3 { margin-bottom: 10px; font-size: clamp(1.5rem, 2.4vw, 1.9rem); letter-spacing: -0.03em; }
.spread-head p { color: var(--muted); max-width: 56ch; }
.core.cols {
  padding: 8px 0 12px;
  background: linear-gradient(var(--line), var(--line)) 50% 0 / 1px 100% no-repeat, var(--core);
}
.cols-head, .seg { display: grid; grid-template-columns: 1fr 1fr; }
.cols-head { padding: 18px 0 6px; color: var(--muted); font: 500 0.78rem/1 var(--mono); }
.cols-head span, .seg-src, .seg-tgt { padding-left: clamp(18px, 3vw, 32px); padding-right: clamp(18px, 3vw, 32px); }
.seg { padding: 14px 0; }
.seg-key { grid-column: 1 / -1; padding: 0 clamp(18px, 3vw, 32px) 8px; color: var(--muted); font: 500 0.78rem/1 var(--mono); }
.seg-src, .seg-tgt { font-family: var(--serif); font-size: clamp(1.1rem, 1.5vw, 1.25rem); line-height: 1.5; }
.seg-src { color: var(--muted); }
.seg-tgt { color: var(--ink); }
.seg-note { position: relative; background: var(--core); grid-column: 1 / -1; margin: 12px clamp(18px, 3vw, 32px) 0; padding: 2px 0 2px 14px; border-left: 2px solid var(--accent); color: var(--muted); font-size: 0.9rem; line-height: 1.55; max-width: 62ch; }
.seg-src::before, .seg-tgt::before {
  content: attr(data-label); display: none; margin-bottom: 4px; color: var(--muted); font: 500 0.74rem/1 var(--mono);
}
.code .seg-src, .code .seg-tgt { font-family: var(--mono); font-size: 0.86rem; line-height: 1.6; word-break: break-word; }
.code .seg + .seg { border-top: 1px solid var(--line); }
.notes { padding: 22px 22px 16px; }
.notes h4 { margin-bottom: 10px; font-size: 0.98rem; letter-spacing: -0.01em; }
.notes ul { margin: 0; padding-left: 1.1em; color: var(--text); font-size: 0.94rem; }
.notes li { margin: 7px 0; }

/* Méthode : quatre colonnes sous un filet */
.rail { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 44px); margin: 0; padding: 0; list-style: none; }
.rail li { padding-top: 22px; border-top: 1px solid var(--ink); }
.rail h3 { margin-bottom: 12px; font-size: 1.5rem; letter-spacing: -0.03em; }
.rail p { color: var(--muted); font-size: 0.97rem; }

/* À propos */
.about { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(36px, 7vw, 96px); align-items: start; }
.about h2 { margin-bottom: 26px; }
.about p { max-width: 58ch; }
.about p + p { margin-top: 16px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 24px; margin: 0; padding-top: 8px; }
.facts .wide { grid-column: 1 / -1; }
.facts dt { margin-bottom: 6px; color: var(--muted); font: 500 0.78rem/1.2 var(--mono); }
.facts dd { margin: 0; color: var(--ink); font-size: 0.98rem; line-height: 1.5; }

/* Questions : liste ouverte, titre qui reste visible */
.faq-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(36px, 7vw, 96px); }
.faq-grid h2 { position: sticky; top: 110px; align-self: start; }
.qa { padding: 28px 0; }
.qa:first-child { padding-top: 0; }
.qa + .qa { border-top: 1px solid var(--line); }
.qa h3 { margin-bottom: 8px; font-size: 1.22rem; line-height: 1.3; }
.qa p { max-width: 56ch; color: var(--muted); }

/* Contact */
.contact .core { padding: clamp(32px, 6vw, 76px); }
.contact-core { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 32px clamp(32px, 6vw, 80px); align-items: end; }
.contact h2 { margin-bottom: 16px; }
.contact p { max-width: 44ch; color: var(--text); }
.contact-act small { display: block; margin-top: 18px; color: var(--muted); font-size: 0.9rem; }

/* Pied de page */
.foot { padding: 24px 0 56px; color: var(--muted); font-size: 0.85rem; }
.foot .wrap { display: grid; gap: 8px; }
.foot p { max-width: 78ch; }

/* Page 404 */
.nf { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.nf .shell { max-width: 560px; }
.nf .core { padding: clamp(28px, 6vw, 56px); }
.nf h1 { margin-bottom: 12px; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.04em; line-height: 1.05; }
.nf p { margin-bottom: 28px; color: var(--muted); }

/* Apparition au défilement (transform + opacity uniquement) */
.js .reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.9s var(--ease) calc(var(--i, 0) * 80ms), transform 0.9s var(--ease) calc(var(--i, 0) * 80ms);
}
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .line-tgt.rise { animation: none; }
  .hl::after { animation: none; transform: scaleX(1); }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .btn-ic, .cell .shell, .cell .core { transition: none; }
}

/* Tablette */
@media (max-width: 1000px) {
  .links { display: none; }
  .nav { padding-left: 20px; }
  .hero-grid, .about, .faq-grid, .contact-core { grid-template-columns: 1fr; }
  .faq-grid h2 { position: static; }
  .bento { grid-template-columns: 1fr 1fr; }
  .span-2, .span-3, .span-4 { grid-column: span 1; }
  .rail { grid-template-columns: 1fr 1fr; row-gap: 36px; }
}

/* Mobile : tout en une colonne, sans chevauchement */
@media (max-width: 640px) {
  .nav .btn { display: none; }
  .bento { grid-template-columns: 1fr; }
  .cell .core { min-height: 0; padding-top: 96px; }
  .rail { grid-template-columns: 1fr; }
  .core.cols { background: var(--core); }
  .cols-head { display: none; }
  .seg { grid-template-columns: 1fr; row-gap: 12px; padding: 18px 0; }
  .seg-src::before, .seg-tgt::before { display: block; }
  .seg + .seg { border-top: 1px solid var(--line); }
  .facts { grid-template-columns: 1fr; }
  .notes { padding: 18px 16px 12px; }
}
