/*
 * Quitéa public site stylesheet. One file, no build step, no inline style attribute
 * (the production CSP only admits styles by nonce or from the same origin).
 * Documented in resources/views/site/README.md and DESIGN.md.
 *
 * World: the product performs. White ground, navy ink, tangerine on the action only. Switzer
 * for everything, the same face as the interface fragments. Square corners outside the
 * fragments, no rules, no shadows at rest, surfaces separated by tone.
 *
 * 1. Tokens       4. Header        7. Legacy components (pages not yet rebuilt)
 * 2. Base         5. Footer        8. Responsive, motion, print
 * 3. Type, links  6. Shared blocks
 */

/* 1. Tokens */
:root {
  --ground: #ffffff;
  --tone-1: #f4f4f2;
  --tone-2: #e3e1dc;
  --ink: #1f2b4d;
  --ink-soft: #586079;
  --accent: #f7941d;
  --accent-deep: #e8820a;
  --accent-ink: #ffffff;
  --field: #05070a;
  --field-ink: #ffffff;
  --field-soft: #c3cbe2;

  --font: 'Switzer', ui-sans-serif, system-ui, sans-serif;
  --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-h: clamp(1.625rem, 1.2rem + 1.2vw, 2.375rem);
  --step-head: clamp(2.5rem, 1.3rem + 3.4vw, 4.75rem);

  --gutter: clamp(1rem, 2.2vw, 2rem);
  --page: 90rem;
  --section-gap: clamp(5rem, 9vw, 8rem);
  /* The one gap between the two columns of any split layout, on every page. */
  --split-gap: clamp(2rem, 4.5vw, 4rem);
  --header-height: 4.5rem;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-ui: 220ms;
  --t-reveal: 760ms;

  /* Legacy names, mapped onto the world so pages not yet rebuilt follow it. */
  --navy: var(--ink);
  --muted: var(--ink-soft);
  --paper: var(--ground);
  --paper-deep: var(--tone-1);
  --surface: var(--tone-1);
  --border: var(--tone-2);
  --border-strong: var(--ink-soft);
  --primary: var(--ink);
  --primary-hover: var(--ink);
  --primary-deep: var(--field);
  --primary-light: var(--tone-1);
  --mint: var(--tone-1);
  --mint-strong: var(--tone-2);
  --warn: #7a4a00;
  --warn-light: #f1e6cf;
  --danger-light: #f4e1df;
  --radius-sm: 0;
  --radius: 0;
  --radius-lg: 0;
  --shadow-card: none;
  --shadow-device: none;
  --font-serif: var(--font);
  --font-sans: var(--font);
  --container: var(--page);
}

/* 2. Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 var(--step-body)/1.5 var(--font); letter-spacing: -0.005em; color: var(--ink); background: var(--ground); font-variant-numeric: lining-nums; }
img, svg, video { max-width: 100%; }
img { height: auto; display: block; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: 0.75rem; background: var(--ink); color: var(--ground); padding: 0.75rem 1rem; z-index: 50; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.icon { width: 1.5rem; height: 1.5rem; flex: none; fill: none; stroke: currentcolor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.container, .wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.wrap { max-width: 52rem; }
.wrap.wide { max-width: var(--page); }
.container--narrow { max-width: 52rem; }
.stack > * + * { margin-top: 1rem; }
.anchor { display: block; position: relative; top: calc(var(--header-height) * -1 - 1rem); visibility: hidden; height: 0; }
table { font-variant-numeric: tabular-nums; }

/* 3. Type and links */
h1, h2, h3, h4 { font-family: var(--font); color: var(--ink); line-height: 1.05; font-weight: 600; letter-spacing: -0.03em; text-wrap: balance; }
p { text-wrap: pretty; }
.display { font-family: var(--font); font-weight: 600; line-height: 0.98; letter-spacing: -0.04em; }
.statement { font-size: var(--step-lead); line-height: 1.32; max-width: 44ch; }
.lead { font-size: var(--step-lead); line-height: 1.32; color: var(--ink); max-width: 44ch; margin: 0 0 1.5rem; }
.meta, .updated { color: var(--ink-soft); font-size: var(--step-small); }
.meta { margin: 0 0 1.5rem; }
a { color: var(--ink); text-decoration-line: underline; text-decoration-thickness: 0.07em; text-underline-offset: 0.2em; text-decoration-color: color-mix(in srgb, currentcolor 45%, transparent); transition: text-decoration-color var(--t-hover) ease, color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration-color: currentcolor; }
}

/* Buttons: one shape, square, flat. Red is the action. */
.btn, .button { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; min-height: 3rem; padding: 0.75rem 1.5rem; border: 0; border-radius: 0; background: var(--accent); color: var(--accent-ink); font: 600 var(--step-small)/1.2 var(--font); letter-spacing: 0.005em; text-decoration: none; cursor: pointer; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease; }
.btn:active, .button:active { transform: scale(0.97); }
.btn, .button { font-weight: 500; }
.btn .icon, .button .icon { width: 1.1rem; height: 1.1rem; stroke-width: 2; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover, .button:hover { background: var(--accent-deep); color: var(--accent-ink); }
}
.btn-outline, .button.secondary, .btn-light { background: var(--tone-1); color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .btn-outline:hover, .button.secondary:hover, .btn-light:hover { background: var(--tone-2); color: var(--ink); }
}
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 3.5rem; padding-inline: 1.9rem; font-size: var(--step-body); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin: 1.5rem 0 2rem; }
.link-arrow { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; }
/* Standalone action links (not inside running text) get a 44 px touch target. */
.link-arrow, .start__link, .trap__sources a, .tool-close__actions a:not(.btn), .cta-band .actions a:not(.btn) { display: inline-flex; align-items: center; min-height: 2.75rem; }
.link-arrow .icon { width: 1rem; height: 1rem; stroke-width: 2; transition: transform var(--t-hover) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .link-arrow:hover .icon { transform: translateX(3px); }
}

/* 4. Header: wordmark, a few plain links, one action. */
.site-header { position: relative; z-index: 30; background: var(--ground); }
.site-header__row { display: flex; align-items: center; gap: 2rem; min-height: var(--header-height); max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink); text-decoration: none; font: 600 1.375rem/1 var(--font); letter-spacing: -0.03em; }
.brand__mark { width: 1.51rem; height: 1.4rem; flex: none; }
.brand__ink { fill: currentcolor; }
.brand__accent { fill: var(--accent); }
.primary-nav { flex: 1; display: flex; }
.primary-nav ul { display: flex; align-items: center; gap: 0.25rem 1.6rem; list-style: none; margin: 0; padding: 0; }
.primary-nav a, .nav-trigger { white-space: nowrap; display: inline-flex; align-items: center; gap: 0.3rem; min-height: 2.75rem; color: var(--ink); font-size: var(--step-small); font-weight: 500; text-decoration: none; }
.primary-nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.45em; text-decoration-color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .primary-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.45em; text-decoration-color: var(--ink); }
}
.nav-menu { position: relative; }
.nav-trigger .icon { width: 0.9rem; height: 0.9rem; stroke-width: 2; transition: transform var(--t-ui) var(--ease-out); }
.nav-menu:focus-within .nav-trigger .icon { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) {
  .nav-menu:hover .nav-trigger .icon { transform: rotate(180deg); }
  .nav-menu:hover .submenu { visibility: visible; opacity: 1; transform: none; transition-duration: var(--t-ui); }
}
/* The guides menu really floats, so it alone carries a shadow. */
.submenu { position: absolute; top: 100%; left: -1rem; min-width: 19rem; padding: 0.5rem; background: var(--ground); box-shadow: 0 12px 32px rgb(18 18 18 / 16%); visibility: hidden; opacity: 0; transform: translateY(-6px) scale(0.98); transform-origin: top left; transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out), visibility 160ms; }
.nav-menu:focus-within .submenu { visibility: visible; opacity: 1; transform: none; transition-duration: var(--t-ui); }
.primary-nav .submenu { display: block; }
.primary-nav .submenu li { display: block; }
.primary-nav .submenu a { display: flex; width: 100%; padding: 0.5rem 0.75rem; font-weight: 400; }
.primary-nav .submenu a:hover, .primary-nav .submenu a[aria-current] { background: var(--tone-1); text-decoration: none; }
.submenu__all a { font-weight: 600 !important; }
.header-actions { white-space: nowrap; display: flex; align-items: center; gap: 1.5rem; }
.header-actions > a:first-child { color: var(--ink); font-size: var(--step-small); font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; min-height: 2.75rem; }
.header-actions .btn { min-height: 2.75rem; padding: 0.6rem 1.15rem; }
.mobile-menu { display: none; margin-left: auto; }
.mobile-menu summary { display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; color: var(--ink); cursor: pointer; list-style: none; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary .icon { width: 1.6rem; height: 1.6rem; }
.mobile-menu .icon-close { display: none; }
.mobile-menu[open] .icon-open { display: none; }
.mobile-menu[open] .icon-close { display: block; }
.mobile-panel { position: absolute; left: 0; right: 0; top: 100%; padding: 0.5rem var(--gutter) 1.5rem; background: var(--tone-1); max-height: calc(100svh - var(--header-height)); overflow: hidden auto; }
.mobile-panel ul { list-style: none; margin: 0; padding: 0; }
@media (prefers-reduced-motion: no-preference) {
  .mobile-menu[open] .mobile-panel { transition: opacity var(--t-ui) var(--ease-out), transform var(--t-ui) var(--ease-out); }
  @starting-style { .mobile-menu[open] .mobile-panel { opacity: 0; transform: translateY(-8px); } }
}
.mobile-panel a, .mobile-panel summary { display: flex; align-items: center; justify-content: space-between; min-height: 3rem; color: var(--ink); font-size: var(--step-body); font-weight: 500; text-decoration: none; cursor: pointer; list-style: none; }
.mobile-panel a[aria-current] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.mobile-panel summary::-webkit-details-marker { display: none; }
.mobile-panel details[open] > summary .icon { transform: rotate(180deg); }
.mobile-panel details ul { padding: 0 0 0.5rem 1rem; }
.mobile-panel details a { min-height: 2.75rem; font-weight: 400; }
.mobile-panel .btn { margin-top: 1rem; color: var(--accent-ink); justify-content: center; }

/* 5. Footer: the last two rows of a board of filled tiles. */
.site-footer { margin-top: var(--section-gap); padding: 10px; }
.site-footer__board { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; }
.tile { margin: 0; padding: clamp(1.25rem, 2vw, 1.75rem); background: var(--tone-1); color: var(--ink); }
.tile a { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; min-height: 2.25rem; }
@media (hover: hover) and (pointer: fine) {
  .tile a:hover { text-decoration: underline; }
}
.tile--statement { grid-column: 1 / span 4; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; min-height: 15rem; }
.tile__lead { margin: 0; font-size: var(--step-lead); line-height: 1.32; letter-spacing: -0.02em; max-width: 24ch; }
.tile__legal { margin: 0; font-size: var(--step-small); color: var(--ink-soft); }
.tile .tile__legal a { display: inline; min-height: 0; color: var(--ink-soft); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentcolor 45%, transparent); }
.tile--map { grid-column: 5 / span 6; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.tile--map h2 { margin: 0 0 0.5rem; font-size: var(--step-small); font-weight: 500; color: var(--ink-soft); letter-spacing: 0; }
.tile--map ul, .tile--legal ul { list-style: none; margin: 0; padding: 0; }
.tile--map a, .tile--legal a { font-size: var(--step-small); min-height: 2rem; }
.tile--legal { grid-column: 11 / span 2; }
.tile--calc { grid-column: 1 / span 8; display: grid; align-content: space-between; gap: 1.5rem; min-height: 18rem; background: var(--ink); color: #ffffff; }
.tile--calc__title { margin: 0; font-size: var(--step-h); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.tile--calc__row { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem; }
.tile--calc label { display: grid; gap: 0.35rem; font-size: var(--step-small); color: var(--field-soft); }
.tile--calc__input { display: flex; align-items: center; width: 10rem; background: #ffffff; }
.tile--calc__input input { width: 100%; min-width: 0; height: 3rem; padding: 0 0.75rem; border: 0; background: none; font: 500 1rem/1 var(--font); color: var(--ink); -moz-appearance: textfield; appearance: textfield; }
.tile--calc__input input::-webkit-inner-spin-button, .tile--calc__input input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tile--calc__input em { padding-right: 0.75rem; font-style: normal; color: var(--ink-soft); }
.tile--calc__input:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile--calc__note { margin: 0; font-size: var(--step-small); color: var(--field-soft); }
.tile.tile--invite { text-decoration: none; }
.tile--invite { grid-column: 9 / span 4; display: flex; flex-direction: column; justify-content: space-between; min-height: 20rem; background: var(--tone-2); font-size: var(--step-h); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; transition: background-color var(--t-hover) ease; }
.tile--invite span { max-width: 10ch; }
.tile--invite svg { align-self: flex-end; width: clamp(3rem, 5vw, 4.5rem); height: auto; color: var(--accent); transition: transform var(--t-ui) var(--ease-out); }
.tile--invite:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) {
  .tile--invite:hover { background: var(--accent); color: var(--accent-ink); text-decoration: none; }
  .tile--invite:hover svg { color: var(--accent-ink); transform: translate(4px, -4px); }
}

/* 6. Shared blocks */
.crumbs { margin: 0 0 1.5rem; font-size: var(--step-small); color: var(--ink-soft); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; margin: 0; padding: 0; }
.crumbs li { display: inline-flex; align-items: center; gap: 0.6rem; }
.crumbs li + li::before { content: '/'; color: var(--ink-soft); }
.crumbs a { color: var(--ink); display: inline-flex; align-items: center; min-height: 2.75rem; }
.crumbs [aria-current] { color: var(--ink-soft); }
.credits { font-size: var(--step-small); color: var(--ink-soft); max-width: 62ch; }
.credits a { color: var(--ink-soft); }

/* Pricing cards: three plans, Solo carries the navy, a monthly or yearly switch. Home and /tarifs. */
.tiers__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; }
.tiers__title { margin: 0 !important; font-size: var(--step-h); }
.tiers__input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tiers__switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--tone-1); }
.tiers__switch::before { content: ''; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); background: var(--ink); transition: transform var(--t-ui) var(--ease-out); }
.tiers:has(#billing-yearly:checked) .tiers__switch::before { transform: translateX(100%); }
.tiers__switch label { position: relative; z-index: 1; padding: 0.7rem 1.25rem; text-align: center; font-weight: 600; font-size: var(--step-body); color: var(--ink-soft); cursor: pointer; transition: color var(--t-ui) ease, background-color 0s; }
.tiers__switch label span { margin-left: 0.4rem; }
/* The thumb slides; once it lands, the label itself carries the navy so the pair reads as one. */
.tiers:has(#billing-monthly:checked) label[for='billing-monthly'], .tiers:has(#billing-yearly:checked) label[for='billing-yearly'] { color: #ffffff; background: var(--ink); transition: color var(--t-ui) ease, background-color 0s var(--t-ui); }
.tiers:has(#billing-yearly:checked) label[for='billing-yearly'] span { color: var(--accent); }
.tiers:has(.tiers__input:focus-visible) .tiers__switch { outline: 3px solid var(--ink); outline-offset: 3px; }
.tiers__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); }
.tier { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0; padding: clamp(1.5rem, 2vw, 2rem); background: var(--tone-1); }
.tier--pick { background: var(--ink); color: #ffffff; }
.tier__name { display: flex; align-items: center; gap: 0.75rem; margin: 0 !important; font-size: var(--step-h); color: inherit; }
.tier__for strong { color: var(--accent); font-weight: 600; }
.tier__for { margin: 0.4rem 0 0 !important; font-size: var(--step-small); color: var(--ink-soft); }
.tier--pick .tier__for { color: var(--field-soft); }
.tier__price { margin: 1.25rem 0 0 !important; }
.tier__price strong { display: block; font-size: var(--step-head); font-weight: 600; letter-spacing: -0.045em; line-height: 1; }
.tier__price span span, .tier__price > span:not(.tier__amount) { display: block; margin-top: 0.6rem; font-size: var(--step-small); color: var(--ink-soft); }
.tier--pick .tier__price span span { color: var(--field-soft); }
/* Both amounts share one cell and cross-fade: a transition, so rapid toggling retargets instead of restarting. */
.tier__price:has(.tier__amount) { display: grid; }
.tier__amount { display: block; grid-area: 1 / 1; transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out), filter 260ms var(--ease-out), visibility 0s; }
.tier__amount--yearly, .tiers:has(#billing-yearly:checked) .tier__amount--monthly { visibility: hidden; opacity: 0; transform: translateY(0.3em); filter: blur(8px); transition-delay: 0s, 0s, 0s, 260ms; }
.tiers:has(#billing-yearly:checked) .tier__amount--yearly { visibility: visible; opacity: 1; transform: none; filter: none; transition-delay: 0s; }
.tier__cta { width: 100%; margin: 1.25rem 0 1.5rem; }
.tier:not(.tier--pick) .tier__cta { background: var(--ink); color: #ffffff; }
@media (hover: hover) and (pointer: fine) {
  .tier:not(.tier--pick) .tier__cta:hover { background: #2c3a63; color: #ffffff; }
}
.tier__features { margin: 0; padding: 0; list-style: none; }
.tier__features li { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.2rem 0; font-size: var(--step-small); }
.tier__features .tier__lead { padding-bottom: 0.35rem; font-weight: 600; }
.tier__features li:not(.tier__lead)::before { content: ''; flex: none; width: 1.1rem; height: 1.1rem; margin-top: 0.1rem; background: url('img/motif/check-ink.svg') center / contain no-repeat; }
.tier--pick .tier__features li:not(.tier__lead)::before { background-image: url('img/motif/check-accent.svg'); }
.tiers__more { margin-top: 1.25rem !important; color: var(--ink-soft); }

@media (max-width: 64rem) {
  /* Carousel: one card in view, its neighbours peeking at the edges so the swipe reads at a glance. */
  .tiers__grid { display: flex; gap: 0.75rem; margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
  .tiers__grid::-webkit-scrollbar { display: none; }
  .tier { display: flex; flex-direction: column; flex: 0 0 min(80%, 22rem); scroll-snap-align: center; }
  .tier--pick { scroll-initial-target: nearest; }
  .tier__features { margin-bottom: 0; }
}
@media (max-width: 40rem) {
  .tiers__switch { width: 100%; }
  .tiers__switch label { display: grid; align-content: center; padding-inline: 0.75rem; }
  .tiers__switch label span { margin: 0.1rem 0 0; font-weight: 400; }
}
/* Carousel position markers, where the browser draws them natively. */
@supports (scroll-marker-group: after) {
  @media (max-width: 64rem) {
    .tiers__grid { scroll-marker-group: after; }
    .tiers__grid::scroll-marker-group { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1.25rem; }
    .tier::scroll-marker { content: ''; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--tone-2); transition: background-color var(--t-ui) ease, width var(--t-ui) var(--ease-out); }
    .tier::scroll-marker:target-current { width: 1.5rem; border-radius: 0.25rem; background: var(--ink); }
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) and (min-width: 64.01rem) {
    .tier { animation: app-in linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
    .tier:nth-child(2) { animation-range: entry 8% entry 63%; }
    .tier:nth-child(3) { animation-range: entry 16% entry 71%; }
  }
  @media (prefers-reduced-motion: no-preference) {
    .tiers__title, .tiers__more { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
  }
}

/* Rows: long text section by section, each beside the screen that shows it (site/rows.edge). */
.rows { display: grid; row-gap: clamp(4rem, 7vw, 6rem); max-width: var(--page); margin: var(--section-gap) auto 0; padding: 0 var(--gutter); }
.row { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--split-gap); align-items: center; }
.row:not(.row--ui) { grid-template-columns: minmax(0, 1fr); }
.row--ui:nth-child(even of .row--ui) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.row--ui:nth-child(even of .row--ui) .row__ui { order: -1; }
.row__text.prose { max-width: none; }
/* A section without a screen keeps the two-column rhythm: its heading on the left, its text on the right. */
.row:not(.row--ui) .row__text { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: var(--split-gap); align-items: start; }
.row:not(.row--ui) .row__text > * { grid-column: 2; }
.row:not(.row--ui) .row__text > h2 { grid-column: 1; grid-row: 1 / span 30; margin: 0; }
.row:not(.row--ui) .row__text > h2 + * { margin-top: 0; }
.row__text table { display: table; width: 100%; }
.row__text > h2:first-child { margin-top: 0; }
.row__text > :last-child { margin-bottom: 0; }
.row__ui { margin: 0; }
@media (max-width: 64rem) {
  .row, .row--ui { grid-template-columns: minmax(0, 1fr); row-gap: 2rem; }
  .row:not(.row--ui) .row__text { display: block; }
  .row__text table { display: block; width: auto; }
  .row:not(.row--ui) .row__text > h2 { margin-bottom: 0.75rem; }
  .row--ui:nth-child(even of .row--ui) { grid-template-columns: minmax(0, 1fr); }
  .row--ui:nth-child(even of .row--ui) .row__ui { order: 0; }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .row__text, .row__ui { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
    .row__ui { animation-name: app-in; animation-range: entry 10% entry 65%; }
  }
}

/* 7. Legacy components, kept working on pages that have not been rebuilt yet. */
.eyebrow { display: none; }
.section { margin: clamp(3rem, 6vw, 5rem) 0; }
.section > h2, .section-title { margin: 0 0 0.75rem; font-size: var(--step-h); }
.hero { position: relative; padding: 2.5rem 0 3.5rem; }
.hero h1 { margin: 0 0 1.25rem; font-size: var(--step-head); letter-spacing: -0.045em; max-width: 16ch; }
.hero__lead { margin: 0 0 1.25rem; font-size: var(--step-lead); line-height: 1.32; max-width: 44ch; }
.hero__text > p:not(.hero__lead):not(.eyebrow):not(.hero__reassure) { max-width: 60ch; margin: 0 0 1.75rem; }
.hero__reassure { margin: 0.9rem 0 0; font-size: var(--step-small); color: var(--ink-soft); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }


.how { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5rem; list-style: none; margin: 0; padding: 0; }
.how h3 { margin: 0 0 0.35rem; font-size: var(--step-lead); }
.how p { margin: 0; }
.card { background: var(--tone-1); padding: 1.5rem; }
.card h2, .card h3 { margin-top: 0; font-size: var(--step-lead); }
.card p:last-child { margin-bottom: 0; }
.card--soft { background: var(--tone-1); }
.proof { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.proof__table { padding: 1.5rem 1.75rem; background: var(--tone-1); }
.proof__table h3 { margin: 0 0 0.5rem; font-size: var(--step-lead); }
.proof__table table { display: table; width: 100%; margin: 0.75rem 0; }
.proof__gap { font-weight: 700; color: var(--accent); }
.faq-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--split-gap); align-items: start; }
details.faq { background: var(--tone-1); margin: 0 0 0.5rem; }
details.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.25rem; padding: 0.75rem 1.1rem; font-weight: 600; cursor: pointer; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary h3 { margin: 0; font-size: var(--step-body); }
details.faq summary .icon { width: 1.1rem; height: 1.1rem; stroke-width: 2; transition: transform var(--t-ui) var(--ease-out); }
details.faq[open] summary .icon { transform: rotate(180deg); }
details.faq .faq__answer { padding: 0 1.1rem 0.5rem; }
details.faq:not([open]) .faq__answer { display: none; }
@supports selector(::details-content) {
  @media (prefers-reduced-motion: no-preference) {
    details.faq { interpolate-size: allow-keywords; }
    details.faq::details-content { height: 0; overflow: clip; transition: height 200ms var(--ease-out), content-visibility 200ms allow-discrete; }
    details.faq[open]::details-content { height: auto; }
  }
}
details.faq .faq__answer p { margin: 0 0 0.75rem; }
.faq-column { min-width: 0; }
.cta-band { position: relative; overflow-x: clip; margin: var(--section-gap) 0 0; padding: clamp(4.5rem, 8vw, 6.5rem) max(var(--gutter), calc((100% - var(--page)) / 2 + var(--gutter))); background: var(--ink); color: #ffffff; }
/* Road markings above and below, sliding in opposite directions as the band scrolls past (as on the home page). */
.cta-band::before, .cta-band::after, .tool-close::before, .tool-close::after { content: ''; position: absolute; left: -320px; right: -320px; height: 8px; background: url('img/motif/route-h-white.svg') repeat-x left center / 64px 8px; opacity: 0.32; pointer-events: none; }
.cta-band::before, .tool-close::before { top: clamp(1.5rem, 3vw, 2.5rem); }
.cta-band::after, .tool-close::after { bottom: clamp(1.5rem, 3vw, 2.5rem); }
/* clip, not hidden: a hidden overflow makes the band its own scroller and freezes the markings' view() timeline. */
.tool-close { position: relative; overflow-x: clip; }
.cta-band h2, .cta-band a:not(.btn) { color: #ffffff; }
/* On navy, the ink focus ring would vanish: every dark surface rings in white. */
:is(.cta-band, .tool-close, .band--ink, .start, .guide-essential, .tier--pick) :focus-visible { outline-color: #ffffff; }
.cta-band p { color: var(--field-soft); }
.cta-band h2 { margin: 0 0 0.75rem; font-size: var(--step-h); }
.cta-band p { margin: 0; max-width: 60ch; }
.cta-band .actions { margin: 1.5rem 0 0; }
.cta-band--row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.cta-band--row .actions { margin: 0; }
.cta-band--full { margin-bottom: 0; }
/* A page that closes on a full-bleed band meets the footer directly. */
main:has(> article > :is(.cta-band, .tool-close, .start):last-child) + .site-footer { margin-top: 0; }
.pricing { position: relative; }
.price { margin: 0; font: 600 var(--step-head)/1 var(--font); letter-spacing: -0.045em; }
.price small { font: 400 var(--step-small)/1.3 var(--font); letter-spacing: 0; color: var(--ink-soft); }
.trust { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gutter); list-style: none; margin: 0; padding: 0; }
.trust li { display: block; }
.trust .icon { display: none; }
.trust strong { display: block; }
.trust span, .trust a { font-size: var(--step-small); color: var(--ink-soft); }
main { padding: 0; }
.page-default { padding-top: 2rem; padding-bottom: 3rem; }
.page-default h1 { margin: 0 0 1rem; font-size: var(--step-head); letter-spacing: -0.045em; max-width: 16ch; }
.prose { max-width: 68ch; }
.prose h2, .page-default h2 { margin: 3.5rem 0 0.75rem; font-size: var(--step-h); }
.prose h3, .page-default h3 { margin: 2rem 0 0.5rem; font-size: var(--step-lead); }
main table { display: block; overflow-x: auto; border-collapse: collapse; margin: 1.25rem 0; max-width: 100%; font-size: var(--step-small); }
main th, main td { padding: 0.65rem 0.9rem; text-align: left; vertical-align: top; }
main thead th { background: var(--ink); color: var(--ground); font-weight: 600; }
main tbody tr:nth-child(even) td, main tbody tr:nth-child(even) th { background: var(--tone-1); }
.nowrap th, .nowrap td { white-space: nowrap; }
.steps { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.5rem; }
.steps li { background: var(--tone-1); padding: 1rem 1.25rem; }
.sources { font-size: var(--step-small); color: var(--ink-soft); }
.sources h2 { font-size: var(--step-body); }
.result { background: var(--tone-1); padding: 1.25rem 1.5rem; margin: 1.5rem 0; }
.result .amount { font-size: var(--step-h); }
.calculator input, .calculator select { font: inherit; min-height: 3rem; padding: 0.5rem 0.75rem; border: 1px solid var(--ink-soft); border-radius: 0; background: var(--ground); color: var(--ink); min-width: 12rem; }
.calculator label { font-weight: 600; }
.calculator button { cursor: pointer; font: inherit; font-weight: 600; }
.guide-hero__facts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; padding: 0; list-style: none; color: var(--ink-soft); font-size: var(--step-small); }
.guide-hero__facts li { display: inline-flex; align-items: center; gap: 0.5rem; }
.guide-hero__facts .icon { width: 1.2rem; height: 1.2rem; }
.guide-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 3rem; align-items: start; }
.guide-body h2 { margin-top: 2.75rem; }
.guide-body > :first-child { margin-top: 0; }

/* 8. Responsive, motion, print */
@media (max-width: 75rem) {
  .primary-nav ul { gap: 0.25rem 1.1rem; }
}
@media (max-width: 64rem) {
  .primary-nav, .header-actions { display: none; }
  .mobile-menu { display: block; }
  .proof, .guide-layout { grid-template-columns: minmax(0, 1fr); }
  .how { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.5rem; }
  .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile--statement, .tile--map { grid-column: 1 / -1; }
  .tile--legal { grid-column: 1 / -1; }
  .tile--calc { grid-column: 1 / -1; min-height: 0; }
  .tile--invite { grid-column: 1 / -1; min-height: 8rem; }
}
@media (max-width: 40rem) {
  .hero__actions .btn { width: 100%; }
  .how, .faq-list, .trust { grid-template-columns: minmax(0, 1fr); }
  .cta-band .btn, .cta-band .button { width: 100%; }
  .cta-band--row { display: block; }
  .cta-band--row .actions { margin-top: 1.5rem; }
  .site-footer { padding: 6px; }
  .site-footer__board { gap: 6px; }
  .tile--map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile--map nav:nth-child(2) { grid-row: span 2; }
  .tile--calc__input { width: 100%; }
  .tile--calc label { flex: 1 1 8rem; }
  .tile--calc .btn { width: 100%; }
}

/* Motion. Every entrance starts from a visible default: without scroll timelines, or under
   reduced motion, the page is simply finished. */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes road-shift { from { transform: translateX(0); } to { transform: translateX(-320px); } }
@keyframes road-shift-back { from { transform: translateX(-320px); } to { transform: translateX(0); } }
@keyframes app-in { from { opacity: 0; transform: translateY(28px) scale(0.985); } }
@keyframes price-in { from { opacity: 0; transform: translateY(0.3em); filter: blur(10px); } }
/* Page entrance: the title block of every content page arrives once, in reading order. */
@media (prefers-reduced-motion: no-preference) {
  :where(main) h1 { animation: rise var(--t-reveal) var(--ease-out) 40ms both; }
  :where(main h1) ~ :where(.lead, .hero__lead, p:first-of-type) { animation: rise var(--t-reveal) var(--ease-out) 120ms both; }
  :where(main h1) ~ :where(.guide-hero__facts, .meta, .hero__actions, .actions) { animation: rise var(--t-reveal) var(--ease-out) 200ms both; }
  /* Tool forms are used again and again: they appear at once, only showcase fragments make an entrance. */
  :where(article:not(.home) > :first-child [data-ui]:not(:has(form, input, select))) { animation: rise 900ms var(--ease-out) 260ms both; }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .cta-band::before, .tool-close::before { animation: road-shift-back linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
    .cta-band::after, .tool-close::after { animation: road-shift linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
    :where(.prose > h2, .guide-body > h2, .section > h2, .card, .cta-band > *, main table:not([data-ui] table)) { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
    [data-reveal] > *, [data-reveal-self] { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
    [data-reveal] > :nth-child(2) { animation-range: entry 8% entry 62%; }
    [data-reveal] > :nth-child(3) { animation-range: entry 14% entry 68%; }
    [data-reveal] > :nth-child(n + 4) { animation-range: entry 20% entry 74%; }
  }
}

/* Content pages (the home page keeps its own choreography). The product moves the way it does on the home page:
   the title fragment fills in line by line at load; every other fragment enters as it scrolls in, its lines in
   cascade and its amount coming into focus; text blocks, table rows and list items arrive in reading order; the
   road marking of the contents list draws as the page is read. */
@media (prefers-reduced-motion: no-preference) {
  :where(article:not(.home) > :first-child [data-ui]) :is(tbody tr, dl > div, ul > li, ol > li, .frag__lines > div) { animation: rise 520ms var(--ease-out) both; animation-delay: 560ms; }
  :where(article:not(.home) > :first-child [data-ui]) :is(tbody tr, dl > div, ul > li, ol > li, .frag__lines > div):nth-child(2) { animation-delay: 620ms; }
  :where(article:not(.home) > :first-child [data-ui]) :is(tbody tr, dl > div, ul > li, ol > li, .frag__lines > div):nth-child(3) { animation-delay: 680ms; }
  :where(article:not(.home) > :first-child [data-ui]) :is(tbody tr, dl > div, ul > li, ol > li, .frag__lines > div):nth-child(4) { animation-delay: 740ms; }
  :where(article:not(.home) > :first-child [data-ui]) :is(tbody tr, dl > div, ul > li, ol > li, .frag__lines > div):nth-child(n + 5) { animation-delay: 800ms; }
  :where(article:not(.home) > :first-child [data-ui]) :is(.frag__total strong, .frag__big, .gf__total dd, .tool-ui__total, .tool-vehicles__amount) { animation: price-in 520ms var(--ease-out) 880ms both; }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    :where(article:not(.home) > :not(:first-child)) [data-ui]:not(:has(form, input, select)) { view-timeline-name: --fragment; animation: app-in linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    :where(article:not(.home) > :not(:first-child)) [data-ui]:not(:has(form, input, select)) :is(tbody tr, dl > div, ul > li, ol > li, .frag__lines > div) { animation: show linear both; animation-timeline: --fragment; animation-range: entry 35% entry 75%; }
    :where(article:not(.home) > :not(:first-child)) [data-ui]:not(:has(form, input, select)) :is(tbody tr, dl > div, ul > li, ol > li, .frag__lines > div):nth-child(2) { animation-range: entry 40% entry 80%; }
    :where(article:not(.home) > :not(:first-child)) [data-ui]:not(:has(form, input, select)) :is(tbody tr, dl > div, ul > li, ol > li, .frag__lines > div):nth-child(3) { animation-range: entry 45% entry 85%; }
    :where(article:not(.home) > :not(:first-child)) [data-ui]:not(:has(form, input, select)) :is(tbody tr, dl > div, ul > li, ol > li, .frag__lines > div):nth-child(n + 4) { animation-range: entry 50% entry 90%; }
    :where(article:not(.home) > :not(:first-child)) [data-ui] :is(.frag__total strong, .frag__big, .gf__total dd, .tool-ui__total, .tool-vehicles__amount) { animation: price-in linear both; animation-timeline: --fragment; animation-range: entry 40% entry 100%; }
    :where(article:not(.home)) :is(.guide-body, .row__text, .legal-body, .faq-cat__list, .howto-steps, .hub-list ul) > :not(.anchor, figure, [data-ui]) { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
    :where(article:not(.home)) main table:not([data-ui] table) tbody tr, :where(article:not(.home)) table:not([data-ui] table) tbody tr { animation: show linear both; animation-timeline: view(); animation-range: entry 0% entry 80%; }
    /* Reading progress: the contents list's road marking draws as the article is read. */
    .guide-toc ol { position: relative; }
    .guide-toc ol::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: url('img/motif/route-v-ink.svg') repeat-y top center / 3px 18px; animation: route-draw linear both; animation-timeline: scroll(root block); z-index: 1; pointer-events: none; }
  }
}
@keyframes show { from { opacity: 0; } to { opacity: 1; } }
@keyframes route-draw { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }

/* Reduced motion keeps the fades and drops every travel, scale and wipe. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-name: fade-in !important; }
}

@media print {
  .site-header, .site-footer, .actions, .cta-band, .crumbs, .skip { display: none !important; }
  body { background: #fff; }
}
