/* =============================================================================
   GymFlow — landing page
   Material 3 (Expressive) styling. Colour and type tokens are copied verbatim
   from the app: shared/.../presentation/theme/Theme.kt and Typography.kt.
   Do not swap these for stock M3 values — the app is a hand-authored red/blue
   scheme, not a seeded purple one.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
    /* Primary (red) */
    --md-primary: #DE0606;
    --md-on-primary: #FFFFFF;
    --md-primary-container: #FFDAD6;
    --md-on-primary-container: #410002;

    /* Secondary (blue) */
    --md-secondary: #007FD7;
    --md-on-secondary: #FFFFFF;
    --md-secondary-container: #D0E4FF;
    --md-on-secondary-container: #001D36;

    /* Tertiary — the app uses this, not primary, for selection/accents */
    --md-tertiary: #0066B3;
    --md-on-tertiary: #FFFFFF;
    --md-tertiary-container: #D0E4FF;
    --md-on-tertiary-container: #001D36;

    --md-error: #BA1A1A;
    --md-on-error: #FFFFFF;
    --md-error-container: #FFDAD6;
    --md-on-error-container: #410002;

    --md-background: #FCFCFC;
    --md-on-background: #1C1B1B;
    --md-surface: #FCFCFC;
    --gf-surface-rgb: 252, 252, 252;
    --md-on-surface: #1C1B1B;
    --md-surface-variant: #E2E2E2;
    --md-on-surface-variant: #44474F;

    --md-outline: #74777F;
    --md-outline-variant: #C4C6D0;

    --md-inverse-surface: #2F3033;
    --md-inverse-on-surface: #F1F0F4;
    --md-inverse-primary: #FFB4AB;
    --md-scrim: #000000;

    /* Surface containers. The app never overrides these, so in-app they fall
       through to M3's purple-tinted baseline. Deliberately re-derived here as a
       neutral, faintly warm ramp — the purple defaults clash with the red. */
    --md-surface-container-lowest: #FFFFFF;
    --md-surface-container-low: #F9F6F6;
    --md-surface-container: #F3EFEF;
    --md-surface-container-high: #EDE8E8;
    --md-surface-container-highest: #E6E1E1;

    /* Brand gradients — the real identity, more than any single token */
    --gf-red-ramp: linear-gradient(180deg, #DE0606 0%, #780303 100%);
    --gf-blue-ramp: linear-gradient(180deg, #407BFF 0%, #264A99 100%);
    --gf-plan-ramp: linear-gradient(180deg, #DE0606 0%, #850404 100%);
    --gf-splash: #AB0404;

    --gf-shadow-1: 0 1px 2px rgba(0, 0, 0, .08), 0 1px 3px rgba(0, 0, 0, .06);
    --gf-shadow-2: 0 2px 6px rgba(0, 0, 0, .09), 0 6px 16px rgba(0, 0, 0, .07);
    --gf-shadow-3: 0 6px 18px rgba(0, 0, 0, .10), 0 18px 44px rgba(0, 0, 0, .10);

    /* Spacing grid observed in the app: 4 / 8 / 12 / 16 / 24 / 32 */
    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;
    --sp-4: 16px; --sp-6: 24px; --sp-8: 32px;

    /* M3 baseline shapes — the app passes no custom Shapes() */
    --shape-xs: 4px;  --shape-s: 8px;  --shape-m: 12px;
    --shape-l: 16px;  --shape-xl: 28px; --shape-full: 999px;

    --gf-motion: 350ms; /* THEME_ANIMATION_DURATION_MS in Theme.kt */
    --gf-ease: cubic-bezier(.2, 0, 0, 1);
    --gf-spring: cubic-bezier(.34, 1.56, .64, 1);

    --gf-max: 1180px;
}

.dark-tokens,
:root[data-theme="dark"] {
    --md-primary: #DE0606;
    --md-on-primary: #FFFFFF;
    --md-primary-container: #AC0202;
    --md-on-primary-container: #FFDAD6;

    --md-secondary: #007FD7;
    --md-on-secondary: #FFFFFF;
    --md-secondary-container: #004A80;
    --md-on-secondary-container: #D0E4FF;

    --md-tertiary: #4DA6FF;
    --md-on-tertiary: #003258;
    --md-tertiary-container: #005A9E;
    --md-on-tertiary-container: #D0E4FF;

    --md-error: #FFB4AB;
    --md-on-error: #690005;
    --md-error-container: #93000A;
    --md-on-error-container: #FFDAD6;

    --md-background: #121212;
    --md-on-background: #E2E2E2;
    --md-surface: #121212;
    --gf-surface-rgb: 18, 18, 18;
    --md-on-surface: #E2E2E2;
    --md-surface-variant: #3F3F3F;
    --md-on-surface-variant: #C8C8C8;

    --md-outline: #8E8E8E;
    --md-outline-variant: #3F3F3F;

    --md-inverse-surface: #E2E2E2;
    --md-inverse-on-surface: #2C2C2C;
    --md-inverse-primary: #FFB4AB;

    --md-surface-container-lowest: #0D0D0D;
    --md-surface-container-low: #1A1818;
    --md-surface-container: #1F1D1D;
    --md-surface-container-high: #262323;
    --md-surface-container-highest: #302C2C;

    --gf-shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
    --gf-shadow-2: 0 2px 6px rgba(0, 0, 0, .55), 0 6px 16px rgba(0, 0, 0, .4);
    --gf-shadow-3: 0 6px 18px rgba(0, 0, 0, .6), 0 18px 44px rgba(0, 0, 0, .45);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --md-primary: #DE0606;
        --md-on-primary: #FFFFFF;
        --md-primary-container: #AC0202;
        --md-on-primary-container: #FFDAD6;

        --md-secondary: #007FD7;
        --md-on-secondary: #FFFFFF;
        --md-secondary-container: #004A80;
        --md-on-secondary-container: #D0E4FF;

        --md-tertiary: #4DA6FF;
        --md-on-tertiary: #003258;
        --md-tertiary-container: #005A9E;
        --md-on-tertiary-container: #D0E4FF;

        --md-error: #FFB4AB;
        --md-on-error: #690005;
        --md-error-container: #93000A;
        --md-on-error-container: #FFDAD6;

        --md-background: #121212;
        --md-on-background: #E2E2E2;
        --md-surface: #121212;
        --gf-surface-rgb: 18, 18, 18;
        --md-on-surface: #E2E2E2;
        --md-surface-variant: #3F3F3F;
        --md-on-surface-variant: #C8C8C8;

        --md-outline: #8E8E8E;
        --md-outline-variant: #3F3F3F;

        --md-inverse-surface: #E2E2E2;
        --md-inverse-on-surface: #2C2C2C;
        --md-inverse-primary: #FFB4AB;

        --md-surface-container-lowest: #0D0D0D;
        --md-surface-container-low: #1A1818;
        --md-surface-container: #1F1D1D;
        --md-surface-container-high: #262323;
        --md-surface-container-highest: #302C2C;

        --gf-shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
        --gf-shadow-2: 0 2px 6px rgba(0, 0, 0, .55), 0 6px 16px rgba(0, 0, 0, .4);
        --gf-shadow-3: 0 6px 18px rgba(0, 0, 0, .6), 0 18px 44px rgba(0, 0, 0, .45);
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* `clip`, not `hidden`: `hidden` here (or on body) turns the element into a
       scroll container, which breaks window scrolling and the reveal observer. */
    overflow-x: clip;
}

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

body {
    margin: 0;
    background: var(--md-background);
    color: var(--md-on-background);
    font-family: Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: .15px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--gf-motion) var(--gf-ease),
                color var(--gf-motion) var(--gf-ease);
}

img, svg { max-width: 100%; display: block; }
/* width/height attributes are present for CLS; height must still track the width */
img { height: auto; }
a { color: var(--md-tertiary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
    outline: 3px solid var(--md-primary);
    outline-offset: 3px;
    border-radius: var(--shape-xs);
}

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 200;
    background: var(--md-primary); color: var(--md-on-primary);
    padding: var(--sp-3) var(--sp-4); border-radius: 0 0 var(--shape-m) 0;
    font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- type scale (Typography.kt) ---------- */
.display-l, .display-m, .display-s,
.headline-l, .headline-m, .headline-s,
h1, h2, h3 {
    font-family: Oswald, "Arial Narrow", system-ui, sans-serif;
    margin: 0;
}

.display-l { font-size: 50px; line-height: 64px; font-weight: 600; letter-spacing: 0; }
.display-m { font-size: 40px; line-height: 52px; font-weight: 600; letter-spacing: 0; }
.display-s { font-size: 32px; line-height: 44px; font-weight: 600; letter-spacing: 0; }
.headline-l { font-size: 28px; line-height: 40px; font-weight: 500; letter-spacing: .15px; }
.headline-m { font-size: 25px; line-height: 36px; font-weight: 500; letter-spacing: .15px; }
.headline-s { font-size: 21px; line-height: 32px; font-weight: 500; letter-spacing: .15px; }
.title-l { font-family: Oswald, sans-serif; font-size: 19px; line-height: 28px; font-weight: 500; letter-spacing: .2px; }
.title-m { font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: .1px; }
.title-s { font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: .1px; }
.body-l { font-size: 16px; line-height: 24px; font-weight: 400; letter-spacing: .15px; }
.body-m { font-size: 14px; line-height: 20px; font-weight: 400; letter-spacing: .1px; }
.body-s { font-size: 12px; line-height: 16px; font-weight: 400; letter-spacing: .2px; }
.label-l { font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: .1px; }
.label-m { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .3px; }
.label-s { font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: .4px; }

/* M3 Expressive "emphasized" = one weight step up at the same size */
.emphasized.display-l, .emphasized.display-m, .emphasized.display-s { font-weight: 700; }
.emphasized.headline-l, .emphasized.headline-m, .emphasized.headline-s,
.emphasized.title-l, .emphasized.title-m, .emphasized.label-l { font-weight: 600; }
.emphasized.body-l, .emphasized.body-m { font-weight: 500; }

.muted { color: var(--md-on-surface-variant); }

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--gf-max); margin: 0 auto; padding: 0 var(--sp-6); }

/* Generous vertical rhythm — sections get room to breathe, and each one opens
   with a big left-aligned statement rather than a centred caption. */
.section { padding: 136px 0; position: relative; }
.section-tint { background: var(--md-surface-container-low); }

.section-head { max-width: 860px; margin-bottom: 88px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.eyebrow {
    font-size: 12px; line-height: 16px; font-weight: 700;
    letter-spacing: 1.6px; text-transform: uppercase;
    color: var(--md-primary); margin: 0 0 var(--sp-3);
}

.section-title {
    font-size: clamp(36px, 5.4vw, 58px);
    line-height: 1.04; font-weight: 600; letter-spacing: -.5px;
}
.section-sub {
    margin: var(--sp-6) 0 0;
    font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55;
    color: var(--md-on-surface-variant); max-width: 54ch;
}
.section-head.center .section-sub { margin-left: auto; margin-right: auto; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
    padding: 14px 26px;
    border-radius: var(--shape-full);      /* CircleShape is the app's house style */
    border: none; cursor: pointer;
    font-family: Montserrat, sans-serif; font-size: 15px; font-weight: 600; letter-spacing: .1px;
    text-decoration: none; white-space: nowrap;
    transition: transform 180ms var(--gf-spring), box-shadow 180ms var(--gf-ease),
                background-color 180ms var(--gf-ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-filled { background: var(--md-primary); color: var(--md-on-primary); box-shadow: var(--gf-shadow-1); }
.btn-filled:hover { box-shadow: var(--gf-shadow-2); }

.btn-tonal { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.btn-outlined { background: transparent; color: var(--md-on-surface); border: 1px solid var(--md-outline); }
.btn-outlined:hover { background: color-mix(in srgb, var(--md-on-surface) 6%, transparent); }

/* ---------- nav ---------- */
.nav {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--md-surface) 82%, transparent);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid transparent;
    transition: border-color 200ms var(--gf-ease), background-color var(--gf-motion) var(--gf-ease);
}
.nav.scrolled { border-bottom-color: var(--md-outline-variant); }

.nav-inner { display: flex; align-items: center; gap: var(--sp-4); height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; margin-right: auto; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand span { font-family: Oswald, sans-serif; font-size: 22px; font-weight: 600; letter-spacing: .2px; }

.nav-links { display: flex; gap: var(--sp-1); list-style: none; margin: 0; padding: 0; }
.nav-links a {
    display: block; padding: 8px 14px; border-radius: var(--shape-full);
    color: var(--md-on-surface-variant); text-decoration: none;
    font-size: 14px; font-weight: 500;
    transition: background-color 160ms var(--gf-ease), color 160ms var(--gf-ease);
}
.nav-links a:hover { background: var(--md-surface-container-high); color: var(--md-on-surface); }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 42px; height: 42px; flex: none;
    border-radius: var(--shape-full); border: 1px solid var(--md-outline-variant);
    background: transparent; color: var(--md-on-surface-variant); cursor: pointer;
    transition: background-color 160ms var(--gf-ease), color 160ms var(--gf-ease);
}
.icon-btn:hover { background: var(--md-surface-container-high); color: var(--md-on-surface); }
.icon-btn svg { width: 20px; height: 20px; }
:root[data-theme="dark"] .icon-sun, .icon-moon { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-sun { display: none; }
    :root:not([data-theme="light"]) .icon-moon { display: block; }
}
:root[data-theme="light"] .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: none; }

/* ---------- hero ---------- */
.hero {
    position: relative;
    display: flex; align-items: center;
    min-height: min(760px, 92vh);
    padding: 96px 0 104px;
    overflow: hidden;
}

.hero-inner { position: relative; z-index: 3; }

.hero-copy { position: relative; max-width: 620px; }
/* A soft blurred pool under the copy, so the lanes read as depth rather than
   noise behind the type. The mask has to live on the wrapper and the
   backdrop-filter on its child — masking the filtered element directly leaves
   a hard rectangle where the backdrop is composited. */
.hero-pool {
    position: absolute; z-index: -1;
    inset: -12% -20% -14% -28%;
    pointer-events: none;
    -webkit-mask-image: radial-gradient(112% 86% at 34% 50%, #000 38%, transparent 78%);
    mask-image: radial-gradient(112% 86% at 34% 50%, #000 38%, transparent 78%);
}
.hero-pool::before {
    content: ""; position: absolute; inset: 0;
    backdrop-filter: blur(20px) saturate(1.05);
    -webkit-backdrop-filter: blur(20px) saturate(1.05);
}

.hero h1 {
    font-size: clamp(44px, 7vw, 78px);
    line-height: 1.04; font-weight: 700; letter-spacing: -.5px;
    margin: 0 0 var(--sp-4);
}
.hero h1 .accent {
    background: var(--gf-plan-ramp);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: clamp(18px, 2.2vw, 21px); line-height: 1.5; color: var(--md-on-surface-variant); margin: 0 0 var(--sp-3); max-width: 34ch; }
.hero-body { font-size: 16px; line-height: 26px; color: var(--md-on-surface-variant); margin: 0 0 var(--sp-8); max-width: 46ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }

/* ---------- hero screen flow ----------
   Three chains of screens laid head to tail and drifting along their own long
   axis — bottom right to top left — on a plane rotated so they run off the
   corners. The plane's rotation is the phones' tilt, and travel is along the
   plane's -y, so each screen leads with its top edge. The chains sit at
   different depths: the middle one is sharp, the outer two are blurred back
   and dimmed, which reads as depth of field rather than clutter. */
.hero-flow {
    position: absolute; inset: 0; z-index: 1;
    pointer-events: none; overflow: hidden;
    /* Fade the chains out towards every edge of the hero. */
    -webkit-mask-image: radial-gradient(108% 82% at 64% 46%, #000 34%, rgba(0, 0, 0, .55) 64%, transparent 90%);
    mask-image: radial-gradient(108% 82% at 64% 46%, #000 34%, rgba(0, 0, 0, .55) 64%, transparent 90%);
}
.flow-track {
    --shot-w: clamp(118px, 12.2vw, 184px);
    --shot-gap: clamp(14px, 1.7vw, 24px);
    --shot-h: calc(var(--shot-w) * 2968 / 1410);
    /* One chain repeat: five screens plus the gap that follows each. */
    --shift: calc(5 * (var(--shot-h) + var(--shot-gap)));

    position: absolute; top: 50%; left: 58%;
    display: flex; gap: var(--shot-gap);
    transform: translate(-50%, -50%) rotate(-28deg);
    transform-origin: 50% 50%;
}
.flow-row {
    display: flex; flex-direction: column; gap: var(--shot-gap);
    height: max-content;
    will-change: transform;
    animation: flow-drift var(--speed, 120s) linear infinite;
}
.flow-set { display: flex; flex-direction: column; gap: var(--shot-gap); flex: none; }

/* Chain depths — the middle chain is the subject, the outer ones fall back. */
.flow-row-1 { --speed: 168s; filter: blur(5px);   opacity: .38; transform: scale(.88); }
.flow-row-2 { --speed: 122s; filter: blur(2.5px); opacity: .62; transform: scale(.94); }
.flow-row-3 { --speed:  96s; filter: blur(0);     opacity: .96; }
.flow-row-4 { --speed: 140s; filter: blur(2px);   opacity: .68; transform: scale(.95); }
.flow-row-5 { --speed: 190s; filter: blur(4px);   opacity: .44; transform: scale(.9); }

@keyframes flow-drift {
    from { translate: 0 0; }
    to   { translate: 0 calc(var(--shift) * -1); }
}

.flow-shot {
    flex: none;
    width: var(--shot-w);
    height: var(--shot-h);
    border-radius: clamp(10px, 1.1vw, 16px);
    overflow: hidden;
    background: var(--md-surface-container);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
    outline: 1px solid rgba(255, 255, 255, .06);
    outline-offset: -1px;
}
.flow-shot img {
    display: block; width: 100%; height: 100%;
    object-fit: cover; object-position: 50% 0;
}

/* The veil ties the chains back into the page: solid under the copy on the
   left, and feathered into the section edges top and bottom. */
.hero-veil {
    position: absolute; inset: 0; z-index: 2;
    pointer-events: none;
    background:
        linear-gradient(100deg,
            rgb(var(--gf-surface-rgb)) 0%,
            rgba(var(--gf-surface-rgb), .97) 30%,
            rgba(var(--gf-surface-rgb), .74) 45%,
            rgba(var(--gf-surface-rgb), .34) 60%,
            rgba(var(--gf-surface-rgb), 0) 80%),
        linear-gradient(180deg,
            rgb(var(--gf-surface-rgb)) 0%,
            rgba(var(--gf-surface-rgb), 0) 16%,
            rgba(var(--gf-surface-rgb), 0) 78%,
            rgb(var(--gf-surface-rgb)) 100%);
}

@media (prefers-reduced-motion: reduce) {
    .flow-row { animation: none; }
}

/* ---------- store badges (official artwork) ---------- */
.store-badges { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-start; }
.store-badge {
    position: relative; display: inline-block; text-decoration: none;
    border-radius: 7px; line-height: 0;
    transition: transform 240ms var(--gf-spring), filter 240ms var(--gf-ease);
}
.store-badge img { width: 156px; height: auto; }
a.store-badge:hover { transform: translateY(-3px) scale(1.02); }
.store-badge em {
    position: absolute; top: -9px; right: -8px;
    padding: 2px 9px; border-radius: var(--shape-full);
    background: var(--md-primary); color: var(--md-on-primary);
    font-family: Montserrat, sans-serif; font-style: normal;
    font-size: 10px; font-weight: 700; letter-spacing: .4px; line-height: 16px;
    box-shadow: var(--gf-shadow-1);
}
.store-badge.is-soon { cursor: default; }
.store-badge.is-soon img { filter: grayscale(.35); opacity: .78; }

/* ---------- expressive icon tiles (ExpressiveIconTile.kt) ---------- */
.tile { position: relative; width: 52px; height: 52px; flex: none; display: grid; place-items: center; }
.tile svg.tile-shape { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile .tile-glyph { position: relative; width: 24px; height: 24px; }

/* ---------- features ---------- */
.features-list { counter-reset: feature; }

.feature {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 88px; align-items: center;
    padding: 88px 0;
    counter-increment: feature;
}
.feature + .feature { border-top: 1px solid var(--md-outline-variant); }
.feature:nth-child(even) .feature-media { order: -1; }

/* A running number gives the list a spine, the way Wise numbers its steps. */
.feature > div:first-child::before {
    content: counter(feature, decimal-leading-zero);
    display: block;
    font-family: Oswald, sans-serif;
    font-size: 13px; font-weight: 600; letter-spacing: 2px;
    color: var(--md-primary);
    margin-bottom: var(--sp-4);
}

.feature-head { display: flex; align-items: center; gap: var(--sp-4); margin-bottom: var(--sp-6); }
.feature h3 {
    font-size: clamp(28px, 3.8vw, 42px);
    line-height: 1.06; font-weight: 600; letter-spacing: -.3px;
}
.feature p {
    margin: 0; font-size: 17px; line-height: 29px;
    color: var(--md-on-surface-variant); max-width: 52ch;
}

.feature-rank {
    display: inline-flex; align-items: center; gap: 6px;
    margin-bottom: var(--sp-4);
    padding: 5px 13px; border-radius: var(--shape-full);
    background: var(--md-primary-container); color: var(--md-on-primary-container);
    font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase;
}

/* ---------- feature device: one static screenshot per feature ----------
   The Android captures ship with their own device frame; the iOS ones are
   cropped to the phone body, so both are sized by width and read as the same
   physical device. */
.feature-media { display: grid; place-items: center; }

.device { position: relative; margin: 0; width: min(248px, 62vw); }
.device img {
    width: 100%;
    filter: drop-shadow(0 24px 48px rgba(0, 0, 0, .28));
    transition: transform 640ms var(--gf-spring), filter 520ms var(--gf-ease);
}
@media (prefers-reduced-motion: reduce) {
    .device img { transition: none; }
}

/* ---------- detail chips ---------- */
.details-section { padding-top: 48px; padding-bottom: 72px; }
.details-section .section-head { margin-bottom: 40px; }

.chips { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: center; }
.chip {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    padding: 12px 22px; border-radius: var(--shape-full);
    background: var(--md-secondary-container); color: var(--md-on-secondary-container);
    font-size: 14px; font-weight: 600;
    box-shadow: var(--gf-shadow-1);
}
.chip svg { width: 17px; height: 17px; transition: transform 420ms var(--gf-spring); }
.chip.accent { background: var(--md-primary-container); color: var(--md-on-primary-container); }

/* Chips run their own entrance instead of the generic [data-reveal] transform:
   the idle float also writes `transform`, and an animation always beats a plain
   declaration, so the two cannot share the property. The float is delayed until
   the pop-in has finished, then it takes over. */
.chip[data-reveal] { opacity: 0; transform: none; transition: none; animation: none; }
.chip[data-reveal].in {
    animation:
        chip-in 700ms var(--gf-spring) calc(var(--i, 0) * 70ms) both,
        chip-float 5.6s var(--gf-ease) calc(700ms + var(--i, 0) * 70ms) infinite;
}
.chip[data-reveal].in:nth-child(even) {
    animation:
        chip-in 700ms var(--gf-spring) calc(var(--i, 0) * 70ms) both,
        chip-float-alt 6.4s var(--gf-ease) calc(700ms + var(--i, 0) * 70ms) infinite;
}

@keyframes chip-in {
    from { opacity: 0; transform: translateY(26px) scale(.88); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes chip-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-7px) rotate(-.7deg); }
}
@keyframes chip-float-alt {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-5px) rotate(.8deg); }
}

.chip:hover {
    animation-play-state: paused;
    box-shadow: var(--gf-shadow-2);
    background: var(--md-secondary);
    color: var(--md-on-secondary);
}
.chip.accent:hover { background: var(--md-primary); color: var(--md-on-primary); }
.chip:hover svg { transform: rotate(-12deg) scale(1.18); }

@media (prefers-reduced-motion: reduce) {
    .chip[data-reveal], .chip[data-reveal].in, .chip:hover { animation: none; opacity: 1; transform: none; }
}

/* ---------- statement + CTA panels ----------
   Wise breaks its page rhythm with full-bleed rounded colour blocks. The fill
   here is the app's own active-plan gradient, so the device is quoting itself. */
.panel-wrap { padding: 0 0 136px; }

.statement {
    position: relative; overflow: hidden;
    border-radius: 40px;
    background: var(--gf-plan-ramp);
    color: #FFFFFF;
    padding: clamp(64px, 9vw, 120px) var(--sp-8);
    text-align: center;
}
.statement h2 {
    position: relative; z-index: 1;
    font-size: clamp(38px, 7vw, 82px);
    line-height: .98; font-weight: 700; letter-spacing: -1px;
    text-transform: uppercase;
    margin: 0 auto; max-width: 16ch;
}
.statement p {
    position: relative; z-index: 1;
    margin: var(--sp-6) auto 0; max-width: 46ch;
    font-size: clamp(16px, 1.5vw, 19px); line-height: 1.6;
    color: rgba(255, 255, 255, .88);
}
/* a single expressive polygon, ghosted into the corner */
.statement svg {
    position: absolute; z-index: 0;
    width: 460px; height: 460px;
    right: -140px; bottom: -190px;
    opacity: .10; fill: #FFFFFF;
}

.cta-panel {
    border-radius: 40px;
    background: var(--md-surface-container);
    border: 1px solid var(--md-outline-variant);
    padding: clamp(56px, 8vw, 104px) var(--sp-8);
    text-align: center;
}
.cta-panel h2 {
    font-size: clamp(32px, 5.4vw, 60px);
    line-height: 1.02; font-weight: 700; letter-spacing: -.6px;
    text-transform: uppercase;
    margin: 0 auto; max-width: 18ch;
}
.cta-panel p {
    margin: var(--sp-6) auto var(--sp-8); max-width: 44ch;
    font-size: 17px; line-height: 1.6; color: var(--md-on-surface-variant);
}
.cta-panel .store-badges { justify-content: center; }

@media (max-width: 560px) {
    .statement, .cta-panel { border-radius: 28px; }
    .panel-wrap { padding-bottom: 72px; }
}

/* ---------- support form ---------- */
.form-card {
    max-width: 620px; margin: 0 auto;
    background: var(--md-surface-container); border-radius: var(--shape-xl);
    padding: 40px; box-shadow: var(--gf-shadow-1);
}
.field { margin-bottom: var(--sp-6); }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: var(--sp-2); color: var(--md-on-surface-variant); }

.field input, .field textarea {
    width: 100%; font-family: Montserrat, sans-serif; font-size: 16px; line-height: 24px;
    color: var(--md-on-surface);
    background: var(--md-surface-container-highest);
    border: none; border-bottom: 2px solid var(--md-outline);
    border-radius: var(--shape-xs) var(--shape-xs) 0 0;
    padding: 15px 16px;
    transition: border-color 160ms var(--gf-ease), background-color 160ms var(--gf-ease);
}
.field textarea { min-height: 148px; resize: vertical; }
.field input:focus, .field textarea:focus {
    outline: none; border-bottom-color: var(--md-primary);
    background: var(--md-surface-container-high);
}
.field input:focus-visible, .field textarea:focus-visible { outline: none; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-bottom-color: var(--md-error); }
.field .err { display: none; margin-top: 6px; font-size: 12px; color: var(--md-error); font-weight: 500; }
.field input[aria-invalid="true"] ~ .err, .field textarea[aria-invalid="true"] ~ .err { display: block; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin-top: var(--sp-4); font-size: 14px; font-weight: 600; min-height: 20px; }
.form-status.ok { color: var(--md-tertiary); }
.form-status.bad { color: var(--md-error); }

.form-alt {
    margin: var(--sp-6) 0 0;
    padding-top: var(--sp-6);
    border-top: 1px solid var(--md-outline-variant);
    text-align: center;
    font-size: 14px; color: var(--md-on-surface-variant);
}
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* ---------- footer ---------- */
.footer { background: var(--md-surface-container-low); border-top: 1px solid var(--md-outline-variant); padding: 64px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer h4 { font-family: Montserrat, sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--md-on-surface-variant); margin: 0 0 var(--sp-4); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer ul a { color: var(--md-on-surface-variant); text-decoration: none; font-size: 14px; }
.footer ul a:hover { color: var(--md-on-surface); text-decoration: underline; }
.footer-bottom {
    border-top: 1px solid var(--md-outline-variant); padding-top: var(--sp-6);
    display: flex; flex-wrap: wrap; gap: var(--sp-4); justify-content: space-between;
    font-size: 12px; line-height: 19px; color: var(--md-on-surface-variant);
}
.footer-bottom p { margin: 0; }

.todo {
    display: inline-block; padding: 1px 8px; border-radius: var(--shape-xs);
    background: var(--md-error-container); color: var(--md-on-error-container);
    font-size: 11px; font-weight: 700; letter-spacing: .3px;
}

/* ---------- scroll reveal: spring physics, staggered ----------
   Sections settle rather than fade: they overshoot slightly and come to rest,
   using the same spring feel as the app's expressive motion. */
[data-reveal] {
    opacity: 0;
    transform: translate3d(0, 34px, 0) scale(.965);
    transition:
        opacity 520ms var(--gf-ease),
        transform 820ms var(--gf-spring);
    transition-delay: calc(var(--i, 0) * 65ms);
    will-change: transform, opacity;
}
[data-reveal].in {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}
/* release the compositor hint once the element has settled */
[data-reveal].in { will-change: auto; }

/* Feature blocks arrive from the side they sit on, so the copy and the device
   converge on the centre line instead of the row sliding up as one slab. */
[data-reveal].from-left  { transform: translate3d(-34px, 20px, 0) scale(.97); }
[data-reveal].from-right { transform: translate3d(34px, 20px, 0) scale(.97); }
.feature:nth-child(even) [data-reveal].from-left  { transform: translate3d(34px, 20px, 0) scale(.97); }
.feature:nth-child(even) [data-reveal].from-right { transform: translate3d(-34px, 20px, 0) scale(.97); }
[data-reveal].from-left.in, [data-reveal].from-right.in,
.feature:nth-child(even) [data-reveal].from-left.in,
.feature:nth-child(even) [data-reveal].from-right.in { transform: translate3d(0, 0, 0) scale(1); }

@media (prefers-reduced-motion: reduce) {
    [data-reveal], [data-reveal].from-left, [data-reveal].from-right,
    .feature:nth-child(even) [data-reveal].from-left,
    .feature:nth-child(even) [data-reveal].from-right {
        opacity: 1; transform: none; transition: none;
    }
}

/* ---------- legal pages ---------- */
.legal { max-width: 780px; margin: 0 auto; padding: 72px var(--sp-6) 96px; }
.legal h1 { font-size: clamp(32px, 5vw, 46px); line-height: 1.12; font-weight: 600; margin-bottom: var(--sp-4); }
.legal h2 {
    font-size: clamp(21px, 2.8vw, 27px); line-height: 1.25; font-weight: 600;
    margin: 56px 0 var(--sp-4); padding-top: var(--sp-6);
    border-top: 1px solid var(--md-outline-variant);
}
.legal h3 { font-size: 19px; line-height: 1.3; font-weight: 500; margin: 34px 0 var(--sp-3); color: var(--md-on-surface); }
.legal p, .legal li { font-size: 16px; line-height: 28px; color: var(--md-on-surface-variant); }
.legal strong { color: var(--md-on-surface); font-weight: 600; }
.legal ul { padding-left: 22px; display: grid; gap: 10px; }
.legal a { color: var(--md-tertiary); }

.legal-meta {
    display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center;
    margin-bottom: var(--sp-6);
}
.legal-lead {
    background: var(--md-surface-container); border-radius: var(--shape-l);
    padding: var(--sp-6); margin-bottom: var(--sp-6);
}
.legal-lead p:last-child { margin-bottom: 0; }

.legal table { width: 100%; border-collapse: collapse; margin: var(--sp-6) 0; font-size: 15px; }
.legal thead th {
    text-align: left; padding: 12px 14px; background: var(--md-surface-container-high);
    color: var(--md-on-surface); font-weight: 600; font-size: 13px;
    letter-spacing: .4px; text-transform: uppercase;
}
.legal thead th:first-child { border-radius: var(--shape-s) 0 0 0; }
.legal thead th:last-child { border-radius: 0 var(--shape-s) 0 0; }
.legal tbody td { padding: 14px; border-bottom: 1px solid var(--md-outline-variant); color: var(--md-on-surface-variant); line-height: 24px; }
.table-wrap { overflow-x: auto; }

.callout {
    border-left: 4px solid var(--md-primary);
    background: var(--md-primary-container); color: var(--md-on-primary-container);
    border-radius: 0 var(--shape-m) var(--shape-m) 0;
    padding: var(--sp-4) var(--sp-6); margin: var(--sp-6) 0;
}
.callout p { color: inherit; margin: 0; }

.back-link {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    margin-bottom: var(--sp-6); text-decoration: none;
    color: var(--md-on-surface-variant); font-size: 14px; font-weight: 600;
}
.back-link:hover { color: var(--md-on-surface); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
    .section { padding: 96px 0; }
    .section-head { margin-bottom: 56px; }
    .feature { padding: 56px 0; }
    /* Copy centres up, so the lanes read as a full-bleed backdrop and the
       veil becomes a wash from the middle out instead of left to right. */
    .hero-copy { max-width: 640px; margin: 0 auto; text-align: center; }
    .hero-pool {
        inset: -6% -14%;
        -webkit-mask-image: radial-gradient(96% 76% at 50% 50%, #000 26%, transparent 84%);
        mask-image: radial-gradient(96% 76% at 50% 50%, #000 26%, transparent 84%);
    }
    .hero-pool::before {
        backdrop-filter: blur(14px) saturate(1.05);
        -webkit-backdrop-filter: blur(14px) saturate(1.05);
    }
    .hero-sub, .hero-body { margin-left: auto; margin-right: auto; }
    .hero-actions, .badges { justify-content: center; }
    .flow-track { left: 50%; }
    .hero-flow {
        -webkit-mask-image: radial-gradient(110% 80% at 50% 46%, #000 30%, rgba(0, 0, 0, .55) 64%, transparent 92%);
        mask-image: radial-gradient(110% 80% at 50% 46%, #000 30%, rgba(0, 0, 0, .55) 64%, transparent 92%);
    }
    .hero-veil {
        background:
            radial-gradient(78% 52% at 50% 50%,
                rgba(var(--gf-surface-rgb), .96) 0%,
                rgba(var(--gf-surface-rgb), .78) 48%,
                rgba(var(--gf-surface-rgb), 0) 82%),
            linear-gradient(180deg,
                rgb(var(--gf-surface-rgb)) 0%,
                rgba(var(--gf-surface-rgb), 0) 20%,
                rgba(var(--gf-surface-rgb), 0) 76%,
                rgb(var(--gf-surface-rgb)) 100%);
    }
    .feature { grid-template-columns: 1fr; gap: 36px; }
    .feature:nth-child(even) .feature-media { order: 0; }
    .feature-head { justify-content: flex-start; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
    .nav-links { display: none; }
}

@media (max-width: 560px) {
    /* A narrow viewport only fits the chains at their smallest, so ease the
       tilt back to keep all three on screen. */
    .flow-track {
        --shot-w: 94px; --shot-gap: 12px;
        left: 54%; transform: translate(-50%, -50%) rotate(-24deg);
    }
    .flow-row-1 { filter: blur(3.5px); }
    .flow-row-5 { filter: blur(3px); }
    [data-reveal].from-left, [data-reveal].from-right,
    .feature:nth-child(even) [data-reveal].from-left,
    .feature:nth-child(even) [data-reveal].from-right {
        transform: translate3d(0, 24px, 0) scale(.98);
    }
    .section { padding: 56px 0; }
    .container { padding: 0 var(--sp-4); }
    .form-card { padding: var(--sp-6); border-radius: var(--shape-l); }
    .footer-grid { grid-template-columns: 1fr; }
    .legal { padding: 48px var(--sp-4) 72px; }
    .hero { padding: 48px 0 64px; }
}

@media print {
    .nav, .hero-flow, .hero-veil, .footer { display: none; }
    body { background: #fff; color: #000; }
}
