/* StudAI — public website.
   One stylesheet, no framework. Two self-hosted fonts subset to Latin
   (~50 Ko in all) so the site speaks like the app, and WebP screenshots
   loaded lazily: the page must still open fast on a mid-range Android phone.
   Tokens mirror the app's palette (lib/core/theme/app_colors.dart). */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("fonts/nunito-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("fonts/nunito-700.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --desk: #ede7db;
  --paper: #f7f2e9;
  --surface: #ffffff;
  --ink: #191512;
  --ink2: #3e3830;
  --mut: #6b6155;
  --brand: #c2431c;
  --brand-hover: #a6360e;
  --brand-deep: #8c3011;
  --on-brand: #f7f2e9;
  --good: #12776a;
  --gold: #c08a16;
  --line: rgba(25, 21, 18, 0.12);
  --line-soft: rgba(25, 21, 18, 0.07);
  --tint: rgba(194, 67, 28, 0.08);
  --danger: #8c2519;
  --danger-bg: rgba(163, 46, 35, 0.07);
  --ok-bg: rgba(18, 119, 106, 0.1);
  --shadow: 0 1px 2px rgba(25, 21, 18, 0.05), 0 10px 24px rgba(25, 21, 18, 0.05);
  --phone-shadow: 0 30px 60px -20px rgba(90, 30, 8, 0.45), 0 10px 20px rgba(25, 21, 18, 0.12);

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 16px;
  --gap: 1.25rem;
  --wrap: 68rem;
}

/* Dark theme, chosen by hand (data-theme on <html>, set by the script in
   base.html) or by the system when nothing was chosen. The two blocks must
   stay identical: tests/test_site_i18n.py compares them. */
:root[data-theme="dark"] {
  color-scheme: dark;
  /* dark tokens */
  --desk: #0e0d0a;
  --paper: #17150f;
  --surface: #211e17;
  --ink: #f3ece0;
  --ink2: #dfd6c6;
  --mut: #aba192;
  --brand: #e4572e;
  --brand-hover: #f26b42;
  --on-brand: #17150f;
  --good: #7fdcc9;
  --gold: #d39b22;
  --line: rgba(255, 255, 255, 0.16);
  --line-soft: rgba(255, 255, 255, 0.08);
  --tint: rgba(228, 87, 46, 0.12);
  --danger: #f0a79d;
  --danger-bg: rgba(226, 116, 104, 0.12);
  --ok-bg: rgba(88, 206, 186, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 24px rgba(0, 0, 0, 0.3);
  --phone-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7), 0 10px 20px rgba(0, 0, 0, 0.4);
  /* end dark tokens */
}

:root[data-theme="light"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* dark tokens */
    --desk: #0e0d0a;
    --paper: #17150f;
    --surface: #211e17;
    --ink: #f3ece0;
    --ink2: #dfd6c6;
    --mut: #aba192;
    --brand: #e4572e;
    --brand-hover: #f26b42;
    --on-brand: #17150f;
    --good: #7fdcc9;
    --gold: #d39b22;
    --line: rgba(255, 255, 255, 0.16);
    --line-soft: rgba(255, 255, 255, 0.08);
    --tint: rgba(228, 87, 46, 0.12);
    --danger: #f0a79d;
    --danger-bg: rgba(226, 116, 104, 0.12);
    --ok-bg: rgba(88, 206, 186, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 24px rgba(0, 0, 0, 0.3);
    --phone-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7), 0 10px 20px rgba(0, 0, 0, 0.4);
    /* end dark tokens */
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}

h1 { font-size: clamp(2.3rem, 8vw, 4rem); }
h2 { font-size: clamp(1.6rem, 5vw, 2.4rem); margin-bottom: 1.4rem; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.015em; }
p { margin: 0 0 1rem; }
strong { font-weight: 700; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1rem;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: var(--on-brand);
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip:focus { left: 0; }

/* ── navigation ──
   Full width: brand on the left, links in the middle, tools and the beta
   button on the right. Below 64rem the links move into a <details> menu. */

.nav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line-soft);
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 90rem;
  min-height: 4.25rem;
  margin: 0 auto;
  padding: 0.6rem clamp(1rem, 4vw, 3rem);
}

/* Equal flexible ends keep the links centred on the page. */
.brand,
.nav-tools { flex: 1 1 0; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }

.brand-mark { width: 2.25rem; height: 2.25rem; border-radius: 10px; }

.nav-links {
  display: none;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  position: relative;
  display: block;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  color: var(--ink2);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Underline drawn from the left; `scale`, never `transform` (see motion). */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.3rem;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
  scale: 0 1;
  transform-origin: left;
  transition: scale 0.25s ease;
}

.nav-links a[aria-current="page"] { color: var(--ink); background: var(--tint); }
.nav-links a[aria-current="page"]::after { scale: 1 1; }

.nav-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.lang-switch,
.theme-toggle,
.nav-menu summary {
  display: inline-grid;
  place-items: center;
  min-width: 2.6rem;
  height: 2.6rem;
  padding: 0 0.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, translate 0.2s ease;
}

.theme-toggle[hidden] { display: none; }
.theme-toggle svg,
.nav-menu summary svg { grid-area: 1 / 1; }

/* The moon offers the dark theme; the sun, once dark, offers light again. */
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

/* `.nav` prefix: `.btn`, declared further down, would otherwise show it on phones. */
.nav .nav-cta {
  display: none;
  padding: 0.55rem 1.1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  white-space: nowrap;
  box-shadow: 0 2px 0 var(--brand-deep);
}

/* ── phone menu ── */

.nav-menu summary { list-style: none; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu .i-close,
.nav-menu[open] .i-menu { display: none; }
.nav-menu[open] .i-close { display: block; }
.nav-menu[open] summary { border-color: var(--brand); color: var(--brand); }

/* Positioned against the sticky .nav: the panel spans the whole bar. */
.nav-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 0.75rem clamp(1rem, 4vw, 3rem) 1.25rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 30px -18px rgba(25, 21, 18, 0.35);
}

.nav-panel-links {
  display: grid;
  gap: 0.25rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.nav-panel-links a {
  display: block;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}
.nav-panel-links a[aria-current="page"] {
  background: var(--tint);
  color: var(--brand);
  box-shadow: inset 3px 0 0 var(--brand);
}

.nav .nav-panel-cta { display: block; text-align: center; }

@media (min-width: 64rem) {
  .nav-links { display: flex; }
  .nav .nav-cta { display: inline-block; }
  .nav-menu { display: none; }
}

/* ── shared bits ── */

.kicker,
.eyebrow {
  margin: 0 0 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.eyebrow { display: flex; align-items: center; gap: 0.6rem; }
.eyebrow img { border-radius: 6px; background: var(--brand); padding: 2px; }

.lead {
  font-size: 1.15rem;
  color: var(--ink2);
  max-width: 40rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.6rem 0 1.2rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--brand);
  color: var(--on-brand);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--brand-deep);
  transition: translate 0.18s ease, box-shadow 0.18s ease, background 0.15s ease;
}
.btn:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn:active { translate: 0 2px; box-shadow: 0 1px 0 var(--brand-deep); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--tint); color: var(--ink); }

.btn-light { background: #f7f2e9; color: #8c3011; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18); }
.btn-light:hover { background: #fff; color: #8c3011; }
.btn-ghost-light {
  background: transparent;
  color: #f7f2e9;
  border-color: rgba(247, 242, 233, 0.45);
  box-shadow: none;
}
.btn-ghost-light:hover { background: rgba(247, 242, 233, 0.12); color: #fff; }

.section { padding: 3rem 0; }
.section-alt { background: var(--desk); }
.narrow { --wrap: 48rem; }

/* ── hero ── */

.hero {
  padding: 2.5rem 0 3rem;
  background:
    radial-gradient(90% 70% at 95% 0%, var(--tint), transparent 60%),
    linear-gradient(180deg, var(--desk), var(--paper));
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero h1 { margin-bottom: 1rem; }

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pills li {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink2);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
}

.pills li::before { content: "✓ "; color: var(--good); }

.hero-phone { display: flex; justify-content: center; }
.hero-phone .phone { max-width: 17rem; }

/* ── phone frame around the screenshots ── */

.phone {
  width: 100%;
  max-width: 16rem;
  margin: 0 auto;
  padding: 0.55rem;
  border-radius: 2.4rem;
  background: #191512;
  box-shadow: var(--phone-shadow);
  transition: translate 0.2s ease, rotate 0.3s ease, scale 0.3s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.phone img {
  display: block;
  width: 100%;
  border-radius: 1.9rem;
  background: #f7f2e9;
}

/* ── features ── */

.feature {
  display: grid;
  gap: 1.75rem;
  align-items: center;
  padding: 1.5rem 0 2.5rem;
}

.feature + .feature { border-top: 1px solid var(--line-soft); padding-top: 2.5rem; }

.feature-text h3 { font-size: clamp(1.4rem, 4vw, 1.9rem); font-weight: 800; }
.feature-text p { color: var(--ink2); max-width: 32rem; }

.feature-note {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand) !important;
  background: var(--tint);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow);
  transition: translate 0.2s ease, rotate 0.3s ease, scale 0.3s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card h3 { color: var(--ink); }
.card p { margin-bottom: 0; color: var(--ink2); font-size: 0.98rem; }

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
}

.steps li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem 1.2rem 4.2rem;
  position: relative;
  transition: translate 0.2s ease, rotate 0.3s ease, scale 0.3s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1.1rem;
  top: 1.15rem;
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand);
  color: var(--on-brand);
  font-family: var(--display);
  font-weight: 800;
}

.steps p { margin-bottom: 0; color: var(--ink2); font-size: 0.98rem; }

/* ── "Tes données" band, in the app's accent card style ── */

.trust {
  background:
    radial-gradient(40rem 30rem at 100% 0%, rgba(255, 255, 255, 0.08), transparent 60%),
    #c2431c;
  color: #f7f2e9;
}

.trust .kicker { color: rgba(247, 242, 233, 0.75); }
.trust h2, .trust h3 { color: #f7f2e9; }
.trust p { color: rgba(247, 242, 233, 0.86); }

.why {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
.why p { margin-bottom: 0; }

.final { text-align: center; }
.final img { border-radius: 18px; margin-bottom: 1rem; }
.final .lead { margin: 0 auto; }
.final .cta-row { justify-content: center; }

/* ── forms ── */

.form { margin-top: 1.75rem; }

.field { margin-bottom: 1.2rem; }

.field > label,
.field legend {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.optional { font-weight: 400; color: var(--mut); }
.field-help { margin: 0.35rem 0 0; font-size: 0.88rem; color: var(--mut); }

.field input[type="text"],
.field input[type="email"],
.field textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.field textarea { resize: vertical; min-height: 8rem; }

.field input:focus-visible,
.field textarea:focus-visible { border-color: var(--brand); }

.field [aria-invalid="true"] { border-color: var(--danger); }

.choices {
  border: 0;
  padding: 0;
  margin: 0 0 1.4rem;
  display: grid;
  gap: 0.5rem;
}

.choice,
.check {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.98rem;
  transition: translate 0.2s ease, rotate 0.3s ease, scale 0.3s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.check { font-weight: 400; color: var(--ink2); }

.choice:has(input:checked) { border-color: var(--brand); background: var(--tint); }

.choice input,
.check input {
  accent-color: var(--brand);
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.2rem 0 0;
  flex: none;
}

.field-error {
  margin: 0.35rem 0 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
}

.form-actions { margin: 1.5rem 0 0.75rem; }
.form-note { font-size: 0.88rem; color: var(--mut); }

.notice,
.alert,
.callout {
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 1.25rem 0;
  border: 1px solid var(--line);
}

.notice p:last-child,
.callout p:last-child { margin-bottom: 0; }

.notice {
  background: var(--ok-bg);
  border-color: color-mix(in srgb, var(--good) 35%, transparent);
}

.ref { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: 0.06em; }

.alert {
  background: var(--danger-bg);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  color: var(--danger);
  font-weight: 700;
}

.callout { background: var(--surface); box-shadow: var(--shadow); }
.callout h2 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.callout p { color: var(--ink2); }

/* Honeypot: hidden from people, reachable by robots. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── privacy policy ── */

.prose h2 {
  margin-top: 2.5rem;
  font-size: 1.45rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: 4.5rem;
}
.prose h3 { margin-top: 1.5rem; color: var(--brand); font-size: 1.05rem; }
.prose p, .prose li { color: var(--ink2); }
.prose ul { padding-left: 1.15rem; }
.prose li { margin-bottom: 0.45rem; }

.summary {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem 0.6rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}
.prose .summary h2 { border: 0; margin: 0 0 0.5rem; padding: 0; font-size: 1.2rem; }

.table-scroll {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.data-table {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.5;
}

.data-table th,
.data-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink2);
}

.data-table thead th {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mut);
  background: var(--desk);
}

.data-table tbody th { font-weight: 700; color: var(--ink); width: 34%; }
.data-table tbody tr:last-child > * { border-bottom: 0; }

.updated {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--mut);
  background: var(--tint);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  margin-bottom: 1.25rem;
}

/* Phones: each row of the table becomes a small card, nothing hidden sideways. */
@media (max-width: 45.99rem) {
  .table-scroll { overflow: visible; border: 0; background: none; }
  .data-table { min-width: 0; }
  .data-table thead { position: absolute; left: -9999px; }
  .data-table tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 0.4rem 0;
    margin-bottom: 0.75rem;
  }
  .data-table th,
  .data-table td { display: block; border: 0; padding: 0.35rem 0.95rem; }
  .data-table tbody th { width: auto; }
  .data-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mut);
  }
}

/* ── footer ── */

.footer {
  background: var(--desk);
  border-top: 1px solid var(--line-soft);
  padding: 2.25rem 0 1.5rem;
  font-size: 0.95rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2.5rem;
  justify-content: space-between;
}

.footer-brand { display: flex; gap: 0.8rem; align-items: center; color: var(--mut); }
.footer-brand img { border-radius: 11px; }
.footer-brand p { margin: 0; }
.footer-brand strong { color: var(--ink); font-family: var(--display); font-size: 1.1rem; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-legal {
  margin: 1.5rem auto 0;
  color: var(--mut);
  font-size: 0.85rem;
}

/* ── wider screens ── */

@media (min-width: 46rem) {
  body { font-size: 1.1rem; }
  .wrap { padding: 0 1.5rem; }
  .hero { padding: 4rem 0 4.5rem; }
  .hero-grid { grid-template-columns: 1.25fr 1fr; }
  .hero-phone .phone { max-width: 18.5rem; }
  .section { padding: 4.5rem 0; }
  .feature { grid-template-columns: 1.2fr 1fr; gap: 3rem; }
  .feature-flip .feature-text { order: 2; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .why { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 64rem) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { transition: none !important; }
  .hero-phone .phone { rotate: 3deg; }
}

/* ── motion ──
   CSS only. Nothing starts hidden outside an animation: a browser without
   scroll-driven animations simply shows the content. */

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes float {
  0%, 100% { transform: rotate(3deg) translateY(0); }
  50% { transform: rotate(3deg) translateY(-8px); }
}

@keyframes nav-lift {
  to {
    background-color: color-mix(in srgb, var(--paper) 96%, transparent);
    box-shadow: 0 10px 28px -16px rgba(25, 21, 18, 0.35);
  }
}

@keyframes spin-in {
  from { transform: rotate(-90deg) scale(0.6); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  /* Hero: its text arrives line after line, the phone floats. */
  .hero-text > * { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-text > :nth-child(2) { animation-delay: 0.08s; }
  .hero-text > :nth-child(3) { animation-delay: 0.16s; }
  .hero-text > :nth-child(4) { animation-delay: 0.24s; }
  .hero-text > :nth-child(5) { animation-delay: 0.32s; }
  .hero-phone { animation: rise 0.8s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-phone .phone { animation: float 6s 1s ease-in-out infinite both; }

  /* The theme icon turns as it changes. */
  .theme-toggle svg { animation: spin-in 0.35s ease both; }

  /* The menu panel slides in when opened. */
  .nav-menu[open] .nav-panel { animation: rise 0.25s ease both; }

  /* The bar firms up and casts a shadow once the page is scrolled. */
  @supports (animation-timeline: scroll()) {
    .nav {
      animation: nav-lift linear both;
      animation-timeline: scroll();
      animation-range: 0 120px;
    }
  }

  /* Sections rise into view as they are scrolled to. */
  @supports (animation-timeline: view()) {
    .feature,
    .grid > .card,
    .steps > li,
    .why > div,
    .final,
    .section h2 {
      animation: rise linear both;
      animation-timeline: view();
      /* Done 30vh after it starts entering, however tall the block: a phone
         reads the top of a long feature fully opaque. */
      animation-range: cover 0% cover 30vh;
    }
  }
}

/* Hover effects for pointers only: on a touch screen they would stick after
   a tap. Independent `translate`/`rotate`/`scale`, never `transform`, which
   the animations above hold. */
@media (hover: hover) {
  .btn:hover {
    translate: 0 -2px;
    box-shadow: 0 5px 0 var(--brand-deep), 0 12px 24px -8px color-mix(in srgb, var(--brand) 60%, transparent);
  }
  .btn:active { translate: 0 2px; }
  .btn-ghost:hover,
  .btn-ghost-light:hover { translate: 0 -2px; box-shadow: none; }
  .nav-links a:hover { background: var(--tint); color: var(--ink); }
  .nav-links a:hover::after { scale: 1 1; }
  .nav-panel-links a:hover { background: var(--tint); }
  .card:hover,
  .steps li:hover {
    translate: 0 -4px;
    border-color: color-mix(in srgb, var(--brand) 40%, transparent);
    box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--brand) 35%, transparent);
  }
  .feature .phone:hover { rotate: -2deg; scale: 1.03; }
  .choice:hover { border-color: color-mix(in srgb, var(--brand) 50%, transparent); }
  .lang-switch:hover,
  .theme-toggle:hover,
  .nav-menu summary:hover { border-color: var(--brand); color: var(--brand); translate: 0 -1px; }
}
