/* NutriPredict — site de présentation. Direction : le rapport imprimé, en deux couleurs (vert et jaune d'œuf). */
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --bg: #F9FAF6;
  --surface: #EEF4EA;
  --ink: #0F2A15;
  --muted: #205C29;
  --action: #2B7534;
  --action-ink: #FFFFFF;
  --yolk: #F2B33D;
  --field: #0F2A15;
  --field-ink: #F3F8F1;
  --field-soft: #C6E0BF;
  --pale: #E3EFDF;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(3.4rem, 1rem + 7.4vw, 7.25rem);

  --margin: clamp(16px, 2.4vw, 36px);
  --gap: clamp(16px, 2vw, 28px);
  --section: clamp(96px, 12vw, 200px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--step-body)/1.45 "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.01em; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; text-wrap: balance; }
h2 { font-size: var(--step-head); }
h3 { font-size: var(--step-lead); letter-spacing: -0.03em; line-height: 1.1; }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 4px; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 3px; }
.band :focus-visible, .footer :focus-visible { outline-color: var(--ink); }
.footer :focus-visible { outline-color: var(--yolk); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 10px 16px; z-index: 10; }
.skip:focus { left: var(--margin); }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }

/* ---------- Hero : colonne étroite à gauche, titre large à droite (34 %) ---------- */
.hero {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  grid-template-rows: auto 1fr auto; min-height: 100svh; padding: 28px var(--margin) 0; overflow: hidden;
}
.wordmark { grid-column: 1 / 5; grid-row: 1; align-self: start; }
.wordmark img { height: 30px; width: auto; }
.nav { grid-column: 5 / -1; grid-row: 1; display: flex; flex-wrap: wrap; gap: 6px 28px; align-items: center; font-weight: 600; font-size: var(--step-small); }
.nav a { text-decoration: none; padding: 6px 0; }
.nav a:hover { text-decoration: underline; }
.nav .lang { margin-left: auto; }
.hero-talk { grid-column: 1 / 5; grid-row: 2; align-self: center; padding-top: 6vh; }
.hero-lede { font-size: var(--step-lead); line-height: 1.3; max-width: 24ch; margin-bottom: 32px; }
.button {
  display: inline-block; background: var(--action); color: var(--action-ink); font-weight: 600; text-decoration: none;
  padding: 16px 24px; transition: background-color 0.2s, transform 0.2s var(--ease);
}
.button:hover { background: var(--muted); }
.button:active { transform: translateY(2px); }
.hero-title { grid-column: 5 / -1; grid-row: 2; align-self: center; font-size: var(--step-display); line-height: 0.88; letter-spacing: -0.05em; padding-top: 6vh; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero-title .line > span { display: block; }
.hero-picture { grid-column: 5 / -1; grid-row: 3; margin: 6vh 0 0; position: relative; height: 34svh; min-height: 220px; }
.hero-picture img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.figure-block {
  position: absolute; z-index: 1; left: 0; top: 0; transform: translateY(-50%); width: min(290px, 70%);
  background: var(--yolk); color: var(--ink); padding: 18px 20px 20px;
}
.figure-block strong { display: block; font-size: var(--step-head); font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.figure-block span { display: block; font-size: var(--step-small); font-weight: 600; line-height: 1.35; margin-top: 8px; }

/* ---------- Méthode : beaucoup en un ---------- */
main > section { padding: var(--section) var(--margin) 0; }
.method { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
.method-head { grid-column: 1 / 6; }
.method-head p { margin-top: 24px; max-width: 44ch; }
.diagram { grid-column: 1 / -1; width: 100%; margin-top: 56px; }
.method-steps { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); column-gap: var(--gap); margin-top: 28px; }
.method-steps h3 { margin-bottom: 8px; }
.method-steps p { max-width: 34ch; }

/* ---------- Calculateur : la page de couleur ---------- */
.calc {
  margin-top: var(--section); background: var(--pale); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap); padding-bottom: var(--section);
}
.calc-text { grid-column: 1 / 6; }
.calc-text p { margin-top: 24px; max-width: 40ch; }
.calc-text .note { font-size: var(--step-small); font-weight: 600; color: var(--muted); }
.calc-form { grid-column: 7 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px var(--gap); align-content: start; }
.calc-form label, .calc-form legend { font-weight: 600; font-size: var(--step-small); display: block; }
.calc-form input[type="number"], .calc-form select {
  display: block; width: 100%; margin-top: 8px; font: inherit; font-size: var(--step-body); color: var(--ink);
  background: var(--bg); border: 2px solid #869483; padding: 12px 14px; border-radius: 0;
}
.calc-form input:focus-visible, .calc-form select:focus-visible { outline-offset: 0; }
.calc-form fieldset { border: 0; padding: 0; margin: 0; grid-column: 1 / -1; display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.calc-form fieldset legend { float: left; margin-right: 12px; }
.calc-form fieldset label { display: flex; align-items: center; gap: 8px; font-size: var(--step-body); font-weight: 400; }
.calc-form input[type="radio"] { width: 20px; height: 20px; accent-color: var(--action); margin: 0; }
.calc-result { grid-column: 1 / -1; display: block; background: var(--field); color: var(--field-ink); padding: 28px 28px 30px; margin-top: 8px; }
.calc-figure { display: block; font-size: var(--step-head); font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.calc-line { display: block; margin-top: 12px; max-width: 46ch; color: var(--field-soft); }
.calc-line b { color: var(--yolk); font-weight: 800; }

/* ---------- Modèle : une planche carrée, peu de texte ---------- */
.model { display: grid; grid-template-columns: 1fr 1fr; column-gap: calc(var(--gap) * 2); min-height: 88svh; align-items: stretch; }
.model-plate { margin: 0; align-self: center; }
.scatter { width: 100%; background: var(--surface); }
.scatter .plot { fill: var(--surface); }
.scatter .diag { stroke: var(--ink); stroke-width: 1.5; }
.scatter .series circle { fill: var(--action); fill-opacity: 0.42; }
.scatter [hidden] { display: none; }
.scatter .series[data-series="rfm"] circle, .scatter .series[data-series="deurenberg"] circle { fill: #8A6100; fill-opacity: 0.4; }
.scatter .ticks text, .scatter .axis { fill: var(--ink); font-size: 14px; font-family: inherit; }
.scatter .axis { font-weight: 600; }
.model-plate figcaption { font-size: var(--step-small); margin-top: 14px; max-width: 58ch; }
.model-text { display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding: 8px 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.tabs button {
  font: inherit; font-size: var(--step-body); font-weight: 600; color: var(--muted); background: none; border: 0; padding: 8px 0; cursor: pointer;
  text-decoration: underline transparent 3px; text-underline-offset: 8px; transition: text-decoration-color 0.2s;
}
.tabs button[aria-selected="true"] { color: var(--ink); text-decoration-color: var(--yolk); }
.tabs button:hover { text-decoration-color: var(--pale); }
.model-text h2 { font-size: var(--step-head); }
.model-text p { margin-top: 28px; max-width: 36ch; }
.model-mae { font-weight: 600; }
.model-mae strong { display: block; font-size: var(--step-head); font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: var(--action); }
.model-actions { display: grid; grid-template-columns: 1fr 1fr; }
.cell { display: flex; align-items: center; min-height: 72px; padding: 0 20px; font-weight: 600; text-decoration: none; transition: background-color 0.2s; }
.cell-ink { background: var(--ink); color: var(--bg); }
.cell-ink:hover { background: var(--muted); }
.cell:not(.cell-ink) { background: var(--pale); }
.cell:not(.cell-ink):hover { background: #C6E0BF; }

/* ---------- Coach : des lignes avec des images en marge ---------- */
.coach { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
.coach > h2 { grid-column: 5 / -1; padding: 6vh 0 8vh; }
.row { grid-column: 5 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: calc(var(--gap) * 2); align-items: start; margin-bottom: clamp(72px, 8vw, 120px); }
.row h3 { letter-spacing: -0.03em; line-height: 1.05; }
.row p { margin-top: 18px; max-width: 34ch; }
.row img { object-fit: cover; }
.row-0 img { width: clamp(220px, 24vw, 340px); aspect-ratio: 8 / 7; object-position: 0 0; }
.row-1 img { width: clamp(150px, 17vw, 240px); aspect-ratio: 4 / 5; }
.row-2 img { width: clamp(170px, 13vw, 200px); aspect-ratio: 1; }
.row-wide img { width: clamp(280px, 28vw, 420px); aspect-ratio: auto; object-fit: contain; }

/* ---------- Preuves : un tableau sans traits ---------- */
.proof h2 { font-size: var(--step-display); }
.proof h2 .indent { display: block; padding-left: calc((100% + var(--gap)) / 12 * 2); }
.table-wrap { margin-top: 72px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--step-body); }
th, td { text-align: left; padding: 14px 16px 14px 0; vertical-align: top; }
thead th { font-size: var(--step-small); color: var(--muted); font-weight: 600; padding-bottom: 18px; }
tbody tr:nth-child(odd) { background: var(--surface); }
tbody th { font-weight: 800; padding-left: 16px; width: 12%; }
tbody td:nth-child(2) { font-weight: 600; width: 18%; }
tbody td:last-child { width: 34%; }

/* ---------- À propos : le portrait en lettrine ---------- */
.about { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
.about-facts { grid-column: 1 / 3; list-style: none; margin: 0; padding: 0; font-size: var(--step-small); font-weight: 600; display: grid; gap: 10px; align-content: start; padding-top: 72px; }
.about-text { grid-column: 3 / -1; }
.about-text h2 { font-size: var(--step-lead); letter-spacing: -0.02em; margin-bottom: 28px; }
.about-text .soft { margin-top: 28px; max-width: 52ch; color: var(--muted); }
.statement { font-size: var(--step-lead); line-height: 1.25; letter-spacing: -0.025em; max-width: 40ch; }
.portrait { float: left; width: 3.6em; height: 3.6em; margin: 0.12em 0.5em 0 0; image-rendering: pixelated; }

/* ---------- Installer : trois images, puis une page de couleur ---------- */
.install { padding: var(--section) 0 0 !important; }
.strip { display: grid; grid-template-columns: repeat(3, 1fr); height: 40svh; min-height: 220px; }
.strip img { width: 100%; height: 100%; object-fit: cover; }
.band { background: var(--yolk); color: var(--ink); padding: 72px var(--margin) 80px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); position: relative; }
.band-text { grid-column: 1 / 9; }
.band h2 { font-size: var(--step-lead); letter-spacing: -0.02em; margin-bottom: 24px; }
.band-statement { font-size: var(--step-lead); line-height: 1.2; letter-spacing: -0.03em; font-weight: 600; max-width: 26ch; }
.band-statement a { text-decoration-thickness: 4px; text-underline-offset: 6px; }
.band p:not(.band-statement) { margin-top: 32px; max-width: 52ch; }
.band pre { margin: 28px 0 0; background: var(--ink); color: var(--field-ink); padding: 20px 22px; overflow-x: auto; font-size: var(--step-small); line-height: 1.6; }
.band code { font-family: monospace; }
.band-portrait { grid-column: 11 / -1; align-self: end; justify-self: end; width: 150px; image-rendering: pixelated; }

/* ---------- Pied de page ---------- */
.footer { background: var(--field); color: var(--field-ink); min-height: 85svh; display: grid; grid-template-rows: auto 1fr auto auto; padding: 40px var(--margin) 24px; }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px var(--gap); }
.footer h2 { font-size: var(--step-small); letter-spacing: -0.01em; font-weight: 600; margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer a { color: var(--field-soft); text-decoration: none; }
.footer a:hover { color: var(--field-ink); text-decoration: underline; }
.footer-mark { grid-row: 3; align-self: end; }
.footer-mark img { width: 100%; height: auto; }
.legal { grid-row: 4; margin-top: 20px; font-size: var(--step-small); color: var(--field-soft); max-width: 90ch; }

/* ---------- Mouvement (absent sans script ou si l'on préfère moins d'animations) ---------- */
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.1) translateY(-2%); } }
@media (prefers-reduced-motion: no-preference) {
  .js .hero-title .line > span { animation: rise 0.9s var(--ease) both; }
  .js .hero-title .line:nth-child(2) > span { animation-delay: 0.11s; }
  .js .hero-talk, .js .figure-block { animation: fade-up 0.8s var(--ease) 0.45s both; }
  .js .hero-picture img { animation: drift 24s ease-in-out infinite alternate; }
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: var(--delay, 0s); }
  .js [data-reveal].in { opacity: 1; transform: none; }
  .js .diagram rect { transition: transform 1.2s var(--ease), opacity 1.2s var(--ease); }
  .js .diagram:not(.in) rect { transform: translateX(-24px); opacity: 0; }
}

/* ---------- Écrans étroits : une composition à part ---------- */
@media (max-width: 900px) {
  .hero { grid-template-rows: auto auto auto auto; padding-top: 20px; }
  .wordmark { grid-column: 1 / 8; }
  .nav { grid-column: 1 / -1; grid-row: 2; margin-top: 16px; gap: 4px 20px; }
  .nav .lang { margin-left: 0; }
  .hero-title { grid-column: 1 / -1; grid-row: 3; font-size: clamp(2.4rem, 11vw, 5rem); line-height: 0.88; padding-top: 10vh; }
  .hero-talk { grid-column: 1 / -1; grid-row: 4; padding-top: 24px; }
  .hero-lede { max-width: 30ch; }
  .button { display: block; text-align: center; }
  .hero-picture { grid-column: 1 / -1; grid-row: 5; height: auto; aspect-ratio: 4 / 3; margin: 64px calc(var(--margin) * -1) 0; }
  .figure-block { width: 60%; left: var(--margin); }
  .method-head, .calc-text, .calc-form { grid-column: 1 / -1; }
  .calc-form { margin-top: 40px; }
  .method-steps { grid-template-columns: 1fr; gap: 24px; }
  .model { grid-template-columns: 1fr; min-height: 0; gap: 40px; }
  .coach > h2, .row { grid-column: 1 / -1; }
  .coach > h2 { padding: 4vh 0 6vh; }
  .proof h2 { font-size: 12vw; }
  .proof h2 .indent { padding-left: 0; }
  .about-facts { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(3, auto); padding-top: 40px; }
  .about-text { grid-column: 1 / -1; }
  .statement { line-height: 1.25; }
  .portrait { width: 4.6em; height: 4.6em; }
  .strip { grid-template-columns: 1fr 1fr; height: auto; }
  .strip img:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
  .strip img:not(:first-child) { aspect-ratio: 1; }
  .band-text { grid-column: 1 / -1; }
  .band-portrait { grid-column: 1 / -1; width: 96px; margin-top: 32px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .row { column-gap: var(--gap); }
  .row-0 img { width: 38vw; } .row-wide img { width: 42vw; }
}
@media (max-width: 600px) {
  .row { grid-template-columns: 1fr; }
  .row img { margin-top: 24px; }
  .row-0 img, .row-wide img { width: 100%; } .row-1 img { width: 70%; justify-self: end; } .row-2 img { width: 55%; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td, .table-wrap tbody th { display: block; width: auto; }
  .table-wrap thead { display: none; }
  .table-wrap tbody tr { padding: 14px 16px; }
  .table-wrap tbody th { padding: 0 0 4px; font-size: 1.375rem; }
  .table-wrap tbody th:empty { display: none; }
  .table-wrap td { padding: 2px 0; }
}
@media (max-width: 520px) { .calc-form { grid-template-columns: 1fr; } }
