/* ── VoiceMemoir — External Stylesheet ─────────────────────── */

:root {
    /* Light, warm palette */
    --bg: #FAFAF8;
    --surface: #FFFFFF;
    --surface-2: #F5F3F0;
    --border: #E2DED8;
    --border-strong: #C9C3BB;
    --text: #1C1917;
    --text-secondary: #44403C;
    --text-muted: #78716C;
    --accent: #B45309;
    --accent-hover: #92400E;
    --accent-light: #FEF3C7;
    --accent-surface: #FFFBEB;
    --success: #047857;
    --success-light: #D1FAE5;
    --error: #DC2626;
    --error-light: #FEE2E2;
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Georgia', 'Times New Roman', serif;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
}

/* ── Lucide icon defaults ─────────────────────────────────── */

[data-lucide] {
    width: 24px; height: 24px;
    stroke: currentColor; stroke-width: 1.5;
    fill: none; display: inline-block; vertical-align: middle;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }


/* ── Nav ──────────────────────────────────────────────────── */

.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(250,250,248,0.92); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: 1200px; margin: 0 auto; padding: 16px 24px;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    font-size: 1.25rem; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: 8px;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-secondary); font-size: 0.9rem; transition: color 0.2s; white-space: nowrap; }
.nav-links a:hover { color: var(--text); }
.nav-links .btn { min-width: 110px; text-align: center; }


/* ── Buttons ──────────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 24px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.95rem; cursor: pointer;
    border: none; transition: all 0.2s; text-decoration: none;
}
.btn-primary {
    background: var(--accent); color: #FFFFFF;
}
.btn-primary:hover {
    background: var(--accent-hover); color: #FFFFFF;
}
.btn-outline {
    background: transparent; color: var(--text);
    border: 1px solid var(--border-strong);
}
.btn-outline:hover {
    border-color: var(--accent); color: var(--accent);
}
.btn-lg {
    padding: 14px 36px; font-size: 1.1rem; border-radius: var(--radius);
}
.btn-full { width: 100%; }
.btn [data-lucide] { width: 18px; height: 18px; stroke-width: 2; margin-right: 6px; }


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

.hero {
    padding: 120px 24px 80px; text-align: center;
    position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; top: 0; left: 50%;
    transform: translateX(-50%); width: 800px; height: 800px;
    background: radial-gradient(circle, rgba(180,83,9,0.05) 0%, transparent 70%);
    pointer-events: none;
}
.hero-for {
    font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px;
    color: var(--text-muted); font-weight: 600; margin-bottom: 16px;
}
.hero-cycle {
    color: var(--accent); font-weight: 700;
    display: inline-block; transition: opacity 0.3s, transform 0.3s;
}
.hero-cycle-out { opacity: 0; transform: translateY(8px); }
.hero-cycle-in { opacity: 1; transform: translateY(0); }
.hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700;
    line-height: 1.15; max-width: 750px; margin: 0 auto 20px;
}
.hero h1 span, .hero h1 em {
    display: inline; transition: opacity 0.3s, transform 0.3s;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero h1 .hero-cycle-out { opacity: 0; }
.hero h1 .hero-cycle-in { opacity: 1; }
.hero .subtitle {
    font-size: clamp(1rem, 2.2vw, 1.2rem); color: var(--text-muted);
    max-width: 560px; margin: 0 auto 32px; line-height: 1.6;
}
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }


/* ── Sections ─────────────────────────────────────────────── */

.section { padding: 100px 24px; max-width: 1200px; margin: 0 auto; }
.section-alt { background: var(--surface-2); }
.section-label {
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px;
    color: var(--accent); font-weight: 600; margin-bottom: 12px;
}
.section h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 20px; line-height: 1.2;
}
.section .lead {
    color: var(--text-muted); font-size: 1.15rem;
    max-width: 640px; margin-bottom: 48px;
}
.section-centered { text-align: center; }
.section-centered .lead { margin-left: auto; margin-right: auto; }


/* ── Problem cards ────────────────────────────────────────── */

.card-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px; margin-top: 48px;
}
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px;
    box-shadow: var(--shadow-sm);
}
.card .icon { margin-bottom: 16px; color: var(--accent); }
.card .icon [data-lucide] { width: 32px; height: 32px; stroke-width: 1.5; }
.card h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text); }
.card p { color: var(--text-muted); font-size: 0.95rem; }


/* ── Steps (how it works) ─────────────────────────────────── */

.steps {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px; margin-top: 48px; counter-reset: step;
}
.step {
    position: relative; padding: 32px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.step::before {
    counter-increment: step; content: counter(step);
    position: absolute; top: -16px; left: 24px;
    width: 32px; height: 32px; background: var(--accent); color: #FFFFFF;
    font-weight: 700; font-size: 0.9rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.step h3 { margin-bottom: 8px; font-size: 1.05rem; color: var(--text); }
.step p { color: var(--text-muted); font-size: 0.9rem; }


/* ── Use cases ("Who It's For") ────────────────────────────── */

.use-case-group { margin-bottom: 48px; }
.use-case-group:last-child { margin-bottom: 0; }
.use-case-heading {
    font-family: var(--font-serif); font-size: 1.3rem;
    margin-bottom: 20px; padding-bottom: 12px;
    border-bottom: 1px solid var(--border); color: var(--text);
}
.use-case-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.use-case-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow-sm); transition: all 0.2s;
}
.use-case-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.use-case-icon { margin-bottom: 12px; color: var(--accent); }
.use-case-icon [data-lucide] { width: 28px; height: 28px; stroke-width: 1.5; }
.use-case-card h4 { font-size: 1rem; margin-bottom: 6px; color: var(--text); }
.use-case-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }

.b2b-cta {
    margin-top: 48px; text-align: center;
    padding: 48px 32px; background: var(--accent-surface);
    border: 1px solid var(--accent-light); border-radius: var(--radius);
}
.b2b-cta .lead { margin: 0 auto 24px; max-width: 480px; }


/* ── Pricing ──────────────────────────────────────────────── */

.pricing-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px; margin-top: 48px;
}
.price-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 40px 32px;
    position: relative; box-shadow: var(--shadow-sm);
}
.price-card.featured {
    border-color: var(--accent); box-shadow: var(--shadow-md);
}
.price-card.featured::before {
    content: 'Most Popular'; position: absolute; top: -12px; left: 50%;
    transform: translateX(-50%); background: var(--accent); color: #FFFFFF;
    font-size: 0.75rem; font-weight: 700; padding: 4px 16px;
    border-radius: 20px; text-transform: uppercase; letter-spacing: 1px;
}
.price-card .tier {
    font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px;
    color: var(--accent); font-weight: 600; margin-bottom: 8px;
}
.price-card .price { font-size: 3rem; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.price-card .price-note { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 24px; }
.price-card ul { list-style: none; margin-bottom: 32px; }
.price-card li {
    padding: 8px 0; font-size: 0.95rem; color: var(--text-secondary);
    display: flex; align-items: flex-start; gap: 10px;
}
.price-card li::before { content: '\2713'; color: var(--success); font-weight: 700; flex-shrink: 0; }
.price-card .btn { width: 100%; }


/* ── Emotional / pullquote ────────────────────────────────── */

.emotional { text-align: center; padding: 120px 24px; }
.emotional blockquote {
    font-family: var(--font-serif);
    font-size: clamp(1.3rem, 3vw, 2rem); font-style: italic;
    color: var(--text-secondary); max-width: 700px;
    margin: 0 auto 32px; line-height: 1.5;
}
.emotional .lead {
    max-width: 560px; margin: 0 auto 32px; color: var(--text-muted);
}


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

.footer {
    border-top: 1px solid var(--border); padding: 48px 24px; text-align: center;
}
.footer p { color: var(--text-muted); font-size: 0.85rem; }
.footer-links {
    display: flex; gap: 24px; justify-content: center;
    margin-bottom: 16px; flex-wrap: wrap;
}
.footer-links a {
    color: var(--text-muted); font-size: 0.85rem; transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }


/* ── Legal pages ──────────────────────────────────────────── */

.legal-page {
    max-width: 720px; margin: 0 auto; padding: 120px 24px 80px;
}
.legal-page h1 {
    font-family: var(--font-serif); font-size: 2.2rem;
    margin-bottom: 8px;
}
.legal-updated {
    color: var(--text-muted); font-size: 0.9rem; margin-bottom: 40px;
}
.legal-content h2 {
    font-size: 1.2rem; margin: 32px 0 12px; color: var(--text);
}
.legal-content p {
    color: var(--text-secondary); margin-bottom: 16px; line-height: 1.7;
}
.legal-content ul {
    color: var(--text-secondary); margin: 0 0 16px 24px; line-height: 1.7;
}
.legal-content li { margin-bottom: 8px; }
.legal-content a { color: var(--accent); }
.legal-content a:hover { color: var(--accent-hover); }

.contact-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px; margin: 24px 0 32px;
}


/* ── Auth pages ───────────────────────────────────────────── */

.auth-page {
    min-height: 100vh; display: flex; align-items: center;
    justify-content: center; padding: 24px;
}
.auth-box {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 48px 40px;
    width: 100%; max-width: 420px; box-shadow: var(--shadow-md);
}
.auth-box .auth-logo { margin-bottom: 32px; display: inline-flex; }
.auth-box h1 { font-family: var(--font-serif); font-size: 1.8rem; margin-bottom: 8px; }
.auth-box .sub { color: var(--text-muted); margin-bottom: 32px; font-size: 0.95rem; }
.auth-box .btn { width: 100%; margin-top: 8px; }
.auth-box .alt { text-align: center; margin-top: 20px; font-size: 0.9rem; color: var(--text-muted); }

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; font-size: 0.85rem; font-weight: 600;
    margin-bottom: 6px; color: var(--text-secondary);
}
.form-group input {
    width: 100%; padding: 12px 16px; background: var(--bg);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: 1rem; outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--accent); }

.error-msg {
    background: var(--error-light); border: 1px solid var(--error);
    color: var(--error); padding: 10px 16px;
    border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 0.9rem;
}


/* ── App shell ────────────────────────────────────────────── */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px; background: var(--surface); border-right: 1px solid var(--border);
    padding: 24px 0; position: fixed; top: 0; left: 0; bottom: 0;
    display: flex; flex-direction: column;
}
.sidebar-logo {
    padding: 0 24px 24px; font-size: 1.1rem; font-weight: 700;
    border-bottom: 1px solid var(--border);
}
.sidebar-logo span { color: var(--accent); }
.sidebar-nav {
    flex: 1; padding: 16px 12px;
    display: flex; flex-direction: column; gap: 4px;
}
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-size: 0.9rem; transition: all 0.2s;
}
.sidebar-nav a [data-lucide] { width: 18px; height: 18px; stroke-width: 1.75; flex-shrink: 0; }
.sidebar-nav a:hover { background: var(--surface-2); color: var(--text); }
.sidebar-nav a.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.sidebar-user {
    padding: 16px 24px; border-top: 1px solid var(--border);
    font-size: 0.85rem; color: var(--text-muted);
}
.sidebar-user .logout-link { font-size: 0.8rem; }

.main-content { margin-left: 240px; flex: 1; padding: 32px; max-width: 900px; }
.main-content h1 { font-family: var(--font-serif); font-size: 1.8rem; margin-bottom: 8px; }
.main-content .page-sub { color: var(--text-muted); margin-bottom: 32px; }


/* ── Story cards ──────────────────────────────────────────── */

.stories-grid { display: grid; gap: 16px; }
.stories-actions { margin-bottom: 24px; }
.stories-loading { color: var(--text-muted); }

.story-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; cursor: pointer;
    transition: all 0.2s; box-shadow: var(--shadow-sm);
}
.story-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.story-card h3 { font-size: 1rem; margin-bottom: 4px; color: var(--text); }
.story-card .meta { font-size: 0.8rem; color: var(--text-muted); }
.story-card .preview {
    font-size: 0.9rem; color: var(--text-muted); margin-top: 8px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}


/* ── Record session ───────────────────────────────────────── */

.record-area {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 48px; text-align: center;
    box-shadow: var(--shadow-sm);
}
.record-prompt {
    font-family: var(--font-serif); font-size: 1.5rem;
    margin-bottom: 32px; line-height: 1.4; color: var(--text);
}
.record-btn {
    width: 80px; height: 80px; border-radius: 50%;
    border: 3px solid var(--error); background: transparent;
    cursor: pointer; display: inline-flex; align-items: center;
    justify-content: center; transition: all 0.2s;
}
.record-btn .dot {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--error); transition: all 0.2s;
}
.record-btn.recording .dot { border-radius: 4px; width: 24px; height: 24px; }
.record-btn.recording {
    border-color: var(--error);
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.3); }
    50% { box-shadow: 0 0 0 16px rgba(220,38,38,0); }
}
.record-timer {
    font-size: 1.5rem; font-variant-numeric: tabular-nums;
    margin-top: 16px; color: var(--text-muted);
}
.record-status { font-size: 0.9rem; color: var(--text-muted); margin-top: 8px; }

/* ── Language selector (record page) ─────────────────────── */

.language-selector {
    display: inline-flex; align-items: center; gap: 8px;
    margin-bottom: 28px;
}

.language-label {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--text-muted);
    white-space: nowrap; user-select: none;
}

.language-select {
    appearance: none; -webkit-appearance: none;
    background-color: var(--surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378716C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    outline: none;
    padding: 7px 32px 7px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}

.language-select:hover {
    border-color: var(--border-strong);
}

.language-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.1);
}


/* ── Draft review ─────────────────────────────────────────── */

.draft-section { margin-top: 32px; }
.draft-heading { margin-bottom: 16px; }
.draft-text {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px;
    font-family: var(--font-serif); font-size: 1.05rem;
    line-height: 1.8; white-space: pre-wrap; box-shadow: var(--shadow-sm);
}
.draft-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

.feedback-input {
    width: 100%; margin-top: 16px; padding: 16px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-size: 1rem; font-family: var(--font);
    resize: vertical; min-height: 80px; outline: none;
}
.feedback-input:focus { border-color: var(--accent); }
.feedback-input::placeholder { color: var(--text-muted); }
.feedback-submit { margin-top: 12px; }

.hidden { display: none; }


/* ── Voice profile ────────────────────────────────────────── */

.profile-section { margin-bottom: 24px; }
.confidence-bar {
    display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.confidence-label { font-size: 0.85rem; color: var(--text-muted); }
.confidence-track {
    flex: 1; height: 8px; background: var(--surface-2);
    border-radius: 4px; overflow: hidden;
}
.confidence-fill {
    height: 100%; background: var(--accent);
    border-radius: 4px; transition: width 0.5s;
}
.confidence-value { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.profile-meta { font-size: 0.8rem; color: var(--text-muted); }
.profile-grid { display: grid; gap: 24px; }


/* ── Story view ───────────────────────────────────────────── */

.back-link {
    font-size: 0.85rem; color: var(--text-muted);
    margin-bottom: 16px; display: inline-block;
}
.back-link:hover { color: var(--accent); }
.transcript-card { margin-bottom: 24px; }
.transcript-text { white-space: pre-wrap; }
.feedback-panel { margin-top: 0; }


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

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero { padding: 100px 24px 60px; }
    .hero h1 { font-size: 1.7rem; }
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .pricing-grid { grid-template-columns: 1fr; }
}
