:root {
    color-scheme: light;
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-muted: #eef2f5;
    --ink: #18202a;
    --muted: #64707d;
    --line: #d8dee6;
    --accent: #196e63;
    --accent-strong: #0e4f47;
    --accent-soft: #e8f4f1;
    --band-warm: #fdf1e2;
    --warn: #a14810;
    --danger: #b42318;
    --ok: #167048;
    --code-bg: #11161d;
    --code-ink: #f2f6fb;
    --shadow: 0 18px 48px rgba(25, 32, 42, 0.11);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 320px;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

.home-page {
    flex: 1 0 auto;
}

.site-nav,
.practice-topbar {
    flex: 0 0 auto;
}

button,
textarea {
    font: inherit;
}

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

.site-nav,
.practice-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 0 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
}

.brand-link {
    color: var(--ink);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0;
}

.nav-actions,
.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.primary-link,
.secondary-link,
.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 7px;
    padding: 9px 15px;
    cursor: pointer;
    font-weight: 850;
    line-height: 1;
}

.primary-link,
.primary-button {
    border: 1px solid var(--accent-strong);
    background: var(--accent);
    color: #ffffff;
}

.primary-link:hover,
.primary-button:hover {
    background: var(--accent-strong);
}

.secondary-link,
.secondary-button {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
}

.secondary-link:hover,
.secondary-button:hover {
    background: var(--surface-muted);
}

.small {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 13px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(37, 94, 77, 0.22);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)),
        linear-gradient(155deg, #2e7d67, #185947);
    box-shadow: 0 8px 18px rgba(24, 89, 71, 0.18);
    color: transparent;
    font-weight: 900;
    overflow: hidden;
}

.brand-mark::before,
.brand-mark::after {
    content: "";
    position: absolute;
    top: 9px;
    width: 10px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.12);
}

.brand-mark::before {
    left: 6px;
    border-radius: 3px 1px 1px 3px;
    transform: skewY(-8deg);
}

.brand-mark::after {
    right: 6px;
    border-radius: 1px 3px 3px 1px;
    transform: skewY(8deg);
}

.brand-mark + * {
    letter-spacing: 0;
}

.nav-actions a:not(.primary-link),
.nav-action-button {
    padding: 6px 2px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 750;
}

.nav-actions a:not(.primary-link):hover,
.nav-action-button:hover {
    color: var(--ink);
}

.primary-link.large {
    min-height: 48px;
    padding: 12px 24px;
    font-size: 15px;
}

/* ---------- Home page ---------- */

.home-page {
    width: 100%;
}

/* Full-bleed color bands: each direct section owns a tinted, edge-to-edge
   background; a divider line separates it from the band before it. */

.band {
    width: 100%;
    border-top: 1px solid var(--line);
}

.home-page > .band:first-child {
    border-top: 0;
}

.band-a {
    background: var(--surface);
}

.band-b {
    background: var(--surface-muted);
}

.band-c {
    background: var(--accent-soft);
}

.band-d {
    background: var(--band-warm);
}

.cta-band {
    padding: 44px 0;
}

.hero,
.topic-strip,
.how-it-works,
.topics-section,
.course-section,
.dataset-section,
.cta-banner,
.site-footer {
    width: min(1180px, calc(100% - 40px));
    margin-right: auto;
    margin-left: auto;
}

.section-heading {
    margin-bottom: 26px;
}

.section-heading.center {
    max-width: 620px;
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

.section-heading h2 {
    margin: 6px 0 0;
    font-size: clamp(24px, 3vw, 32px);
    letter-spacing: -0.01em;
}

/* Hero */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    gap: 48px;
    align-items: center;
    padding: 60px 0 56px;
}

.hero-copy h1 {
    max-width: 620px;
    margin: 12px 0 0;
    font-size: clamp(36px, 4.6vw, 56px);
    line-height: 1.04;
    letter-spacing: -0.02em;
}

.hero-lede {
    max-width: 540px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
}

.hero-actions {
    margin-top: 28px;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 38px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.hero-stats div {
    display: flex;
    flex-direction: column;
}

.hero-stats strong {
    color: var(--accent-strong);
    font-size: 28px;
    line-height: 1;
}

.hero-stats span {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero-visual {
    display: grid;
    gap: 16px;
}

.code-card {
    overflow: hidden;
    border: 1px solid #232c37;
    border-radius: 10px;
    background: var(--code-bg);
    box-shadow: var(--shadow);
}

.code-card-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 14px;
    border-bottom: 1px solid #262f39;
    background: #1b2129;
}

.code-card-bar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3a4451;
}

.code-card-bar span:nth-child(1) {
    background: #e6635a;
}

.code-card-bar span:nth-child(2) {
    background: #e8b13c;
}

.code-card-bar span:nth-child(3) {
    background: #3fbd6c;
}

.code-card-bar p {
    margin: 0 0 0 6px;
    color: #8b97a5;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12px;
}

.code-card-body {
    margin: 0;
    overflow-x: auto;
    padding: 20px;
    color: var(--code-ink);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12.5px;
    line-height: 1.75;
    white-space: pre;
}

.tok-type {
    color: #7fe0c4;
}

.tok-str {
    color: #f2c078;
}

.result-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 16px 18px;
}

.result-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 5px 11px;
    background: #e7f5ee;
    color: var(--ok);
    font-size: 12px;
    font-weight: 850;
}

.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--line);
    color: #394654;
    font-size: 13px;
}

.result-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.result-row strong {
    color: var(--accent-strong);
}

/* Topic strip */

.topic-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 26px 0;
}

.topic-strip span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 14px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

/* How it works */

.how-it-works {
    padding: 64px 0 20px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.step-card,
.topic-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 26px 24px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.step-card:hover,
.topic-card:hover {
    border-color: #b9c9c5;
    transform: translateY(-2px);
    box-shadow: 0 22px 44px rgba(25, 32, 42, 0.13);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 14px;
    font-weight: 950;
    margin-bottom: 16px;
}

.step-card h3,
.topic-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
    letter-spacing: 0;
}

.step-card p,
.topic-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

/* Topics grid */

.topics-section {
    padding: 44px 0 20px;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.topic-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    margin-bottom: 14px;
}

/* Curriculum */

.course-section {
    padding: 60px 0 20px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.module-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    min-height: 172px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.module-card:hover {
    border-color: #b9c9c5;
    transform: translateY(-2px);
    box-shadow: 0 22px 44px rgba(25, 32, 42, 0.13);
}

.module-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 7px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 950;
}

.module-card h3 {
    margin: 0;
    font-size: 17px;
    letter-spacing: 0;
}

.module-card p {
    margin: 8px 0 12px;
    color: #394654;
    font-size: 14px;
}

.module-card a {
    color: var(--accent-strong);
    font-size: 13px;
    font-weight: 850;
}

/* Dataset showcase */

.dataset-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
    gap: 40px;
    align-items: center;
    padding: 64px 0;
}

.dataset-copy h2 {
    margin: 8px 0 0;
    font-size: clamp(24px, 3vw, 32px);
    letter-spacing: -0.01em;
}

.dataset-copy p {
    max-width: 520px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.65;
}

.feature-list {
    display: grid;
    gap: 8px;
    margin: 20px 0 26px;
}

.feature-list span {
    display: block;
    border-left: 3px solid var(--accent);
    padding: 7px 0 7px 12px;
    color: #394654;
    font-size: 14px;
}

.dataset-table-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 20px;
}

.mini-table {
    min-width: 0;
    margin-top: 12px;
}

/* Final CTA */

.cta-banner {
    padding: 56px 40px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    color: #ffffff;
    text-align: center;
    box-shadow: var(--shadow);
}

.cta-banner h2 {
    margin: 0;
    font-size: clamp(26px, 4vw, 36px);
    letter-spacing: -0.01em;
}

.cta-banner p {
    margin: 12px 0 28px;
    color: #dcefe9;
    font-size: 16px;
}

.cta-banner .primary-link {
    border-color: #ffffff;
    background: #ffffff;
    color: var(--accent-strong);
}

.cta-banner .primary-link:hover {
    background: #eef7f4;
}

/* Guide page */

.guide-hero {
    grid-template-columns: minmax(0, 1fr);
}

.guide-hero .hero-copy h1,
.guide-hero .hero-lede {
    max-width: 720px;
}

.guide-stuck .dataset-table-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

p code,
li code,
summary code,
td code {
    border-radius: 4px;
    padding: 1px 5px;
    background: var(--surface-muted);
    color: var(--accent-strong);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.9em;
}

.faq-list {
    display: grid;
    gap: 10px;
    max-width: 760px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 16px 18px;
}

.faq-item summary {
    cursor: pointer;
    font-weight: 850;
    font-size: 15px;
    list-style: revert;
}

.faq-item summary::marker {
    color: var(--accent);
}

.faq-item p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

/* Articles page */

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.article-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--ink);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.article-card:hover {
    border-color: #b9c9c5;
    transform: translateY(-2px);
    box-shadow: 0 22px 44px rgba(25, 32, 42, 0.13);
}

.article-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.article-card-badges span {
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.article-card h3 {
    margin: 0;
    font-size: 17px;
    letter-spacing: 0;
}

.article-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .read-more {
    margin-top: auto;
    color: var(--accent-strong);
    font-size: 13px;
    font-weight: 850;
}

.article-empty {
    display: grid;
    gap: 6px;
    max-width: 440px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: var(--surface);
    color: var(--muted);
    font-size: 14px;
}

.article-empty strong {
    color: var(--ink);
    font-size: 17px;
}

.article-detail {
    max-width: 720px;
    margin: 0 auto;
}

.article-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.article-detail-meta span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
}

.article-detail h1 {
    margin: 0;
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.article-detail-prompt {
    margin: 16px 0 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    background: var(--surface-muted);
    color: #394654;
    font-size: 15px;
}

.article-detail-body {
    margin-top: 28px;
}

.article-detail-body h2,
.article-detail-body h3,
.article-detail-body h4 {
    margin: 34px 0 12px;
    color: var(--ink);
    letter-spacing: 0;
    line-height: 1.2;
}

.article-detail-body h2 {
    font-size: 26px;
}

.article-detail-body h3 {
    font-size: 21px;
}

.article-detail-body h4 {
    font-size: 18px;
}

.article-detail-body p {
    margin: 0 0 18px;
    color: #2c3a44;
    font-size: 16px;
    line-height: 1.75;
}

.article-detail-body blockquote {
    margin: 0 0 22px;
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 12px 16px;
    background: var(--surface-muted);
    color: #2c3a44;
    font-size: 16px;
    line-height: 1.65;
}

.article-detail-body ul,
.article-detail-body ol {
    margin: 0 0 22px 22px;
    padding: 0;
    color: #2c3a44;
    font-size: 16px;
    line-height: 1.75;
}

.article-detail-body li {
    margin: 4px 0;
}

.article-detail-body p:last-child {
    margin-bottom: 0;
}

.article-detail-body strong {
    color: var(--accent-strong);
}

.article-detail-body p code,
.article-detail-body li code,
.article-detail-body td code,
.article-detail-body th code,
.article-detail-body h2 code,
.article-detail-body h3 code,
.article-detail-body h4 code {
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1px 5px;
    background: var(--surface-muted);
    color: var(--accent-strong);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.88em;
}

.article-rule {
    margin: 32px 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.article-table-wrap {
    overflow-x: auto;
    margin: 0 0 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    color: #2c3a44;
    font-size: 14px;
    line-height: 1.5;
}

.article-table th,
.article-table td {
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.article-table th {
    background: var(--surface-muted);
    color: var(--ink);
    font-weight: 900;
}

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

.code-example {
    margin: 0 0 22px;
    padding: 16px 18px;
    border-radius: 8px;
    background: var(--code-bg);
    color: var(--code-ink);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 13.5px;
    line-height: 1.65;
    overflow-x: auto;
    white-space: pre;
}

.article-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* Admin panel */

.admin-layout {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.admin-list-panel,
.admin-form-panel {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 18px;
}

.admin-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.admin-tab {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 850;
    padding: 10px 12px;
}

.admin-tab:hover {
    border-color: #9bb5af;
    color: var(--ink);
}

.admin-tab.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--ink);
}

.full-width {
    width: 100%;
}

.admin-list-actions {
    display: grid;
    gap: 8px;
}

.admin-list-actions .danger-button {
    margin-left: 0;
}

.admin-article-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.admin-article-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    font-size: 13.5px;
    font-weight: 800;
}

.admin-article-item:hover {
    border-color: #9bb5af;
}

.admin-article-item.active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.admin-article-item span {
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
}

.admin-empty-list {
    display: grid;
    gap: 4px;
    border: 1px dashed #bdc9c4;
    border-radius: 8px;
    padding: 14px;
    background: #fbfcfb;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.admin-empty-list strong {
    color: var(--ink);
    font-size: 14px;
}

.admin-message {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--surface-muted);
    color: #394654;
    font-size: 13.5px;
}

.admin-message.error {
    background: #fff0ed;
    color: var(--danger);
}

.admin-message.success {
    background: #e7f5ee;
    color: var(--ok);
}

.admin-form {
    display: grid;
    gap: 16px;
    margin-top: 14px;
}

.admin-field {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 800;
    color: #394654;
}

.admin-field-grid {
    display: grid;
    gap: 12px;
}

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

.admin-field input,
.admin-field textarea {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 9px 11px;
    font-size: 14px;
    font-weight: 400;
    font-family: inherit;
    color: var(--ink);
    resize: vertical;
}

.admin-field input:focus,
.admin-field textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.admin-field textarea.code-field {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12.5px;
}

.admin-sections-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-section-card {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.admin-section-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-section-card-header span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.admin-section-card textarea.code-field {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12.5px;
}

.markdown-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 4px;
}

.markdown-toolbar button {
    min-height: 30px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 5px 9px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 850;
}

.markdown-toolbar button:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--ink);
}

.admin-field textarea.markdown-field {
    min-height: 420px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.55;
}

.danger-button {
    margin-left: auto;
    border-color: var(--danger);
    color: var(--danger);
}

.danger-button:hover {
    background: #fff0ed;
}

.admin-sign-in {
    max-width: 380px;
    margin: 0 auto;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    gap: clamp(28px, 5vw, 72px);
    align-items: center;
    width: min(1120px, calc(100% - 32px));
    min-height: calc(100vh - 170px);
    margin: 0 auto;
    padding: 68px 0;
}

.auth-copy {
    display: grid;
    gap: 18px;
    max-width: 650px;
}

.auth-copy h1 {
    max-width: 620px;
    margin: 0;
    font-size: clamp(44px, 6vw, 76px);
    line-height: 0.95;
    letter-spacing: 0;
}

.auth-copy p:not(.eyebrow) {
    max-width: 610px;
    margin: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.65;
}

.auth-panel {
    display: grid;
    gap: 16px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-panel-header {
    display: grid;
    gap: 3px;
}

.auth-panel-header h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1.15;
    letter-spacing: 0;
}

.auth-mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.auth-mode-tab {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-muted);
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
}

.auth-mode-tab:hover {
    border-color: #9bb5af;
    color: var(--ink);
}

.auth-mode-tab.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--ink);
}

.google-link {
    width: 100%;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--line);
}

.auth-form-panel {
    display: grid;
    gap: 12px;
}

.auth-form-panel.hidden {
    display: none !important;
}

.auth-text-button {
    justify-self: center;
    border: 0;
    background: transparent;
    color: var(--accent-strong);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    padding: 2px 4px;
}

.auth-text-button:hover {
    color: var(--ink);
}

.auth-layout,
.profile-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 62px 0;
}

.profile-layout {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.auth-card {
    display: grid;
    align-content: start;
    gap: 12px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-card h2 {
    margin: 0;
    font-size: 23px;
    line-height: 1.2;
    letter-spacing: 0;
}

.auth-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.auth-card .admin-message {
    margin: 0;
}

.primary-link.disabled {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.58;
}

.profile-meta-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-top: 6px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.profile-meta-grid span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.profile-meta-grid strong {
    color: var(--ink);
    font-size: 14px;
}

.profile-progress-list {
    display: grid;
    gap: 8px;
}

.profile-progress-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 850;
}

.profile-progress-row:hover {
    border-color: #9bb5af;
    background: var(--surface-muted);
}

.profile-progress-row span {
    min-width: 0;
}

.profile-progress-row strong {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

/* Footer */

.site-footer-band {
    flex: 0 0 auto;
    width: 100%;
    border-top: 1px solid var(--line);
    background: #18202a;
    color: #dce5e2;
}

.site-footer {
    display: grid;
    grid-template-columns: minmax(220px, 1.1fr) minmax(260px, 1fr) minmax(180px, auto);
    align-items: start;
    justify-content: space-between;
    gap: 24px;
    padding: 30px 0;
    color: #b7c5c1;
    font-size: 13px;
}

.footer-brand-block {
    display: grid;
    gap: 8px;
    max-width: 390px;
}

.footer-brand-block p,
.footer-meta span {
    margin: 0;
    color: #b7c5c1;
    line-height: 1.55;
}

.site-footer .footer-brand-link {
    color: #ffffff;
    font-weight: 900;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-nav a {
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 7px;
    padding: 7px 10px;
    color: #dce5e2;
    font-size: 13px;
    font-weight: 850;
}

.footer-nav a:hover {
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.footer-meta {
    display: grid;
    gap: 6px;
    justify-items: end;
    text-align: right;
}

.footer-meta span:first-child {
    color: #ffffff;
    font-weight: 900;
}

/* Load-in and scroll-reveal motion */

@media (prefers-reduced-motion: no-preference) {
    @keyframes fade-in-up {
        from {
            opacity: 0;
            transform: translateY(18px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .hero-copy > * {
        opacity: 0;
        animation: fade-in-up 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
    }

    .hero-copy > *:nth-child(1) {
        animation-delay: 0.04s;
    }

    .hero-copy > *:nth-child(2) {
        animation-delay: 0.11s;
    }

    .hero-copy > *:nth-child(3) {
        animation-delay: 0.19s;
    }

    .hero-copy > *:nth-child(4) {
        animation-delay: 0.27s;
    }

    .hero-copy > *:nth-child(5) {
        animation-delay: 0.35s;
    }

    .hero-visual {
        opacity: 0;
        animation: fade-in-up 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
        animation-delay: 0.24s;
    }

    .reveal {
        opacity: 0;
        transform: translateY(22px);
        transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
    }

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


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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 9px 10px;
    text-align: left;
    white-space: nowrap;
}

th {
    background: var(--surface-muted);
    color: #394654;
    font-size: 12px;
}

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

@media (max-width: 1240px) {
    .steps-grid,
    .topics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .site-nav,
    .practice-topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px;
    }

    .home-page,
    .site-footer {
        width: auto;
        margin-right: 12px;
        margin-left: 12px;
    }

    .site-footer {
        grid-template-columns: 1fr;
    }

    .footer-meta {
        justify-items: start;
        text-align: left;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 36px 0 44px;
    }

    .hero-copy h1 {
        max-width: none;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        min-height: 0;
        padding: 42px 0;
    }

    .auth-copy h1 {
        max-width: none;
        font-size: 44px;
        line-height: 1;
    }

    .hero-visual {
        max-width: 480px;
    }

    .steps-grid,
    .topics-grid,
    .admin-layout,
    .auth-layout,
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .auth-layout,
    .profile-layout {
        padding: 44px 0;
    }

    .dataset-section {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 44px 0;
    }

    .cta-banner {
        padding: 40px 24px;
    }
}

@media (max-width: 620px) {
    .nav-actions,
    .hero-actions {
        align-items: stretch;
        width: 100%;
    }

    .primary-link,
    .secondary-link,
    .primary-button,
    .secondary-button {
        flex: 1 1 130px;
    }

    .hero-copy h1 {
        font-size: 34px;
    }

    .hero-lede {
        font-size: 16px;
    }

    .auth-copy p:not(.eyebrow) {
        font-size: 16px;
    }

    .auth-panel {
        padding: 18px;
    }

    .hero-stats {
        gap: 22px;
    }

    .module-card,
    .step-card,
    .topic-card {
        padding: 14px;
    }

    .cta-banner {
        padding: 32px 18px;
    }

    .admin-field-grid.two {
        grid-template-columns: 1fr;
    }
}
