/* ============================================================
   Wisp landing page — Tones the same way the app does.
   Charter-first serif stack. Generous whitespace. One accent.
   ============================================================ */

:root {
    /* Dark theme — warm cream on deep blue-black (mirrors Wisp's
       default dark Palette: text #f1eee4 = rgb(243, 237, 227)).   */
    --bg: #0f0f12;
    --bg-elev: #16161b;
    --bg-glass: rgba(22, 22, 27, 0.65);
    --text: #f3ede3;
    --text-muted: rgba(243, 237, 227, 0.55);
    --text-faint: rgba(243, 237, 227, 0.28);
    --line: rgba(243, 237, 227, 0.08);
    --accent: #f3ede3;
    --accent-on: #0f0f12;
    --kbd-bg: rgba(243, 237, 227, 0.08);

    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 6px;

    --serif: "Charter", "Iowan Old Style", "Hoefler Text", "Palatino", "Source Serif Pro", "Georgia", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", system-ui, sans-serif;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

    --max-w: 1080px;
    --pad: clamp(1.5rem, 4vw, 4rem);
}

html[data-theme="light"] {
    --bg: #ffffff;
    --bg-elev: #f7f5f0;
    --bg-glass: rgba(247, 245, 240, 0.65);
    --text: #1a1a1e;
    --text-muted: rgba(26, 26, 30, 0.55);
    --text-faint: rgba(26, 26, 30, 0.32);
    --line: rgba(26, 26, 30, 0.10);
    --accent: #1a1a1e;
    --accent-on: #ffffff;
    --kbd-bg: rgba(26, 26, 30, 0.06);
}

@media (prefers-color-scheme: light) {
    html[data-theme="system"] {
        --bg: #ffffff;
        --bg-elev: #f7f5f0;
        --bg-glass: rgba(247, 245, 240, 0.65);
        --text: #1a1a1e;
        --text-muted: rgba(26, 26, 30, 0.55);
        --text-faint: rgba(26, 26, 30, 0.32);
        --line: rgba(26, 26, 30, 0.10);
        --accent: #1a1a1e;
        --accent-on: #ffffff;
        --kbd-bg: rgba(26, 26, 30, 0.06);
    }
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--serif);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    font-size: 17px;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

::selection {
    background: var(--accent);
    color: var(--accent-on);
}

/* -------------------------- Navigation -------------------------- */

.nav {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem var(--pad);
    background: var(--bg-glass);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: var(--text);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--accent);
    color: var(--accent-on);
    font-family: var(--serif);
    font-weight: 600;
    font-size: 17px;
    line-height: 1;
}

.brand-name {
    font-family: var(--serif);
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.6rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--sans);
    font-size: 0.9rem;
    transition: color 0.15s ease;
}

.nav-links a:hover {
    color: var(--text);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle svg {
    width: 14px;
    height: 14px;
}

.theme-toggle:hover {
    color: var(--text);
    border-color: var(--text-faint);
}

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

main {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--pad);
}

.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 5rem);
    padding: clamp(3rem, 8vw, 8rem) 0 clamp(3rem, 6vw, 6rem);
    align-items: center;
}

.hero-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.5rem, 5.5vw, 4.2rem);
    line-height: 1.05;
    letter-spacing: -0.025em;
    margin-bottom: 1.8rem;
}

.hero-line {
    display: block;
}

.hero-line.muted {
    color: var(--text-muted);
}

.hero-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 32rem;
    line-height: 1.65;
}

.hero-desc kbd {
    font-family: var(--mono);
    font-size: 0.82em;
    padding: 0.1em 0.4em;
    background: var(--kbd-bg);
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--text);
    white-space: nowrap;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-bottom: 1.2rem;
}

.hero-fine {
    color: var(--text-faint);
    font-family: var(--sans);
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}

/* ------------------------------ Buttons ------------------------------ */

.btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.6rem;
    border-radius: var(--radius-sm);
    font-family: var(--sans);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-on);
}

.btn-primary:hover {
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--line);
}

.btn-ghost:hover {
    border-color: var(--text-faint);
}

.btn-large {
    padding: 1.1rem 2.4rem;
    font-size: 1.05rem;
}

.btn-label {
    font-weight: 500;
}

.btn-meta {
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.65;
    letter-spacing: 0.02em;
    margin-top: 0.18rem;
}

/* --------------------- Faux Wisp panel preview --------------------- */

.hero-visual {
    position: relative;
}

.desktop {
    position: relative;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #1a1a22 0%, #0c0c10 100%);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5), 0 0 0 1px var(--line);
}

html[data-theme="light"] .desktop,
html[data-theme="system"] .desktop {
    background: linear-gradient(135deg, #d1c7b4 0%, #b9ab93 100%);
}

@media (prefers-color-scheme: light) {
    html[data-theme="system"] .desktop {
        background: linear-gradient(135deg, #d1c7b4 0%, #b9ab93 100%);
    }
}

.menubar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 26px;
    background: rgba(20, 20, 26, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 1rem;
    gap: 0.8rem;
}

.menubar-glyph {
    color: rgba(255,255,255,0.65);
    font-size: 0.85rem;
    transform: rotate(-15deg);
    animation: wisp-pulse 6s ease-in-out infinite;
}

@keyframes wisp-pulse {
    0%, 100% { opacity: 0.65; transform: rotate(-15deg) scale(1); }
    50% { opacity: 0.95; transform: rotate(-15deg) scale(1.05); }
}

.menubar-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #5fbe5f;
    box-shadow: 0 0 6px rgba(95, 190, 95, 0.6);
}

.panel {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 84%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 26, 0.78);
    backdrop-filter: blur(30px) saturate(160%);
    -webkit-backdrop-filter: blur(30px) saturate(160%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 25px 60px rgba(0,0,0,0.45);
    overflow: hidden;
    color: #f3ede3;
    animation: panel-in 0.6s ease-out;
}

html[data-theme="light"] .panel,
html[data-theme="system"] .panel {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0,0,0,0.08);
    color: #1a1a1e;
}

@media (prefers-color-scheme: light) {
    html[data-theme="system"] .panel {
        background: rgba(255, 255, 255, 0.92);
        border-color: rgba(0,0,0,0.08);
        color: #1a1a1e;
    }
}

@keyframes panel-in {
    from { opacity: 0; transform: translate(-50%, -47%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.panel-body {
    padding: 1.4rem 1.6rem 1rem;
    font-family: var(--serif);
    font-size: 0.92rem;
    line-height: 1.55;
}

.panel-line {
    margin: 0.2rem 0;
}

.panel-h {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 0.5rem;
}

.panel-divider {
    height: 1px;
    background: currentColor;
    opacity: 0.32;
    margin: 0.7rem 0;
    border: 0;
}

.panel-muted {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85em;
}

.panel-cursor {
    display: inline-block;
    width: 1px;
    height: 1em;
    background: currentColor;
    vertical-align: text-bottom;
    margin-left: 1px;
    animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.panel-footer {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 1.6rem;
    font-family: var(--sans);
    font-size: 0.7rem;
    opacity: 0.55;
    border-top: 1px solid rgba(255,255,255,0.04);
}

html[data-theme="light"] .panel-footer,
html[data-theme="system"] .panel-footer {
    border-top-color: rgba(0,0,0,0.05);
}

.kbd-hint {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.25rem;
    opacity: 0.6;
    animation: hint-pulse 3s ease-in-out infinite;
}

.kbd-hint kbd {
    font-family: var(--mono);
    font-size: 0.75rem;
    padding: 0.25rem 0.55rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 5px;
    color: rgba(255,255,255,0.9);
}

@keyframes hint-pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 0.9; }
}

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

.section-head {
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-head h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.section-head .muted {
    color: var(--text-muted);
}

.features,
.install,
.trust,
.screenshot-section,
.cta-band {
    padding: clamp(3rem, 7vw, 6rem) 0;
    border-top: 1px solid var(--line);
}

/* Features grid */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
}

.feature {
    padding: 1.8rem 0;
}

.feature h3 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
    letter-spacing: -0.01em;
}

.feature p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.feature code,
.install-method code,
.install-note code {
    font-family: var(--mono);
    font-size: 0.82em;
    padding: 0.08em 0.36em;
    background: var(--kbd-bg);
    border-radius: 4px;
    color: var(--text);
}

/* Screenshot */

.screenshot-section figure {
    margin: 0;
    text-align: center;
}

.screenshot-section img {
    max-width: 100%;
    width: 880px;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px -20px rgba(0,0,0,0.4), 0 0 0 1px var(--line);
}

.screenshot-section figcaption {
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.95rem;
}

/* Install */

.install-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.5rem, 3vw, 2.5rem);
}

.install-method {
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--bg-elev);
}

.install-method h3 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.install-method p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.install-method pre {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    margin: 1rem 0;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.82rem;
    line-height: 1.6;
}

.install-method pre code {
    background: transparent;
    padding: 0;
    color: var(--text);
}

.install-note {
    font-size: 0.85rem !important;
    color: var(--text-faint) !important;
    margin-top: 1rem !important;
    margin-bottom: 0 !important;
    line-height: 1.5;
}

.install-method a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--text-faint);
    text-underline-offset: 3px;
}

.install-method a:hover {
    text-decoration-color: var(--text);
}

/* Trust band */

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.trust-item {
    text-align: center;
    padding: 2rem 1rem;
}

.trust-item strong {
    display: block;
    font-family: var(--serif);
    font-size: clamp(2.2rem, 4vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.trust-item span {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* CTA band */

.cta-band {
    text-align: center;
    padding-top: clamp(4rem, 8vw, 7rem);
    padding-bottom: clamp(4rem, 8vw, 7rem);
}

.cta-band h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.4rem, 5vw, 3.5rem);
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.cta-band > p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 2.4rem;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

.cta-band .btn {
    margin-bottom: 1rem;
}

/* Footer */

.footer {
    border-top: 1px solid var(--line);
    padding: clamp(3rem, 5vw, 4rem) var(--pad) 2rem;
    max-width: var(--max-w);
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    font-family: var(--sans);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin-bottom: 1rem;
    font-weight: 500;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--sans);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    transition: color 0.15s ease;
}

.footer-col a:hover {
    color: var(--text);
}

.footer-tag {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.8rem;
    max-width: 18rem;
}

.footer-bottom {
    border-top: 1px solid var(--line);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-faint);
    font-family: var(--sans);
    font-size: 0.82rem;
}

/* ============================================================
   Legal pages (privacy, terms) — shared simple layout
   ============================================================ */

.legal-main {
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(2.5rem, 6vw, 5rem) var(--pad) clamp(3rem, 6vw, 5rem);
}

.legal-main h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.2rem, 4.5vw, 3rem);
    letter-spacing: -0.02em;
    margin-bottom: 0.6rem;
}

.legal-meta {
    color: var(--text-faint);
    font-family: var(--sans);
    font-size: 0.85rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.legal-main h2 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.4rem;
    margin: 2.4rem 0 0.8rem;
    letter-spacing: -0.01em;
}

.legal-main h3 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.1rem;
    margin: 1.8rem 0 0.6rem;
}

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

.legal-main ul,
.legal-main ol {
    padding-left: 1.4rem;
    margin-bottom: 1rem;
}

.legal-main li {
    margin-bottom: 0.4rem;
}

.legal-main a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--text-faint);
    text-underline-offset: 3px;
}

.legal-main a:hover {
    text-decoration-color: var(--text);
}

.legal-main code {
    font-family: var(--mono);
    font-size: 0.88em;
    padding: 0.1em 0.4em;
    background: var(--kbd-bg);
    border-radius: 4px;
}

/* ============================================================
   Responsive — mobile-first reflow
   ============================================================ */

@media (max-width: 860px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 2.5rem 0 3rem;
    }

    .hero-visual {
        order: -1;
        max-width: 480px;
        margin: 0 auto;
        width: 100%;
    }

    .install-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 540px) {
    .nav {
        padding: 0.9rem var(--pad);
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        display: none;
    }

    .nav-links a[href*="github.com"] {
        display: inline;
    }

    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-cta .btn {
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

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