/* ===== FONT ===== */
@font-face {
    font-family: "Inter Variable";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("/fonts/inter-latin-wght.woff2") format("woff2-variations");
}

/* ===== DESIGN TOKENS (mirror chatgpt-clone-web src/index.css) ===== */
:root {
    color-scheme: dark;

    --bg: #0d0d0d;
    --surface: #171717;
    --surface-raised: #212121;
    --text: #f5f5f5;
    --text-secondary: #b4b4b4;
    --text-muted: #8e8e8e;
    --border: #2f2f2f;
    --primary: #10b981;
    --primary-hover: #34d399;
    --primary-text: #10b981;
    --on-primary: #0d0d0d;
    --primary-soft: rgba(16, 185, 129, 0.12);
    --header-bg: rgba(13, 13, 13, 0.8);
    --shadow-frame: 0 30px 80px rgba(0, 0, 0, 0.55);
    --glow: radial-gradient(ellipse 60% 45% at 50% 0%, rgba(16, 185, 129, 0.14), transparent 70%);

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4.5rem;
    --space-2xl: 7rem;

    --radius-sm: 0.5rem;
    --radius-md: 0.875rem;
    --radius-lg: 1.25rem;
    --radius-pill: 999px;

    --header-height: 4rem;
    --content-max: 72rem;
    --prose-max: 44rem;
    --frame-bar-height: 2.25rem;
    --frame-dot-size: 0.7rem;
    --brand-dot-size: 0.5rem;
    --slot-row-height: 4rem;
    --slot-visible-rows: 3;
    --slot-spin-duration: 1.4s;
    --provider-chip-size: 2.25rem;
    --anthropic-tint: #d97757;
    --gemini-tint: #4285f4;

    --font-sans: "Inter Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

:root.light {
    color-scheme: light;

    --bg: #ffffff;
    --surface: #f7f7f8;
    --surface-raised: #ececf1;
    --text: #0d0d0d;
    --text-secondary: #5d5d5d;
    --text-muted: #6e6e6e;
    --border: #e5e5e5;
    --primary-text: #047857;
    --primary-hover: #34d399;
    --primary-soft: rgba(16, 185, 129, 0.1);
    --header-bg: rgba(255, 255, 255, 0.85);
    --shadow-frame: 0 30px 80px rgba(0, 0, 0, 0.12);
    --glow: radial-gradient(ellipse 60% 45% at 50% 0%, rgba(16, 185, 129, 0.1), transparent 70%);
}

/* ===== BASE ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: var(--font-sans);
    background-color: var(--bg);
    background-image: var(--glow);
    background-repeat: no-repeat;
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: var(--space-sm);
    top: -3rem;
    z-index: 20;
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: var(--on-primary);
}

.skip-link:focus {
    top: var(--space-sm);
}

.container {
    width: min(100%, var(--content-max));
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ===== HEADER ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(16px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    height: var(--header-height);
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.wordmark-dot {
    width: var(--brand-dot-size);
    height: var(--brand-dot-size);
    border-radius: var(--radius-pill);
    background: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* ===== BUTTONS ===== */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.5rem;
    padding: 0.55rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.button-primary {
    background: var(--primary);
    color: var(--on-primary);
}

.button-primary:hover {
    background: var(--primary-hover);
}

.button-ghost {
    border-color: var(--border);
    color: var(--text);
}

.button-ghost:hover {
    background: var(--surface);
}

.button-large {
    min-height: 3rem;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.theme-toggle:hover {
    color: var(--text);
    background: var(--surface);
}

.theme-toggle svg {
    width: 1.1rem;
    height: 1.1rem;
}

.icon-moon,
:root.light .icon-sun {
    display: none;
}

:root.light .icon-moon {
    display: block;
}

/* ===== HERO ===== */
.hero {
    padding: var(--space-xl) 0 var(--space-lg);
    text-align: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--space-md);
    padding: 0.3rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.eyebrow .wordmark-dot {
    flex: none;
}

.hero-title {
    max-width: 52rem;
    margin: 0 auto var(--space-md);
    font-size: clamp(2.4rem, 6.5vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.04;
}

.text-accent {
    color: var(--primary-text);
}

.hero-subtitle {
    max-width: 38rem;
    margin: 0 auto var(--space-lg);
    color: var(--text-secondary);
    font-size: 1.15rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.hero-note {
    margin-top: var(--space-md);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== DEMO FRAME ===== */
.demo {
    padding: var(--space-lg) 0 var(--space-xl);
}

.browser-frame {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-frame);
}

.browser-bar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    height: var(--frame-bar-height);
    padding: 0 var(--space-sm);
    border-bottom: 1px solid var(--border);
}

.browser-dot {
    width: var(--frame-dot-size);
    height: var(--frame-dot-size);
    border-radius: var(--radius-pill);
    background: var(--border);
}

.browser-url {
    margin-left: var(--space-sm);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.demo-video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    background: var(--bg);
}

.demo-caption {
    margin-top: var(--space-sm);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* ===== SECTIONS ===== */
.section {
    padding: var(--space-xl) 0;
}

.section-header {
    max-width: var(--prose-max);
    margin: 0 auto var(--space-lg);
    text-align: center;
}

.section-title {
    margin-bottom: var(--space-xs);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

section[id] {
    scroll-margin-top: var(--header-height);
}

/* ===== TYPEWRITER ===== */
.typewriter {
    text-align: center;
}

.typewriter .section-title {
    margin-bottom: var(--space-md);
}

.slot-machine {
    max-width: 40rem;
    margin: 0 auto;
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.slot-window {
    position: relative;
    height: calc(var(--slot-row-height) * var(--slot-visible-rows));
    margin-bottom: var(--space-md);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
    mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}

.slot-window::after {
    content: "";
    position: absolute;
    inset: var(--slot-row-height) 0;
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    background: var(--primary-soft);
    pointer-events: none;
}

.slot-reel {
    list-style: none;
    will-change: transform;
}

.slot-reel.is-spinning {
    transition: transform var(--slot-spin-duration) cubic-bezier(0.15, 0.85, 0.25, 1.05);
}

.slot-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    height: var(--slot-row-height);
    font-size: clamp(1.25rem, 3.5vw, 1.75rem);
    font-weight: 650;
    letter-spacing: -0.02em;
}

.provider-chip {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: var(--provider-chip-size);
    height: var(--provider-chip-size);
    border-radius: var(--radius-pill);
}

.provider-chip svg {
    width: 60%;
    height: 60%;
}

.provider-openai {
    background: var(--text);
    color: var(--bg);
}

.provider-anthropic {
    background: var(--anthropic-tint);
    color: #ffffff;
}

.provider-gemini {
    background: var(--gemini-tint);
    color: #ffffff;
}

.typewriter-line {
    min-height: 2.6em;
    font-size: clamp(1.15rem, 3vw, 1.6rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.2;
}

.typewriter-text {
    color: var(--primary-text);
}

.typewriter-caret {
    display: inline-block;
    width: 0.08em;
    height: 1em;
    margin-left: 0.06em;
    vertical-align: -0.12em;
    background: var(--primary);
    animation: caret-blink 1s steps(1) infinite;
}

@keyframes caret-blink {
    50% {
        opacity: 0;
    }
}

/* ===== CARDS ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-md);
}

.card {
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.card-title {
    margin-bottom: var(--space-xs);
    font-size: 1.15rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.card-copy {
    color: var(--text-secondary);
}

.model-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: var(--space-sm);
}

.model-chip {
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--bg);
    font-size: 0.88rem;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-md);
    background: var(--primary-soft);
    color: var(--primary-text);
}

.feature-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* ===== FAQ ===== */
.faq-list {
    max-width: var(--prose-max);
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    font-size: 1.05rem;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    color: var(--text-muted);
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1;
}

.faq-item[open] summary::after {
    content: "\2212";
}

.faq-answer {
    padding-bottom: var(--space-md);
    color: var(--text-secondary);
}

.faq-answer a,
.inline-link {
    color: var(--primary-text);
    text-underline-offset: 0.18em;
}

/* ===== CLOSING CTA ===== */
.closing-cta {
    padding: var(--space-xl) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    text-align: center;
}

.closing-cta .section-subtitle {
    margin-bottom: var(--space-lg);
}

/* ===== FOOTER ===== */
.site-footer {
    margin-top: var(--space-xl);
    border-top: 1px solid var(--border);
    padding: var(--space-lg) 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-nav a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--text);
}

/* ===== LEGAL PAGES ===== */
.legal-main {
    padding: var(--space-xl) 0 var(--space-lg);
}

.legal-article {
    width: min(100%, var(--prose-max));
}

.legal-title {
    margin-bottom: var(--space-xs);
    font-size: clamp(2rem, 5vw, 2.8rem);
    letter-spacing: -0.04em;
    line-height: 1.15;
}

.legal-updated {
    margin-bottom: var(--space-lg);
    color: var(--text-muted);
    font-size: 0.92rem;
}

.legal-article h2 {
    margin: var(--space-lg) 0 var(--space-sm);
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.legal-article p,
.legal-article li {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.legal-article a {
    color: var(--primary-text);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.legal-article a:hover {
    color: var(--text);
}

.legal-article ul {
    padding-left: 1.2rem;
    margin-bottom: var(--space-sm);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .header-login {
        display: none;
    }

    .hero {
        padding-top: var(--space-lg);
    }

    .browser-url {
        display: none;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
