/* Case study styles. Shared by every page in pages/ (the chat case set the standard).
   Layout A: one reading column, visuals breaking out wider, TOC in the margin.
   One typeface (Geist), one ink, hairlines instead of boxes. */

@font-face {
  font-family: 'Geist';
  src: url('fonts/geist-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg:      #FFFFFF;
  --ink:     #111111;
  --ink-2:   #464646;
  --ink-3:   #737373;
  --rule:    #E6E6E6;
  --surface: #F5F5F4;
  --focus:   #111111;

  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --fs:   17px;
  --lh:   1.65;

  --col:  680px;
  --wide: 1040px;
  --side: clamp(20px, 5vw, 48px);
  --gap-section: 120px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 32px; }
body {
  overflow-x: clip;  /* full-bleed hero wall uses 100vw */
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs);
  line-height: var(--lh);
  letter-spacing: -0.011em;
  font-feature-settings: 'ss01' 0;
}
a { color: inherit; }
img { display: block; max-width: 100%; }

/* ── Labels: small, muted, sentence case ── */
.label {
  display: block;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0;
  line-height: 1.4;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ── Site header and footer ── */
header.site, footer.site {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 28px var(--side);
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
header.site a { text-decoration: none; color: var(--ink-3); transition: color .15s; }
header.site a:hover { color: var(--ink); }
header.site .name { color: var(--ink); font-weight: 500; }
footer.site { color: var(--ink-3); border-top: 1px solid var(--rule); margin-top: 40px; }
/* language switcher: current language in ink, the other one a quiet link */
header.site .site-end { display: flex; align-items: baseline; gap: 24px; }
.lang-switch { display: flex; gap: 10px; font-size: 13px; letter-spacing: .02em; }
.lang-switch [aria-current] { color: var(--ink); font-weight: 500; }
header.site a { white-space: nowrap; }
@media (max-width: 560px) {
  /* four links and the language switch no longer fit beside the name: the nav drops to its own row */
  header.site { flex-wrap: wrap; row-gap: 10px; }
}
@media (max-width: 440px) {
  header.site { gap: 12px; }
  header.site .site-nav { gap: 10px; }
  .lang-switch { gap: 5px; }
}

/* ── Header menu (system/site-nav.js): menu button on narrow screens, Contact menu ── */
header.site { position: relative; }
.nav-toggle { display: none; }
.contact { position: relative; display: inline-flex; }
header.site .contact > a[aria-expanded="true"] { color: var(--ink); }

.contact-menu {
  position: absolute; top: calc(100% + 12px); right: -12px; z-index: 30;
  min-width: 232px; padding: 6px;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 12px;
  box-shadow: 0 10px 30px rgb(0 0 0 / .08), 0 1px 2px rgb(0 0 0 / .04);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transform-origin: top right;
  transition: opacity .15s ease-out, transform .15s ease-out, visibility 0s linear .15s;
}
.contact[data-open] .contact-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.contact-email { padding: 8px 10px 10px; font-size: 13px; line-height: 1.3; color: var(--ink-3); user-select: all; border-bottom: 1px solid var(--rule); margin-bottom: 6px; }
header.site .contact-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%;
  min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: none; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--ink); text-align: left; text-decoration: none;
  transition: background-color .12s;
}
header.site .contact-item:hover { background: var(--surface); color: var(--ink); }
header.site .contact-item:focus-visible, .nav-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ci-icon { flex: none; color: var(--ink-3); }
.ci-check { display: none; }
.contact-item[data-state="done"] .ci-copy { display: none; }
.contact-item[data-state="done"] .ci-check { display: block; color: var(--ink); }
.contact-item[data-state="failed"] .ci-label { color: var(--ink-2); }
.contact-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 640px) {
  header.nav-js { flex-wrap: nowrap; align-items: center; padding-top: 14px; padding-bottom: 14px; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    width: 44px; height: 44px; margin: 0 -12px 0 auto; padding: 0; border: 0; background: none; cursor: pointer; color: var(--ink);
    -webkit-tap-highlight-color: transparent;
  }
  .nav-toggle .bar { display: block; width: 18px; height: 1.5px; background: currentColor; border-radius: 1px; transition: transform .2s ease; }
  .nav-open .nav-toggle .bar:first-child { transform: translateY(3.25px) rotate(45deg); }
  .nav-open .nav-toggle .bar:last-child { transform: translateY(-3.25px) rotate(-45deg); }

  header.nav-js .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 0 var(--side) 16px; background: var(--bg); border-bottom: 1px solid var(--rule);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .18s ease-out, transform .18s ease-out, visibility 0s linear .18s;
  }
  header.nav-js.nav-open .site-nav { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  header.nav-js .site-nav > a, header.nav-js .contact > a { display: flex; align-items: center; min-height: 52px; font-size: 17px; letter-spacing: -0.01em; border-top: 1px solid var(--rule); }
  header.nav-js .site-nav > a:first-child { border-top: 0; }
  header.nav-js .site-nav [aria-current="page"] { color: var(--ink); }
  header.nav-js .contact { display: block; border-top: 1px solid var(--rule); }
  header.nav-js .contact > a { border-top: 0; }
  header.nav-js .contact-menu {
    position: static; display: none; min-width: 0; padding: 0 0 8px; border: 0; border-radius: 0; box-shadow: none;
    opacity: 1; visibility: visible; transform: none; transition: none; background: none;
  }
  header.nav-js .contact[data-open] .contact-menu { display: block; }
  header.nav-js .contact-email { padding: 0 0 10px; border-bottom: 0; margin-bottom: 0; }
  header.nav-js .contact-item { min-height: 48px; padding: 0; font-size: 16px; border-radius: 0; }
  header.nav-js .contact-item:hover { background: none; }
  header.nav-js .lang-switch { padding-top: 14px; border-top: 1px solid var(--rule); font-size: 14px; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .contact-menu, header.nav-js .site-nav, .nav-toggle .bar { transition: none; }
}

/* ── Column ── */
main { padding: 0 var(--side) 64px; }
main > section, .next { max-width: var(--col); margin-left: auto; margin-right: auto; }

/* ── Hero ── */
.hero { padding-top: clamp(56px, 10vw, 112px); }
.hero > .label { margin-bottom: 20px; }
h1 {
  /* plain wrapping: "balance" shortened every line, so the title never reached the column edge.
     50px rather than 52: at 52 "conversation" cannot fit after "espace de" and the lines stop short. */
  font-size: clamp(34px, 5vw, 50px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.04em;
  text-wrap: wrap;
  margin-bottom: 20px;
}
.lede { font-size: 19px; line-height: 1.5; color: var(--ink-2); letter-spacing: -0.015em; text-wrap: pretty; }
.hero > .lede { max-width: 34em; }

/* Brief ("L'essentiel en 30 secondes"): a label, then rows on hairlines */
.brief-label { margin-top: 56px; }
.brief {
  margin-top: 12px;
  border-top: 1px solid var(--ink);
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
}
.brief dt, .brief dd { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.brief dt { font-size: 14px; color: var(--ink-3); padding-top: 18px; }
.brief dd { font-size: 15.5px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.brief dd strong { color: var(--ink); font-weight: 550; }
.brief ul { list-style: none; }
.brief li + li { margin-top: 10px; }

.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 32px; margin-top: 20px; font-size: 14px; }
.meta dt { color: var(--ink-3); }
.meta dd { color: var(--ink); }

/* ── Sections ── */
.case-section { padding-top: var(--gap-section); }
.sec-head { margin-bottom: 40px; }
.sec-head .label { margin-bottom: 14px; }
h2 {
  font-size: clamp(26px, 3.2vw, 32px);  /* 32 max: the longest one-line title (section 05) fits the 680 column */
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.035em;
  text-wrap: pretty;  /* balance split short titles onto two lines */
  margin-bottom: 14px;
}
/* Standfirst: a step between h2 and body, set apart by size and tone */
.sec-head .lede { font-size: clamp(20px, 2.2vw, 23px); line-height: 1.42; letter-spacing: -0.022em; color: var(--ink-3); max-width: 30em; }

.case-section p, .case-section li { color: var(--ink-2); text-wrap: pretty; }
.case-section p + p, .case-section p + ul, .case-section ul + p { margin-top: 1.1em; }
.case-section strong { color: var(--ink); font-weight: 550; }
.case-section ul { list-style: none; }
.case-section li { position: relative; padding-left: 1.4em; }
.case-section li + li { margin-top: 0.7em; }
.case-section li::before { content: ''; position: absolute; left: 0.15em; top: 0.8em; width: 0.55em; height: 1px; background: var(--ink-3); }
.case-section a { text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Decision titles */
h3 {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin: 72px 0 18px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 32px;
}
h3 .label { margin-bottom: 8px; }

/* ── Decisions: card always visible, story collapsible ── */
.decision { scroll-margin-top: 32px; }
.decision h3 { scroll-margin-top: 32px; }
.card {
  display: grid;
  grid-template-columns: 8.5em minmax(0, 1fr);
  border-top: 1px solid var(--ink);
  margin-top: 4px;
}
.card dt, .card dd { padding: 13px 0; border-bottom: 1px solid var(--rule); }
.card dt { font-size: 14px; color: var(--ink-3); padding-top: 15px; }
.card dd { color: var(--ink); font-size: 16px; line-height: 1.55; text-wrap: pretty; }

.decision .canvas { margin: 32px 0 0; }

/* ── Canvas: prototype + reasoning, one surface ── */
.canvas {
  background: var(--surface);
  border-radius: 18px;
  padding: clamp(32px, 5vw, 56px) clamp(16px, 4vw, 48px) 12px;
}
.canvas--slim { padding-top: 12px; }
/* no prototype: closed, the toggle sits centred in the band (12 above, 12 below) */
.canvas--slim > .story[hidden] + .story-toggle { margin-top: 0; }
.canvas .story-body {
  max-width: var(--col);
  margin: 0 auto;
  padding: 40px 0 8px;
}
.canvas:not(.canvas--slim) .story-body { border-top: 1px solid #E4E4E2; margin-top: 40px; }
.canvas--slim .story-body { padding-top: 28px; }
.canvas .story { overflow: hidden; }
.canvas .story[hidden]:not([hidden="until-found"]) { display: none; }
.canvas .story-body p { color: var(--ink-2); }
.canvas .story-body p + p { margin-top: 1.1em; }
.canvas-figure figcaption { text-align: center; }

.story-toggle {
  display: flex; align-items: center; gap: 8px;
  margin: 8px auto 0;
  height: 40px; padding: 0 16px;
  font: inherit; font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--ink); background: none; border: 0; border-radius: 999px; cursor: pointer;
  transition: background-color .15s;
}
.story-toggle:hover { background: rgba(0,0,0,.05); }
.story-toggle svg { width: 16px; height: 16px; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.story-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.story-toggle .t-close { display: none; }
.story-toggle[aria-expanded="true"] .t-open { display: none; }
.story-toggle[aria-expanded="true"] .t-close { display: inline; }

@media print {
  .story-toggle { display: none; }
  .story[hidden] { display: block !important; }
  .toc, .skip-link { display: none !important; }
}

/* ── Visuals: break out of the column ── */
.breakout {
  width: min(var(--wide), 100vw - 2 * var(--side));
  margin: 56px 0;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.frame {
  background: var(--surface);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.placeholder { font-size: 13px; line-height: 1.55; color: var(--ink-3); max-width: 44ch; text-align: center; padding: 32px; }
figcaption {
  max-width: var(--col);
  margin: 14px auto 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-3);
  text-wrap: pretty;
}
.hero .breakout { margin-top: 64px; margin-bottom: 0; }

/* ── Closing ── */
.closing { padding-top: var(--gap-section); }
blockquote p {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}

/* ── Next case ── */
.next {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-top: 96px;
  padding: 24px 0;
  border-top: 1px solid var(--ink);
  text-decoration: none;
}
.next .label { grid-column: 1 / -1; margin-bottom: 6px; }
.next-title { font-size: 22px; font-weight: 500; letter-spacing: -0.025em; }
.next .arrow { font-size: 22px; transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.next:hover .arrow { transform: translateX(4px); }

/* ── Table of contents (wide screens) ── */
.toc { display: none; }
@media (min-width: 1240px) {
  .toc {
    display: block;
    position: fixed;
    top: 104px;
    left: max(32px, calc((100vw - var(--wide)) / 2 - 220px));
    width: 196px;
    font-size: 13px;
    line-height: 1.45;
  }
  .toc a { text-decoration: none; color: var(--ink-3); transition: color .15s; }
  .toc a:hover { color: var(--ink); }
  .toc-title { display: block; color: var(--ink) !important; font-weight: 500; margin-bottom: 18px; }
  .toc ol { list-style: none; }
  .toc > ol > li + li { margin-top: 10px; }
  .toc > ol > li > a { display: flex; gap: 10px; }
  .toc .n { color: #BDBDBD; font-variant-numeric: tabular-nums; }
  .toc ol ol { margin: 8px 0 2px 28px; display: none; }
  .toc ol ol li + li { margin-top: 6px; }
  .toc li.in > ol { display: block; }
  .toc li.in > a, .toc li.on > a { color: var(--ink); }
  .toc li.in > a .n { color: var(--ink); }
}
/* Between 1240 and 1500px the TOC sits at 32px: keep wide visuals clear of it */
@media (min-width: 1240px) and (max-width: 1499px) {
  .breakout { width: min(var(--wide), 100vw - 520px); }
}

/* ── Accessibility ── */
.skip-link { position: absolute; left: 16px; top: -48px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; text-decoration: none; z-index: 10; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

/* ── Small screens ── */
@media (max-width: 640px) {
  :root { --fs: 16px; --gap-section: 88px; }
  header.site { padding-top: 20px; padding-bottom: 20px; }
  .lede { font-size: 17px; }
  .sec-head .lede { font-size: 19px; }
  .brief-label { margin-top: 40px; }
  .brief { grid-template-columns: 1fr; }
  .brief dt { border-bottom: 0; padding-bottom: 2px; }
  .brief dd { padding-top: 0; }
  .meta { gap: 14px 24px; }
  h3 { font-size: 20px; margin-top: 56px; }
  .card { grid-template-columns: 1fr; }
  .card dt { border-bottom: 0; padding-bottom: 0; }
  .card dd { padding-top: 2px; font-size: 15.5px; }
  .breakout { width: calc(100vw - 2 * var(--side)); margin: 40px 0; }
  .frame { border-radius: 10px; }
  .canvas { padding-left: 6px; padding-right: 6px; border-radius: 14px; }
  figcaption { font-size: 13px; }
}

/* ── Body tables (build-case.py): scannable rows, cards on mobile ── */
.table-wrap { margin: 28px 0 32px; }
.case-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.case-table thead th { text-align: left; font-size: 13px; font-weight: 500; color: var(--ink-3); padding: 0 16px 10px 0; border-bottom: 1px solid var(--ink, #111); }
.case-table tbody th, .case-table td { text-align: left; vertical-align: top; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule, #E6E6E6); }
.case-table tbody th { font-weight: 500; white-space: nowrap; width: 1%; padding-right: 28px; }
.case-table td { color: var(--ink-2, #464646); }
@media (min-width: 1100px) { .breakout-soft { margin-left: -80px; margin-right: -80px; } }
@media (max-width: 720px) {
  .case-table thead { display: none; }
  .case-table, .case-table tbody, .case-table tr, .case-table th, .case-table td { display: block; width: auto; }
  .case-table tr { padding: 16px 0; border-bottom: 1px solid var(--rule, #E6E6E6); }
  .case-table tbody th, .case-table td { border: 0; padding: 0; white-space: normal; }
  .case-table tbody th { font-size: 16px; margin-bottom: 8px; width: auto; }
  .case-table td { margin-top: 6px; }
  .case-table td::before { content: attr(data-label); display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
}

/* ── Working notes in drafts (✍️ / 🔎 lines) ── */
.draft-note { margin: 20px 0; padding: 14px 16px; border-radius: 10px; background: #FFF8E6; border: 1px dashed #E0B85A; font-size: 14px; line-height: 1.5; color: #5C4A1A; }
.draft-note p { margin: 0; }
.draft-note ul { margin: 8px 0 0; padding-left: 18px; }

/* ── Constraint → rule (build-case.py, "> 🧩" block) ──
   Editorial rows, no chrome: team, what it costs them, the rule the flow adopted.
   Hierarchy by colour only (muted constraint, ink rule); hairlines between rows. */
.case-section ul.cr { list-style: none; margin: 32px 0 36px; padding: 0; }
.case-section ul.cr > li { display: grid; grid-template-columns: 9.5rem 1fr 1fr; column-gap: 24px; align-items: baseline; margin: 0; padding: 14px 0; border-top: 1px solid var(--rule); }
.case-section ul.cr > li::before { content: none; display: none; }
.case-section ul.cr > li:last-child { border-bottom: 1px solid var(--rule); }
.case-section ul.cr > li.cr-head { padding: 0 0 8px; border-top: 0; font-size: 13px; color: var(--ink-3); }
.cr-team { font-size: 15px; line-height: 1.5; color: var(--ink-3); }
.case-section ul.cr p, .cr-c, .cr-r { margin: 0; font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.cr-c { color: var(--ink-2); }
.cr-r { color: var(--ink); font-weight: 500; }
@media (max-width: 640px) {
  .case-section ul.cr > li { grid-template-columns: 1fr; row-gap: 2px; padding: 14px 0 16px; }
  .case-section ul.cr > li.cr-head { display: none; }
  .cr-team { font-size: 13px; }
  .cr-r { margin-top: 4px; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── User quotations in the body (e.g. reviews left after an order) ── */
.quotes { display: grid; gap: 20px; margin: 28px 0; }
blockquote.quote { margin: 0; padding-left: 18px; border-left: 2px solid var(--rule); }
blockquote.quote p { font-size: inherit; font-weight: 400; line-height: var(--lh); letter-spacing: 0; color: var(--ink); text-wrap: pretty; }
blockquote.quote cite { display: block; margin-top: 4px; font-size: 14px; font-style: normal; color: var(--ink-3); }

/* Company: logo and name above the case title */
.company { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 15px; font-weight: 500; line-height: 1; letter-spacing: -0.01em; color: var(--ink); }
.company svg { width: 22px; height: 22px; flex: none; }
.hero .company { display: flex; }
