/*
Theme Name: Eucharistus
Theme URI: https://eucharistus.com/
Description: Single-page landing for the Eucharistus iOS app. Greyscale Vatican map hero, Liquid Glass UI, light + dark.
Author: Eucharistus
Version: 0.2.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: eucharistus
*/

/* ---------- Reset + tokens ---------- */

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

:root {
    color-scheme: light dark;

    --bg:           light-dark(#fdfdfb, #0a0a0a);
    --bg-soft:      light-dark(#f5f3ef, #121214);
    --surface:      light-dark(#ffffff, #16161a);
    --text:         light-dark(#0a0a0a, #f6f5f1);
    --text-soft:    light-dark(rgba(10,10,10,.62), rgba(246,245,241,.62));
    --text-faint:   light-dark(rgba(10,10,10,.42), rgba(246,245,241,.42));
    --hairline:     light-dark(rgba(10,10,10,.10), rgba(246,245,241,.12));

    --accent:       light-dark(#db8f1f, #f5c261);
    --accent-soft:  light-dark(rgba(219,143,31,.16), rgba(245,194,97,.20));
    --visited:      color-mix(in srgb, var(--accent) 60%, transparent);

    --glass-bg:        light-dark(rgba(255,255,255,.42), rgba(22,22,26,.38));
    --glass-bg-strong: light-dark(rgba(255,255,255,.72), rgba(28,28,32,.64));
    --glass-stroke:    light-dark(rgba(0,0,0,.08), rgba(255,255,255,.10));
    --glass-specular:  light-dark(rgba(255,255,255,.55), rgba(255,255,255,.12));
    --glass-shadow:    0 3px 12px rgba(0,0,0,.14), 0 1px 2px rgba(0,0,0,.06);
    --glass-shadow-lg: 0 12px 40px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.08);

    /* Match SwiftUI .rect(cornerRadius:) values used in the app */
    --r-14: 14px;
    --r-18: 18px;
    --r-22: 22px;
    --r-36: 36px;
    --r-pill: 999px;

    --font-serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
    --font-sans:  -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;

    --max-w: 1180px;
    --gutter: clamp(1.25rem, 4vw, 2.75rem);
    --section-y: clamp(4rem, 9vw, 8rem);
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
}

::selection {
    background: var(--accent);
    color: light-dark(#ffffff, #0a0a0a);
}

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

/* ---------- Typography primitives ---------- */

.serif {
    font-family: var(--font-serif);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.08;
}

.eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 0.9rem;
}

h1, h2, h3 { margin: 0; }

h1.display {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(2.4rem, 5.4vw, 4.5rem);
    line-height: 1.04;
    letter-spacing: -0.022em;
}

h2.title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(1.9rem, 3.8vw, 2.9rem);
    line-height: 1.1;
    letter-spacing: -0.015em;
}

.lede {
    font-size: clamp(1.05rem, 1.25vw, 1.18rem);
    color: var(--text-soft);
    max-width: 56ch;
    line-height: 1.5;
}

/* ---------- Glass primitives ---------- */

/* Liquid-Glass-flavored translucent surface. Inner top-edge specular highlight
   mirrors the way SwiftUI's .glassEffect(.regular) paints a soft light edge.
   Lower base alpha + bigger blur lets the ambient backdrop refract through. */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid var(--glass-stroke);
    box-shadow:
        inset 0 1px 0 var(--glass-specular),
        0 1px 2px rgba(0,0,0,.04),
        0 12px 32px rgba(0,0,0,.10);
    border-radius: var(--r-22);
}

.glass-strong {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid var(--glass-stroke);
    box-shadow:
        inset 0 1px 0 var(--glass-specular),
        var(--glass-shadow-lg);
    border-radius: var(--r-22);
}

.glass-pill {
    border-radius: var(--r-pill);
}

.glass--tight {
    border-radius: var(--r-18);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass, .glass-strong { background: var(--glass-bg-strong); }
}

/* ---------- Ambient backdrop ----------
   Soft, blurred accent blobs behind glass surfaces — gives the .glass cards
   something to refract so they read as "clear glass" rather than as opaque
   tiles on flat color. */
.ambient {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}
.ambient::before {
    content: "";
    position: absolute;
    inset: -10%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 50% at 18% 22%, var(--accent-soft) 0%, transparent 55%),
        radial-gradient(ellipse 55% 60% at 82% 78%, var(--accent-soft) 0%, transparent 60%);
    filter: blur(40px);
    opacity: light-dark(0.7, 0.5);
    /* Fade the backdrop at the top and bottom edges so each section's
       ambience dissolves into bare bg before the next section begins —
       removes the hard color line at section boundaries. */
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 20%, black 80%, transparent 100%);
            mask-image: linear-gradient(180deg, transparent 0%, black 20%, black 80%, transparent 100%);
}

/* ---------- Onboarding-rhythm section header ----------
   Left-aligned, serif largeTitle + body subtitle, mirrors the bottom block
   of OnboardingStepLayout. Used by sections 2-5. */
.section-header--onboarding {
    max-width: 38rem;
    margin: 0 auto 2.75rem;
    text-align: left;
    display: grid;
    gap: 0.75rem;
}
.section-header--onboarding .section-title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(2.1rem, 4.4vw, 3.2rem);
    line-height: 1.06;
    letter-spacing: -0.018em;
    color: var(--text);
}
.section-header--onboarding .lede {
    margin: 0;
    max-width: 36rem;
}
.section-header--onboarding.is-centered {
    text-align: center;
    justify-items: center;
}

/* ---------- Layout ---------- */

.wrap {
    max-width: var(--max-w);
    margin: 0 auto;
    padding-inline: var(--gutter);
}

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

/* Each onboarding-mirrored section fills the viewport, with its content
   vertically centered — mirrors the way each step of the iOS onboarding
   owns one screen. */
.activities,
.challenges,
.insights,
.holy-days {
    min-height: 100svh;
    display: grid;
    align-content: center;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
    position: relative;
    height: 100vh;
    min-height: 640px;
    height: 100svh;
    width: 100%;
    overflow: hidden;
    isolation: isolate;
}

.hero__map {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--bg-soft);
    /* Mirrors ChurchMapLayer.swift:91-94 — .saturation(0).contrast(1.25).
       Voyager's beige building tone is darker than its cream roads; pulling
       brightness down before pushing contrast up keeps roads near-white while
       sending buildings into a visible mid-grey, giving the same road/building
       distinction Apple Maps has when desaturated. */
    filter: grayscale(1) brightness(0.85) contrast(1.55);
}

@media (prefers-color-scheme: dark) {
    .hero__map { filter: grayscale(1) contrast(1.15) brightness(0.78); }
}

/* Veil — matches the app's bottom-anchored gradient over the map hero */
.hero__veil {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg,
            light-dark(rgba(253,253,251,.55), rgba(10,10,10,.55)) 0%,
            light-dark(rgba(253,253,251,0),   rgba(10,10,10,0))   28%,
            light-dark(rgba(253,253,251,0),   rgba(10,10,10,0))   42%,
            light-dark(rgba(253,253,251,.92), rgba(10,10,10,.92)) 88%,
            var(--bg) 100%);
}

.hero__chrome {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: clamp(1rem, 2.5vw, 1.75rem) var(--gutter) clamp(1.5rem, 3vw, 2.5rem);
    pointer-events: none;
}

.hero__chrome > * { pointer-events: auto; }

/* Top bar: wordmark + glass profile button (mirrors app screenshots) */
.hero__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.wordmark {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(1.75rem, 3.4vw, 2.4rem);
    letter-spacing: -0.022em;
    color: var(--text);
    margin: 0;
    line-height: 1;
}

.season-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.42rem 0.85rem 0.42rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.005em;
    color: var(--text);
    white-space: nowrap;
}
.season-pill__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
    flex-shrink: 0;
}

.hero__center {
    align-self: end;
    display: grid;
    gap: 1.5rem;
    justify-items: start;
    max-width: 720px;
    padding-bottom: clamp(2rem, 6vw, 5rem);
}

.hero__center h1 { color: var(--text); }

.hero__center .lede {
    max-width: 48ch;
    color: var(--text-soft);
}

/* App Store CTA badge */
.appstore {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.65rem 1.2rem 0.65rem 1rem;
    background: light-dark(#0a0a0a, #f6f5f1);
    color: light-dark(#f6f5f1, #0a0a0a);
    border-radius: 14px;
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--glass-stroke);
    transition: transform 180ms ease, box-shadow 180ms ease;
    font-family: var(--font-sans);
}
.appstore:hover { transform: translateY(-1px); box-shadow: var(--glass-shadow-lg); }
.appstore__apple { width: 30px; height: 30px; flex: 0 0 auto; }
.appstore__copy { display: grid; line-height: 1; gap: 3px; }
.appstore__copy small { font-size: 0.66rem; letter-spacing: 0.02em; opacity: 0.85; }
.appstore__copy strong { font-size: 1.18rem; font-weight: 600; letter-spacing: -0.01em; }

/* Bottom "Journey" decorative strip (mirrors app's persistent bottom sheet) */
.hero__journey {
    align-self: end;
    margin-top: clamp(1.5rem, 4vw, 2.5rem);
    width: min(100%, 520px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-radius: var(--r-22);
    color: var(--text);
    font-family: var(--font-sans);
}
.hero__journey-title { font-weight: 600; font-size: 1.05rem; line-height: 1.2; }
.hero__journey-sub { font-size: 0.86rem; color: var(--text-soft); margin-top: 2px; }
.hero__journey svg { width: 14px; height: 14px; color: var(--text-soft); }

/* Floating right-side glass controls (search + recenter) */
.hero__controls {
    position: absolute;
    right: var(--gutter);
    bottom: calc(var(--gutter) + 2rem);
    display: grid;
    gap: 14px;
    z-index: 3;
}
.hero__controls button {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 1px solid var(--glass-stroke);
    background: var(--glass-bg-strong);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    box-shadow: var(--glass-shadow);
    display: grid; place-items: center;
    color: var(--text-soft);
    cursor: pointer;
}
.hero__controls svg { width: 20px; height: 20px; }

@media (max-width: 720px) {
    .hero__controls { display: none; }
    .hero__journey { display: none; }
}

/* ---------- Map pin (mirrors ChurchAnnotationView.swift) ---------- */

.eu-pin {
    /* MapLibre wraps the element. Keep zero base styling so positioning is exact. */
    pointer-events: none;
}
.eu-pin__body {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid; place-items: center;
    position: relative;
    background: var(--glass-bg-strong);
    border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 3px 8px rgba(0,0,0,.18);
    color: var(--accent);
    overflow: hidden;
}
.eu-pin__body::before {
    /* Subtle Greek cross — matches SubtleGlassCross at 60% diameter, 15% opacity */
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(var(--text) 0 0) center / 3px 60% no-repeat,
        linear-gradient(var(--text) 0 0) center / 60% 3px no-repeat;
    opacity: 0.15;
    border-radius: 999px;
}
.eu-pin__body--visited::after {
    content: "";
    position: absolute; inset: 0;
    background: var(--visited);
    border-radius: 50%;
    z-index: 0;
}
.eu-pin__ihs {
    position: relative;
    z-index: 1;
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--accent);
}
.eu-pin__tail {
    width: 0; height: 0;
    margin: 1px auto 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid color-mix(in srgb, var(--accent) 78%, transparent);
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.18));
}

/* Hide church markers on phone-sized viewports — at small widths the pins
   crowd the hero and pull focus from the title. The map itself stays. */
@media (max-width: 720px) {
    .maplibregl-marker { display: none; }
}

/* ============================================================
   ACTIVITIES
   ============================================================ */

.activities__grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(0.7rem, 1.2vw, 1.1rem);
    margin: 0 auto;
}

@media (max-width: 960px) {
    .activities__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .activities__grid { grid-template-columns: 1fr; }
}

.activity-card {
    padding: 1.15rem 1.05rem 1.2rem;
    border-radius: var(--r-22);
    display: grid;
    gap: 0.5rem;
    align-content: start;
    min-height: 170px;
}
.activity-card__icon {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 0.35rem;
}
.activity-card__icon svg { width: 22px; height: 22px; }
.activity-card__title {
    font-family: var(--font-serif);
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.005em;
    line-height: 1.15;
    color: var(--text);
}
.activity-card__copy {
    font-size: 0.86rem;
    color: var(--text-soft);
    line-height: 1.45;
}

.activities__footnote {
    text-align: center;
    margin: 2.5rem auto 0;
    max-width: 540px;
    color: var(--text-soft);
    font-size: 0.92rem;
}

/* ============================================================
   CHALLENGES
   ============================================================ */

.challenges .wrap { max-width: 1320px; }

.challenges__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1rem, 1.5vw, 1.5rem);
}
@media (max-width: 880px) {
    .challenges__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .challenges__grid { grid-template-columns: 1fr; }
}

/* Mirrors OnboardingChallengesHero active-challenge-card:
   subhead.bold title + caption detail on the left, 56pt circular gauge on
   the right, progress capsule + count below, promise quote at the foot. */
.challenge-card {
    padding: 1.5rem;
    border-radius: var(--r-22);
    display: grid;
    gap: 1.1rem;
    grid-template-rows: auto auto auto auto;
    min-height: 320px;
}
.challenge-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}
.challenge-card__meta { min-width: 0; }
.challenge-card__name {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.15;
    letter-spacing: -0.005em;
    color: var(--text);
}
.challenge-card__detail {
    font-size: 0.82rem;
    color: var(--text-soft);
    margin-top: 4px;
    line-height: 1.35;
}

.challenge-card__gauge {
    width: 56px; height: 56px;
    flex: 0 0 auto;
    position: relative;
}
.challenge-card__gauge svg {
    width: 56px; height: 56px;
    color: var(--accent);
}
.challenge-card__gauge-icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--text-soft);
    pointer-events: none;
}
.challenge-card__gauge-icon svg { width: 20px; height: 20px; }

.challenge-card__progress {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.7rem;
    align-items: center;
}
.challenge-card__count {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.005em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.challenge-card__progress-bar {
    height: 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-soft) 22%, transparent);
    overflow: hidden;
    position: relative;
}
.challenge-card__progress-bar > span {
    display: block;
    height: 100%;
    width: calc(var(--p, 0) * 100%);
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--accent) 78%, transparent) 0%,
        var(--accent) 100%);
}

.challenge-card__quote {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.98rem;
    line-height: 1.42;
    color: var(--text);
    border-left: 2px solid var(--accent);
    padding-left: 0.9rem;
    margin: 0;
}
.challenge-card__attr {
    font-size: 0.76rem;
    color: var(--text-faint);
    letter-spacing: 0.01em;
    font-style: normal;
}

/* ============================================================
   HOLY DAYS — mirrors OnboardingHolyDaysHero + step controls
   ============================================================ */

.holy-days__stack {
    max-width: 480px;
    margin: 0 auto;
    display: grid;
    gap: 1rem;
}

/* Mock iOS notification card */
.notif {
    padding: 0.95rem 1.05rem;
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 0.85rem;
    align-items: center;
    border-radius: var(--r-22);
}
.notif__icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid; place-items: center;
}
.notif__icon svg { width: 22px; height: 22px; }
.notif__body { min-width: 0; }
.notif__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}
.notif__title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}
.notif__time {
    font-size: 0.74rem;
    color: var(--text-faint);
    flex-shrink: 0;
}
.notif__sub {
    font-size: 0.84rem;
    color: var(--text-soft);
    margin-top: 2px;
}

/* Controls card — two toggle rows for Day before / On the day */
.controls-card {
    padding: 1.1rem 1.15rem;
    display: grid;
    gap: 0.85rem;
    border-radius: var(--r-22);
}
.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.controls-row__label { min-width: 0; }
.controls-row__title {
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--text);
}
.controls-row__time {
    font-size: 0.82rem;
    color: var(--text-soft);
    margin-top: 2px;
}
.controls-divider {
    height: 1px;
    background: var(--hairline);
    opacity: 0.6;
}
.controls-card__footnote {
    font-size: 0.78rem;
    color: var(--text-soft);
    margin: 0.3rem 0 0;
    text-align: center;
}

/* Pure-CSS iOS-style switch */
.toggle {
    flex-shrink: 0;
    display: inline-block;
    width: 52px;
    height: 32px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-soft) 28%, transparent);
    position: relative;
    transition: background 200ms ease;
}
.toggle::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: light-dark(#ffffff, #f6f5f1);
    box-shadow: 0 2px 4px rgba(0,0,0,.18), 0 0 1px rgba(0,0,0,.12);
    transition: left 200ms ease;
}
.toggle--on { background: var(--accent); }
.toggle--on::after { left: 22px; }

/* ============================================================
   INSIGHTS — mirrors OnboardingInsightsHero: ratio + heatmap stack
   ============================================================ */

.insights__stack {
    max-width: 920px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 720px) {
    .insights__stack { grid-template-columns: 1fr; }
}

/* Shared card header */
.card-title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.005em;
    color: var(--text);
    line-height: 1.15;
}
.card-caption {
    font-size: 0.84rem;
    color: var(--text-soft);
    margin-top: 4px;
    line-height: 1.35;
}

/* Eucharist ratio card */
.ratio-card {
    padding: 1.1rem 1.2rem 1.15rem;
    display: grid;
    gap: 0.6rem;
    align-content: start;
}
.ratio-card__metric {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-top: 0;
}
.ratio-card__pct {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(2.4rem, 5vw, 2.8rem);
    line-height: 1;
    letter-spacing: -0.015em;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.ratio-card__base {
    font-size: 0.95rem;
    color: var(--text-soft);
}
.ratio-card__bar {
    height: 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-soft) 22%, transparent);
    overflow: hidden;
}
.ratio-card__bar > span {
    display: block;
    height: 100%;
    width: calc(var(--p, 0) * 100%);
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--accent) 78%, transparent) 0%,
        var(--accent) 100%);
}
.ratio-card__narrative {
    font-size: 0.88rem;
    color: var(--text-soft);
    line-height: 1.5;
    margin: 0;
}

/* Heatmap card */
.heatmap-card {
    padding: 1.5rem 1.4rem;
    display: grid;
    gap: 1rem;
}
.heatmap {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.heatmap__cell {
    aspect-ratio: 1;
    border-radius: 4px;
    background: var(--hairline);
}
.heatmap__cell[data-level="1"] { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.heatmap__cell[data-level="2"] { background: color-mix(in srgb, var(--accent) 38%, transparent); }
.heatmap__cell[data-level="3"] { background: color-mix(in srgb, var(--accent) 64%, transparent); }
.heatmap__cell[data-level="4"] { background: var(--accent); }

.heatmap-card__legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    color: var(--text-faint);
    margin-top: 0.25rem;
}
.heatmap__swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: var(--hairline);
}
.heatmap__swatch[data-level="1"] { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.heatmap__swatch[data-level="2"] { background: color-mix(in srgb, var(--accent) 38%, transparent); }
.heatmap__swatch[data-level="3"] { background: color-mix(in srgb, var(--accent) 64%, transparent); }
.heatmap__swatch[data-level="4"] { background: var(--accent); }

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    padding-block: clamp(3rem, 6vw, 5rem) clamp(2rem, 3vw, 2.5rem);
    border-top: 1px solid var(--hairline);
}
.site-footer__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: end;
}
@media (max-width: 720px) {
    .site-footer__inner { grid-template-columns: 1fr; }
}
.site-footer__mark {
    display: flex; align-items: center; gap: 0.75rem;
}
.site-footer__brand {
    display: flex; flex-direction: column; gap: 0.15rem;
}
.site-footer__mark .wordmark { font-size: 2rem; line-height: 1; }
.site-footer__email {
    font-size: 0.88rem;
    color: var(--text-soft);
    letter-spacing: 0.01em;
}
.site-footer__email:hover { color: var(--text); }
.site-footer__mark .ihs {
    width: 28px; height: 28px;
    color: var(--accent);
    transform: translateY(2px);
}
.site-footer__nav {
    display: flex; gap: 1.5rem; flex-wrap: wrap;
    font-size: 0.92rem; color: var(--text-soft);
}
.site-footer__nav a:hover { color: var(--text); }
.site-footer__legal {
    margin-top: 1rem;
    font-size: 0.82rem;
    color: var(--text-faint);
    grid-column: 1 / -1;
}
.site-footer__apple {
    margin-top: 0.35rem;
    font-size: 0.68rem;
    color: var(--text-faint);
    opacity: 0.75;
    grid-column: 1 / -1;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ---------- Privacy page ----------
   Long-form legal page. Reuses .ambient + .glass + .wrap + tokens; adds
   layout, TOC sidebar, numbered headings, sub-processors table, callouts. */

.privacy { display: block; }

.privacy-topbar {
    padding-top: clamp(1.25rem, 3vw, 2rem);
    padding-bottom: clamp(0.5rem, 1.5vw, 1rem);
}
.privacy-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.privacy-topbar__brand {
    display: inline-flex;
    align-items: center;
    color: inherit;
    border-radius: 6px;
    transition: opacity 120ms ease;
}
.privacy-topbar__brand:hover,
.privacy-topbar__brand:focus-visible { opacity: 0.7; }
.privacy-topbar__brand .wordmark { margin: 0; }

.privacy-hero {
    padding: clamp(2rem, 4vw, 3.5rem) 0 clamp(2.5rem, 5vw, 4rem);
    text-align: center;
}
.privacy-hero__inner { max-width: 48rem; margin: 0 auto; }
.privacy-hero .eyebrow { margin-bottom: 1.1rem; }
.privacy-hero .lede {
    margin: 1.1rem auto 1.8rem;
    max-width: 38rem;
}

.privacy-meta {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 0.35rem 1.1rem;
    font-size: 0.93rem;
    color: var(--text-soft);
    margin: 0;
}
.privacy-meta strong { color: var(--text); font-weight: 600; }
.privacy-meta__dot { color: var(--text-faint); }
.privacy-meta a {
    color: var(--text-soft);
    border-bottom: 1px solid var(--hairline);
}
.privacy-meta a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.privacy-summary { padding: clamp(1.5rem, 4vw, 3.5rem) 0; }
.privacy-summary .wrap { max-width: 920px; }

.privacy-card { padding: clamp(1.5rem, 3vw, 2.1rem) clamp(1.5rem, 3vw, 2.3rem); }
.privacy-card__title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(1.25rem, 2.1vw, 1.5rem);
    line-height: 1.18;
    letter-spacing: -0.012em;
    margin: 0 0 0.4rem;
}

.privacy-bullets { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.privacy-bullets li {
    position: relative;
    padding: 0.7rem 0 0.7rem 1.4rem;
    border-bottom: 1px solid var(--hairline);
    line-height: 1.55;
}
.privacy-bullets li:last-child { border-bottom: 0; padding-bottom: 0.3rem; }
.privacy-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1.05rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
}
.privacy-bullets li strong { color: var(--text); font-weight: 600; }
.privacy-bullets li a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.privacy-bullets li a:hover { border-bottom-color: var(--accent); }

.privacy-body { padding: clamp(2rem, 4vw, 4rem) 0 clamp(4rem, 8vw, 7rem); }
.privacy-body__layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.25rem;
}
@media (min-width: 1024px) {
    .privacy-body__layout {
        grid-template-columns: 240px minmax(0, 1fr);
        gap: 3.5rem;
    }
}

.privacy-toc {
    padding: 1.1rem 1.25rem 1.2rem;
    font-size: 0.92rem;
    align-self: start;
}
@media (min-width: 1024px) {
    .privacy-toc {
        position: sticky;
        top: 1.5rem;
        max-height: calc(100vh - 3rem);
        overflow-y: auto;
    }
}
.privacy-toc__label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 0 0 0.7rem;
    font-weight: 600;
}
.privacy-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: toc;
    line-height: 1.45;
}
.privacy-toc__list li { counter-increment: toc; margin: 0; }
.privacy-toc__list a {
    display: block;
    padding: 0.3rem 0 0.3rem 1.85rem;
    color: var(--text-soft);
    position: relative;
    border-radius: 4px;
    transition: color 120ms ease;
}
.privacy-toc__list a::before {
    content: counter(toc, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0.36rem;
    font-size: 0.74rem;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}
.privacy-toc__list a:hover,
.privacy-toc__list a:focus-visible { color: var(--accent); }

.privacy-body__content { min-width: 0; max-width: 44rem; }

.privacy-section {
    margin-bottom: clamp(2.4rem, 5vw, 3.8rem);
    scroll-margin-top: 1.5rem;
}
.privacy-section:last-child { margin-bottom: 0; }
.privacy-section__title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(1.45rem, 2.4vw, 1.85rem);
    line-height: 1.18;
    letter-spacing: -0.012em;
    margin: 0 0 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--hairline);
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
}
.privacy-section__title .num {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.6em;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}
.privacy-section h3 {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1.04rem;
    line-height: 1.35;
    margin: 1.7rem 0 0.55rem;
    color: var(--text);
}
.privacy-section h3 .num {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    color: var(--text-faint);
    font-weight: 500;
    font-size: 0.88em;
    margin-right: 0.4rem;
    font-variant-numeric: tabular-nums;
}
.privacy-section p,
.privacy-section ul,
.privacy-section ol { margin: 0 0 0.85rem; line-height: 1.65; }
.privacy-section ul,
.privacy-section ol { padding-left: 1.4rem; }
.privacy-section li { margin-bottom: 0.4rem; }
.privacy-section li > p:first-child { margin-bottom: 0.25rem; }
.privacy-section li > p:last-child { margin-bottom: 0; }
.privacy-section strong { color: var(--text); font-weight: 600; }
.privacy-section em { font-style: italic; }
.privacy-section a {
    color: var(--accent);
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    transition: border-color 120ms ease;
}
.privacy-section a:hover,
.privacy-section a:focus-visible { border-bottom-color: var(--accent); }
.privacy-section code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.88em;
    background: var(--bg-soft);
    border: 1px solid var(--hairline);
    border-radius: 4px;
    padding: 1px 6px;
}

.privacy-callout {
    padding: 1.1rem 1.3rem 1.2rem;
    margin: 1rem 0 1.4rem;
}
.privacy-callout dl { margin: 0; }
.privacy-callout dt {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
    font-weight: 600;
    margin-top: 0.85rem;
}
.privacy-callout dt:first-child { margin-top: 0; }
.privacy-callout dd { margin: 0.2rem 0 0; }
.privacy-callout dd a {
    color: var(--accent);
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.privacy-callout dd a:hover { border-bottom-color: var(--accent); }
.privacy-callout dd code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.88em;
    background: var(--bg-soft);
    border: 1px solid var(--hairline);
    border-radius: 4px;
    padding: 1px 6px;
}

.privacy-legal-bases { margin: 0.4rem 0 0; }
.privacy-legal-bases dt {
    font-weight: 600;
    color: var(--text);
    margin-top: 1rem;
    font-size: 0.95rem;
}
.privacy-legal-bases dt:first-child { margin-top: 0; }
.privacy-legal-bases dt code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.85em;
    background: var(--bg-soft);
    border: 1px solid var(--hairline);
    border-radius: 4px;
    padding: 1px 6px;
    font-weight: 500;
    color: var(--text-soft);
}
.privacy-legal-bases dd {
    margin: 0.3rem 0 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.privacy-table-wrap {
    margin: 1.1rem 0 1.6rem;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.privacy-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    min-width: 720px;
}
.privacy-table thead { background: color-mix(in srgb, var(--text) 4%, transparent); }
.privacy-table th {
    text-align: left;
    padding: 0.85rem 0.95rem;
    border-bottom: 1px solid var(--hairline);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
    font-weight: 600;
    vertical-align: top;
}
.privacy-table td {
    padding: 0.9rem 0.95rem;
    border-bottom: 1px solid var(--hairline);
    vertical-align: top;
    line-height: 1.55;
}
.privacy-table tbody tr:last-child td { border-bottom: 0; }
.privacy-table strong { color: var(--text); font-weight: 600; }
.privacy-table code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.86em;
    background: var(--bg-soft);
    border: 1px solid var(--hairline);
    border-radius: 4px;
    padding: 0 5px;
}
.privacy-table__links { white-space: nowrap; }
.privacy-table__links a {
    display: inline-block;
    margin-right: 0.5rem;
    color: var(--accent);
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.privacy-table__links a:hover { border-bottom-color: var(--accent); }

/* ---------- Contact page ----------
   Reuses the .privacy-topbar at the top + the .ambient backdrop pattern;
   centers a single glass pill CTA that opens the user's mail client. */

.contact { display: block; }

.contact-hero {
    min-height: calc(100svh - 4rem);
    display: grid;
    align-content: center;
    text-align: center;
    padding: clamp(3rem, 7vw, 5rem) 0;
}
.contact-hero__inner {
    max-width: 38rem;
    margin: 0 auto;
}
.contact-hero .eyebrow { margin-bottom: 1.1rem; }
.contact-hero .lede {
    margin: 1.1rem auto 2.2rem;
    max-width: 30rem;
}

.contact-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 1.6rem 0.85rem 1.25rem;
    border-radius: var(--r-pill);
    color: var(--text);
    font-size: 1.04rem;
    font-weight: 500;
    letter-spacing: -0.003em;
    transition: transform 140ms ease, box-shadow 200ms ease;
    will-change: transform;
}
.contact-cta:hover,
.contact-cta:focus-visible {
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 var(--glass-specular),
        0 1px 2px rgba(0,0,0,.04),
        0 18px 44px rgba(0,0,0,.14);
}
.contact-cta:active { transform: translateY(0); }
.contact-cta__icon {
    width: 24px;
    height: 24px;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.contact-cta__icon svg { width: 100%; height: 100%; }
.contact-cta__text { font-variant-numeric: tabular-nums; }
