/* ============================================
   Scribomatic — Marketing site
   Dark theme, burgundy accent, Inter + JetBrains Mono
   ============================================ */

:root {
    --bg: #18181b;
    --bg-elevated: #27272a;
    --bg-sidebar: #1e1e21;
    --bg-hover: rgba(255, 255, 255, 0.04);
    --border: #333338;
    --border-subtle: #2a2a2f;
    --text: #e4e4e7;
    --text-muted: #a1a1aa;
    --text-dim: #71717a;
    --accent: #a11d2a;
    --accent-dim: #871620;
    --accent-soft: rgba(161, 29, 42, 0.15);
    --accent-glow: rgba(161, 29, 42, 0.25);
    --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', monospace;
    --radius: 8px;
    --radius-lg: 12px;
    --container: 1120px;
    --transition: 150ms ease;
}

/* Reset & base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-elevated);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

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

.sr-only-focusable:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    padding: 0.75rem 1.5rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    z-index: 9999;
    border-radius: 0 0 var(--radius) 0;
}

/* Container */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================
   Header
   ============================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(24, 24, 27, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    transition: opacity var(--transition);
}

.site-logo:hover {
    opacity: 0.8;
}

.site-logo img {
    width: 32px;
    height: 32px;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-list a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition);
}

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

.nav-cta {
    background: var(--accent);
    color: #fff !important;
    padding: 0.5rem 1.15rem;
    border-radius: var(--radius);
    font-weight: 600 !important;
    transition: background var(--transition), transform var(--transition) !important;
}

.nav-cta:hover {
    background: var(--accent-dim) !important;
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform var(--transition), opacity var(--transition);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 0 var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-dim);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    transform: translateY(-1px);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

/* ============================================
   Hero
   ============================================ */
.hero {
    padding: 10rem 0 6rem;
    background: radial-gradient(ellipse at 50% 0%, rgba(161, 29, 42, 0.08) 0%, transparent 60%);
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: center;
}

/* Hero icon */
.hero-icon {
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: var(--font-mono);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero-description {
    font-size: 1.05rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* App window mockup */
.app-window {
    background: var(--bg-sidebar);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.2),
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 80px var(--accent-soft);
}

.app-window-bar {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.app-window-bar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
}

.app-window-content {
    display: grid;
    grid-template-columns: 160px 1fr;
    min-height: 280px;
}

.app-sidebar {
    padding: 1rem 0.75rem;
    border-right: 1px solid var(--border-subtle);
}

.app-sidebar-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    padding: 0 0.5rem;
    margin-bottom: 0.5rem;
}

.app-sidebar-item {
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.app-sidebar-item.active {
    background: var(--accent-soft);
    color: var(--text);
}

.app-sidebar-item.dim {
    color: var(--text-dim);
}

.app-editor {
    padding: 1.25rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.app-editor-line .md-h {
    color: var(--text);
    font-weight: 600;
}

.cursor-blink {
    color: var(--accent);
    animation: blink 1s step-end infinite;
}

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

/* ============================================
   Section headings
   ============================================ */
.section-title {
    font-family: var(--font-mono);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 3.5rem;
}

/* ============================================
   Features
   ============================================ */
.features {
    padding: 6rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: border-color var(--transition), transform var(--transition);
}

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

.feature-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-radius: var(--radius);
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

/* ============================================
   How it works
   ============================================ */
.how-it-works {
    padding: 6rem 0;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.steps {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.step {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
    border-radius: 50%;
    border: 1px solid rgba(161, 29, 42, 0.3);
}

.step-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.step-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ============================================
   Download
   ============================================ */
.download {
    padding: 6rem 0;
}

.download-card {
    text-align: center;
    background: radial-gradient(ellipse at 50% 100%, rgba(161, 29, 42, 0.1) 0%, var(--bg-elevated) 70%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 4rem 2rem;
}

.download-card h2 {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.download-card > p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.download-note {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border-subtle);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.95rem;
}

.footer-tagline {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.footer-legal {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    .hero .container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero {
        padding: 8rem 0 4rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-list {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border);
        padding: 1rem;
        gap: 0;
    }

    .nav-list.open {
        display: flex;
    }

    .nav-list li {
        width: 100%;
    }

    .nav-list a {
        display: block;
        padding: 0.75rem 1rem;
        border-radius: var(--radius);
    }

    .nav-list a:hover {
        background: var(--bg-hover);
    }

    .nav-cta {
        text-align: center;
        margin-top: 0.5rem;
    }

    .nav-toggle {
        display: flex;
    }
}

/* Scroll reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Header scroll state */
.site-header.scrolled {
    border-bottom-color: var(--border);
}

@media (max-width: 600px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .download-card {
        padding: 3rem 1.5rem;
    }

    .download-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-large {
        width: 100%;
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .app-window-content {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        display: none;
    }
}
