/* ─────────────────────────────────────────────────────────
   Subscurate — landing page styles
   Tokens mirror the Earth palette in `Subscurate/Theme/Palettes/Earth.swift`
   so the site reads as a continuation of the app, not a remix of it.
   Dark is default; light overrides via prefers-color-scheme.
   Synced 2026-05-07 — pre-Earth values were off by 5–15 pts on every
   surface and most accents.
   ───────────────────────────────────────────────────────── */

:root {
    /* Dark — matches Earth's dark palette */
    --bg: #1A1510;                       /* Kiln Dark */
    --bg-card: #2C2318;                  /* Clay Body — surface */
    --text-primary: #DDD5C4;             /* Ash White */
    --text-secondary: #B8B5A8;           /* Dried Reed */
    --text-tertiary: #7B7C74;            /* Moss Stone */
    --text-muted: #4A4B46;               /* Char Beige */
    --card-surface: rgba(221, 213, 196, 0.04);  /* Ash White at 4% — matches cardSurfaceDark */
    --card-border:  rgba(221, 213, 196, 0.06);  /* Ash White at 6% — matches cardBorderDark */
    --divider: #3E3025;                  /* Fired Slip */

    /* Accents — Earth's Pine/Bamboo/Kaki/Vermilion families */
    --accent: #7A8C74;                   /* Lichen Green — brand action (dark) */
    --accent-warm: #B88C60;              /* Kaki Warm — caution / inline italic links */
    --freed: #80AB8D;                    /* Bamboo Light — positive */
    --danger: #D47860;                   /* Vermilion Glow — destructive */
    --affordance-line: #9A9B91;          /* Sumi Pale — dashed underline ink */

    /* Type stacks — same families as the app, with notes */
    /* Display + mono match the app exactly (Instrument Serif, DM Mono).
       Body uses DM Sans on web because the app's SF Pro Text via system stack
       doesn't render natively on non-Apple browsers. */
    --font-display: "Instrument Serif", "Cormorant Garamond", "Iowan Old Style", "Times New Roman", serif;
    --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    --font-mono: "DM Mono", ui-monospace, "SF Mono", "Menlo", monospace;

    /* Rhythm */
    --max-content: 64rem;
    --max-narrow: 44rem;
    --section-y: clamp(4.5rem, 8vw, 8rem);
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #F0EFEC;                       /* Snow Field */
        --bg-card: #FAFAF7;                  /* Frost Mist */
        --text-primary: #232820;             /* Pine Dark */
        --text-secondary: #3A4036;           /* Pine Shadow */
        --text-tertiary: #9A9890;            /* Branch Grey */
        --text-muted: #B9BAB6;               /* Lichen Pale */
        --card-surface: rgba(35, 40, 32, 0.03);   /* Pine Dark at 3% */
        --card-border:  rgba(35, 40, 32, 0.06);   /* Pine Dark at 6% */
        --divider: #E0DDD8;                  /* Frost Edge */

        --accent: #2A302A;                   /* Pine Ink — brand action (light) */
        --accent-warm: #9C7A52;              /* Kaki Deep */
        --freed: #4E8062;                    /* Bamboo Deep */
        --danger: #B74A35;                   /* Vermilion */
        --affordance-line: #6E6F69;          /* Sumi Trace */
    }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text-primary);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 200ms ease;
}

a:hover { opacity: 0.7; }

img, svg { display: block; max-width: 100%; }

::selection { background: var(--accent-warm); color: #FFFFFF; }

/* ───── Layout containers ───── */

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

.container--narrow { max-width: var(--max-narrow); }

section { padding: var(--section-y) 0; }

/* ───── Typography ───── */

.display {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.02;
    letter-spacing: -0.015em;
    color: var(--text-primary);
}

h1.display { font-size: clamp(3rem, 8vw, 5.75rem); }
h2.display { font-size: clamp(2.25rem, 5vw, 3.5rem); }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-tertiary);
}

.lede {
    font-size: 1.25rem;
    line-height: 1.55;
    color: var(--text-secondary);
    max-width: 38ch;
}

p { color: var(--text-secondary); }

.italic {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--text-primary);
}

em { font-style: italic; }

/* ───── Header ───── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: color-mix(in srgb, var(--bg) 75%, transparent);
    border-bottom: 1px solid var(--card-border);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.5rem;
    letter-spacing: -0.005em;
    color: var(--text-primary);
}

.site-nav {
    display: flex;
    gap: 1.75rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

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

.hero {
    padding-top: clamp(5rem, 10vw, 8rem);
    padding-bottom: clamp(3rem, 6vw, 6rem);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.hero__inner {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

/* Stack the curve below the hero copy below 900px — the curve has a wider
   aspect than the old ring, so it benefits from a slightly later breakpoint
   to stop the H1 from collapsing to two narrow columns. */
@media (max-width: 900px) {
    .hero__inner { grid-template-columns: 1fr; }
}

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

.hero .lede { margin-bottom: 2.5rem; }

.hero__cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

/* CTA — quiet pill, no Apple iconography (App Store guidelines forbid the
   logomark in marketing for an unreleased app). Reused on hero, closing
   section, and 404. */
.cta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--card-surface);
    transition: border-color 250ms ease, transform 250ms ease, background 250ms ease;
}

.cta-pill:hover {
    border-color: var(--accent-warm);
    background: color-mix(in srgb, var(--accent-warm) 6%, var(--card-surface));
    opacity: 1;
    transform: translateY(-1px);
}

.cta-pill__label { letter-spacing: -0.005em; }

.cta-pill__arrow {
    font-family: var(--font-display);
    font-size: 1.125rem;
    color: var(--accent-warm);
    transition: transform 250ms ease;
    line-height: 1;
}

.cta-pill:hover .cta-pill__arrow { transform: translateX(3px); }

.hero__purchase-note {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
}

.hero__purchase-note strong {
    color: var(--text-secondary);
    font-weight: 400;
}

/* ───── Hero visual: SVG Year Ahead curve ─────
   Renders the actual app component in SVG so the page reads as a
   continuation of the app, not a screenshot. Replaces the Almanac Ring
   (cut from the app in the 2026-05-01 home strip-down). */

.curve {
    width: 100%;
    max-width: 36rem;
    aspect-ratio: 600 / 360;
    margin: 0 auto;
    position: relative;
    color: var(--text-primary); /* SVG strokes use currentColor — adapts to light/dark */
}

.curve svg { width: 100%; height: 100%; }

.curve__caption {
    position: absolute;
    inset: auto 0 -2.25rem 0;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-tertiary);
}

/* ───── How it works ───── */

.how { border-top: 1px solid var(--card-border); }

.how__intro { margin-bottom: 4rem; }

.how__intro h2 { margin-bottom: 1.25rem; }

.steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 760px) {
    .steps { grid-template-columns: repeat(3, 1fr); gap: 3rem; }
}

/* ───── Device images (real screenshots in Apple iPhone 17 Pro Deep Blue bezels) ─────
   Source: simulator screenshots composited into Apple's official product bezel PNG,
   exported at 700px wide (PNG8 + WebP via <picture>). See docs/launch/screenshot-workflow.md. */

.device-img {
    display: block;
    width: 100%;
    max-width: 240px;
    height: auto;
    margin: 0 auto 1.75rem;
    filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.55));
}

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

@media (prefers-color-scheme: light) {
    .device { background: #1a1714; }
    .device__notch { background: #0a0807; }
}

.step__number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-warm);
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

.step h3 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.5rem;
    margin-bottom: 0.625rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.step p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ───── On principle ───── */

.on-principle__intro {
    text-align: center;
    max-width: 36ch;
    margin: 0 auto 4rem;
}

.on-principle__intro h2 { margin-bottom: 1.25rem; }

.principle-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    list-style: none;
    max-width: 32rem;
    margin: 0 auto;
}

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

.principle-list li {
    padding: 1.5rem;
    background: var(--card-surface);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
}

.principle-list h4 {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9375rem;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
}

.principle-list p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ───── Closing ───── */

.closing {
    text-align: center;
    padding-bottom: clamp(6rem, 10vw, 9rem);
}

.closing h2 { margin-bottom: 2.5rem; }

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

.site-footer {
    border-top: 1px solid var(--card-border);
    padding: 3rem 0 4rem;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.site-footer__nav {
    display: flex;
    gap: 1.5rem;
}

.site-footer__nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--text-secondary);
}

.site-footer__copy {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
}

/* ───── Long-form pages (privacy / support) ───── */

.longform {
    padding: clamp(4rem, 8vw, 6rem) 0;
}

.longform__inner {
    max-width: 38rem;
    margin: 0 auto;
}

.longform__back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-tertiary);
    margin-bottom: 3rem;
}

.longform h1 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.25rem, 4vw, 3rem);
    line-height: 1.1;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.longform__updated {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 3rem;
    letter-spacing: 0.06em;
}

.longform h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.625rem;
    margin: 3rem 0 1rem;
    color: var(--text-primary);
}

.longform h3 {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    margin: 2rem 0 0.5rem;
    color: var(--text-primary);
}

.longform p,
.longform li {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.longform ul,
.longform ol {
    margin: 0 0 1rem 1.25rem;
}

.longform a {
    color: var(--text-primary);
    border-bottom: 1px solid var(--text-tertiary);
}

.longform a:hover { border-bottom-color: var(--accent); }

.longform code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--card-surface);
    padding: 0.1em 0.4em;
    border-radius: 0.25em;
    border: 1px solid var(--card-border);
}

.longform hr {
    border: 0;
    border-top: 1px solid var(--card-border);
    margin: 3rem 0;
}

/* ───── Reduced motion ───── */

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

/* ───── Subtle entrance ───── */

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

.hero h1, .hero .lede, .hero__cta-row, .hero__purchase-note {
    animation: rise 800ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero .lede { animation-delay: 100ms; }
.hero__cta-row { animation-delay: 200ms; }
.hero__purchase-note { animation-delay: 300ms; }
.curve { animation: rise 1000ms cubic-bezier(0.2, 0.8, 0.2, 1) 200ms both; }
