:root {
    --bg-base: #f7f3f0;
    --text-main: #1a1a1a;
    --text-muted: #666361;
    --olive: #8c9454;
    --orange: #c97d4a;
    --border-thin: rgba(0, 0, 0, 0.08);
    --bg: #f7f5f0;
    --surface: #ffffff;
    --border: rgba(0,0,0,0.08);
    --text-primary: #1a1916;
    --text-secondary: #6b6860;
    --text-tertiary: #a8a69f;
    --accent: #2d5a3d;
    --accent-light: #e8f0eb;
    --serif-viz: 'DM Serif Display', Georgia, serif;
    --sans-viz: 'DM Sans', system-ui, sans-serif;
    --mono-viz: 'DM Mono', monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

h1, h2, h3, .serif {
    font-family: 'Newsreader', serif;
    font-variation-settings: "opsz" 72;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* ─── Navigation ─── */

.nav-blur {
    background: rgba(247, 243, 240, 0.9);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-thin);
}

/* ─── Buttons ─── */

.btn-black {
    background-color: var(--text-main);
    color: white;
    padding: 8px 20px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-block;
    text-decoration: none;
    border: none;
    cursor: pointer;
    text-align: center;
}
.btn-black:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* ─── Cards ─── */

.card-frame {
    background: white;
    border: 1px solid var(--border-thin);
    border-radius: 12px;
    overflow: hidden;
}

/* ─── Form ─── */

input, textarea {
    font-family: 'Inter', sans-serif;
}

/* ─── Utility ─── */

.w-full { width: 100%; }
.h-full { height: 100%; }
.h-auto { height: auto; }
.block { display: block; }
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-col { flex-direction: column; }
.text-center { text-align: center; }
.italic { font-style: italic; }
.rounded-lg { border-radius: 0.5rem; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1); }
.fixed { position: fixed; }
.z-50 { z-index: 50; }
.mx-auto { margin-left: auto; margin-right: auto; }
.cursor-pointer { cursor: pointer; }

/* ─── Spacing ─── */

.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.px-10 { padding-left: 2.5rem; padding-right: 2.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.py-24 { padding-top: 6rem; padding-bottom: 6rem; }
.py-32 { padding-top: 8rem; padding-bottom: 8rem; }
.pt-8 { padding-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.space-x-10 > * + * { margin-left: 2.5rem; }
.gap-16 { gap: 4rem; }
.gap-20 { gap: 5rem; }

/* ─── Typography ─── */

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }
.font-light { font-weight: 300; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.uppercase { text-transform: uppercase; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-widest { letter-spacing: 0.1em; }
.leading-relaxed { line-height: 1.625; }
.leading-\[1\.1\] { line-height: 1.1; }

/* ─── Colors ─── */

.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.border-black { border-color: #000; }
.border-black\/\[0\.05\] { border-color: rgba(0,0,0,0.05); }
.border-gray-300 { border-color: #d1d5db; }
.bg-white { background-color: #fff; }
.bg-\[\#efebdf\] { background-color: #efebdf; }
.hover\:text-black:hover { color: #000; }
.focus\:ring-2:focus { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); }
.focus\:ring-black:focus { --tw-ring-opacity: 1; --tw-ring-color: rgb(0 0 0 / 1); }
.focus\:ring-offset-2:focus { --tw-ring-offset-width: 2px; }

/* ─── Borders ─── */

.border { border-width: 1px; }
.border-y { border-top-width: 1px; border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }

/* ─── Nav links ─── */

nav a {
    text-decoration: none;
}

/* ─── Viz sections ─── */

.pub-link:hover h3 {
    text-decoration: underline;
    color: var(--olive);
}

.viz-section {
    padding: 4rem 0;
    border-bottom: 0.5px solid var(--border);
}
.viz-section:last-child {
    border-bottom: none;
}

/* ─── Tooltip ─── */

#TT {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity .12s;
    width: 210px;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 13px;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    font-family: var(--sans-viz);
}
#TT.on {
    opacity: 1;
}
.tth {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 6px;
}
.ttr {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}
.ttk {
    color: var(--text-secondary);
    font-size: 11px;
}
.ttv {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 11px;
    font-family: var(--mono-viz);
}

/* ─── Viz Wraps ─── */

.viz-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    border: 0.5px solid var(--border);
    background: #fff;
    cursor: grab;
    user-select: none;
    touch-action: none;
    margin-bottom: 1rem;
}
.viz-wrap:active {
    cursor: grabbing;
}

.controls {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}

.zbtn {
    font-family: var(--mono-viz);
    font-size: 11px;
    padding: 4px 10px;
    border: 0.5px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .15s;
}
.zbtn:hover {
    background: var(--bg);
}

.hint {
    font-family: var(--mono-viz);
    font-size: 10px;
    color: var(--text-tertiary);
    margin-left: auto;
    letter-spacing: .04em;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: .75rem;
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--sans-viz);
}

.ld {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    vertical-align: middle;
}

.ls {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    display: inline-block;
    margin-right: 4px;
    vertical-align: middle;
}

.sources {
    margin-top: .75rem;
    font-size: 11px;
    color: var(--text-tertiary);
    font-family: var(--mono-viz);
}

.sources a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color .15s;
}
.sources a:hover {
    border-color: var(--accent);
}

.stat-row {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.stat-pill {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 6px;
    padding: .6rem 1rem;
    flex: 1;
    min-width: 120px;
}

.stat-num {
    font-family: var(--serif-viz);
    font-size: 1.6rem;
    color: var(--text-primary);
    display: block;
    line-height: 1;
    margin-bottom: 3px;
}

.stat-lbl {
    font-size: 11px;
    color: var(--text-tertiary);
    font-family: var(--mono-viz);
    letter-spacing: .04em;
}

/* ─── Responsive ─── */

@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:p-12 { padding: 3rem; }
    .md\:px-16 { padding-left: 4rem; padding-right: 4rem; }
    .md\:px-32 { padding-left: 8rem; padding-right: 8rem; }
    .md\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
    .md\:text-\[5\.2rem\] { font-size: 5.2rem; }
}

@media (max-width: 700px) {
    .section-header {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
