/* Prépa Cafetier — website design system ("Brasserie moderne", editorial edition).
   Every section stylesheet builds on these tokens and primitives. No other colours, no other fonts.
   Light "paper" sections alternate with dark "brasserie at night" sections (.night). */

/* ------------------------------------------------------------------ fonts (bundled, SIL OFL) */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(../fonts/fraunces-normal-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(../fonts/fraunces-normal-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 300 700; font-display: swap; src: url(../fonts/fraunces-italic-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 300 700; font-display: swap; src: url(../fonts/fraunces-italic-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }

/* ------------------------------------------------------------------ tokens */
:root {
  /* paper (light sections) */
  --paper: #FBF8F4; --paper-2: #F6F0E7; --linen: #EFE6D9; --card: #FFFFFF;
  --ink: #1F1A17; --muted: #6B5F57; --line: #E8DFD2; --line-strong: #D6C8B6;
  --wine: #8A1C35; --wine-hover: #731629; --wine-soft: #F7E9EC; --wine-deep: #4A0F1D;
  --brass: #8A6526;        /* brass TEXT on paper (AA) */
  --brass-deco: #C9A45C;   /* brass lines, rings, drawings — never small text */
  --ok: #1E7A4C; --ok-soft: #E8F3EC; --bad: #B42318; --bad-soft: #FBEAE7;
  /* night (dark sections) */
  --night: #14100F; --night-2: #1E1917; --night-3: #2A2320; --night-line: #3A302B;
  --on-night: #F5EEE7; --on-night-muted: #B8ABA0;
  --rose: #F0A3B3;         /* accent on night (AA on --night) */
  --brass-light: #DDBB78;  /* brass TEXT on night (AA) */
  /* type */
  --serif: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* layout */
  --max: 1200px; --gutter: clamp(20px, 4vw, 40px); --section-y: clamp(80px, 12vw, 160px);
  --r-sm: 12px; --r: 20px; --r-lg: 28px; --r-xl: 40px;
  --shadow: 0 1px 2px rgba(60, 30, 20, .04), 0 10px 30px rgba(60, 30, 20, .07);
  --shadow-hi: 0 2px 8px rgba(60, 30, 20, .06), 0 30px 60px rgba(60, 30, 20, .12);
  --ease: cubic-bezier(.2, .7, .2, 1); --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--wine); color: #fff; }
:focus-visible { outline: 3px solid var(--wine); outline-offset: 3px; border-radius: 6px; }
.night :focus-visible { outline-color: var(--rose); }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 16px; top: -100px; z-index: 1000; background: var(--wine); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 16px; }

/* ------------------------------------------------------------------ layout primitives */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.section { position: relative; padding: var(--section-y) 0; }
.section:not(.night):not(.alt) + .section:not(.night):not(.alt) { padding-top: calc(var(--section-y) * .6); }
.alt { background: var(--paper-2); }
.night { background: var(--night); color: var(--on-night); color-scheme: dark; }
.night .muted, .night .lead { color: var(--on-night-muted); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------------------------ type */
.eyebrow { display: inline-flex; align-items: center; gap: 12px; font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--brass); margin: 0 0 18px; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--brass-deco); }
.night .eyebrow { color: var(--brass-light); }
.display { font-family: var(--serif); font-weight: 400; font-size: clamp(46px, 8.2vw, 112px); line-height: .98; letter-spacing: -.035em; margin: 0; font-optical-sizing: auto; font-variation-settings: "SOFT" 30, "WONK" 0; }
.h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5.4vw, 68px); line-height: 1.03; letter-spacing: -.03em; margin: 0 0 22px; font-optical-sizing: auto; }
.h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15; letter-spacing: -.015em; margin: 0 0 10px; }
.display em, .h2 em, .h3 em { font-style: italic; color: var(--wine); font-weight: 400; }
.night .display em, .night .h2 em, .night .h3 em { color: var(--rose); }
.lead { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.6; color: var(--muted); max-width: 40em; margin: 0; }
.muted { color: var(--muted); }
.num { font-family: var(--serif); font-variant-numeric: lining-nums tabular-nums; }

/* ------------------------------------------------------------------ buttons */
.btn { --mx: 0px; --my: 0px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 28px; border-radius: 999px; border: 0; background: var(--wine); color: #fff; font-weight: 650; font-size: 16.5px; letter-spacing: .005em; text-decoration: none; box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 10px 26px rgba(138, 28, 53, .28); transform: translate(var(--mx), var(--my)); transition: background-color .2s, transform .35s var(--ease-out), box-shadow .3s; }
.btn:hover { background: var(--wine-hover); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 14px 34px rgba(138, 28, 53, .36); }
.btn:active { transform: translate(var(--mx), calc(var(--my) + 1px)); }
.btn svg { width: 18px; height: 18px; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn-ghost:hover { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--ink); }
.night .btn { background: var(--rose); color: #2A0A12; box-shadow: 0 10px 30px rgba(240, 163, 179, .18); }
.night .btn:hover { background: #F5B8C5; }
.night .btn-ghost { background: transparent; color: var(--on-night); box-shadow: inset 0 0 0 1.5px var(--night-line); }
.night .btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--on-night); background: rgba(255,255,255,.04); }
.btn[aria-disabled="true"] { cursor: default; }

/* ------------------------------------------------------------------ surfaces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.night .card { background: var(--night-2); border-color: var(--night-line); box-shadow: 0 0 0 1px rgba(255, 240, 225, .03), 0 20px 50px rgba(0, 0, 0, .35); }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink); }
.night .pill { background: var(--night-2); border-color: var(--night-line); color: var(--on-night); }
.rule { height: 1px; background: linear-gradient(90deg, transparent, var(--brass-deco), transparent); border: 0; margin: 0; opacity: .7; }
/* subtle paper grain (inline SVG noise) */
.grain::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .05; mix-blend-mode: multiply;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.night.grain::after { mix-blend-mode: screen; opacity: .04; }

/* ------------------------------------------------------------------ reveal on scroll (base.js adds .in) */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform 1s var(--ease-out); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }
html.no-js [data-reveal] { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------------ site nav */
.nav { position: fixed; z-index: 100; top: 0; left: 0; right: 0; transition: background-color .4s, box-shadow .4s, transform .5s var(--ease-out); }
.nav-in { display: flex; align-items: center; gap: 20px; height: 76px; }
.nav.scrolled { background: rgba(251, 248, 244, .95); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); box-shadow: 0 1px 0 var(--line); }
.nav.hide { transform: translateY(-100%); }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; min-height: 44px; }
.brand em { font-style: italic; font-weight: 400; color: var(--wine); }
.brand .ch { width: 16px; height: 16px; border-radius: 3px; background: #DA291C; position: relative; flex: none; }
.brand .ch::before, .brand .ch::after { content: ""; position: absolute; background: #fff; }
.brand .ch::before { left: 6.5px; top: 3px; width: 3px; height: 10px; }
.brand .ch::after { left: 3px; top: 6.5px; width: 10px; height: 3px; }
.nav-links { display: none; gap: 4px; margin-left: auto; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; text-decoration: none; font-size: 15px; font-weight: 550; color: var(--muted); transition: color .2s, background-color .2s; }
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--ink); background: rgba(31, 26, 23, .05); }
.nav .btn { min-height: 46px; padding: 0 20px; font-size: 15px; margin-left: auto; }
@media (min-width: 980px) { .nav-links { display: flex; } .nav .btn { margin-left: 8px; } }

/* ------------------------------------------------------------------ footer */
.foot { background: var(--night); color: var(--on-night-muted); padding: 80px 0 40px; font-size: 15px; }
.foot .brand { color: var(--on-night); }
.foot .brand em { color: var(--rose); }
.foot-grid { display: grid; gap: 40px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.foot h2 { font-family: var(--sans); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--brass-light); margin: 0 0 14px; font-weight: 700; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.foot a { color: var(--on-night); text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; }
.foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
.foot .legal { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--night-line); display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; font-size: 13.5px; line-height: 1.55; }
.foot .legal p { margin: 0; max-width: 62em; }
.foot .legal b { color: var(--on-night); }
.foot .foot-tag { margin: 16px 0 0; max-width: 30em; line-height: 1.6; }
