:root {
    --bg: #f8f3ec;
    --panel: rgba(255, 255, 255, 0.78);
    --panel-strong: rgba(255, 255, 255, 0.92);
    --text: #1f1a14;
    --muted: #5b5145;
    --accent: #1d9bf0;
    --accent-strong: #0f6bdc;
    --border: #e5d9cf;
    --glow: 0 25px 60px rgba(31, 26, 20, 0.16);
    --bg-accent-1: rgba(255, 247, 236, 0.9);
    --bg-accent-2: rgba(245, 228, 207, 0.6);
    --glow-spot-1: rgba(255, 247, 236, 0.7);
    --glow-spot-2: rgba(245, 228, 207, 0.42);
    --shadow-soft: 0 8px 18px rgba(31, 26, 20, 0.16);
    --card-shadow: 0 20px 50px rgba(31, 26, 20, 0.12);
    --sans: "DM Sans", "SF Pro Display", "Helvetica Neue", system-ui, -apple-system, "Segoe UI", sans-serif;
    --serif: "IBM Plex Serif", "Georgia", serif;
    
    /* Grid system spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 2.5rem;
    --spacing-3xl: 3rem;
    
    /* Layout constants */
    --header-height: 72px;
    --container-width: min(1100px, 92vw);
    --container-narrow: min(860px, 92vw);
}

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

body {
    min-height: 100vh;
    font-family: var(--serif);
    background: radial-gradient(120% 120% at 18% 10%, var(--bg-accent-1), transparent 55%), radial-gradient(120% 120% at 78% 12%, var(--bg-accent-2), transparent 50%), var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #05070d;
        --panel: rgba(255, 255, 255, 0.04);
        --panel-strong: rgba(255, 255, 255, 0.08);
        --text: #f7f9fb;
        --muted: #a9b4c4;
        --border: rgba(255, 255, 255, 0.08);
        --bg-accent-1: rgba(124, 240, 201, 0.14);
        --bg-accent-2: rgba(97, 162, 255, 0.18);
        --glow: 0 25px 80px rgba(12, 41, 80, 0.25);
        --glow-spot-1: rgba(124, 240, 201, 0.25);
        --glow-spot-2: rgba(84, 132, 255, 0.25);
        --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.3);
        --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    }

    body {
        background: radial-gradient(120% 120% at 20% 10%, var(--bg-accent-1), transparent 55%), radial-gradient(120% 120% at 80% 0%, var(--bg-accent-2), transparent 50%), var(--bg);
    }

    .slide {
        background: linear-gradient(150deg, rgba(12, 16, 26, 0.92), rgba(12, 16, 26, 0.8));
        border-color: rgba(255, 255, 255, 0.08);
    }

    .screenshot {
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--card-shadow);
    }
}

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

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

button {
    font: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Grid-based layout system */
.shell {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.shell.narrow {
    width: var(--container-narrow);
}

/* Header - consistent height across all pages */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    padding: var(--spacing-lg) 0;
    gap: var(--spacing-md);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-weight: 600;
    letter-spacing: -0.01em;
    font-family: var(--sans);
    color: var(--text);
    transition: opacity 0.2s ease;
    text-decoration: none;
}

.brand:hover {
    opacity: 0.8;
}

.brand:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.brand img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
}

nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    font-size: 0.95rem;
    flex-wrap: wrap;
    font-family: var(--sans);
}

nav a {
    padding: var(--spacing-md) var(--spacing-md);
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    color: var(--muted);
}

nav a:hover {
    border-color: rgba(15, 107, 220, 0.24);
    color: var(--text);
    background: rgba(15, 107, 220, 0.08);
}

/* Main content area */
main {
    padding: var(--spacing-2xl) 0;
    width: 100%;
}

h1 {
    font-size: clamp(2.4rem, 4vw, 3.3rem);
    margin: var(--spacing-lg) 0 var(--spacing-md);
    letter-spacing: -0.03em;
    line-height: 1.05;
    font-family: var(--sans);
}

h2 {
    font-size: 1.35rem;
    margin-top: var(--spacing-2xl);
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em;
    font-family: var(--sans);
}

h3 {
    font-size: 1.05rem;
    margin: var(--spacing-lg) 0 var(--spacing-sm);
    font-family: var(--sans);
}

.lede {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.muted {
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 999px;
    background: rgba(15, 107, 220, 0.08);
    color: var(--accent);
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    border: 1px solid rgba(15, 107, 220, 0.2);
    font-family: var(--sans);
}

/* Hero section with grid */
.hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-2xl);
    align-items: start;
}

.feature-list {
    list-style: none;
    margin: var(--spacing-xl) 0 var(--spacing-lg);
    display: grid;
    gap: var(--spacing-md);
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.feature-list .icon {
    width: 12px;
    height: 12px;
    margin-top: 4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 0 0 6px rgba(15, 107, 220, 0.12);
}

.cta {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
}

.cta.top {
    margin-bottom: var(--spacing-md);
    margin-top: 0;
}

.app-store {
    display: inline-flex;
    align-items: center;
    border-radius: 14px;
    padding: 6px;
    border: 1px solid var(--border);
    background: var(--panel-strong);
    transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.app-store img {
    height: 46px;
    width: auto;
    display: block;
}

.app-store:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

.secondary-link {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 4px;
    font-weight: 500;
}

.hero-visual {
    position: relative;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.glow {
    position: absolute;
    inset: 0;
    filter: blur(48px);
    background: radial-gradient(circle at 40% 30%, var(--glow-spot-1), transparent 52%), radial-gradient(circle at 76% 22%, var(--glow-spot-2), transparent 42%);
    opacity: 0.9;
    pointer-events: none;
}

.device {
    position: relative;
    padding: 0;
}

.carousel {
    position: relative;
    width: 100%;
    max-width: min(420px, 100%);
    margin: 0 auto;
}

.slides {
    position: relative;
    width: 100%;
    min-height: 500px;
}

.slide {
    display: none;
    width: 100%;
    border-radius: 18px;
    padding: var(--spacing-sm);
    border: 1px solid var(--border);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.82));
    box-sizing: border-box;
    box-shadow: var(--card-shadow);
}

.slide.active {
    display: block;
}

.screenshot {
    display: block;
    width: 100%;
    height: auto;
    max-height: 600px;
    border-radius: 12px;
    object-fit: contain;
    border: none;
    box-shadow: var(--card-shadow);
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.nav-buttons button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav-buttons button:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 107, 220, 0.4);
    background: var(--panel-strong);
}

.dots {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.dots button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 107, 220, 0.16);
    cursor: pointer;
    padding: 0;
}

.dots .active {
    width: 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

/* Footer - consistent across all pages */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: 0.95rem;
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-top: auto;
}

.footer a {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Page layouts (privacy, credits) */
.page-card {
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.82));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.page-meta {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.95rem;
}

.page-text {
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 10px;
}

.page-list {
    list-style: none;
    margin: 8px 0 12px;
    padding: 0;
}

.page-list li {
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 8px;
}

.link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 4px;
    font-weight: 600;
}

.stack {
    display: grid;
    gap: var(--spacing-md);
}

.list-item {
    padding: var(--spacing-md);
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
}

.license {
    margin-top: 8px;
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 107, 220, 0.12);
    color: var(--accent);
    font-size: 0.85rem;
}

details {
    margin-top: var(--spacing-md);
    border-radius: 12px;
    background: var(--panel-strong);
    border: 1px solid var(--border);
    padding: var(--spacing-md);
}

details summary {
    cursor: pointer;
    color: var(--text);
    font-weight: 600;
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

.license-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--spacing-md);
    list-style: none;
    cursor: pointer;
}

.license-copy {
    display: grid;
    gap: var(--spacing-xs);
}

.license-header {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    justify-content: flex-start;
}

.license-summary .arrow {
    transition: transform 0.2s ease;
    color: var(--muted);
}

details[open] .license-summary .arrow {
    transform: rotate(90deg);
}

pre {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(15, 107, 220, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(15, 107, 220, 0.2);
    color: var(--text);
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.page-footer {
    margin-top: var(--spacing-3xl);
    font-size: 0.95rem;
    color: var(--muted);
}

@media (max-width: 720px) {
    .shell {
        padding: 0 var(--spacing-md);
    }
    
    header {
        gap: var(--spacing-md);
        min-height: auto;
        padding: var(--spacing-md) 0;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .device {
        padding: var(--spacing-lg);
    }

    .carousel {
        max-width: 100%;
    }

    .slides {
        min-height: 400px;
    }

    .slide {
        padding: var(--spacing-sm);
    }

    .screenshot {
        max-height: 500px;
    }
    
    main {
        padding: var(--spacing-xl) 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto;
        transition: none !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    .app-store:hover,
    .nav-buttons button:hover {
        transform: none;
        box-shadow: none;
    }

}
