/* =====================================================================
   Fade List — shared site styles
   Used by index.html, privacy.html, terms.html
   ===================================================================== */


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

:root {
    --shadow: 0 1px 2px rgba(64, 57, 51, 0.04), 0 12px 32px -12px rgba(64, 57, 51, 0.12);
    --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}


/* ---------- Themes (mirrors AppTheme in Theme.swift) ---------- */

:root,
[data-theme="sage"] {
    --bg: #f3f1ed;
    --surface: #ede8df;
    --card: #ffffff;
    --ink: #403933;
    --ink-soft: #6b655e;
    --ink-faint: #a8a29b;
    --line: #dcd7cd;
    --sage: #8aae95;
    --sage-deep: #5f8870;
    --sage-wash: #e0eae0;
    --dark-surface: #403933;
    --dark-surface-hover: #2a251f;
    --preview-dot: #5f8870;
}

[data-theme="stone"] {
    --bg: #eef0ef;
    --surface: #e7e8ea;
    --card: #ffffff;
    --ink: #33383f;
    --ink-soft: #666b72;
    --ink-faint: #9ea3a8;
    --line: #d4d6d9;
    --sage: #8492a2;
    --sage-deep: #5a6877;
    --sage-wash: #e0e4ea;
    --dark-surface: #33383f;
    --dark-surface-hover: #1e2229;
    --preview-dot: #6b7785;
}

[data-theme="ocean"] {
    --bg: #ecf1f2;
    --surface: #e5ebed;
    --card: #ffffff;
    --ink: #2d3c41;
    --ink-soft: #606f74;
    --ink-faint: #98a5aa;
    --line: #d1d9dc;
    --sage: #57929c;
    --sage-deep: #38767e;
    --sage-wash: #dceaed;
    --dark-surface: #2d3c41;
    --dark-surface-hover: #1c282c;
    --preview-dot: #38767e;
}

[data-theme="clay"] {
    --bg: #f5f0eb;
    --surface: #efe9e3;
    --card: #ffffff;
    --ink: #44352d;
    --ink-soft: #72635a;
    --ink-faint: #a89d95;
    --line: #dcd5cc;
    --sage: #be8368;
    --sage-deep: #9c6146;
    --sage-wash: #eee3dc;
    --dark-surface: #44352d;
    --dark-surface-hover: #2e241e;
    --preview-dot: #a86a4f;
}

[data-theme="dusk"] {
    --bg: #f0edf2;
    --surface: #ebe6ed;
    --card: #ffffff;
    --ink: #3f3546;
    --ink-soft: #6d6374;
    --ink-faint: #a49ca9;
    --line: #d8d4dc;
    --sage: #937a9c;
    --sage-deep: #6f577a;
    --sage-wash: #e7e1ea;
    --dark-surface: #3f3546;
    --dark-surface-hover: #2a2230;
    --preview-dot: #796180;
}

[data-theme="midnight"] {
    --bg: #25282e;
    --surface: #2e3138;
    --card: #383c44;
    --ink: #e1e0dc;
    --ink-soft: #a5a4a0;
    --ink-faint: #78797d;
    --line: #464a52;
    --sage: #989e8e;
    --sage-deep: #808774;
    --sage-wash: #383e36;
    --dark-surface: #16181b;
    --dark-surface-hover: #0e0f11;
    --preview-dot: #484f5d;
}

/* Smooth theme switch */
html, body, header, footer, section, main,
.feature-card, .price-card, .principle, .short-version,
.swatch-dot, .nav-store, .appstore-img,
.doc-rule, details.faq, .doc-body blockquote {
    transition: background-color .5s ease, color .5s ease, border-color .5s ease;
}


/* ---------- Reset + base ---------- */

* { box-sizing: border-box; }

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

::selection {
    background: var(--sage);
    color: #fff;
}

a {
    color: var(--sage-deep);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 28px;
}


/* ---------- Header ---------- */

header.top {
    padding: 28px 0 0;
}

.top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    color: var(--ink);
}
.wordmark:hover { text-decoration: none; }
.wordmark img.logo {
    display: block;
    height: 28px;
    width: auto;
}

/* Logo variant swap: light wordmark on the Midnight theme */
.wordmark .logo-light,
footer .foot-logo.logo-light { display: none; }
[data-theme="midnight"] .wordmark .logo-dark,
[data-theme="midnight"] footer .foot-logo.logo-dark { display: none; }
[data-theme="midnight"] .wordmark .logo-light { display: block; }
[data-theme="midnight"] footer .foot-logo.logo-light { display: block; }

.nav-store {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--sans);
    font-weight: 500;
    font-size: 14px;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--dark-surface);
    color: #fff;
    transition: transform .15s ease, background .2s ease;
}
.nav-store:hover {
    background: var(--dark-surface-hover);
    text-decoration: none;
    transform: translateY(-1px);
}
.nav-store svg { width: 16px; height: 16px; }


/* ---------- Hero (index) ---------- */

.hero {
    padding: 90px 0 60px;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 64px;
    align-items: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 28px;
}
.eyebrow::before {
    content: "";
    width: 24px;
    height: 1px;
    background: var(--ink-faint);
}

h1.hero-title {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(56px, 9vw, 96px);
    line-height: 0.98;
    letter-spacing: -0.015em;
    color: var(--ink);
    margin: 0 0 28px;
}
h1.hero-title .fade {
    color: var(--sage-deep);
}

.hero-sub {
    font-size: 18px;
    line-height: 1.55;
    color: var(--ink-soft);
    max-width: 460px;
    margin: 0 0 36px;
}

.cta-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.appstore-img {
    display: inline-flex;
    align-items: center;
    border-radius: 14px;
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.appstore-img img {
    display: block;
    height: 56px;
    width: auto;
}
.appstore-img:hover {
    text-decoration: none;
    transform: translateY(-1px);
    filter: brightness(0.92);
}

.meta-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 13px;
}
.meta-line .pip {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--sage);
}

.hero-image {
    display: flex;
    justify-content: center;
}
.hero-image img {
    display: block;
    max-width: 100%;
    width: 360px;
    height: auto;
}

/* Hero fade-in — quiet, staggered, app-like */
@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes heroImageFade {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hero .eyebrow,
.hero h1.hero-title,
.hero .hero-sub,
.hero .cta-row,
.hero .hero-image {
    opacity: 0;
    will-change: opacity, transform;
    animation: heroFadeUp 900ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.hero .eyebrow      { animation-delay: 0ms; }
.hero h1.hero-title { animation-delay: 150ms; }
.hero .hero-sub     { animation-delay: 320ms; }
.hero .cta-row      { animation-delay: 480ms; }
.hero .hero-image {
    animation-name: heroImageFade;
    animation-duration: 1200ms;
    animation-delay: 220ms;
}

@media (prefers-reduced-motion: reduce) {
    .hero .eyebrow,
    .hero h1.hero-title,
    .hero .hero-sub,
    .hero .cta-row,
    .hero .hero-image {
        opacity: 1;
        transform: none;
        animation: none;
    }
}


/* ---------- Section base (index) ---------- */

section {
    padding: 90px 0;
}

.section-eyebrow {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 16px;
}

h2 {
    font-family: var(--sans);
    font-weight: 800;
    font-size: clamp(26px, 4vw, 42px);
    line-height: 1.05;
    letter-spacing: -0.005em;
    text-transform: uppercase;
    color: var(--ink);
    margin: 0 0 24px;
    max-width: 760px;
}
/* The closing call-to-action mirrors the editorial italic of the hero. */
.final-cta h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(36px, 5.5vw, 56px);
    line-height: 1.02;
    letter-spacing: -0.01em;
    text-transform: none;
}

.lede {
    font-size: 18px;
    color: var(--ink-soft);
    max-width: 580px;
    margin: 0 0 56px;
}


/* ---------- Principles (index) ---------- */

.principles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--line);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.principle {
    background: var(--bg);
    padding: 40px 32px;
}
.principle .num {
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    color: var(--sage-deep);
    margin-bottom: 12px;
    letter-spacing: 0.04em;
}
.principle h3 {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 18px;
    line-height: 1.15;
    letter-spacing: 0;
    text-transform: uppercase;
    margin: 0 0 12px;
    color: var(--ink);
}
.principle p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink-soft);
    margin: 0;
}


/* ---------- Feature row (index) ---------- */

.features {
    background: var(--surface);
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 24px;
}
.feature-card {
    background: var(--card);
    border-radius: 18px;
    padding: 28px 24px;
    box-shadow: var(--shadow);
}
.feature-card .ico {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--sage-wash);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: var(--sage-deep);
}
.feature-card .ico svg { width: 20px; height: 20px; }
.feature-card h3 {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    margin: 0 0 8px;
    color: var(--ink);
}
.feature-card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink-soft);
}


/* ---------- Themes strip (index) ---------- */

.themes {
    text-align: center;
}
.swatches {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    flex-wrap: wrap;
}
.swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: 0;
    padding: 6px 4px;
    cursor: pointer;
    font: inherit;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}
.swatch-dot {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    box-shadow: 0 6px 14px -6px rgba(0,0,0,0.3);
    transition: transform .25s ease, box-shadow .25s ease;
}
.swatch:hover .swatch-dot {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -8px rgba(0,0,0,0.35);
}
.swatch.is-selected .swatch-dot {
    box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--sage-deep), 0 6px 14px -6px rgba(0,0,0,0.3);
}
.swatch.is-selected .swatch-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7.5'/></svg>") center / 22px no-repeat;
}
.swatch span {
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-soft);
    letter-spacing: 0.02em;
}
.swatch.is-selected span {
    color: var(--sage-deep);
}


/* ---------- Pricing (index) ---------- */

.pricing {
    background: var(--surface);
}
.price-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 24px;
}
.price-card {
    background: var(--card);
    border-radius: 18px;
    padding: 32px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.price-card.featured {
    background: var(--dark-surface);
    color: #f0ece2;
}
.price-card .tier {
    font-family: var(--serif);
    font-style: italic;
    font-size: 22px;
    color: var(--ink);
    margin-bottom: 6px;
}
.price-card.featured .tier { color: #fff; }
.price-card .price {
    font-family: var(--serif);
    font-size: 44px;
    line-height: 1;
    margin: 4px 0 18px;
    color: var(--ink);
}
.price-card.featured .price { color: #fff; }
.price-card .price small {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-faint);
    letter-spacing: 0.02em;
    margin-left: 4px;
}
.price-card.featured .price small { color: rgba(255,255,255,0.5); }
.price-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink-soft);
}
.price-card.featured ul { color: rgba(255,255,255,0.75); }
.price-card ul li {
    padding-left: 22px;
    position: relative;
}
.price-card ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 12px;
    height: 1px;
    background: var(--sage-deep);
}
.price-card.featured ul li::before { background: var(--sage); }
.price-foot {
    margin-top: auto;
    font-size: 12px;
    color: var(--ink-faint);
}
.price-card.featured .price-foot { color: rgba(255,255,255,0.5); }


/* ---------- FAQ (index) ---------- */

.faq-list {
    margin-top: 16px;
    border-top: 1px solid var(--line);
}
details.faq {
    border-bottom: 1px solid var(--line);
    padding: 22px 0;
}
details.faq summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    font-size: 18px;
    font-weight: 500;
    color: var(--ink);
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
    content: "+";
    font-family: var(--serif);
    font-size: 26px;
    line-height: 1;
    color: var(--sage-deep);
    transition: transform .25s ease;
}
details.faq[open] summary::after {
    content: "−";
}
details.faq p {
    margin: 14px 0 0;
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink-soft);
    max-width: 720px;
}


/* ---------- Final CTA (index) ---------- */

.final-cta {
    text-align: center;
    padding: 110px 0 90px;
}
.final-cta h2 {
    margin: 0 auto 28px;
    max-width: 720px;
}
.final-cta .cta-row {
    justify-content: center;
}


/* ---------- Document pages (privacy / terms) ---------- */

.doc-head {
    max-width: 720px;
    margin: 0 auto;
    padding: 80px 0 24px;
    text-align: center;
}
.doc-eyebrow {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 18px;
}
h1.doc-title {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(44px, 6vw, 64px);
    line-height: 1.02;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 0 0 18px;
}
.doc-effective {
    font-size: 14px;
    color: var(--ink-soft);
    font-style: italic;
    font-family: var(--serif);
}
.doc-rule {
    max-width: 720px;
    margin: 56px auto 0;
    height: 1px;
    background: var(--line);
}

.doc-body {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 0 80px;
    line-height: 1.65;
}

.doc-body p {
    margin: 0 0 1.1em;
    color: var(--ink);
}

/* Inline anchors in legal copy get a subtle underline rule */
.doc-body a,
.doc-body strong + a,
.short-version a {
    border-bottom: 1px solid var(--line);
    padding-bottom: 1px;
}
.doc-body a:hover,
.short-version a:hover {
    text-decoration: none;
    border-bottom-color: var(--sage-deep);
}

.doc-body h2 {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 22px;
    line-height: 1.15;
    letter-spacing: -0.005em;
    text-transform: uppercase;
    color: var(--ink);
    margin: 56px 0 18px;
    position: relative;
    max-width: none;
}
.doc-body h2 .num {
    display: block;
    font-family: var(--sans);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sage-deep);
    margin-bottom: 10px;
}

.doc-body h3 {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 13px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--ink);
    margin: 32px 0 8px;
}

.doc-body ul {
    padding-left: 0;
    list-style: none;
    margin: 0 0 1.4em;
}
.doc-body ul li {
    position: relative;
    padding: 4px 0 4px 26px;
    color: var(--ink);
}
.doc-body ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 16px;
    width: 14px;
    height: 1px;
    background: var(--sage-deep);
}
.doc-body ul li strong { font-weight: 600; color: var(--ink); }

.doc-body blockquote {
    margin: 32px 0;
    padding: 20px 24px;
    background: var(--surface);
    border-left: 2px solid var(--sage-deep);
    border-radius: 4px;
    font-size: 16px;
    color: var(--ink-soft);
}
.doc-body blockquote p:last-child { margin-bottom: 0; }

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

.doc-body .all-caps {
    font-size: 13px;
    line-height: 1.7;
    color: var(--ink-soft);
    letter-spacing: 0.02em;
}

.short-version {
    background: var(--card);
    border-radius: 16px;
    padding: 28px 32px;
    margin: 32px 0 40px;
    box-shadow: var(--shadow);
}
.short-version h2 {
    margin-top: 0;
    font-size: 18px;
}
.short-version ul li { padding-top: 6px; padding-bottom: 6px; }


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

footer {
    border-top: 1px solid var(--line);
    padding: 48px 0 56px;
    font-size: 14px;
    color: var(--ink-soft);
}
footer .foot-logo {
    display: block;
    height: 32px;
    width: auto;
    margin-bottom: 10px;
}
footer .foot-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    flex-wrap: wrap;
}
footer .links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
footer .links a {
    color: var(--ink-soft);
}
footer .links a:hover { color: var(--sage-deep); }
footer .colophon {
    font-size: 12px;
    color: var(--ink-faint);
    margin-top: 28px;
    letter-spacing: 0.02em;
}
footer .colophon a {
    color: var(--ink-soft);
    border-bottom: 1px solid var(--line);
    padding-bottom: 1px;
}
footer .colophon a:hover {
    color: var(--sage-deep);
    border-bottom-color: var(--sage-deep);
    text-decoration: none;
}


/* ---------- Responsive ---------- */

@media (max-width: 880px) {
    .hero { padding: 60px 0 40px; }
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 56px;
    }
    .hero-image img { width: 280px; }
    .feature-grid { grid-template-columns: 1fr; }
    .principles { grid-template-columns: 1fr; }
    .price-grid { grid-template-columns: 1fr; }
    section { padding: 64px 0; }
    .final-cta { padding: 80px 0 64px; }
}

@media (max-width: 600px) {
    .doc-head { padding: 56px 0 16px; }
    .doc-rule { margin-top: 40px; }
    .doc-body { padding: 36px 0 56px; }
    .doc-body h2 { font-size: 20px; }
    .short-version { padding: 22px; }
}

@media (max-width: 480px) {
    .wrap { padding: 0 20px; }
    .nav-store .label-long { display: none; }
    .swatches {
        gap: 16px;
        flex-wrap: nowrap;
    }
    .swatch {
        padding: 6px 0;
        gap: 10px;
    }
    .swatch-dot { width: 36px; height: 36px; }
    .swatch.is-selected .swatch-dot {
        box-shadow:
            0 0 0 2px var(--bg),
            0 0 0 3px var(--sage-deep),
            0 4px 10px -4px rgba(0,0,0,0.3);
    }
    .swatch.is-selected .swatch-dot::after { background-size: 16px; }
    .swatch span {
        font-size: 10px;
        letter-spacing: 0;
    }
}
