:root {
    --bg: #fff8ee;
    --bg-surface: #ffffff;
    --bg-raised: #fff1dc;
    --border: #f0d3a7;
    --text: #2c2419;
    --text-muted: #6c5a42;
    --text-subtle: #9a8564;
    --accent: #d76400;
    --accent-hover: #af4f00;
    --green: #2f8a56;
    --orange: #b96600;
    --red: #c93b2f;
    --purple: #9c4b72;
    --code-bg: #fff3e1;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'JetBrains Mono', 'Fira Code', monospace;
    --max-width: 960px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background:
        radial-gradient(circle at 10% 0%, #ffe8bf 0%, rgba(255, 232, 191, 0) 42%),
        radial-gradient(circle at 90% 8%, #ffd7ab 0%, rgba(255, 215, 171, 0) 36%),
        linear-gradient(180deg, #fff9ef 0%, #fff4e4 100%);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    color-scheme: light;
}

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

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

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* --- Nav --- */

nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 250, 241, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    box-shadow: 0 3px 20px rgba(161, 94, 25, 0.08);
}

nav .nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

nav .logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
}

nav .logo-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(170, 94, 16, 0.22);
}

nav .logo:hover {
    text-decoration: none;
    color: var(--accent-hover);
}

nav .nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

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

nav .nav-links a:hover,
nav .nav-links a.active {
    color: var(--text);
    text-decoration: none;
}

/* --- Main content --- */

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* --- Hero --- */

.hero {
    text-align: center;
    padding: 4rem 0 3rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--accent), #ffb347);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .tagline {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.5;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent);
    color: #fffaf5;
}

.btn-primary:hover {
    background: var(--accent-hover);
    text-decoration: none;
    color: #fffaf5;
}

.hero-download-btn {
    animation: hero-download-nudge 4s ease-in-out infinite;
    box-shadow: 0 0 0 rgba(215, 100, 0, 0);
}

.hero-download-btn:hover {
    animation-play-state: paused;
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-raised);
    border-color: var(--text-subtle);
    text-decoration: none;
}

@keyframes hero-download-nudge {
    0%, 82%, 100% {
        transform: translateX(0);
        box-shadow: 0 0 0 rgba(215, 100, 0, 0);
    }
    86% {
        transform: translateX(-1px) rotate(-1deg);
        box-shadow: 0 0 0 0 rgba(215, 100, 0, 0.22);
    }
    89% {
        transform: translateX(2px) rotate(1deg);
        box-shadow: 0 0 0 7px rgba(215, 100, 0, 0.12);
    }
    92% {
        transform: translateX(-2px) rotate(-1deg);
        box-shadow: 0 0 0 12px rgba(215, 100, 0, 0.04);
    }
    95% {
        transform: translateX(1px) rotate(0.5deg);
        box-shadow: 0 0 0 0 rgba(215, 100, 0, 0);
    }
}

/* --- Code blocks --- */

pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.875rem;
    line-height: 1.65;
}

pre code {
    font-family: var(--font-mono);
    color: var(--text);
}

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

pre code {
    background: none;
    padding: 0;
    color: var(--text);
}

/* --- Syntax highlighting --- */

.kw { color: #b63a2a; }
.type { color: var(--purple); }
.fn { color: #8e477a; }
.str { color: #8f4f00; }
.num { color: #006a8f; }
.cmt { color: var(--text-subtle); font-style: italic; }
.op { color: #cc5f00; }
.bool { color: #b63a2a; }

/* --- Feature grid --- */

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin: 2rem 0;
}

.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    transition: border-color 0.15s;
}

.feature-card:hover {
    border-color: var(--text-subtle);
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* --- Section headings --- */

.section-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 0.5rem;
}

p + p,
p + pre,
pre + p {
    margin-top: 1rem;
}

/* --- Status section --- */

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.status-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}

.status-card .number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.status-card .label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.number.green { color: var(--green); }
.number.orange { color: var(--orange); }
.number.blue { color: var(--accent); }

/* --- Tables --- */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

th {
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.6rem 1rem;
    border-bottom: 2px solid var(--border);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border);
}

tr:last-child td {
    border-bottom: none;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
}

.platform-icon {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

/* --- Badge --- */

.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15em 0.55em;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-done { background: rgba(47, 138, 86, 0.14); color: var(--green); }
.badge-wip { background: rgba(185, 102, 0, 0.16); color: var(--orange); }
.badge-planned { background: rgba(154, 133, 100, 0.16); color: var(--text-muted); }

/* --- Benchmark tables --- */

.bench-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.bench-table-wrap {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    overflow: auto;
    max-height: 520px;
}

.bench-table-wrap table {
    margin: 0;
}

.bench-table-wrap th {
    position: sticky;
    top: 0;
    background: var(--bg-raised);
    z-index: 1;
}

.bench-table-wrap td.num {
    text-align: right;
    font-family: var(--font-mono);
}

/* --- Quick example --- */

.example-section {
    margin: 3rem 0;
}

.example-section pre {
    font-size: 0.9rem;
}

/* --- Docs pages --- */

.doc-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.doc-content h1 + p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.doc-content h2 {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.doc-content h2:first-of-type {
    margin-top: 2rem;
    padding-top: 0;
    border-top: none;
}

.doc-content h3 {
    margin-top: 1.75rem;
}

.doc-content ul,
.doc-content ol {
    padding-left: 1.5rem;
    margin: 0.75rem 0;
}

.doc-content li {
    margin: 0.35rem 0;
    color: var(--text-muted);
}

.doc-content li code {
    color: var(--accent);
}

/* --- Sidebar layout for docs --- */

.doc-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 3rem;
    align-items: start;
}

.doc-sidebar {
    position: sticky;
    top: 72px;
}

.doc-sidebar h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-subtle);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.doc-sidebar ul {
    list-style: none;
    padding: 0;
}

.doc-sidebar li {
    margin: 0;
}

.doc-sidebar a {
    display: block;
    padding: 0.3rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: color 0.15s;
}

.doc-sidebar a:hover,
.doc-sidebar a.active {
    color: var(--text);
    text-decoration: none;
}

/* --- Footer --- */

footer {
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-subtle);
    font-size: 0.85rem;
}

footer a {
    color: var(--text-muted);
}

footer p + p {
    margin-top: 0.4rem;
}

@media (prefers-reduced-motion: reduce) {
    .hero-download-btn {
        animation: none;
    }
}

/* --- Responsive --- */

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    nav {
        padding: 0 1rem;
    }

    nav .nav-inner {
        height: auto;
        min-height: 56px;
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.85rem 0;
    }

    nav .nav-links {
        gap: 0.85rem 1rem;
        flex-wrap: wrap;
        width: 100%;
    }

    nav .nav-links a {
        font-size: 0.85rem;
    }

    main {
        padding: 1.25rem 1rem 3rem;
    }

    .hero {
        padding: 2rem 0 2rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero .tagline {
        font-size: 1.05rem;
    }

    .hero-buttons {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

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

    .features {
        grid-template-columns: 1fr;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .doc-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .doc-sidebar {
        position: static;
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--border);
    }

    h2 {
        font-size: 1.45rem;
    }

    .doc-content h1 {
        font-size: 1.75rem;
    }

    pre {
        padding: 1rem;
        font-size: 0.8rem;
        line-height: 1.55;
        border-radius: 6px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    th,
    td {
        padding: 0.55rem 0.75rem;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 0 0.85rem;
    }

    main {
        padding: 1rem 0.85rem 2.5rem;
    }

    .hero h1 {
        font-size: 1.7rem;
    }

    .hero .tagline {
        font-size: 1rem;
    }

    .feature-card,
    .status-card {
        padding: 1rem;
    }

    pre {
        font-size: 0.76rem;
    }
}
