/* ==========================================================================
   NestMind website — one stylesheet for all five pages.

   Principles: system type, an 8‑pt rhythm, one brand red used sparingly,
   the app's dotted paper as the page itself (light and dark follow the
   system), real captures in simple device frames.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */

:root {
    color-scheme: light dark;

    /* Page: the Home hub's cream paper with a 20px dot grid */
    --page: #f3efe9;
    --dot: rgba(0, 0, 0, 0.1);

    /* Lifted surfaces */
    --surface: #ffffff;
    --surface-2: #faf8f4;
    --line: rgba(0, 0, 0, 0.08);
    --line-strong: rgba(0, 0, 0, 0.14);

    /* Ink */
    --ink: #1d1b19;
    --ink-2: #5e5a55;
    --ink-3: #8a857f;

    /* Brand red: fills stay system red; red text is darker for AA on cream */
    --red: #ff3b30;
    --red-hover: #e6352b;
    --red-ink: #c0261e;
    --red-soft: rgba(255, 59, 48, 0.1);

    --bezel: #121212;
    --on-red: #ffffff;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
    --shadow-phone: 0 1px 2px rgba(0, 0, 0, 0.12), 0 28px 56px -20px rgba(0, 0, 0, 0.35);
    --shadow-widget: 0 12px 32px -12px rgba(0, 0, 0, 0.35);

    /* Stage: the app's paper, as a backdrop for widgets and the Dynamic Island */
    --stage: #f0ebe3;
    --stage-glow: rgba(255, 59, 48, 0.09);

    /* Spacing (8‑pt grid) */
    --s1: 8px;
    --s2: 16px;
    --s3: 24px;
    --s4: 32px;
    --s5: 48px;
    --s6: 64px;
    --s7: 96px;
    --s8: 128px;

    /* Type scale */
    --t-xs: 13px;
    --t-sm: 15px;
    --t-base: 17px;
    --t-lg: 20px;
    --t-xl: 24px;
    --t-2xl: 32px;
    --t-3xl: 44px;
    --t-4xl: 60px;

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
        "Helvetica Neue", "Inter", "Segoe UI", Roboto, sans-serif;

    --container: 1120px;
    --gutter: 20px;
    --measure: 60ch;
    --radius: 16px;
    --radius-lg: 24px;
    --nav-h: 60px;

    --ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --page: #252525;
        --dot: rgba(255, 255, 255, 0.08);
        --surface: #2e2d2c;
        --surface-2: #363534;
        --line: rgba(255, 255, 255, 0.08);
        --line-strong: rgba(255, 255, 255, 0.18);
        --ink: #f5f5f5;
        --ink-2: #b6b2ad;
        --ink-3: #8b8782;
        --red-ink: #ff5c56;
        --red-soft: rgba(255, 92, 86, 0.14);
        --bezel: #0c0c0c;
        --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
        --shadow-phone: 0 1px 2px rgba(0, 0, 0, 0.5), 0 28px 56px -20px rgba(0, 0, 0, 0.7);
        --shadow-widget: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
        --stage: #3a3836;
        --stage-glow: rgba(255, 92, 86, 0.12);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
        --page: #252525;
        --dot: rgba(255, 255, 255, 0.08);
        --surface: #2e2d2c;
        --surface-2: #363534;
        --line: rgba(255, 255, 255, 0.08);
        --line-strong: rgba(255, 255, 255, 0.18);
        --ink: #f5f5f5;
        --ink-2: #b6b2ad;
        --ink-3: #8b8782;
        --red-ink: #ff5c56;
        --red-soft: rgba(255, 92, 86, 0.14);
        --bezel: #0c0c0c;
        --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
        --shadow-phone: 0 1px 2px rgba(0, 0, 0, 0.5), 0 28px 56px -20px rgba(0, 0, 0, 0.7);
        --shadow-widget: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
        --stage: #3a3836;
        --stage-glow: rgba(255, 92, 86, 0.12);
    color-scheme: dark;
}

@media (min-width: 768px) {
    :root {
        --gutter: 32px;
    }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--t-base);
    line-height: 1.5;
    color: var(--ink);
    background-color: var(--page);
    /* The app's dot grid: 2.4px dots every 20px, first dot at (10, 10) */
    background-image: radial-gradient(circle, var(--dot) 1.2px, transparent 1.6px);
    background-size: 20px 20px;
    background-position: 0 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.nav-open {
    overflow: hidden;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-wrap: balance;
}

p {
    margin: 0;
}

a {
    color: var(--red-ink);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

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

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

strong {
    font-weight: 600;
    color: var(--ink);
}

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

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.container-narrow {
    max-width: 760px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Type helpers
   -------------------------------------------------------------------------- */

.eyebrow {
    display: block;
    margin-bottom: var(--s2);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--red-ink);
}

.lead {
    font-size: var(--t-lg);
    line-height: 1.5;
    color: var(--ink-2);
    max-width: var(--measure);
}

.muted {
    color: var(--ink-3);
}

.section-head {
    max-width: 640px;
    margin: 0 auto var(--s5);
    text-align: center;
}

.section-head h2 {
    font-size: var(--t-2xl);
    margin-bottom: var(--s2);
}

.section-head p {
    font-size: var(--t-lg);
    color: var(--ink-2);
}

@media (min-width: 768px) {
    .section-head h2 {
        font-size: 40px;
    }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s1);
    height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-size: var(--t-sm);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition:
        background-color 160ms var(--ease),
        border-color 160ms var(--ease),
        transform 160ms var(--ease);
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--red);
    color: var(--on-red);
}

.btn-primary:hover {
    background-color: var(--red-hover);
    color: var(--on-red);
}

.btn-secondary {
    background-color: var(--surface);
    border-color: var(--line-strong);
    color: var(--ink);
}

.btn-secondary:hover {
    background-color: var(--surface-2);
    color: var(--ink);
}

.btn-lg {
    height: 52px;
    padding: 0 28px;
    font-size: var(--t-base);
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
    align-items: center;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    background-color: color-mix(in srgb, var(--page) 82%, transparent);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-h);
    gap: var(--s3);
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: var(--t-base);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.nav-logo:hover {
    text-decoration: none;
}

.nav-logo img {
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--s3);
}

.nav-link {
    font-size: var(--t-sm);
    font-weight: 500;
    color: var(--ink-2);
    padding: 6px 2px;
}

.nav-link:hover {
    color: var(--ink);
    text-decoration: none;
}

.nav-link.active {
    color: var(--ink);
}

.nav-cta {
    margin-left: var(--s1);
    height: 36px;
    padding: 0 16px;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.nav-toggle-bar {
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background-color: var(--ink);
    transition: transform 200ms var(--ease), opacity 200ms var(--ease);
}

.nav-backdrop {
    display: none;
}

@media (max-width: 767px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: var(--nav-h);
        left: 0;
        right: 0;
        z-index: 100;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: var(--s1) var(--gutter) var(--s3);
        background-color: var(--page);
        border-bottom: 1px solid var(--line);
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition:
            opacity 180ms var(--ease),
            transform 180ms var(--ease),
            visibility 0s linear 180ms;
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        transition-delay: 0s;
    }

    .nav-link {
        font-size: var(--t-base);
        padding: 14px 0;
        border-bottom: 1px solid var(--line);
    }

    .nav-cta {
        margin: var(--s2) 0 0;
        height: 44px;
        justify-content: center;
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: var(--nav-h) 0 0;
        z-index: 90;
        background-color: rgba(0, 0, 0, 0.25);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms var(--ease);
    }

    body.nav-open .nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}

/* --------------------------------------------------------------------------
   Device frames
   -------------------------------------------------------------------------- */

.phone {
    position: relative;
    width: 100%;
    max-width: var(--phone-w, 300px);
    margin: 0 auto;
    padding: 9px;
    border-radius: 15.5%/7.1%;
    background-color: var(--bezel);
    box-shadow: var(--shadow-phone);
}

.phone img {
    width: 100%;
    border-radius: 13%/6%;
    background-color: var(--surface);
}

.phone-sm {
    --phone-w: 240px;
}

.phone-lg {
    --phone-w: 320px;
}

/* Two phones side by side (light + dark) */
.pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s2);
    align-items: end;
    max-width: 560px;
    margin: 0 auto;
}

.pair .phone {
    --phone-w: 100%;
    margin: 0;
}

.pair figcaption,
.phone-caption {
    margin-top: var(--s2);
    font-size: var(--t-xs);
    font-weight: 500;
    text-align: center;
    color: var(--ink-3);
}

figure {
    margin: 0;
}

/* Flat captures (widgets, Dynamic Island, controls) */
.capture {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-widget);
}

.capture img {
    width: 100%;
}

/* Stage: a widget or Dynamic Island capture (cropped to its own rounded shape,
   transparent corners) on a soft piece of the app's dotted paper */
.stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: clamp(16px, 6%, 28px);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background-color: var(--stage);
    background-image:
        radial-gradient(90% 80% at 12% 0%, var(--stage-glow), transparent 65%),
        radial-gradient(circle, var(--dot) 1.2px, transparent 1.6px);
    background-size: 100% 100%, 20px 20px;
    background-position: 0 0, 10px 10px;
}

.stage img {
    width: 100%;
    box-shadow: var(--shadow-widget);
}

/* Each capture's own corner radius, as a ratio so it scales with the image */
.stage-widget img {
    max-width: 480px;
    border-radius: 7.4%/15.8%;
}

.stage-square img {
    max-width: 200px;
    border-radius: 14.8%;
}

.stage-pill img {
    max-width: 320px;
    border-radius: 999px;
}

.stage-island img {
    max-width: 480px;
    border-radius: 13.6%/34.6%;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
    padding: var(--s6) 0 var(--s6);
}

.hero-grid {
    display: grid;
    gap: var(--s5);
    align-items: center;
}

.hero h1 {
    font-size: 40px;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: var(--s3);
}

.hero h1 em {
    font-style: normal;
    color: var(--red-ink);
}

.hero .lead {
    margin-bottom: var(--s4);
}

.hero-note {
    margin-top: var(--s2);
    font-size: var(--t-sm);
    color: var(--ink-3);
}

.hero-note strong {
    color: var(--ink-2);
    font-weight: 500;
}

.hero-media {
    order: -1;
}

@media (min-width: 900px) {
    .hero {
        padding: var(--s7) 0 var(--s7);
    }

    .hero-grid {
        grid-template-columns: 1.15fr 0.85fr;
        gap: var(--s6);
    }

    .hero h1 {
        font-size: var(--t-4xl);
    }

    .hero-media {
        order: 0;
        justify-self: end;
    }
}

/* Centered page hero (features, vision) */
.hero-centered {
    padding: var(--s6) 0 var(--s4);
    text-align: center;
}

.hero-centered h1 {
    font-size: 36px;
    letter-spacing: -0.03em;
    margin: 0 auto var(--s3);
    max-width: 18ch;
}

.hero-centered .lead {
    margin: 0 auto;
    max-width: 52ch;
}

@media (min-width: 768px) {
    .hero-centered {
        padding: var(--s7) 0 var(--s5);
    }

    .hero-centered h1 {
        font-size: 52px;
    }
}

/* --------------------------------------------------------------------------
   Trust strip
   -------------------------------------------------------------------------- */

.trust {
    padding: var(--s3) 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.trust ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--s1) var(--s4);
}

.trust li {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: var(--t-sm);
    font-weight: 500;
    color: var(--ink-2);
}

.trust li::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--red);
}

/* --------------------------------------------------------------------------
   Steps (How it works)
   -------------------------------------------------------------------------- */

.section {
    padding: var(--s6) 0;
}

@media (min-width: 768px) {
    .section {
        padding: var(--s7) 0;
    }
}

.steps {
    display: grid;
    gap: var(--s4);
    counter-reset: step;
}

.step {
    position: relative;
    padding-top: var(--s2);
    border-top: 1px solid var(--line-strong);
}

.step::before {
    counter-increment: step;
    content: "0" counter(step);
    display: block;
    margin-bottom: var(--s2);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--red-ink);
}

.step h3 {
    font-size: var(--t-lg);
    margin-bottom: var(--s1);
}

.step p {
    font-size: var(--t-sm);
    color: var(--ink-2);
}

@media (min-width: 600px) {
    .steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* --------------------------------------------------------------------------
   Feature rows (text + capture, alternating)
   -------------------------------------------------------------------------- */

.feature {
    padding: var(--s6) 0;
}

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

.feature-grid {
    display: grid;
    gap: var(--s5);
    align-items: center;
}

.feature-media {
    order: -1;
}

.feature-copy h2 {
    font-size: var(--t-2xl);
    margin-bottom: var(--s2);
}

.feature-copy > p {
    font-size: var(--t-base);
    line-height: 1.6;
    color: var(--ink-2);
    max-width: var(--measure);
}

.checklist {
    margin-top: var(--s3);
    display: grid;
    gap: 10px;
}

.checklist li {
    position: relative;
    padding-left: 28px;
    font-size: var(--t-base);
    line-height: 1.5;
    color: var(--ink-2);
}

.checklist li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.3em;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--red-soft);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.5l2.3 2.3L11.5 6' fill='none' stroke='%23c0261e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 16px;
}

@media (prefers-color-scheme: dark) {
    .checklist li::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.5l2.3 2.3L11.5 6' fill='none' stroke='%23ff5c56' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }
}

.quotes li {
    color: var(--ink);
    font-weight: 500;
}

.feature-link {
    display: inline-block;
    margin-top: var(--s3);
    font-size: var(--t-sm);
    font-weight: 600;
}

@media (min-width: 900px) {
    .feature {
        padding: var(--s7) 0;
    }

    .feature-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--s6);
    }

    .feature-media {
        order: 0;
    }

    .feature-flip .feature-media {
        order: -1;
    }

    .feature-copy h2 {
        font-size: 36px;
    }
}

/* --------------------------------------------------------------------------
   Showcase (widgets, Dynamic Island, Lock Screen, Control Center)
   -------------------------------------------------------------------------- */

.showcase {
    padding: var(--s6) 0;
    border-top: 1px solid var(--line);
}

@media (min-width: 768px) {
    .showcase {
        padding: var(--s7) 0;
    }
}

.tiles {
    display: grid;
    gap: var(--s2);
}

.tile {
    display: flex;
    flex-direction: column;
    gap: var(--s3);
    padding: var(--s3);
    border-radius: var(--radius-lg);
    background-color: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
}

.tile-media {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile h3 {
    font-size: var(--t-base);
    margin-bottom: 4px;
}

.tile p {
    font-size: var(--t-sm);
    line-height: 1.5;
    color: var(--ink-2);
}

.tile .phone {
    --phone-w: 220px;
}

.tile .capture {
    width: 100%;
}

.tile .capture-sm {
    max-width: 240px;
}

@media (min-width: 720px) {
    .tiles {
        grid-template-columns: repeat(3, 1fr);
    }

    .tile-wide {
        grid-column: span 2;
    }

    .tile-tall {
        grid-row: span 2;
    }

    .tile {
        padding: var(--s4);
    }
}

/* --------------------------------------------------------------------------
   Pricing
   -------------------------------------------------------------------------- */

.pricing {
    padding: var(--s6) 0;
    border-top: 1px solid var(--line);
}

.pricing-card {
    max-width: 640px;
    margin: 0 auto;
    padding: var(--s4);
    border-radius: var(--radius-lg);
    background-color: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    text-align: center;
}

.pricing-card h2 {
    font-size: var(--t-2xl);
    margin-bottom: var(--s2);
}

.pricing-card > p {
    font-size: var(--t-base);
    line-height: 1.6;
    color: var(--ink-2);
    max-width: 52ch;
    margin: 0 auto var(--s3);
}

.pricing-card .checklist {
    display: inline-grid;
    text-align: left;
    margin: 0 auto var(--s4);
}

.pricing-plan {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--s3);
    padding: 6px 14px 6px 10px;
    border-radius: 999px;
    background-color: var(--red-soft);
    font-size: var(--t-xs);
    font-weight: 600;
    color: var(--red-ink);
}

.pricing-plan::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--red);
}

@media (min-width: 768px) {
    .pricing {
        padding: var(--s7) 0;
    }

    .pricing-card {
        padding: var(--s5) var(--s6);
    }
}

/* --------------------------------------------------------------------------
   Final CTA
   -------------------------------------------------------------------------- */

.cta {
    padding: var(--s7) 0;
    text-align: center;
    border-top: 1px solid var(--line);
}

.cta h2 {
    font-size: var(--t-2xl);
    margin-bottom: var(--s2);
}

.cta p {
    font-size: var(--t-lg);
    color: var(--ink-2);
    margin: 0 auto var(--s4);
    max-width: 40ch;
}

.cta .btn-group {
    justify-content: center;
}

.cta-note {
    margin-top: var(--s3);
    font-size: var(--t-sm);
    color: var(--ink-3);
}

@media (min-width: 768px) {
    .cta h2 {
        font-size: 44px;
    }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
    padding: var(--s6) 0 var(--s4);
    border-top: 1px solid var(--line);
}

.footer-grid {
    display: grid;
    gap: var(--s4);
    margin-bottom: var(--s5);
}

.footer-brand .nav-logo {
    margin-bottom: var(--s2);
}

.footer-brand p {
    font-size: var(--t-sm);
    color: var(--ink-2);
    max-width: 32ch;
}

.footer h4 {
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: var(--s2);
}

.footer-col a {
    display: block;
    padding: 4px 0;
    font-size: var(--t-sm);
    color: var(--ink-2);
}

.footer-col a:hover {
    color: var(--ink);
    text-decoration: none;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--s2);
    padding-top: var(--s3);
    border-top: 1px solid var(--line);
    font-size: var(--t-xs);
    color: var(--ink-3);
}

.footer-bottom a {
    color: var(--ink-3);
}

.footer-bottom a + a {
    margin-left: var(--s2);
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

/* --------------------------------------------------------------------------
   Article pages (Support, Privacy)
   -------------------------------------------------------------------------- */

.doc {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s5);
    padding: var(--s5) 0 var(--s7);
}

.doc > * {
    min-width: 0;
}

.doc-nav {
    position: sticky;
    top: var(--nav-h);
    z-index: 5;
    margin: 0 calc(-1 * var(--gutter));
    padding: var(--s2) var(--gutter);
    background-color: color-mix(in srgb, var(--page) 90%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.doc-nav-title {
    display: none;
}

.doc-nav ul {
    display: flex;
    gap: var(--s1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.doc-nav ul::-webkit-scrollbar {
    display: none;
}

.doc-nav a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background-color: var(--surface);
    font-size: var(--t-xs);
    font-weight: 500;
    color: var(--ink-2);
    white-space: nowrap;
}

.doc-nav a:hover {
    color: var(--ink);
    text-decoration: none;
}

.doc-body {
    min-width: 0;
    max-width: 720px;
}

.doc-body h1 {
    font-size: 36px;
    letter-spacing: -0.03em;
    margin-bottom: var(--s2);
}

.doc-body .lead {
    margin-bottom: var(--s4);
}

.doc-body section + section {
    margin-top: var(--s6);
    padding-top: var(--s5);
    border-top: 1px solid var(--line);
}

.doc-body h2 {
    font-size: 28px;
    margin-bottom: var(--s2);
}

.doc-body h3 {
    font-size: var(--t-lg);
    margin: var(--s4) 0 var(--s1);
}

.doc-body h4 {
    font-size: var(--t-base);
    margin-bottom: 4px;
}

.doc-body p,
.doc-body li {
    font-size: var(--t-base);
    line-height: 1.6;
    color: var(--ink-2);
}

.doc-body p + p {
    margin-top: var(--s2);
}

.doc-body .intro {
    margin-bottom: var(--s3);
}

.doc-body ul.bullets {
    display: grid;
    gap: var(--s1);
    padding-left: 20px;
    list-style: disc;
}

.doc-body figure {
    margin: var(--s4) 0;
}

.doc-body figcaption {
    margin-top: var(--s2);
    font-size: var(--t-xs);
    color: var(--ink-3);
}

.doc-figure-grid {
    display: grid;
    gap: var(--s2);
}

@media (min-width: 600px) {
    .doc-figure-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

/* Contact card */
.contact-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s3);
    padding: var(--s3);
    border-radius: var(--radius-lg);
    background-color: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
}

.contact-card h3 {
    margin: 0 0 4px;
    font-size: var(--t-base);
}

.contact-card p {
    font-size: var(--t-sm);
}

.contact-card .meta {
    display: block;
    margin-top: 4px;
    font-size: var(--t-xs);
    color: var(--ink-3);
}

/* Help grid */
.help-grid {
    display: grid;
    gap: var(--s2);
}

.help-card {
    display: block;
    padding: var(--s2) var(--s3);
    border-radius: var(--radius);
    background-color: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    transition: border-color 160ms var(--ease);
}

.help-card:hover {
    border-color: var(--line-strong);
    text-decoration: none;
}

.help-card strong {
    display: block;
    font-size: var(--t-sm);
}

.help-card span {
    display: block;
    font-size: var(--t-xs);
    color: var(--ink-2);
}

@media (min-width: 600px) {
    .help-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* FAQ */
.faq details {
    border-top: 1px solid var(--line);
}

.faq details:last-child {
    border-bottom: 1px solid var(--line);
}

.faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s2);
    padding: var(--s2) 0;
    font-size: var(--t-base);
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "+";
    flex: none;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    font-weight: 500;
    color: var(--ink-2);
    transition: transform 200ms var(--ease);
}

.faq details[open] summary::after {
    transform: rotate(45deg);
}

.faq details > p {
    padding: 0 0 var(--s2);
    max-width: var(--measure);
}

/* Troubleshooting rows */
.trouble {
    display: grid;
    gap: var(--s3);
}

.trouble li {
    padding-left: var(--s2);
    border-left: 2px solid var(--line-strong);
}

.trouble h4 {
    color: var(--ink);
}

.trouble p {
    font-size: var(--t-sm);
}

/* Fact list (privacy) */
.facts {
    display: grid;
    gap: var(--s2);
}

.facts li {
    display: grid;
    gap: 2px;
    padding: var(--s2) var(--s3);
    border-radius: var(--radius);
    background-color: var(--surface);
    border: 1px solid var(--line);
}

.facts strong {
    font-size: var(--t-sm);
}

.facts span {
    font-size: var(--t-sm);
    color: var(--ink-2);
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s1);
    margin-top: var(--s2);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background-color: var(--red-soft);
    font-size: var(--t-xs);
    font-weight: 600;
    color: var(--red-ink);
}

.note {
    margin-top: var(--s3);
    padding: var(--s2) var(--s3);
    border-radius: var(--radius);
    background-color: var(--surface);
    border: 1px solid var(--line);
    font-size: var(--t-sm);
    color: var(--ink-2);
}

@media (min-width: 900px) {
    .doc {
        grid-template-columns: 200px minmax(0, 1fr);
        gap: var(--s7);
        padding: var(--s6) 0 var(--s8);
    }

    .doc-nav {
        top: calc(var(--nav-h) + var(--s4));
        align-self: start;
        margin: 0;
        padding: 0;
        background: none;
        border: 0;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .doc-nav-title {
        display: block;
        margin-bottom: var(--s2);
        font-size: var(--t-xs);
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--ink-3);
    }

    .doc-nav ul {
        display: grid;
        gap: 2px;
        overflow: visible;
    }

    .doc-nav a {
        display: block;
        padding: 6px 10px;
        margin-left: -10px;
        border: 0;
        border-radius: 8px;
        background: none;
        font-size: var(--t-sm);
        white-space: normal;
    }

    .doc-nav a:hover {
        background-color: var(--surface);
    }

    .doc-body h1 {
        font-size: 44px;
    }

    .doc-body h2 {
        font-size: 32px;
    }
}

/* --------------------------------------------------------------------------
   Vision / About
   -------------------------------------------------------------------------- */

.story {
    padding: var(--s6) 0;
    border-top: 1px solid var(--line);
}

.story-grid {
    display: grid;
    gap: var(--s4);
}

.story-label h2 {
    font-size: var(--t-xl);
}

.story-body p {
    font-size: var(--t-lg);
    line-height: 1.55;
    color: var(--ink-2);
    max-width: var(--measure);
}

.story-body p + p {
    margin-top: var(--s3);
}

.story-body p.first {
    font-size: var(--t-xl);
    color: var(--ink);
    font-weight: 500;
}

.signature {
    margin-top: var(--s3);
    font-size: var(--t-sm);
    color: var(--ink-3);
}

.principles {
    display: grid;
    gap: var(--s2);
}

.principle {
    padding: var(--s3);
    border-radius: var(--radius-lg);
    background-color: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
}

.principle .num {
    display: block;
    margin-bottom: var(--s2);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--red-ink);
}

.principle h3 {
    font-size: var(--t-lg);
    margin-bottom: var(--s1);
}

.principle p {
    font-size: var(--t-sm);
    line-height: 1.55;
    color: var(--ink-2);
}

.roadmap {
    display: grid;
    gap: var(--s2);
}

.roadmap li {
    display: flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s2) 0;
    border-bottom: 1px solid var(--line);
    font-size: var(--t-base);
    color: var(--ink);
}

.status {
    flex: none;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: var(--red-soft);
    font-size: var(--t-xs);
    font-weight: 600;
    color: var(--red-ink);
}

@media (min-width: 768px) {
    .story {
        padding: var(--s7) 0;
    }

    .story-grid {
        grid-template-columns: 240px minmax(0, 1fr);
        gap: var(--s6);
    }

    .principles {
        grid-template-columns: 1fr 1fr;
    }

    .principle {
        padding: var(--s4);
    }
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: var(--s3);
}

.mt-4 {
    margin-top: var(--s4);
}

/* --------------------------------------------------------------------------
   Motion (progressive enhancement)

   js/motion.js adds .motion to <html> when JavaScript runs and the user has
   not asked for reduced motion. Every rule below is keyed on that class, so
   without JavaScript nothing is hidden, and under prefers-reduced-motion
   the whole block is skipped: content is simply visible. Only transform and
   opacity animate.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

@media (prefers-reduced-motion: no-preference) {
    :root {
        --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
        --reveal-ms: 600ms;
        --phone-ms: 760ms;
    }

    /* Interactive details ------------------------------------------------ */

    .btn {
        transition:
            background-color 160ms var(--ease),
            border-color 160ms var(--ease),
            transform 200ms var(--ease-out);
    }

    .btn:hover {
        transform: translateY(-1px);
    }

    .btn:active {
        transform: scale(0.98);
        transition-duration: 160ms, 160ms, 80ms;
    }

    .nav-link {
        position: relative;
        transition: color 160ms var(--ease);
    }

    .nav-link::after {
        content: "";
        position: absolute;
        left: 2px;
        right: 2px;
        bottom: 1px;
        height: 1.5px;
        border-radius: 1px;
        background-color: currentColor;
        opacity: 0.7;
        transform: scaleX(0);
        transform-origin: left center;
        transition: transform 220ms var(--ease-out);
    }

    .nav-link:hover::after,
    .nav-link:focus-visible::after {
        transform: scaleX(1);
    }

    @media (max-width: 767px) {
        .nav-link::after {
            display: none;
        }
    }

    .footer-col a,
    .doc-nav a,
    .feature-link {
        transition: color 160ms var(--ease);
    }

    .help-card {
        transition:
            border-color 160ms var(--ease),
            transform 200ms var(--ease-out);
    }

    .help-card:hover {
        transform: translateY(-1px);
    }

    .faq details > p {
        animation: rise 360ms var(--ease-out) both;
    }

    /* Sticky nav: quiet at the top, lifts once the page scrolls ---------- */

    html.motion .nav {
        border-bottom-color: transparent;
        background-color: transparent;
        transition:
            background-color 260ms var(--ease),
            border-color 260ms var(--ease);
    }

    html.motion .nav.is-scrolled {
        border-bottom-color: var(--line);
        background-color: color-mix(in srgb, var(--page) 82%, transparent);
    }

    /* Hero entrance ------------------------------------------------------- */

    @keyframes rise {
        from {
            opacity: 0;
            transform: translateY(16px);
        }

        to {
            opacity: 1;
            transform: none;
        }
    }

    @keyframes phone-in {
        from {
            opacity: 0;
            transform: translateY(28px) rotateY(-10deg) rotateX(3deg);
        }

        to {
            opacity: 1;
            transform: none;
        }
    }

    html.motion .hero-copy > *,
    html.motion .hero-centered .container > * {
        animation: rise 640ms var(--ease-out) both;
    }

    html.motion .hero-copy > :nth-child(1),
    html.motion .hero-centered .container > :nth-child(1) {
        animation-delay: 40ms;
    }

    html.motion .hero-copy > :nth-child(2),
    html.motion .hero-centered .container > :nth-child(2) {
        animation-delay: 120ms;
    }

    html.motion .hero-copy > :nth-child(3),
    html.motion .hero-centered .container > :nth-child(3) {
        animation-delay: 200ms;
    }

    html.motion .hero-copy > :nth-child(4),
    html.motion .hero-centered .container > :nth-child(4) {
        animation-delay: 280ms;
    }

    html.motion .hero-copy > :nth-child(5) {
        animation-delay: 360ms;
    }

    html.motion .hero-media {
        perspective: 1400px;
    }

    html.motion .hero-media .phone {
        animation: phone-in var(--phone-ms) var(--ease-out) 160ms both;
        /* Very light parallax: the phone drifts up a little slower than the page */
        translate: 0 calc(var(--scroll, 0) * -0.06px);
    }

    /* Scroll reveals ------------------------------------------------------ */

    html.motion .reveal {
        opacity: 0;
        transform: translateY(20px);
        transition:
            opacity var(--reveal-ms) var(--ease-out) var(--delay, 0ms),
            transform var(--reveal-ms) var(--ease-out) var(--delay, 0ms);
    }

    html.motion .reveal.is-in {
        opacity: 1;
        transform: none;
    }

    /* Phone mockups: a slight 3D presentation that settles flat ---------- */

    html.motion .feature-media,
    html.motion .pair,
    html.motion .tile-media {
        perspective: 1400px;
    }

    html.motion .phone {
        /* Hover tilt (fine pointers only, set by js/motion.js); eases back to 0 */
        rotate: var(--tilt-x, 0) var(--tilt-y, 1) 0 var(--tilt, 0deg);
        transition: rotate 260ms var(--ease-out);
    }

    html.motion .phone.reveal {
        transform: translateY(28px) rotateY(var(--ry0, -9deg)) rotateX(3deg);
        transition:
            opacity var(--phone-ms) var(--ease-out) var(--delay, 0ms),
            transform var(--phone-ms) var(--ease-out) var(--delay, 0ms),
            rotate 260ms var(--ease-out);
    }

    html.motion .phone.reveal.is-in {
        transform: none;
    }

    /* A phone on the left of its text turns the other way */
    html.motion .feature-flip .feature-media > .phone {
        --ry0: 9deg;
    }

    /* A pair opens like a book, and the two drift apart gently on scroll */
    html.motion .pair > .phone:first-child {
        --ry0: 9deg;
        translate: 0 calc(var(--parallax, 0) * -6px);
    }

    html.motion .pair > .phone:last-child {
        --ry0: -9deg;
        translate: 0 calc(var(--parallax, 0) * 10px);
    }
}
