/* CSS Variables */
:root {
    --font-display: 'Outfit', system-ui, sans-serif;
    --font-body: 'Crimson Pro', Georgia, serif;
    --font-mono: 'JetBrains Mono', monospace;

    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --accent: #ff6b35;
    --accent-glow: rgba(255, 107, 53, 0.3);

    --nav-height: 4.5rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding-top: var(--nav-height);
}

/* Grid background */
.bg-grid {
    background-image:
        linear-gradient(rgba(255, 107, 53, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 107, 53, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

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

a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    text-shadow: 0 0 10px var(--accent-glow);
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(255, 107, 53, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav-logo .accent {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-family: var(--font-display);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

/* Footer: full-width bar, inner content constrained */
.site-footer {
    width: 100%;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255, 107, 53, 0.2);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.site-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem 1.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.site-footer__inner > .footer-copyright {
    opacity: 0.85;
}

.footer-version {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.35rem;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Hero Section */
.hero {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    position: relative;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.avatar {
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    margin: 0 auto 2rem;
    display: block;
    box-shadow: 0 0 30px var(--accent-glow);
    object-fit: cover;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.hero .subtitle {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero .subtitle-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--text-secondary);
    transition: color 0.2s, border-color 0.2s;
}

.hero .subtitle-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.hero .bio {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 3rem;
}

/* Social Links */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    border-color: rgba(255, 107, 53, 0.5);
    box-shadow: 0 0 20px var(--accent-glow);
    color: var(--text-primary);
}

.social-link svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* CTA Button */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--accent);
    color: var(--bg-primary);
    border-radius: 0.5rem;
    font-family: var(--font-display);
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn:hover {
    background: #e55a28;
    transform: translateY(-2px);
    text-shadow: none;
}

.btn svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.2s ease;
}

.btn:hover svg {
    transform: translateX(4px);
}

/* Background decorations */
.bg-decoration {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
}

.bg-decoration.top {
    top: 25%;
    left: 25%;
    width: 24rem;
    height: 24rem;
    background: rgba(255, 107, 53, 0.05);
}

.bg-decoration.bottom {
    bottom: 25%;
    right: 25%;
    width: 16rem;
    height: 16rem;
    background: rgba(234, 88, 12, 0.05);
}

/* Notes landing */
.notes-landing {
    padding-top: 6rem;
    padding-bottom: 4rem;
}

.notes-header {
    text-align: center;
    margin-bottom: 2rem;
}

.notes-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.notes-tagline {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text-secondary);
}

.notes-intro {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
}

.notes-intro p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Notes landing: category cards */
.notes-categories {
    margin-top: 3rem;
}

.notes-category-grid {
    display: grid;
    gap: 1.25rem;
    max-width: 480px;
    margin: 0 auto;
}

.notes-category-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1.5rem 1.75rem;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.notes-category-card:hover {
    border-color: rgba(255, 107, 53, 0.35);
    box-shadow: 0 0 24px var(--accent-glow);
}

.notes-category-card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
}

.notes-category-card:hover .notes-category-card-title {
    color: var(--accent);
}

.notes-category-card-desc {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.notes-category-card-arrow {
    margin-top: 0.25rem;
    font-size: 1.125rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.notes-category-card:hover .notes-category-card-arrow {
    color: var(--accent);
    opacity: 1;
}

/* Notes landing: D3 hierarchy */
.notes-hierarchy-viz {
    display: flex;
    justify-content: center;
    min-height: 420px;
    margin-top: 2rem;
}

.notes-hierarchy-viz svg {
    overflow: visible;
}

.notes-hierarchy-link {
    fill: none;
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 2px;
}

.notes-hierarchy-node {
    fill: #5a5a6a;
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 2px;
}

.notes-hierarchy-node--folder {
    fill: #5a5a6a;
    stroke: rgba(255, 255, 255, 0.4);
}

.notes-hierarchy-node--leaf {
    fill: var(--accent);
    stroke: rgba(255, 107, 53, 0.6);
    stroke-width: 2px;
}

.notes-hierarchy-node--folder:hover {
    fill: #7a7a8a;
    filter: brightness(1.1);
}

.notes-hierarchy-node--leaf:hover {
    fill: var(--accent);
    filter: brightness(1.15);
}

.notes-hierarchy-label {
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 500;
    fill: #e0e0e8;
    pointer-events: auto;
    cursor: pointer;
}

.notes-hierarchy-label:hover {
    fill: var(--accent);
}

/* Convolution interactive demo */
.conv-demo {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.conv-demo-grids {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.conv-demo-block {
    flex: 0 0 auto;
}

.conv-demo-block label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.conv-grid {
    display: grid;
    gap: 2px;
}

.conv-cell {
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: var(--text-primary);
    transition: background 0.2s, border-color 0.2s;
}

.conv-cell--patch {
    background: rgba(255, 107, 53, 0.2);
    border-color: rgba(255, 107, 53, 0.5);
}

.conv-cell--clickable {
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.conv-cell--clickable:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.conv-cell--selected {
    background: rgba(255, 107, 53, 0.25);
    border-color: var(--accent);
}

.conv-demo-result {
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.conv-demo-result p {
    margin: 0.25rem 0;
    font-size: 0.9375rem;
}

.conv-demo-value {
    color: var(--accent);
    font-weight: 600;
}

.conv-demo-formula {
    font-family: var(--font-mono, monospace);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Batch norm diagram and demo */
.batchnorm-diagram {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow-x: auto;
}

.batchnorm-svg {
    display: block;
    width: 100%;
    min-width: 640px;
    max-width: 720px;
    margin: 0 auto;
}

.batchnorm-diagram-caption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.batchnorm-demo {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.batchnorm-demo-grids {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
}

.batchnorm-demo-block {
    flex: 0 0 auto;
}

.batchnorm-demo-block > label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.batchnorm-demo-batch {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.batchnorm-demo-batch .conv-grid {
    display: grid;
    gap: 2px;
}

.batchnorm-demo-stats {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.batchnorm-demo-stats span {
    margin-right: 1rem;
}

.batchnorm-demo-params {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
    margin-bottom: 0.75rem;
}

.batchnorm-demo-params label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.batchnorm-demo-params input[type="range"] {
    width: 80px;
}

/* Notes category/note page */
.notes-page {
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.breadcrumbs {
    font-family: var(--font-display);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.breadcrumb-link:hover {
    color: var(--accent);
}

.breadcrumb-sep {
    margin: 0 0.5rem;
    color: var(--text-secondary);
}

.notes-page-header {
    margin-bottom: 2rem;
}

.notes-page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.notes-page-desc {
    font-size: 1rem;
    color: var(--text-secondary);
}

.notes-child-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notes-child-list li {
    margin-bottom: 0.75rem;
}

.notes-child-link {
    font-family: var(--font-display);
    font-weight: 500;
}

.notes-child-desc {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* Note content page: sidebar + main */
.note-content-layout {
    position: relative;
    display: flex;
    min-height: calc(100vh - 5rem);
}

.note-sidebar-toggle {
    position: fixed;
    left: 0.75rem;
    top: 5.5rem;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.note-sidebar-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.note-sidebar {
    position: fixed;
    left: 0;
    top: 5rem;
    bottom: 0;
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1rem 0 2rem;
    overflow-y: auto;
    z-index: 35;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
}

.note-sidebar.is-open {
    transform: translateX(0);
}

.note-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 0.75rem;
}

.note-sidebar-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.note-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.note-sidebar-close:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.note-sidebar-nav {
    padding: 0 0.5rem;
}

.note-sidebar-block {
    margin-bottom: 0.5rem;
}

.note-sidebar-category {
    margin-bottom: 0.5rem;
}

.note-sidebar-category-title {
    display: block;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.note-sidebar-category-title:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.04);
}

.note-sidebar-list {
    list-style: none;
    padding: 0 0 0 1rem;
    margin: 0.25rem 0 0;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.note-sidebar-toc {
    padding-left: 0;
    border-left: none;
    margin-top: 0;
}

.note-sidebar-toc li {
    margin-bottom: 0.25rem;
}

.note-sidebar-toc li > ul.note-sidebar-nested {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.note-sidebar-nested .note-sidebar-link {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem 0.3rem 0.75rem;
}

.note-sidebar-link {
    display: block;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.note-sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.note-sidebar-link.is-active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: rgba(255, 107, 53, 0.08);
}

.note-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 34;
}

@media (min-width: 1025px) {
    .note-sidebar-overlay {
        pointer-events: none;
        opacity: 0;
        visibility: hidden;
    }
}

.note-content-main {
    flex: 1;
    margin-left: 0;
    padding-top: 0.5rem;
    padding-bottom: 4rem;
    transition: margin-left 0.25s ease;
}

.note-content-layout:has(.note-sidebar.is-open) .note-content-main {
    margin-left: 260px;
}

@media (max-width: 1024px) {
    .note-content-main,
    .note-content-layout:has(.note-sidebar.is-open) .note-content-main {
        margin-left: 0;
    }
}

.note-content-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid color-mix(in srgb, var(--text-secondary) 25%, transparent);
}

.note-content-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.note-content-title {
    font-size: 2rem;
    margin-bottom: 0.35rem;
}

.note-content-subtitle {
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0;
    margin-bottom: 0;
}

.note-content-meta-left {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.note-meta-label {
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.note-meta-sep {
    color: var(--text-secondary);
}

.note-content-published {
    display: inline;
}

.note-view-count {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.note-view-icon {
    flex-shrink: 0;
}

.note-content-main .article {
    padding-top: 0;
    padding-bottom: 4rem;
}

.article .note-usage-list {
    margin: 0.75rem 0 1rem;
    padding-left: 1.5rem;
}

.article .note-usage-list li {
    margin-bottom: 0.35rem;
}

.article .note-examples {
    margin: 0.75rem 0 1.5rem;
}

.article .note-examples p {
    margin-bottom: 0.5rem;
}

.article .note-examples p:last-child {
    margin-bottom: 0;
}

.notes-article h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.notes-placeholder {
    color: var(--text-secondary);
}

/* Page header */
.page-header {
    padding-top: 8rem;
    padding-bottom: 4rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
}

/* Notes list */
.notes-grid {
    display: grid;
    gap: 1.5rem;
}

.note-card {
    display: block;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.note-card:hover {
    border-color: rgba(255, 107, 53, 0.3);
    box-shadow: 0 0 30px var(--accent-glow);
}

.note-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

.note-card:hover h2 {
    color: var(--accent);
}

.note-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 9999px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

/* Empty state */
.empty-state {
    margin-top: 3rem;
    padding: 2rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    text-align: center;
    color: var(--text-secondary);
    font-family: var(--font-display);
}

/* Article styles */
.article {
    padding-top: 6rem;
    padding-bottom: 4rem;
}

.article .back-link {
    display: inline-block;
    margin-bottom: 2rem;
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.article .back-link:hover {
    color: var(--accent);
}

.article h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.article .tags {
    margin-bottom: 3rem;
}

.article .tag {
    border: 1px solid rgba(255, 107, 53, 0.2);
    color: var(--accent);
}

.article section {
    margin-bottom: 3rem;
}

.article section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.article p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.article strong {
    color: var(--text-primary);
}

/* Math blocks */
.math-block {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    border-left: 3px solid var(--accent);
    overflow-x: auto;
}

/* Highlight box (recipe, key formula) */
.highlight-box {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    border-left: 3px solid var(--accent);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Interactive section */
.interactive-section {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin: 2rem 0;
}

.slider-container label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider-row input[type="range"] {
    flex: 1;
    height: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 0.25rem;
    appearance: none;
    cursor: pointer;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-glow);
}

.slider-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--accent);
    min-width: 4rem;
    text-align: right;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    padding: 1rem;
}

.stat-card label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-card .value {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    color: var(--text-primary);
}

.stat-card .value.accent {
    color: var(--accent);
}

/* Chart container */
.chart-container {
    height: 320px;
    margin: 1rem 0;
}

.chart-caption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* Insights grid */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 640px) {
    .insights-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.insight-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    padding: 1rem;
}

.insight-card h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.insight-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.insight-card code {
    color: var(--accent);
    font-size: 0.875rem;
}

/* Summary list */
.summary-list {
    list-style: none;
}

.summary-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.summary-list .arrow {
    color: var(--accent);
    flex-shrink: 0;
}

/* Divider */
.divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin: 2rem 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Selection */
::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

/* Admin */
.admin-page {
    max-width: 48rem;
    margin: 0 auto;
    padding: 2rem 1rem;
}
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.admin-page h1 {
    margin-bottom: 0;
}
.admin-logout {
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.admin-logout:hover {
    color: var(--accent);
}
.admin-last-login {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}
.admin-intro {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-display);
}
.admin-table th,
.admin-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--bg-tertiary);
}
.admin-table th {
    color: var(--text-secondary);
    font-weight: 500;
}
.admin-table code {
    font-size: 0.9em;
}
.admin-empty {
    color: var(--text-secondary);
}

/* Admin login page */
.login-page {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.login-card {
    width: 100%;
    max-width: 24rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 0.75rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}
.login-card h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}
.login-intro {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.form-group label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 0.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
}
.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-error {
    font-size: 0.875rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}
.btn-login {
    margin-top: 0.25rem;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 0.875rem;
}
