/* ==========================================================================
   WineFlow — homepage stylesheet ("Cantina editoriale")
   Tokens mirror the app's design system (frontend/src/app/globals.css,
   "Cantina Moderna"): warm linen neutrals, wine reds, champagne gold,
   Fraunces for display, Instrument Sans for text, JetBrains Mono for figures.
   Change a colour here, never inline.
   ========================================================================== */

:root {
    /* Neutrals — the app's warm linen ramp (gray-50 … gray-900) */
    --paper: #f4f1ec;
    --paper-2: #faf8f5;
    --white: #ffffff;
    --line: #e9e4dc;
    --line-2: #d8d1c7;
    --ink: #1b1816;
    --ink-2: #2c2825;
    --ink-3: #423d38;
    --muted: #57514b;
    --faint: #6f675f;

    /* Wine ramp (red-100 … red-950) */
    --rose-100: #fae8ea;
    --rose-200: #f3cdd2;
    --rose-300: #e7a4ad;
    --rose-400: #d4707e;
    --wine: #8b1e2d;
    --wine-700: #741825;
    --burgundy: #5c0f1c;
    --cellar-2: #490d18;
    --cellar: #2b070e;

    /* Champagne gold (yellow-400 … 700) */
    --gold: #d6a756;
    --gold-hover: #e2b96c;
    --gold-600: #9a6e2e;
    --gold-700: #7a5626;

    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Warm layered shadows — same recipe as the app's --shadow-* */
    --shadow-sm: 0 1px 2px 0 rgb(43 27 24 / 0.05), 0 2px 6px -1px rgb(43 27 24 / 0.06);
    --shadow-lg: 0 4px 8px -2px rgb(43 27 24 / 0.06), 0 14px 28px -6px rgb(43 27 24 / 0.1);
    --shadow-xl: 0 4px 10px -2px rgb(43 27 24 / 0.06), 0 40px 80px -24px rgb(43 27 24 / 0.3);

    --wrap: 1280px;
    --gutter: clamp(16px, 5vw, 80px);
    --nav-h: 72px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ── Base ─────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
a { color: var(--wine); text-underline-offset: 3px; }
a:hover { color: var(--burgundy); }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

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

.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 100;
    background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius-sm);
    text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; color: var(--paper); }

.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* ── Type ─────────────────────────────────────────────────────────────── */

.eyebrow {
    display: flex; align-items: center; gap: 12px;
    font-family: var(--font-mono); font-size: 12px; font-weight: 500;
    letter-spacing: 0.14em; text-transform: uppercase; color: var(--wine);
    margin-bottom: 18px;
}
.eyebrow-rule { width: 28px; height: 1px; background: var(--gold); flex-shrink: 0; }
.eyebrow-gold { color: var(--gold); }
.eyebrow-gold-dark { color: var(--gold-700); }

.display {
    font-family: var(--font-display); font-weight: 500;
    font-size: clamp(34px, 3.9vw, 54px); line-height: 1.06; letter-spacing: -0.01em;
    font-variation-settings: 'opsz' 96;
    text-wrap: balance;
}
.display-sm { font-family: var(--font-display); font-weight: 500; font-size: clamp(26px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -0.01em; }

.lede { font-size: 17px; line-height: 1.6; color: var(--ink-3); text-wrap: pretty; }
.index { font-family: var(--font-mono); font-size: 13px; color: var(--wine); }
.index-gold { color: var(--gold-600); }
.fineprint { margin-top: 48px; font-size: 15px; color: var(--muted); }
.fineprint a { font-weight: 600; }

/* ── Buttons & links ──────────────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 46px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent;
    font-family: var(--font-sans); font-size: 15px; font-weight: 600; line-height: 1.2;
    text-decoration: none; cursor: pointer; text-align: center;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-lg { min-height: 54px; padding: 0 26px; border-radius: var(--radius); font-size: 16px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--wine); color: var(--white); box-shadow: 0 10px 24px -12px rgb(92 15 28 / 0.75); }
.btn-primary:hover { background: var(--wine-700); color: var(--white); }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-gold { background: var(--gold); color: var(--cellar); }
.btn-gold:hover { background: var(--gold-hover); color: var(--cellar); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.link-underline {
    font-weight: 600; color: var(--ink); text-decoration: none;
    border-bottom: 1px solid var(--gold); padding-bottom: 2px;
}
.link-underline:hover { color: var(--wine); border-color: var(--wine); }
.link-arrow { display: inline-block; margin-top: 12px; font-weight: 600; text-decoration: none; }
.link-light { color: var(--paper-2); font-weight: 600; }
.link-light:hover { color: var(--gold); }

/* ── Navigation ───────────────────────────────────────────────────────── */

.site-nav {
    position: sticky; top: 0; z-index: 50;
    background: rgb(250 248 245 / 0.88);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
    backdrop-filter: saturate(140%) blur(12px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow 0.2s;
}
.site-nav.scrolled { box-shadow: 0 8px 24px -18px rgb(43 27 24 / 0.35); }

.nav-inner {
    max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter);
    height: var(--nav-h); display: flex; align-items: center; gap: 32px;
}

.nav-logo {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--ink); text-decoration: none;
    font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
}
.nav-logo:hover { color: var(--ink); }

.nav-primary { display: flex; align-items: center; gap: 30px; margin: 0 auto; }
.nav-primary a { color: var(--ink-3); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-primary a:hover { color: var(--wine); }

.nav-links { display: flex; align-items: center; gap: 16px; }
.btn-login { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.btn-login:hover { color: var(--wine); }

.nav-toggle {
    display: none; width: 44px; height: 44px; border-radius: 10px;
    border: 1px solid var(--line-2); background: transparent; cursor: pointer;
    align-items: center; justify-content: center; color: var(--ink);
}

.mobile-menu {
    border-top: 1px solid var(--line); background: var(--paper-2);
    padding: 8px var(--gutter) 20px; display: flex; flex-direction: column;
}
.mobile-menu a {
    padding: 14px 0; border-bottom: 1px solid var(--line);
    color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 500;
}
.mobile-menu .menu-links { justify-content: space-between; padding-top: 12px; margin-left: 0; }
.mobile-menu .menu-links .btn-login { border-bottom: 0; }
.mobile-menu .menu-links .lang-switcher { order: 2; }
.mobile-menu .lang-dropdown { right: 0; left: auto; top: auto; bottom: calc(100% + 8px); }

/* Language switcher (markup injected by i18n.js) */
.lang-switcher { position: relative; }
.lang-switcher-btn {
    height: 38px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--line-2); border-radius: 999px; background: transparent; cursor: pointer;
    font-family: var(--font-mono); font-size: 12px; color: var(--ink-3);
}
.lang-switcher-btn:hover { border-color: var(--ink-3); }
.lang-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 160px; padding: 6px;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); display: none; z-index: 60;
}
.lang-dropdown.show { display: block; }
.lang-option {
    display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: var(--radius-sm);
    background: transparent; text-align: left; cursor: pointer; font-size: 14px; color: var(--ink-3);
}
.lang-option:hover { background: var(--paper); }
.lang-option.active { color: var(--wine); font-weight: 600; }

/* ── Bands (sections) ─────────────────────────────────────────────────── */

.band { padding: clamp(72px, 9vw, 124px) 0; position: relative; }
.band-tight { padding: clamp(48px, 5vw, 72px) 0; }
.band-paper { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-cellar {
    color: var(--paper-2);
    background:
        radial-gradient(900px 520px at 82% -10%, rgb(116 24 37 / 0.9) 0%, rgb(92 15 28 / 0) 70%),
        radial-gradient(600px 400px at 0% 110%, rgb(73 13 24 / 0.9) 0%, rgb(73 13 24 / 0) 70%),
        var(--cellar);
}
.band-cellar .display { color: var(--paper-2); }
.band-cellar .lede { color: var(--rose-300); }

.section-head { margin-bottom: clamp(40px, 5vw, 60px); }
.section-head.split {
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: end;
}
.section-head.split > div { grid-column: span 7; }
.section-head.split > .lede,
.section-head.split > .billing-toggle { grid-column: 9 / span 4; }
.section-head.split > .billing-toggle { justify-self: end; }
.section-head .lede { margin-top: 18px; }
.section-head.split > .lede { margin-top: 0; }

/* ── Screenshots ──────────────────────────────────────────────────────── */

.shot {
    margin: 0; background: var(--white); border: 1px solid var(--line);
    border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-xl);
}
.shot img { display: block; width: 100%; height: auto; }
.shot-note {
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--faint); margin-bottom: 14px;
}
.callout { display: flex; align-items: center; gap: 10px; }
.callout-rule { width: 40px; height: 1px; background: var(--wine); flex-shrink: 0; }
.callout span:last-child {
    font-family: var(--font-mono); font-size: 12px; line-height: 1.4; color: var(--burgundy);
    background: var(--paper-2); border: 1px solid var(--rose-300); border-radius: 999px; padding: 6px 12px;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
    position: relative; overflow: hidden;
    padding: clamp(56px, 7vw, 96px) 0 clamp(96px, 10vw, 150px);
    background: radial-gradient(1100px 620px at 88% 12%, #faf1da 0%, rgb(250 241 218 / 0) 62%), var(--paper);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 64px; align-items: start; }
.hero-copy { position: relative; z-index: 2; }

.hero-title {
    font-family: var(--font-display); font-weight: 500; font-variation-settings: 'opsz' 110;
    font-size: clamp(42px, 5vw, 72px); line-height: 1.03; letter-spacing: -0.015em;
    text-wrap: balance;
}
.hero-title span { font-style: italic; font-weight: 400; color: var(--wine); font-variation-settings: 'opsz' 72; letter-spacing: -0.01em; }

.hero-lede { margin-top: 26px; font-size: 19px; line-height: 1.6; color: var(--ink-3); max-width: 520px; text-wrap: pretty; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }

.hero-facts {
    margin: 44px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line-2);
}
.hero-facts > div { padding: 18px 18px 0; border-left: 1px solid var(--line); }
.hero-facts > div:first-child { padding-left: 0; border-left: 0; }
.hero-facts dt { font-family: var(--font-mono); font-size: 26px; font-weight: 500; color: var(--ink); line-height: 1.2; }
.hero-facts dd { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }

.hero-visual { position: relative; width: min(900px, 60vw); margin-top: -8px; }
.hero-visual .shot-note { text-align: left; }
.shot-float {
    position: absolute; left: -12%; bottom: -12%; width: 71%;
    box-shadow: 0 30px 60px -18px rgb(43 27 24 / 0.38);
}
.callout-hero { position: absolute; left: 52%; bottom: -21%; }

/* Load choreography — only when the visitor has not asked for less motion */
@media (prefers-reduced-motion: no-preference) {
    .hero-copy > * { animation: rise 0.8s var(--ease) both; }
    .hero-copy > *:nth-child(2) { animation-delay: 0.06s; }
    .hero-copy > *:nth-child(3) { animation-delay: 0.14s; }
    .hero-copy > *:nth-child(4) { animation-delay: 0.22s; }
    .hero-copy > *:nth-child(5) { animation-delay: 0.3s; }
    .shot-hero { animation: rise 1s 0.15s var(--ease) both; }
    .shot-float { animation: rise-float 1s 0.45s var(--ease) both; }
    .callout-hero { animation: fade 0.8s 0.9s var(--ease) both; }

    html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
    html.js .reveal.visible { opacity: 1; transform: none; }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes rise-float { from { opacity: 0; transform: translate(-12px, 24px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ── Who it's for ─────────────────────────────────────────────────────── */

.segments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.segment { border-top: 2px solid var(--ink); padding-top: 26px; display: flex; flex-direction: column; gap: 14px; }
.segment h3 { font-family: var(--font-display); font-size: 28px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; }
.segment p { font-size: 16px; line-height: 1.6; color: var(--ink-3); }

/* ── Problem ──────────────────────────────────────────────────────────── */

.problem-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.problem-grid > div:first-child { grid-column: span 4; align-self: start; position: sticky; top: calc(var(--nav-h) + 32px); }
.pains { grid-column: 6 / span 7; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 48px; }
.pain { padding-top: 18px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.pain h3 { font-size: 20px; font-weight: 600; line-height: 1.3; }
.pain p { font-size: 16px; color: var(--muted); }
.pull {
    grid-column: 1 / -1; margin-top: 8px;
    font-family: var(--font-display); font-style: italic; font-size: 22px; line-height: 1.5; color: var(--ink-3);
}

/* ── The flow ─────────────────────────────────────────────────────────── */

.flow { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 56px; align-items: start; }
.flow-tabs { display: flex; flex-direction: column; }

.flow-tab {
    width: 100%; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: start;
    padding: 20px 12px 20px 0; border: 0; border-top: 1px solid rgb(214 167 86 / 0.22);
    border-left: 2px solid transparent; background: transparent; color: inherit; cursor: pointer;
    text-align: left; opacity: 0.7; transition: opacity 0.2s, background-color 0.2s, padding 0.25s var(--ease);
}
.flow-tab:last-child { border-bottom: 1px solid rgb(214 167 86 / 0.22); }
.flow-tab:hover { opacity: 0.95; }
.flow-tab[aria-selected="true"] { opacity: 1; padding-left: 18px; border-left-color: var(--gold); background: rgb(214 167 86 / 0.08); }
.flow-tab .index { color: var(--gold); padding-top: 4px; }
.flow-tab-body { display: flex; flex-direction: column; gap: 8px; }
.flow-tab-title { font-family: var(--font-display); font-size: 23px; font-weight: 500; line-height: 1.2; color: var(--paper-2); }
.flow-tab-text { display: none; font-size: 15px; line-height: 1.55; color: var(--rose-200); }
.flow-tab[aria-selected="true"] .flow-tab-text { display: block; }

.flow-panel { margin: 0; display: flex; flex-direction: column; gap: 16px; }
.flow-panel .shot {
    aspect-ratio: 16 / 10; border-color: rgb(214 167 86 / 0.3);
    box-shadow: 0 40px 90px -30px rgb(0 0 0 / 0.7);
}
.flow-panel .shot img { height: 100%; object-fit: cover; object-position: left top; }
.flow-panel .shot-pad { display: flex; align-items: center; padding: 6%; background: var(--white); }
.flow-panel .shot-pad img { height: auto; object-fit: contain; border-radius: 6px; box-shadow: var(--shadow-lg); }
.flow-panel figcaption {
    display: flex; justify-content: space-between; gap: 24px;
    font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--rose-400);
}
.flow-cap-text { display: none; }
.flow-cap-tag { margin-left: auto; text-align: right; }

/* Without JavaScript: no tabs, every step stacked with its caption */
html:not(.js) .flow { grid-template-columns: 1fr; }
html:not(.js) .flow-tabs { display: none; }
html:not(.js) .flow-panels { display: grid; gap: 48px; }
html:not(.js) .flow-cap-text { display: block; font-family: var(--font-sans); font-size: 15px; color: var(--rose-200); }

/* ── Intelligence ─────────────────────────────────────────────────────── */

.intel-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.intel-visual { grid-column: span 7; position: relative; }
.callout-intel { position: absolute; left: 28px; bottom: -16px; }
.ledger { grid-column: 9 / span 4; }
.ledger li { padding: 20px 0; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.ledger li:nth-last-child(2) { border-bottom: 1px solid var(--line-2); }
.ledger strong { font-size: 17px; font-weight: 600; line-height: 1.35; }
.ledger span { font-size: 15px; line-height: 1.55; color: var(--muted); }
.ledger li.ledger-note { border: 0; padding-top: 16px; font-family: var(--font-mono); font-size: 12px; color: var(--faint); }

.duo { margin-top: clamp(40px, 5vw, 64px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.tile {
    background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 28px 30px; display: flex; gap: 20px; align-items: flex-start; color: var(--wine);
}
.tile svg { flex-shrink: 0; }
.tile h3 { font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.tile p { font-size: 15px; line-height: 1.55; color: var(--muted); }

/* ── Getting started + partner ────────────────────────────────────────── */

.start-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.start-grid > div { grid-column: span 6; }
.start-grid .lede { margin-top: 18px; max-width: 520px; }
.steps { grid-column: 8 / span 5; display: flex; flex-direction: column; gap: 28px; }
.steps li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; }
.step-n { font-family: var(--font-mono); font-size: 30px; line-height: 1; color: var(--gold); }
.steps strong { display: block; font-size: 17px; margin-bottom: 4px; }
.steps span { font-size: 15px; line-height: 1.55; color: var(--muted); }
.steps a { font-weight: 600; white-space: nowrap; }

.partner {
    margin-top: clamp(48px, 6vw, 72px);
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 20px;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: clamp(28px, 3.5vw, 44px);
}
.partner > div:first-child { grid-column: span 4; }
.partner > div:last-child { grid-column: 6 / span 7; display: flex; flex-direction: column; gap: 14px; }
.partner .eyebrow { margin-bottom: 12px; }
.partner h3 { font-family: var(--font-display); font-size: 30px; font-weight: 500; line-height: 1.15; }
.partner > div:last-child p { font-size: 17px; color: var(--ink-3); }
.partner > div:last-child .partner-disclosure { font-size: 14px; color: var(--faint); }

/* ── Integrations ─────────────────────────────────────────────────────── */

.integrations { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; }
.integrations > div { grid-column: span 4; }
.chips { grid-column: 6 / span 7; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li {
    padding: 10px 16px; border: 1px solid var(--line-2); border-radius: 999px;
    background: var(--paper-2); font-size: 15px; font-weight: 500;
}

/* ── Pricing ──────────────────────────────────────────────────────────── */

.billing-toggle { display: inline-flex; padding: 4px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); }
.billing-opt {
    min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
    font-size: 14px; font-weight: 600; color: var(--ink-3);
}
.billing-opt.active { background: var(--ink); color: var(--paper-2); }
.billing-opt .save { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--gold-600); margin-left: 4px; }
.billing-opt.active .save { color: var(--gold); }

.timetovalue {
    margin: -20px 0 36px; padding-left: 16px; border-left: 2px solid var(--gold);
    font-size: 15px; color: var(--ink-3); max-width: 760px;
}

.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.plan {
    position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 30px 26px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-sm);
}
.plan h3 { font-size: 20px; font-weight: 600; }
.plan-sub { font-size: 14px; color: var(--muted); min-height: 2.8em; }
.plan-price { font-family: var(--font-mono); font-size: 42px; font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; }
.plan-price .per { font-size: 14px; font-weight: 400; color: var(--faint); letter-spacing: 0; margin-left: 2px; }
.plan-price-custom { font-family: var(--font-display); font-style: italic; font-size: 40px; }
.plan-features { display: flex; flex-direction: column; gap: 9px; font-size: 14px; color: var(--ink-3); margin: 6px 0 12px; }
.plan-features li { position: relative; padding-left: 22px; line-height: 1.45; }
.plan-features li::before {
    content: ''; position: absolute; left: 2px; top: 0.35em; width: 10px; height: 6px;
    border-left: 1.6px solid var(--wine); border-bottom: 1.6px solid var(--wine); transform: rotate(-45deg);
}
.plan-features li.off { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line-2); }
.plan-features li.off::before { border: 0; border-top: 1.6px solid var(--line-2); transform: none; top: 0.7em; }
.plan .btn { margin-top: auto; }

.plan-featured { background: var(--cellar); border-color: var(--cellar); color: var(--paper-2); box-shadow: 0 30px 60px -24px rgb(43 7 14 / 0.6); }
.plan-featured .plan-sub { color: var(--rose-200); }
.plan-featured .plan-price .per { color: var(--rose-300); }
.plan-featured .plan-features { color: var(--rose-100); }
.plan-featured .plan-features li::before { border-color: var(--gold); }
.plan-flag {
    position: absolute; top: -12px; left: 26px; padding: 5px 10px; border-radius: 999px;
    background: var(--gold); color: var(--cellar);
    font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
}

.pricing-notes {
    margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line);
    display: flex; justify-content: space-between; gap: 12px 32px; flex-wrap: wrap; font-size: 14px; color: var(--muted);
}

.compare { margin-top: 28px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--white); }
.compare summary {
    list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
    padding: 18px 24px; font-weight: 600; font-size: 15px;
}
.compare summary::-webkit-details-marker { display: none; }
.compare summary svg { transition: transform 0.2s; }
.compare[open] summary svg { transform: rotate(180deg); }
.compare-scroll { overflow-x: auto; border-top: 1px solid var(--line); }
.compare-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 14px; }
.compare-table th, .compare-table td { padding: 12px 20px; text-align: center; border-bottom: 1px solid var(--line); }
.compare-table th:first-child, .compare-table td:first-child { text-align: left; }
.compare-table thead th { font-weight: 600; background: var(--paper-2); position: sticky; top: 0; }
.compare-table tr.cat td {
    background: var(--paper); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--gold-700); text-align: left;
}
.compare-table td.yes { color: var(--wine); font-weight: 600; }
.compare-table td.no { color: var(--line-2); }
.tag { display: inline-block; font-family: var(--font-mono); font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line-2); color: var(--gold-700); }
.tag-in { background: var(--rose-100); border-color: var(--rose-200); color: var(--burgundy); }

.addons {
    margin-top: clamp(48px, 6vw, 72px);
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; align-items: start;
}
.addons-head .eyebrow { margin-bottom: 10px; }
.addons-head h3 { font-family: var(--font-display); font-size: 26px; font-weight: 500; line-height: 1.15; margin-bottom: 10px; }
.addons-head p:not(.eyebrow) { font-size: 14px; color: var(--muted); }
.addon { border-top: 1px solid var(--line-2); padding-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.addon h4 { font-size: 16px; font-weight: 600; }
.addon-price { font-family: var(--font-mono); font-size: 22px; }
.addon-price .per { font-size: 12px; color: var(--faint); }
.addon .addon-annual { font-family: var(--font-mono); font-size: 11px; color: var(--faint); margin-top: -4px; }
.addon p { font-size: 14px; color: var(--muted); }
.addon .addon-avail { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }

/* ── FAQ ──────────────────────────────────────────────────────────────── */

.faq-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.faq-grid > div:first-child { grid-column: span 4; align-self: start; position: sticky; top: calc(var(--nav-h) + 32px); }
.faq { grid-column: 6 / span 7; }
.faq details { border-top: 1px solid var(--line-2); }
.faq details:last-child { border-bottom: 1px solid var(--line-2); }
.faq summary {
    list-style: none; cursor: pointer; padding: 24px 40px 24px 0; position: relative;
    font-size: 18px; font-weight: 600; line-height: 1.4;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: '+'; position: absolute; right: 4px; top: 22px;
    font-family: var(--font-mono); font-size: 20px; color: var(--wine); transition: transform 0.2s;
}
.faq details[open] summary::after { content: '−'; }
.faq details p { padding: 0 40px 24px 0; font-size: 16px; color: var(--muted); margin-top: -8px; }

/* ── Closing CTA + contact ────────────────────────────────────────────── */

.closing { padding: 0 clamp(8px, 2.5vw, 40px) clamp(64px, 8vw, 110px); }
.closing-card {
    max-width: 1360px; margin: 0 auto; border-radius: var(--radius-xl);
    padding: clamp(40px, 6vw, 84px) clamp(22px, 5vw, 72px);
    color: var(--paper-2);
    background:
        radial-gradient(700px 420px at 8% 0%, rgb(116 24 37 / 0.95) 0%, rgb(116 24 37 / 0) 70%),
        var(--cellar);
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 40px; align-items: start;
}
.closing-copy { grid-column: span 6; }
.closing-copy .display { color: var(--paper-2); font-size: clamp(32px, 3.6vw, 50px); }
.closing-copy .lede { margin-top: 20px; color: var(--rose-200); }
.closing-actions { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.closing-response { margin-top: 18px; font-family: var(--font-mono); font-size: 12px; color: var(--rose-300); }

.contact-form {
    grid-column: 8 / span 5; background: var(--paper-2); color: var(--ink);
    border-radius: var(--radius-lg); padding: 28px; display: flex; flex-direction: column; gap: 14px;
    box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.6);
}
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.field input, .field select, .field textarea {
    width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    background: var(--white); color: var(--ink); font-family: var(--font-sans); font-size: 15px;
}
.field textarea { resize: vertical; min-height: 104px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px rgb(139 30 45 / 0.14); }
.field ::placeholder { color: #8a8178; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { font-size: 14px; border-radius: var(--radius-sm); }
.form-status.success, .form-status.error { padding: 12px 14px; }
.form-status.success { background: #e1efe2; color: #23442d; }
.form-status.error { background: var(--rose-100); color: var(--burgundy); }

/* ── Footer ───────────────────────────────────────────────────────────── */

.site-footer { padding: 24px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 2.2fr repeat(4, minmax(0, 1fr)); gap: 32px; padding-bottom: 40px; }
.footer-brand p { margin-top: 14px; font-size: 15px; color: var(--muted); max-width: 320px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 {
    font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--gold-700); margin-bottom: 4px;
}
.footer-col a { font-size: 14px; color: var(--ink-3); text-decoration: none; }
.footer-col a:hover { color: var(--wine); }
.footer-bottom {
    padding-top: 22px; border-top: 1px solid var(--line-2);
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
    font-size: 13px; color: var(--faint);
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 1180px) {
    .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 56px; }
    .hero-copy { max-width: 680px; }
    .hero-visual { width: min(900px, 118%); margin-top: 0; }
    .hero-visual .shot-note { text-align: left; }
    .shot-float { left: auto; right: 14%; bottom: -14%; width: 60%; }
    .callout-hero { display: none; }
    .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .addons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .addons-head { grid-column: 1 / -1; max-width: 640px; }
}

@media (max-width: 1024px) {
    .nav-primary { display: none; }
    .nav-toggle { display: inline-flex; }
    .nav-links { margin-left: auto; }
}

@media (max-width: 900px) {
    .section-head.split, .problem-grid, .intel-grid, .start-grid, .integrations, .faq-grid, .closing-card, .partner {
        grid-template-columns: minmax(0, 1fr);
    }
    .section-head.split > div, .section-head.split > .lede, .section-head.split > .billing-toggle,
    .problem-grid > div:first-child, .pains, .intel-visual, .ledger, .start-grid > div, .steps,
    .integrations > div, .chips, .faq-grid > div:first-child, .faq, .closing-copy, .contact-form,
    .partner > div:first-child, .partner > div:last-child {
        grid-column: 1 / -1;
    }
    .section-head.split { row-gap: 18px; }
    .section-head.split > .billing-toggle { justify-self: start; }
    .problem-grid > div:first-child, .faq-grid > div:first-child { position: static; margin-bottom: 36px; }
    .ledger, .steps { margin-top: 36px; }
    .chips { margin-top: 24px; }
    .callout-intel { display: none; }
    .segments { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .duo { grid-template-columns: minmax(0, 1fr); }
    .timetovalue { margin-top: 0; }

    /* Flow: chips on top, the chosen step's caption under its screen */
    .flow { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .flow-tabs {
        flex-direction: row; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity;
        margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px; scrollbar-width: none;
        scroll-padding-inline: var(--gutter);
    }
    .flow-tabs::-webkit-scrollbar { display: none; }
    .flow-tab, .flow-tab:last-child {
        width: auto; flex-shrink: 0; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 8px;
        min-height: 44px; padding: 0 16px; border: 1px solid rgb(214 167 86 / 0.35); border-radius: 999px; opacity: 1;
    }
    .flow-tab .index { padding-top: 0; font-size: 12px; }
    .flow-tab-title { font-family: var(--font-sans); font-size: 14px; font-weight: 500; white-space: nowrap; }
    .flow-tab[aria-selected="true"] { padding-left: 16px; background: var(--gold); border-color: var(--gold); }
    .flow-tab[aria-selected="true"] .index, .flow-tab[aria-selected="true"] .flow-tab-title { color: var(--cellar); }
    .flow-tab[aria-selected="true"] .flow-tab-text { display: none; }
    .flow-panel { flex-direction: column-reverse; }
    .flow-panel figcaption { flex-direction: column; gap: 8px; }
    .flow-cap-text { display: block; font-family: var(--font-sans); font-size: 16px; letter-spacing: 0; line-height: 1.55; color: var(--rose-200); }
    .flow-cap-tag { margin-left: 0; text-align: left; }
}

@media (max-width: 640px) {
    /* A full desktop screen at phone width is unreadable: show the working
       area instead — sidebar cropped out, table at ~1.75× — still the real capture. */
    .flow-panel .shot:not(.shot-pad) { aspect-ratio: 4 / 3; }
    .flow-panel .shot:not(.shot-pad) img { width: 175%; max-width: none; height: auto; transform: translateX(-16%); }
}

@media (max-width: 640px) {
    :root { --nav-h: 64px; }
    .nav-inner { gap: 12px; }
    .nav-logo { font-size: 20px; }
    .nav-links { gap: 8px; }
    .nav-inner > .nav-links .btn-login { display: none; }
    .nav-links .btn { padding: 0 12px; }
    .hero-lede { font-size: 17px; }
    .hero-actions .btn { width: 100%; }
    .hero-actions .link-underline { margin: 0 auto; }
    .hero-facts dt { font-size: 20px; }
    .hero-facts > div { padding: 14px 10px 0; }
    .hero-facts dd { font-size: 12px; }
    .hero-visual { width: 132%; }
    .shot-float { right: 30%; width: 64%; bottom: -18%; }
    .pains { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .pull { font-size: 19px; }
    .plans { grid-template-columns: minmax(0, 1fr); }
    .addons { grid-template-columns: minmax(0, 1fr); }
    .form-row { grid-template-columns: minmax(0, 1fr); }
    .contact-form { padding: 20px; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
    .nav-inner { gap: 10px; }
    .nav-logo { gap: 8px; font-size: 19px; }
    .nav-logo svg { width: 26px; height: 26px; }
    .nav-links .btn { white-space: nowrap; min-height: 40px; padding: 0 12px; font-size: 14px; }
    /* The switcher moves into the menu; the bar keeps logo, demo and menu. */
    .nav-inner > .nav-links .lang-switcher { display: none; }
}

@media (max-width: 340px) {
    .nav-links .btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
