/*
 * Gateway static surfaces — docsight.io landing page (/)
 * and waitlist signup page (/waitlist/). Visual language mirrors
 * brain-web's login.jte / waitlist-denied.jte. Source of truth
 * for tokens: brain-web/src/main/jte/layout.jte.
 */

:root {
    --bg-primary: #0a0a0c;
    --bg-secondary: #111114;
    --bg-hover: #252530;
    --border-subtle: #1f1f28;
    --border-default: #2a2a36;
    --border-strong: #3a3a4a;
    --text-primary: #ededf0;
    --text-secondary: #9898a8;
    --text-tertiary: #5c5c6e;
    --accent: #10b981;
    --accent-deep: #059669;
    --accent-glow: rgba(16, 185, 129, 0.25);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --shadow-card: 0 8px 40px rgba(0, 0, 0, 0.5);
    --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    height: 100%;
    font-family: 'Outfit', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scene: full-viewport flex center with radial glow + 48px grid */
.landing-scene {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.landing-scene::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.landing-scene::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

/* Card */
.landing-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    padding: 48px 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    text-align: center;
    animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Brand mark */
.landing-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
}

.landing-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 24px var(--accent-glow);
}

.landing-brand-icon svg {
    width: 20px;
    height: 20px;
    color: #ffffff;
}

.landing-brand-name {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* Heading + body */
.landing-heading {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.landing-body {
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
}

/* Actions */
.landing-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: 'Outfit', sans-serif;
    font-size: 14.5px;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: #ffffff;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 28px rgba(16, 185, 129, 0.35);
}

.btn-primary svg {
    width: 16px;
    height: 16px;
}

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

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

/* Meta caption */
.landing-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
    margin-top: 28px;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Tertiary landing link */
.landing-tertiary {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.landing-tertiary a {
    color: var(--accent);
    text-decoration: none;
}

.landing-tertiary a:hover {
    color: #34d399;
    text-decoration: underline;
}

/* ── Waitlist signup ─────────────────────────────────────────── */

.waitlist-card {
    text-align: left;
}

.waitlist-card .landing-brand {
    justify-content: center;
}

.waitlist-card section {
    display: none;
}

.waitlist-card[data-state="form"] section[data-section="form"],
.waitlist-card[data-state="success"] section[data-section="success"],
.waitlist-card[data-state="already-listed"] section[data-section="already-listed"],
.waitlist-card[data-state="has-access"] section[data-section="has-access"] {
    display: block;
}

.waitlist-card section[data-section] > h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-align: center;
    margin-bottom: 10px;
    outline: none;
}

.waitlist-card section[data-section] > p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: center;
    margin-bottom: 24px;
}

.waitlist-card .state-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.waitlist-card .state-icon svg {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.waitlist-card section[data-section="has-access"] .btn-primary {
    display: flex;
    width: fit-content;
    margin: 0 auto;
}

/* Form elements (ported from brain-web layout.jte:363-399) */
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.form-input {
    width: 100%;
    padding: 9px 13px;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    transition: all var(--transition);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.field {
    margin-bottom: 16px;
}

.field-error {
    min-height: 16px;
    font-size: 12px;
    color: #f87171;
    margin-top: 6px;
}

.form-error {
    font-size: 13px;
    color: #f87171;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 16px;
}

.waitlist-card form .btn-primary {
    width: 100%;
}

.btn-primary[disabled] {
    opacity: 0.6;
    cursor: progress;
}

.btn-primary.is-loading .btn-label,
.btn-primary.is-loading svg {
    visibility: hidden;
}

.btn-primary.is-loading {
    position: relative;
}

.btn-primary.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.waitlist-card.card-in {
    animation: cardIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Responsive */
@media (max-width: 480px) {
    .landing-card {
        padding: 36px 24px;
    }

    .landing-heading {
        font-size: 24px;
    }

    .landing-actions {
        flex-direction: column;
    }

    .landing-actions .btn-primary,
    .landing-actions .btn-ghost {
        width: 100%;
    }

    .waitlist-card section[data-section] > h1 {
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .landing-card,
    .waitlist-card.card-in {
        animation: none;
    }

    .btn-primary,
    .btn-ghost {
        transition: none;
    }
}

/* ───────────────────────────────────────────────────────────────
 * docsight.io marketing landing page
 * Activated only when <body class="docsight-landing">; the waitlist
 * page does not set this class and is unaffected by these rules.
 * ───────────────────────────────────────────────────────────────*/

body.docsight-landing {
    position: relative;
    overflow-x: hidden;
}

body.docsight-landing::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(16, 185, 129, 0.10) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

body.docsight-landing::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}

body.docsight-landing > .page-nav,
body.docsight-landing > main,
body.docsight-landing > .page-footer {
    position: relative;
    z-index: 1;
}

/* Top nav ────────────────────────────────────────────────────── */
.page-nav {
    border-bottom: 1px solid var(--border-subtle);
}

.page-nav-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.page-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.page-nav-brand .landing-brand-icon {
    width: 32px;
    height: 32px;
}

.page-nav-brand .landing-brand-icon svg {
    width: 18px;
    height: 18px;
}

.page-nav-brand .landing-brand-name {
    font-size: 18px;
}

.page-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 13.5px;
}

/* Button size variant — oversized hero CTA ───────────────────── */
.btn-primary.btn-lg {
    padding: 16px 36px;
    font-size: 16px;
    border-radius: 10px;
    box-shadow: 0 0 32px rgba(16, 185, 129, 0.30);
}

.btn-primary.btn-lg:hover {
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.45);
}

.btn-primary.btn-lg svg {
    width: 18px;
    height: 18px;
}

/* Hero ───────────────────────────────────────────────────────── */
.hero {
    max-width: 1080px;
    margin: 0 auto;
    padding: 96px 32px 64px;
    text-align: center;
}

.hero-eyebrow {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
}

.hero-title {
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 36px;
}

.hero-cta {
    display: inline-flex;
}

.hero-signin {
    margin-top: 18px;
    margin-bottom: 64px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.hero-signin a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.hero-signin a:hover {
    color: var(--accent-hover, #34d399);
    text-decoration: underline;
}

/* Hero faux chat preview ─────────────────────────────────────── */
.hero-preview {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    text-align: left;
    animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-preview-row {
    display: flex;
    margin-bottom: 14px;
}

.hero-preview-row:last-child { margin-bottom: 0; }
.hero-preview-row-user      { justify-content: flex-end; }

.hero-preview-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--bg-hover);
    font-size: 14px;
    line-height: 1.5;
    max-width: 85%;
}

.hero-preview-bubble-ai {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    width: 100%;
    max-width: 100%;
}

.hero-preview-bubble-ai p {
    margin-bottom: 8px;
    font-size: 14px;
}

.hero-preview-bubble-ai p:last-child {
    margin-bottom: 0;
}

.hero-preview-bubble-ai ul {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.hero-preview-bubble-ai li {
    padding: 5px 0;
    border-bottom: 1px dashed var(--border-subtle);
}

.hero-preview-bubble-ai li:last-child {
    border-bottom: none;
}

.hero-preview-bubble-ai strong {
    color: var(--text-primary);
    font-weight: 500;
}

.hero-preview-cite {
    font-size: 11px;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
    margin-top: 10px;
}

/* Section utilities ──────────────────────────────────────────── */
.section-eyebrow {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.section-heading {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 8px;
    margin-bottom: 16px;
    line-height: 1.25;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Use-case section ───────────────────────────────────────────── */
.usecase {
    max-width: 1080px;
    margin: 0 auto;
    padding: 96px 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
}

.usecase-copy p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: 12px;
    font-size: 14.5px;
}

.usecase-copy em {
    color: var(--text-primary);
    font-style: normal;
    background: rgba(16, 185, 129, 0.08);
    border-bottom: 1px dashed rgba(16, 185, 129, 0.4);
    padding: 1px 5px;
    border-radius: 3px;
}

.usecase-illustration {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.doc-stack {
    position: relative;
    width: 168px;
    height: 200px;
    flex-shrink: 0;
}

.doc {
    position: absolute;
    top: 0;
    left: 14px;
    width: 140px;
    height: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 100% 14px;
    background-position: 0 32px;
}

.doc-back  { transform: rotate(-7deg) translate(-14px, 0); }
.doc-mid   { transform: rotate(3deg) translate(8px, 4px); }
.doc-front { transform: rotate(-1deg) translate(0, 10px); z-index: 2; }

.doc-label {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
    align-self: flex-start;
    background: rgba(16, 185, 129, 0.08);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
}

.doc-spacer { flex: 1; }

.usecase-arrow {
    flex-shrink: 0;
    width: 56px;
    height: 24px;
    color: var(--accent);
}

.answer-card {
    flex-shrink: 0;
    width: 160px;
    padding: 16px 14px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 10px;
    box-shadow: 0 0 32px rgba(16, 185, 129, 0.18);
}

.answer-card-header {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.answer-card-line {
    height: 6px;
    background: var(--border-default);
    border-radius: 3px;
    margin-bottom: 6px;
}

.answer-card-line:nth-child(2) { width: 90%; }
.answer-card-line:nth-child(3) { width: 70%; }
.answer-card-line:nth-child(4) { width: 80%; }
.answer-card-line:last-child   { margin-bottom: 0; width: 60%; }

/* Features grid ──────────────────────────────────────────────── */
.features {
    max-width: 1080px;
    margin: 0 auto;
    padding: 64px 32px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.feature-card {
    padding: 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: border-color var(--transition), transform var(--transition);
}

.feature-card:hover {
    border-color: var(--border-default);
    transform: translateY(-2px);
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 24px var(--accent-glow);
    margin-bottom: 16px;
    color: #ffffff;
}

.feature-icon svg {
    width: 20px;
    height: 20px;
}

.feature-card h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Closing CTA band ───────────────────────────────────────────── */
.cta-band {
    max-width: 720px;
    margin: 96px auto;
    padding: 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-band::before {
    content: '';
    position: absolute;
    top: -160px;
    right: -160px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.10) 0%, transparent 70%);
    pointer-events: none;
}

.cta-band > * { position: relative; z-index: 1; }

.cta-band .section-heading {
    margin-top: 0;
    margin-bottom: 24px;
}

/* Footer ─────────────────────────────────────────────────────── */
.page-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 24px 32px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
}

/* Responsive ─────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .hero {
        padding: 64px 20px 48px;
    }
    .hero-title    { font-size: 34px; }
    .hero-subtitle { font-size: 15.5px; }
    .hero-preview  { padding: 20px; }

    .usecase {
        grid-template-columns: 1fr;
        padding: 64px 20px;
        gap: 32px;
    }
    .usecase-illustration { display: none; }

    .features {
        grid-template-columns: 1fr;
        padding: 48px 20px;
    }

    .cta-band {
        padding: 36px 24px;
        margin: 64px 20px;
    }

    .page-nav-inner { padding: 14px 20px; }
    .page-footer    { padding: 20px; font-size: 11px; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 28px; }
    .hero-cta {
        display: flex;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-preview { animation: none; }
    .feature-card { transition: none; }
}

/* Privacy / text content pages ──────────────────────────────── */
.privacy-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 64px 32px;
}

.privacy-content h1 {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.privacy-updated {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 40px;
}

.privacy-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
}

.privacy-content h3 {
    font-size: 16px;
    font-weight: 500;
    margin-top: 20px;
    margin-bottom: 8px;
}

.privacy-content p,
.privacy-content ul {
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.privacy-content ul {
    padding-left: 20px;
}

.privacy-content li {
    margin-bottom: 6px;
}

.privacy-content a {
    color: var(--accent);
    text-decoration: none;
}

.privacy-content a:hover {
    text-decoration: underline;
}

/* Footer links ──────────────────────────────────────────────── */
.page-footer a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color var(--transition);
}

.page-footer a:hover {
    color: var(--accent);
}

@media (max-width: 720px) {
    .privacy-content {
        padding: 48px 20px;
    }
}
