:root {
    color-scheme: light;
    --bg: #f7f8fb;
    --surface: #ffffff;
    --surface-soft: #eef3f7;
    --ink: #17212b;
    --muted: #5b6875;
    --line: #d9e1e8;
    --accent: #166d75;
    --accent-strong: #0f545a;
    --accent-soft: #d8eef0;
    --warning: #8b4a08;
    --code-bg: #101820;
    --code-ink: #e9f2f4;
    --shadow: 0 12px 30px rgba(21, 33, 43, 0.08);
    --radius: 8px;
    --content: 1160px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

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

a {
    color: var(--accent-strong);
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    background: var(--ink);
    color: #fff;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
}

.skip-link:focus {
    top: 1rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(247, 248, 251, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.nav-shell {
    max-width: var(--content);
    margin: 0 auto;
    min-height: 64px;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a,
.nav-toggle,
.button-link,
.text-link {
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
}

.nav-links a {
    color: var(--ink);
    padding: 0.45rem 0.7rem;
}

.nav-links a:hover,
.nav-links a:focus,
.nav-links a.is-active {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    padding: 0.45rem 0.7rem;
}

.hero {
    max-width: var(--content);
    min-height: 420px;
    margin: 0 auto;
    padding: 5rem 1rem 2rem;
    display: grid;
    align-items: end;
}

.hero-compact {
    min-height: 330px;
}

.hero-copy {
    max-width: 820px;
}

.eyebrow {
    margin: 0 0 0.5rem;
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    line-height: 1.18;
}

h1 {
    max-width: 960px;
    font-size: clamp(2.25rem, 6vw, 4.75rem);
}

h2 {
    font-size: clamp(1.55rem, 3vw, 2.35rem);
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1rem;
}

p {
    margin: 0.7rem 0 0;
}

.section {
    max-width: var(--content);
    margin: 0 auto;
    padding: 3rem 1rem;
}

.section-heading {
    max-width: 780px;
    margin-bottom: 1.4rem;
}

.feature-grid,
.topic-grid,
.screenshot-grid {
    display: grid;
    gap: 1rem;
}

.feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.question-bank-list {
    grid-template-columns: 1fr;
}

.question-bank-list .topic-card {
    padding: 1.25rem 1.35rem;
}

.question-bank-list .topic-card p {
    max-width: 86ch;
    line-height: 1.75;
}

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

.feature-card,
.topic-card,
.workflow-card,
.callout,
.source-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.feature-card,
.topic-card,
.workflow-card,
.callout {
    padding: 1.1rem;
}

.feature-card p,
.topic-card p,
.workflow-card p,
.callout p {
    color: var(--muted);
}

.text-link,
.button-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1rem;
    color: var(--accent-strong);
}

.button-link {
    background: var(--accent);
    color: #fff;
    padding: 0.65rem 0.85rem;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
    gap: 1rem;
    align-items: start;
}

.guide-layout {
    max-width: var(--content);
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 2rem;
}

.side-nav {
    position: sticky;
    top: 84px;
    align-self: start;
    display: grid;
    gap: 0.3rem;
    padding: 0.8rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.side-nav a {
    padding: 0.45rem 0.55rem;
    border-radius: 6px;
    color: var(--ink);
    text-decoration: none;
}

.source-listings-page .side-nav a {
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

.side-nav a:hover,
.side-nav a:focus {
    background: var(--surface-soft);
}

.guide-content {
    min-width: 0;
}

.guide-section {
    scroll-margin-top: 90px;
    margin-bottom: 2.2rem;
}

.guide-section > p,
.guide-section > ul,
.guide-section > ol {
    color: var(--muted);
}

.answer-block {
    margin-top: 1rem;
    padding: 1rem;
    border-left: 4px solid var(--accent);
    background: var(--surface);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.answer-block p,
.answer-block li {
    color: var(--ink);
}

.checklist {
    display: grid;
    gap: 0.5rem;
    padding-left: 1.2rem;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

th,
td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--surface-soft);
}

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

.source-card {
    margin: 1rem 0 1.6rem;
    overflow: hidden;
}

.source-card header {
    padding: 0.8rem 1rem;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
}

.source-card pre {
    margin: 0;
    padding: 1rem;
    overflow: auto;
    background: var(--code-bg);
    color: var(--code-ink);
    font-size: 0.9rem;
    line-height: 1.55;
    tab-size: 4;
}

.coding-workflow-page .source-card pre,
.source-listings-page .source-card pre {
    background: #fbfcff;
    color: #172033;
    border-top: 1px solid #dfe6f0;
}

.coding-workflow-page .source-card code,
.source-listings-page .source-card code {
    color: inherit;
}

.coding-workflow-page .source-card header,
.source-listings-page .source-card header {
    background: #f2f5fa;
}

.syntax-reference-page [data-syntax-card] > p {
    margin: 0.85rem 1rem;
    line-height: 1.65;
}

.syntax-reference-page [data-syntax-card] > p:last-child {
    margin-bottom: 1.1rem;
}

code {
    font-family: Consolas, "Cascadia Mono", "Courier New", monospace;
}

p code,
li code,
td code {
    padding: 0.1rem 0.25rem;
    background: var(--surface-soft);
    border-radius: 4px;
    color: var(--ink);
}

.screenshot-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.screenshot-card figure {
    margin: 0;
}

.screenshot-card figcaption {
    padding: 0.85rem;
    color: var(--muted);
}

.filter-row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin: 1rem 0 1.5rem;
}

.filter-row input {
    width: min(460px, 100%);
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}

.site-footer {
    max-width: var(--content);
    margin: 0 auto;
    padding: 2rem 1rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

@media (max-width: 860px) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav-shell {
        flex-wrap: wrap;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding-bottom: 0.7rem;
    }

    .nav-links.is-open {
        display: flex;
    }

    .feature-grid,
    .topic-grid,
    .screenshot-grid,
    .two-column,
    .guide-layout {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: 300px;
        padding-top: 3rem;
    }

    .side-nav {
        position: static;
    }
}
