/* ===========================================================
   Fliporium website
   - System fonts only (no Google Fonts, no third-party CDNs).
   - Dark theme by default; light theme via prefers-color-scheme.
   - Zero JS analytics, zero cookies, zero trackers.
   =========================================================== */

:root {
    --bg:          #131318;
    --bg-soft:     #1a1a22;
    --bg-card:     #16161d;
    --ink:         #f1f1ff;
    --ink-soft:    #d8dee9;
    --ink-muted:   #9aa0ad;
    --purple:      #c9a7ff;
    --purple-deep: #5b3aa3;
    --cream:       #fff5d1;
    --green:       #4ade80;
    --rule:        #2a2a36;
    --shadow:      0 12px 36px rgba(0, 0, 0, 0.45);
    --serif:       ui-serif, "Iowan Old Style", "Apple Garamond", Baskerville,
                   "Times New Roman", "Droid Serif", Times, "Source Serif Pro",
                   serif, "Apple Color Emoji", "Segoe UI Emoji";
    --sans:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                   "Helvetica Neue", Arial, sans-serif;
    --mono:        ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                   "Liberation Mono", monospace;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg:          #faf8f2;
        --bg-soft:     #ffffff;
        --bg-card:     #fff;
        --ink:         #1c1c24;
        --ink-soft:    #2a2a36;
        --ink-muted:   #6f7384;
        --purple-deep: #4a2d8a;
        --rule:        #e6e2d4;
        --shadow:      0 12px 36px rgba(70, 40, 100, 0.08);
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink-soft);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--purple);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover { color: var(--cream); }

code {
    font-family: var(--mono);
    font-size: 0.9em;
    background: rgba(201, 167, 255, 0.12);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--purple);
}

/* ============== topnav ============== */
.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    max-width: 1200px;
    margin: 0 auto;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--serif);
    font-weight: 600;
    font-size: 22px;
    letter-spacing: 0.01em;
    color: var(--ink);
}
.brand:hover { color: var(--purple); }
.brand img { display: block; }
.topnav nav {
    display: flex;
    gap: 28px;
}
.topnav nav a {
    color: var(--ink-muted);
    font-size: 15px;
    letter-spacing: 0.02em;
}
.topnav nav a:hover { color: var(--ink); }

/* ============== hero ============== */
.hero {
    position: relative;
    padding: 60px 32px 100px;
    overflow: hidden;
}
.hero-stripes {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at top, rgba(201, 167, 255, 0.10), transparent 60%),
        repeating-linear-gradient(
            115deg,
            transparent 0,
            transparent 40px,
            rgba(201, 167, 255, 0.025) 40px,
            rgba(201, 167, 255, 0.025) 80px
        );
    z-index: 0;
    pointer-events: none;
}
.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}
.hero-mark {
    display: block;
    margin: 0 auto 28px;
    filter: drop-shadow(0 10px 24px rgba(91, 58, 163, 0.35));
}
.hero h1 {
    font-family: var(--serif);
    font-size: clamp(48px, 8vw, 88px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    margin: 0 0 24px;
    color: var(--ink);
    background: linear-gradient(180deg, var(--ink) 30%, var(--purple) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
@media (prefers-color-scheme: light) {
    .hero h1 {
        background: linear-gradient(180deg, var(--ink) 30%, var(--purple-deep) 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}
.tagline {
    font-family: var(--serif);
    font-size: clamp(20px, 2.4vw, 26px);
    font-style: italic;
    color: var(--ink-soft);
    margin: 0 auto 40px;
    max-width: 560px;
    line-height: 1.4;
}
.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin-bottom: 18px;
}

.btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 10px;
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
    text-decoration: none;
    border: 1px solid transparent;
}
.btn small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    margin-top: 4px;
    opacity: 0.8;
    letter-spacing: 0.04em;
}
.btn-primary {
    background: var(--purple);
    color: #2a1a4a;
    box-shadow: 0 8px 24px rgba(201, 167, 255, 0.35);
}
.btn-primary:hover {
    background: var(--cream);
    color: var(--purple-deep);
    transform: translateY(-1px);
}
.btn-ghost {
    background: transparent;
    color: var(--ink-soft);
    border-color: var(--rule);
    padding-top: 22px;
}
.btn-ghost:hover {
    color: var(--ink);
    border-color: var(--purple);
}
.hero-fineprint {
    font-size: 13px;
    color: var(--ink-muted);
    margin: 6px 0 0;
    letter-spacing: 0.02em;
}

/* ============== prose sections ============== */
section {
    max-width: 760px;
    margin: 0 auto;
    padding: 60px 32px;
}
section h2 {
    font-family: var(--serif);
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin: 0 0 28px;
    line-height: 1.15;
}
section h3 {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 10px;
}
section p {
    margin: 0 0 18px;
    color: var(--ink-soft);
    max-width: 64ch;
}
.prose em {
    font-style: italic;
    color: var(--cream);
}
@media (prefers-color-scheme: light) {
    .prose em { color: var(--purple-deep); }
}

/* ============== features grid ============== */
.features {
    max-width: 1100px;
    padding-top: 80px;
    padding-bottom: 80px;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}
.feature {
    background: var(--bg-card);
    border: 1px solid var(--rule);
    border-radius: 14px;
    padding: 28px 26px;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.feature:hover {
    border-color: rgba(201, 167, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.feature-icon {
    font-size: 32px;
    line-height: 1;
    margin-bottom: 14px;
}
.feature h3 { margin-bottom: 8px; }
.feature p {
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink-muted);
    margin: 0;
    max-width: none;
}

/* ============== privacy promise + quickstart ============== */
.privacy-promise {
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding-top: 60px;
    padding-bottom: 60px;
}

.quickstart h2 { text-align: center; }
.steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 40px 0;
    display: grid;
    gap: 18px;
}
.steps li {
    counter-increment: step;
    position: relative;
    padding: 22px 26px 22px 78px;
    background: var(--bg-card);
    border: 1px solid var(--rule);
    border-radius: 12px;
    font-size: 16px;
    color: var(--ink-soft);
}
.steps li::before {
    content: counter(step);
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--purple);
    color: #2a1a4a;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.steps strong {
    color: var(--ink);
    font-weight: 600;
}
.quickstart-cta {
    text-align: center;
    margin-top: 30px;
}

/* ============== footer ============== */
.sitefoot {
    border-top: 1px solid var(--rule);
    margin-top: 40px;
    padding: 50px 32px;
    background: var(--bg-soft);
}
.foot-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}
.sitefoot nav {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}
.sitefoot nav a {
    color: var(--ink-muted);
    font-size: 14px;
}
.sitefoot nav a:hover { color: var(--ink); }
.foot-line {
    color: var(--ink-muted);
    font-size: 13px;
    margin: 0;
    max-width: 480px;
}

/* ============== docs / privacy / stats shared ============== */
.page-title {
    text-align: center;
    padding: 60px 32px 20px;
}
.page-title h1 {
    font-family: var(--serif);
    font-size: clamp(38px, 6vw, 56px);
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--ink);
    letter-spacing: -0.02em;
}
.page-title p {
    color: var(--ink-muted);
    font-size: 18px;
    max-width: 540px;
    margin: 0 auto;
    font-style: italic;
    font-family: var(--serif);
}

.doc {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 32px 80px;
}
.doc h2 {
    font-family: var(--serif);
    font-size: 30px;
    font-weight: 600;
    color: var(--ink);
    margin: 56px 0 16px;
    letter-spacing: -0.01em;
}
.doc h2:first-of-type { margin-top: 24px; }
.doc h3 {
    font-family: var(--sans);
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    margin: 32px 0 10px;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}
.doc p { color: var(--ink-soft); }
.doc ul, .doc ol {
    padding-left: 24px;
    margin: 0 0 18px;
    color: var(--ink-soft);
}
.doc li { margin-bottom: 8px; }
.doc blockquote {
    margin: 20px 0;
    padding: 14px 22px;
    border-left: 3px solid var(--purple);
    background: rgba(201, 167, 255, 0.06);
    color: var(--ink-soft);
    font-style: italic;
    border-radius: 0 8px 8px 0;
}
.doc dl { margin: 0; }
.doc dt {
    font-weight: 600;
    color: var(--ink);
    margin-top: 16px;
    font-family: var(--serif);
    font-size: 18px;
}
.doc dd {
    margin: 4px 0 0;
    color: var(--ink-soft);
}

.toc {
    background: var(--bg-card);
    border: 1px solid var(--rule);
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 36px;
}
.toc strong {
    display: block;
    font-family: var(--serif);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-muted);
    margin-bottom: 10px;
    font-weight: 600;
}
.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    column-gap: 30px;
}
.toc li { margin-bottom: 6px; break-inside: avoid; }
.toc a { color: var(--ink-soft); }
.toc a:hover { color: var(--purple); }

/* ============== stats page ============== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 32px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--rule);
    border-radius: 14px;
    padding: 32px 28px;
    text-align: center;
}
.stat-num {
    font-family: var(--serif);
    font-size: clamp(48px, 8vw, 72px);
    font-weight: 600;
    color: var(--purple);
    line-height: 1;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.stat-num.pending::after {
    content: "—";
    color: var(--ink-muted);
}
.stat-label {
    color: var(--ink-muted);
    font-size: 14px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 500;
    margin: 0;
}
.stat-note {
    text-align: center;
    color: var(--ink-muted);
    font-size: 13px;
    margin-top: 36px;
    font-style: italic;
}

/* ============== responsive ============== */
@media (max-width: 640px) {
    .topnav { padding: 16px 20px; }
    .topnav nav { gap: 16px; }
    .topnav nav a { font-size: 14px; }
    .brand span { font-size: 18px; }
    .hero { padding: 32px 20px 60px; }
    .hero-mark { width: 120px; height: 120px; margin-bottom: 20px; }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .btn { width: 100%; }
    section { padding: 40px 20px; }
    .features { padding: 60px 20px; }
    .toc ul { columns: 1; }
}
