/* ── Fonts (self-hosted) ─────────────────────────────────────────────────── */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/inter-latin-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/inter-latin-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/inter-latin-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/inter-latin-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('fonts/inter-latin-800.woff2') format('woff2');
}

/* ── Reset & base ───────────────────────────────────────────────────────── */

:root {
    --bg:           #08090e;
    --bg-surface:   #12141c;
    --bg-elevated:  #1a1d28;
    --border:       rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.14);

    --text:         #f0f0f5;
    --text-secondary: #9197a6;
    --text-muted:   #5c6272;

    --accent:       #8b5cf6;
    --accent-glow:  rgba(139, 92, 246, 0.18);
    --accent-hover: #7c3aed;

    --success:      #22c55e;
    --error:        #ef4444;

    --radius:       10px;
    --radius-lg:    16px;
    --transition:   180ms ease;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Page ───────────────────────────────────────────────────────────────── */

.page {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Logo ───────────────────────────────────────────────────────────────── */

.logo {
    padding: 28px 0;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-muted);
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero {
    text-align: center;
    padding: 48px 0 40px;
    transition: opacity var(--transition);
}

.hero-headline {
    font-size: clamp(34px, 7vw, 52px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 16px;
    color: var(--text);
}

.hero-sub {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 420px;
    margin: 0 auto 20px;
    line-height: 1.5;
}

.social-proof {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 28px;
    letter-spacing: 0.3px;
}

/* ── Signup form ────────────────────────────────────────────────────────── */

#signup-form {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    transition: opacity 350ms ease, transform 350ms ease;
}

#signup-form.form-hidden {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

.email-row {
    display: flex;
    gap: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 5px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.email-row:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.email-input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
}

.email-input::placeholder { color: var(--text-muted); }
.email-input.input-error { color: var(--error); }

.subscribe-btn {
    padding: 14px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition), transform var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.subscribe-btn:hover { background: var(--accent-hover); }
.subscribe-btn:active { transform: scale(0.97); }
.subscribe-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

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

/* ── Form messages ──────────────────────────────────────────────────────── */

.form-message {
    margin-top: 8px;
    padding: 10px 16px;
    border-radius: 9px;
    font-size: 13px;
    text-align: center;
    font-weight: 500;
}

.message-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: var(--success);
}

.message-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--error);
}

/* ── Success state ──────────────────────────────────────────────────────── */

.hero-success .hero-headline {
    font-size: clamp(28px, 5vw, 40px);
    letter-spacing: -1px;
}

.success-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    font-size: 20px;
    margin-right: 12px;
    vertical-align: middle;
    animation: checkPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkPop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.hero-success .hero-sub {
    color: var(--text-secondary);
    margin-bottom: 0;
}

.legal-text {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 16px;
}

/* ── Riddle sample ──────────────────────────────────────────────────────── */

.sample {
    padding: 40px 0;
    border-top: 1px solid var(--border);
    max-width: 480px;
    margin: 0 auto;
}

.sample-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 14px;
    text-align: center;
}

.riddle-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color var(--transition);
}

.riddle-card:hover {
    border-color: var(--border-hover);
    border-left-color: var(--accent);
}

.riddle-question {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 16px;
    font-style: italic;
}

.riddle-answer-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.riddle-answer {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    filter: blur(8px);
    user-select: none;
    transition: filter 0.4s ease;
}

.riddle-answer.revealed {
    filter: blur(0);
    user-select: auto;
    animation: unblurCascade 0.4s ease forwards;
}

@keyframes unblurCascade {
    0%   { filter: blur(8px); opacity: 0.5; }
    30%  { filter: blur(4px); opacity: 0.7; }
    60%  { filter: blur(2px); opacity: 0.85; }
    100% { filter: blur(0); opacity: 1; }
}

.riddle-reveal-btn {
    padding: 8px 20px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    flex-shrink: 0;
}

.riddle-reveal-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.riddle-reveal-btn:active {
    transform: scale(0.96);
}

.riddle-reveal-btn.hidden {
    display: none;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.footer {
    text-align: center;
    padding: 32px 0;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.footer p {
    font-size: 12px;
    color: var(--text-muted);
}

.footer a {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

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

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .hero { padding: 32px 0; }
    .hero-headline { font-size: 30px; letter-spacing: -1.2px; }
    .hero-sub { font-size: 15px; margin-bottom: 16px; }

    .email-row { flex-direction: column; }
    .subscribe-btn { width: 100%; padding: 14px; border-radius: 8px; }

    .riddle-answer-wrap { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 380px) {
    .page { padding: 0 16px; }
    .hero-headline { font-size: 26px; }
}
