/* ----------------------------------------------------------------- *
 * SageCast landing page — modern, minimal, brand-matched.
 * Default to dark theme (matching the dark app icon). Auto-switches
 * to light if the visitor prefers light. Single column, fluid type.
 * ----------------------------------------------------------------- */

:root {
    /* Brand */
    --coral: #FF8866;
    --coral-soft: rgba(255, 136, 102, 0.18);
    --plum: #3A1E3F;

    /* Dark theme (default) */
    --bg: #0E0B12;
    --bg-elev: #161220;
    --bg-card: #1A1525;
    --hairline: rgba(255, 255, 255, 0.08);
    --text: #F4EFEC;
    --text-muted: rgba(244, 239, 236, 0.65);
    --text-faint: rgba(244, 239, 236, 0.4);
    --accent: var(--coral);
    --accent-text: #1A0F1F;

    /* Sizing */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --content-max: 960px;
    --reading-max: 720px;
}

/* Auto: respect the OS preference unless an override is set. */
@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        --bg: #FAF7F3;
        --bg-elev: #FFFFFF;
        --bg-card: #FFFFFF;
        --hairline: rgba(0, 0, 0, 0.08);
        --text: #1A0F1F;
        --text-muted: rgba(26, 15, 31, 0.65);
        --text-faint: rgba(26, 15, 31, 0.4);
        --accent: var(--plum);
        --accent-text: #FFFFFF;
    }
}

/* Manual override via [data-theme="light|dark"] on <html>. */
:root[data-theme="light"] {
    --bg: #FAF7F3;
    --bg-elev: #FFFFFF;
    --bg-card: #FFFFFF;
    --hairline: rgba(0, 0, 0, 0.08);
    --text: #1A0F1F;
    --text-muted: rgba(26, 15, 31, 0.65);
    --text-faint: rgba(26, 15, 31, 0.4);
    --accent: var(--plum);
    --accent-text: #FFFFFF;
}
:root[data-theme="dark"] {
    --bg: #0E0B12;
    --bg-elev: #161220;
    --bg-card: #1A1525;
    --hairline: rgba(255, 255, 255, 0.08);
    --text: #F4EFEC;
    --text-muted: rgba(244, 239, 236, 0.65);
    --text-faint: rgba(244, 239, 236, 0.4);
    --accent: var(--coral);
    --accent-text: #1A0F1F;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.85; }

code {
    font-family: "SF Mono", ui-monospace, Menlo, monospace;
    font-size: 0.92em;
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: 4px;
    padding: 1px 6px;
}

/* ------------------------------ Topbar ------------------------------ */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px max(24px, calc((100vw - var(--content-max)) / 2));
    backdrop-filter: saturate(140%) blur(12px);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
    background: color-mix(in srgb, var(--bg) 75%, transparent);
    border-bottom: 1px solid var(--hairline);
}

.brand { display: flex; align-items: center; gap: 8px; color: var(--text); }
.brand-mark { width: 22px; height: 22px; }
.brand-name {
    font-weight: 600;
    letter-spacing: 0.04em;
    font-size: 15px;
}

.topnav { display: flex; align-items: center; gap: 22px; }
.topnav a { color: var(--text-muted); font-size: 14px; }
.topnav a:hover { color: var(--text); opacity: 1; }

.theme-toggle {
    background: transparent;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    padding: 6px 8px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: color-mix(in srgb, var(--text) 25%, var(--hairline)); }
.theme-toggle-icon { display: block; }
:root[data-theme="dark"] .theme-toggle-sun,
:root:not([data-theme]) .theme-toggle-sun { display: block; }
:root[data-theme="dark"] .theme-toggle-moon,
:root:not([data-theme]) .theme-toggle-moon { display: none; }
:root[data-theme="light"] .theme-toggle-sun { display: none; }
:root[data-theme="light"] .theme-toggle-moon { display: block; }
@media (prefers-color-scheme: light) {
    :root:not([data-theme]) .theme-toggle-sun { display: none; }
    :root:not([data-theme]) .theme-toggle-moon { display: block; }
}
.topnav-cta {
    background: var(--accent);
    color: var(--accent-text) !important;
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 600;
}
.topnav-cta:hover { opacity: 0.9; }

@media (max-width: 640px) {
    .topnav a:not(.topnav-cta) { display: none; }
}

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

.hero {
    padding: 96px max(24px, calc((100vw - var(--content-max)) / 2)) 64px;
    background:
        radial-gradient(800px 600px at 20% -10%, var(--coral-soft), transparent 60%),
        radial-gradient(700px 500px at 90% 0%, color-mix(in srgb, var(--plum) 30%, transparent), transparent 70%);
}

.hero-inner { max-width: var(--reading-max); margin: 0 auto; text-align: center; }

.hero-icon {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-xl);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.45),
        0 0 0 1px var(--hairline);
    margin-bottom: 28px;
}

.eyebrow {
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--text-faint);
    text-transform: uppercase;
    margin-bottom: 14px;
}

.hero h1 {
    font-size: clamp(32px, 5.4vw, 54px);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin-bottom: 22px;
}

.lede {
    color: var(--text-muted);
    font-size: clamp(15px, 1.5vw, 18px);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.cta-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 36px 0 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    transition: transform 0.12s ease, opacity 0.12s ease;
    cursor: pointer;
}
.btn:hover { transform: translateY(-1px); opacity: 1; }
.btn-lg { padding: 14px 26px; font-size: 15px; }

.btn-primary {
    background: var(--accent);
    color: var(--accent-text);
}
.btn-primary .btn-meta {
    color: color-mix(in srgb, var(--accent-text) 70%, transparent);
    font-size: 12px;
    font-weight: 500;
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--hairline);
}
.btn-ghost:hover { background: var(--bg-card); }

.btn-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}
.btn-disabled .btn-meta {
    color: var(--text-faint);
    font-size: 12px;
    font-weight: 500;
}

.hero-foot {
    color: var(--text-faint);
    font-size: 13px;
    margin-top: 8px;
}

/* ----------------------------- Sections ----------------------------- */

section { padding: 96px max(24px, calc((100vw - var(--content-max)) / 2)); }
section + section { border-top: 1px solid var(--hairline); }

.section-head {
    max-width: var(--reading-max);
    margin: 0 auto 48px;
    text-align: center;
}
.section-head h2 {
    font-size: clamp(26px, 3.4vw, 38px);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.2;
}
.section-head p.lede { margin-top: 16px; }

/* ----------------------------- Features ----------------------------- */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    max-width: var(--content-max);
    margin: 0 auto;
}

.feature {
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.feature:hover {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--hairline));
    transform: translateY(-2px);
}
.feature-glyph {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}
.dot { width: 12px; height: 12px; border-radius: 50%; display: block; }
.dot-coral { background: var(--coral); }
.dot-plum  { background: color-mix(in srgb, var(--plum) 60%, var(--text)); }

.feature h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.005em;
}
.feature p {
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.55;
}

/* --------------------------- Screenshots ---------------------------- */

/* Horizontal scroll strip. The section breaks the page's content max
 * width so the strip can extend edge-to-edge while the section head
 * stays centered. */
.screenshots {
    overflow: hidden; /* clip whatever the strip extends past */
}

.screenshot-strip {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px max(24px, calc((100vw - var(--content-max)) / 2)) 18px;
    margin: 0 calc(-1 * max(24px, calc((100vw - var(--content-max)) / 2)));
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scroll-padding: 0 max(24px, calc((100vw - var(--content-max)) / 2));
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--hairline) transparent;
}
.screenshot-strip::-webkit-scrollbar { height: 8px; }
.screenshot-strip::-webkit-scrollbar-track { background: transparent; }
.screenshot-strip::-webkit-scrollbar-thumb {
    background: var(--hairline);
    border-radius: 999px;
}
.screenshot-strip::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--text) 25%, var(--hairline));
}
.screenshot-strip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: var(--radius);
}

.shot {
    flex: 0 0 auto;
    width: clamp(280px, 60vw, 640px);
    scroll-snap-align: center;
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.shot:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 30%, var(--hairline));
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
}
.shot img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid var(--hairline);
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top;
}
.shot figcaption {
    padding: 14px 18px;
    color: var(--text-muted);
    font-size: 13.5px;
    line-height: 1.45;
}

.strip-hint {
    text-align: center;
    color: var(--text-faint);
    font-size: 12px;
    letter-spacing: 0.08em;
    margin-top: 18px;
    user-select: none;
}

@media (min-width: 900px) {
    .strip-hint { display: none; }
}

/* ----------------------------- Privacy ------------------------------ */

.bullets {
    list-style: none;
    max-width: var(--reading-max);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.bullets li {
    padding: 18px 22px;
    border-left: 2px solid var(--accent);
    background: var(--bg-card);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
}
.bullets strong { color: var(--text); font-weight: 600; }

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

.pricing-card {
    max-width: 520px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    position: relative;
    overflow: hidden;
}
.pricing-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(420px 280px at 20% 0%, var(--coral-soft), transparent 60%),
        radial-gradient(360px 240px at 100% 100%, color-mix(in srgb, var(--plum) 20%, transparent), transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.pricing-card > * { position: relative; z-index: 1; }

.pricing-amount {
    display: flex;
    align-items: baseline;
    gap: 8px;
    justify-content: center;
    margin-bottom: 28px;
}
.price {
    font-size: 64px;
    font-weight: 600;
    letter-spacing: -0.04em;
    color: var(--text);
    line-height: 1;
}
.price-meta {
    font-size: 14px;
    color: var(--text-faint);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.pricing-list {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pricing-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.5;
}
.pricing-list .check {
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.pricing-cta {
    display: flex !important;
    width: 100%;
    justify-content: center;
}

.pricing-fineprint {
    max-width: var(--reading-max);
    margin: 28px auto 0;
    text-align: center;
    color: var(--text-faint);
    font-size: 13.5px;
    line-height: 1.6;
}

/* ----------------------------- Download ----------------------------- */

.download .section-head { margin-bottom: 32px; }
.download-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.download-foot {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.install-list {
    max-width: var(--reading-max);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.install-option {
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.install-option:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent) 25%, var(--hairline));
}
.install-option.recommended {
    border-color: color-mix(in srgb, var(--accent) 50%, var(--hairline));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

.install-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}
.install-rank {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}
.install-option.recommended .install-rank {
    background: var(--accent);
    color: var(--accent-text);
}
.install-head h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.005em;
}
.install-head p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}
.install-tag {
    display: inline-block;
    margin-left: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    padding: 2px 8px;
    border-radius: 999px;
    vertical-align: 2px;
}

.install-cmd {
    background: var(--bg);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 12px 0;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.5;
}
.install-cmd code {
    background: transparent;
    border: 0;
    padding: 0;
    font-size: 13.5px;
    white-space: pre;
    color: var(--text);
}

.install-actions {
    margin: 8px 0 16px;
}

.install-steps {
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.65;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 4px 0 8px;
}
.install-steps strong { color: var(--text); }

.install-note {
    color: var(--text-faint);
    font-size: 13px;
    line-height: 1.6;
    margin-top: 12px;
}
.install-note a { color: var(--accent); }

/* ------------------------------ FAQ --------------------------------- */

.faq-list {
    max-width: var(--reading-max);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.faq-list details {
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 14px 18px;
    transition: border-color 0.15s ease;
}
.faq-list details[open] {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--hairline));
}
.faq-list summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
    content: "+";
    font-size: 20px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    line-height: 1;
}
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p {
    color: var(--text-muted);
    font-size: 14.5px;
    margin-top: 10px;
    line-height: 1.6;
}

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

.footer {
    padding: 48px max(24px, calc((100vw - var(--content-max)) / 2));
    text-align: center;
    border-top: 1px solid var(--hairline);
    color: var(--text-muted);
    font-size: 14px;
}
.footer-line { margin-bottom: 6px; }
.footer-line.muted { color: var(--text-faint); font-size: 13px; }
.footer a { color: var(--text); border-bottom: 1px solid var(--hairline); }
.footer a:hover { border-color: var(--accent); }

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

@media (max-width: 640px) {
    .hero { padding: 64px 20px 48px; }
    .hero-icon { width: 80px; height: 80px; margin-bottom: 22px; }
    section { padding: 64px 20px; }
    .feature { padding: 22px 20px; }
}

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

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