
:root {
    --bg-ground: #0e1424;
    --bg-surface: #131b30;
    --bg-elevated: #19233d;
    --bg-subtle: #10172a;
    --bg-translucent: rgba(14, 20, 36, 0.94);
    --bg-translucent-surface: rgba(19, 27, 48, 0.92);

    --border-rule: #253456;
    --border-rule-subtle: #1c2844;
    --border-rule-bright: #3d5380;
    --border-rule-accent: rgba(0, 245, 212, 0.45);

    --text-main: #eaeffb;
    --text-muted: #a3b3d3;
    --text-dim: #8fa2c7;
    --text-inverse: #0a0f1b;

    --accent-cyan: #00f5d4;
    --accent-cyan-rgb: 0, 245, 212;
    --accent-cyan-hover: #33f7dc;
    --accent-cyan-active: #00d1b5;
    --accent-cyan-dim: rgba(0, 245, 212, 0.12);
    --accent-cyan-glow: rgba(0, 245, 212, 0.28);

    --accent-ultramarine: #3a7bff;
    --accent-ultramarine-rgb: 58, 123, 255;
    --accent-ultramarine-hover: #5a93ff;
    --accent-ultramarine-active: #2864e0;
    --accent-ultramarine-dim: rgba(58, 123, 255, 0.15);

    --signal-warn: #ffb347;
    --signal-danger: #ff5a5f;
    --signal-success: #00f5d4;

    --peki-4fd: 'Cinzel', Georgia, 'Times New Roman', serif;
    --peki-8ad: 'EB Garamond', Georgia, Garamond, serif;
    --peki-16e: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

    --text-xs: clamp(0.72rem, 0.69rem + 0.15vw, 0.82rem);
    --text-sm: clamp(0.85rem, 0.81rem + 0.2vw, 0.96rem);
    --text-base: clamp(1.08rem, 1.02rem + 0.32vw, 1.22rem);
    --text-lg: clamp(1.24rem, 1.15rem + 0.45vw, 1.48rem);
    --text-xl: clamp(1.46rem, 1.32rem + 0.7vw, 1.84rem);
    --text-2xl: clamp(1.8rem, 1.58rem + 1.1vw, 2.4rem);
    --text-3xl: clamp(2.2rem, 1.88rem + 1.6vw, 3.15rem);
    --text-4xl: clamp(2.7rem, 2.22rem + 2.4vw, 4.2rem);
    --text-display: clamp(3.0rem, 2.45rem + 3.4vw, 5.6rem);

    --space-3xs: 0.25rem;
    --space-2xs: 0.5rem;
    --space-xs: 0.75rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4.5rem;
    --space-3xl: 6rem;
    --space-4xl: 8rem;

    --boxed-frame-width: 1400px;
    --frame-padding: clamp(14px, 2.6vw, 32px);
    --frame-border-width: 1px;
    --header-height: 74px;
    --tap-target-min: 44px;

    --radius-none: 0px;

    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out-expo: cubic-bezier(0.87, 0, 0.13, 1);
    --ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --duration-fast: 140ms;
    --duration-norm: 220ms;
    --duration-slow: 380ms;

    --shadow-ledger: 0 1px 0 0 var(--border-rule);
    --shadow-elevated: 0 16px 36px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border-rule);
    --shadow-accent: 0 0 24px -4px var(--accent-cyan-glow);
}

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

html {
    -webkit-text-size-adjust: 100%;
    color-scheme: dark;
    scroll-behavior: smooth;
    background-color: var(--bg-ground);
}

body {
    background-color: var(--bg-ground);
    color: var(--text-main);
    font-family: var(--peki-8ad);
    font-size: var(--text-base);
    line-height: 1.68;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

img, picture, svg, video {
    display: block;
    max-width: 100%;
    height: auto;
}

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

table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--peki-4fd);

    font-weight: 600;
    line-height: 1.18;
    letter-spacing: 0.02em;
    color: var(--text-main);
    text-wrap: balance;
}

h1 {
    font-size: var(--text-4xl);
    font-weight: 700;
    letter-spacing: 0.03em;
}

h2 {
    font-size: var(--text-3xl);
    letter-spacing: 0.025em;
}

h3 {
    font-size: var(--text-2xl);
    letter-spacing: 0.02em;
}

h4 {
    font-size: var(--text-xl);
    letter-spacing: 0.015em;
}

h5 {
    font-size: var(--text-lg);
    font-family: var(--peki-16e);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

h6 {
    font-size: var(--text-sm);
    font-family: var(--peki-16e);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

p {
    font-size: var(--text-base);
    line-height: 1.72;
    color: var(--text-main);
}

p + p {
    margin-top: 1.4em;
}

strong, b {
    font-weight: 600;
    color: #ffffff;
}

em, i {
    font-style: italic;
}

code, kbd, samp, pre {
    font-family: var(--peki-16e);
    font-size: var(--text-sm);
}

code {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-rule);
    padding: 0.15em 0.45em;
    color: var(--accent-cyan);
}

pre {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-rule);
    padding: var(--space-md);
    overflow-x: auto;
    line-height: 1.5;
}

blockquote {
    border-left: 2px solid var(--accent-cyan);
    padding-left: var(--space-md);
    margin: var(--space-lg) 0;
    font-style: italic;
    font-size: var(--text-lg);
    color: var(--text-main);
    background-color: var(--bg-surface);
    padding-top: var(--space-sm);
    padding-bottom: var(--space-sm);
    padding-right: var(--space-md);
}

hr {
    border: 0;
    height: 1px;
    background-color: var(--border-rule);
    margin: var(--space-xl) 0;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-md);
    background-color: var(--accent-cyan);
    color: var(--text-inverse);
    padding: var(--space-xs) var(--space-md);
    font-family: var(--peki-16e);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    z-index: 9999;
    border: 1px solid var(--text-inverse);
    min-height: var(--tap-target-min);
    display: inline-flex;
    align-items: center;
    transition: top var(--duration-fast) var(--ease-out-expo);
}

.skip-link:focus-visible {
    top: var(--space-sm);
    outline: 2px solid var(--text-main);
    outline-offset: 3px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.boxed-site-frame {
    max-width: var(--boxed-frame-width);
    margin-left: auto;
    margin-right: auto;
    border-left: var(--frame-border-width) solid var(--border-rule);
    border-right: var(--frame-border-width) solid var(--border-rule);
    background-color: var(--bg-ground);
    position: relative;
    min-height: 100vh;

    display: flex;
    flex-direction: column;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.7);
}

.boxed-frame-top-strip {
    border-bottom: 1px solid var(--border-rule);
    background-color: var(--bg-subtle);
    padding: 0.45rem var(--frame-padding);
    font-family: var(--peki-16e);
    font-size: var(--text-xs);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    min-height: 34px;
    overflow: hidden;
}

.top-strip-left, .top-strip-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex-shrink: 1;
}

.top-strip-left span, .top-strip-right span, .top-strip-right a {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

@media (max-width: 1200px) {
    .top-strip-right {
        display: none;
    }
}

.top-strip-coordinate {
    color: var(--accent-cyan);
    font-weight: 500;
}

.top-strip-divider {
    color: var(--text-muted);
}

.container {
    width: 100%;
    max-width: 1220px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--frame-padding);
    padding-right: var(--frame-padding);
}

.container-narrow {
    width: 100%;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--frame-padding);
    padding-right: var(--frame-padding);
}

.container-fluid {
    width: 100%;
    padding-left: var(--frame-padding);
    padding-right: var(--frame-padding);
}

.ledger-rule {
    position: relative;
    border-top: 1px solid var(--border-rule);
}

.ledger-rule-double {
    border-top: 1px solid var(--border-rule);
    border-bottom: 1px solid var(--border-rule);
    padding-top: 2px;
}

.ledger-grid-bg {
    background-image: 
        linear-gradient(to right, var(--border-rule-subtle) 1px, transparent 1px),
        linear-gradient(to bottom, var(--border-rule-subtle) 1px, transparent 1px);
    background-size: 48px 48px;
    background-position: -1px -1px;
}

.ledger-baseline-lines {
    background-image: linear-gradient(to bottom, var(--border-rule-subtle) 1px, transparent 1px);
    background-size: 100% 28px;
}

.flow > * + * {
    margin-top: var(--space-md);
}

.flow-lg > * + * {
    margin-top: var(--space-xl);
}

.flow-sm > * + * {
    margin-top: var(--space-sm);
}

.editorial-essay {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
    font-size: var(--text-base);
    line-height: 1.78;
}

.editorial-essay p {
    margin-bottom: 1.6em;
}

.editorial-essay .lead-paragraph {
    font-size: var(--text-lg);
    line-height: 1.72;
    color: var(--text-main);
    border-left: 2px solid var(--accent-cyan);
    padding-left: var(--space-md);
    margin-bottom: var(--space-xl);
}

.editorial-essay h2 {
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-sm);
}

.editorial-essay h3 {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-xs);
}

.essay-figure {
    margin: var(--space-2xl) 0;
    border: 1px solid var(--border-rule);
    background-color: var(--bg-surface);
}

.essay-figure img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.essay-caption {
    padding: var(--space-sm) var(--space-md);
    font-family: var(--peki-16e);
    font-size: var(--text-xs);
    color: var(--text-muted);
    border-top: 1px solid var(--border-rule);
    background-color: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.essay-caption > * {
    min-width: 0;
}

@media (max-width: 480px) {
    .essay-caption {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2xs);
    }
}

.essay-caption-ref {
    color: var(--accent-cyan);
    font-weight: 500;
}

.fact-inset {
    margin: var(--space-xl) 0;
    border: 1px solid var(--border-rule-bright);
    background-color: var(--bg-surface);
    padding: var(--space-md) var(--space-lg);
    position: relative;
}

.fact-inset::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--accent-cyan);
}

.fact-inset-header {
    font-family: var(--peki-16e);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: var(--space-xs);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.fact-inset-header > * {
    min-width: 0;
}

@media (max-width: 480px) {
    .fact-inset-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3xs);
    }
}

.fact-inset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-sm);
}

.fact-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-3xs);
    border-top: 1px solid var(--border-rule);
    padding-top: var(--space-2xs);
}

.fact-label {
    font-family: var(--peki-16e);
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fact-value {
    font-family: var(--peki-16e);
    font-size: var(--text-sm);
    color: var(--text-main);
    font-weight: 500;
}

.icon {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    fill: currentColor;
    vertical-align: -0.2em;
}

.icon-xs { width: 0.85rem; height: 0.85rem; }
.icon-sm { width: 1rem; height: 1rem; }
.icon-md { width: 1.35rem; height: 1.35rem; }
.icon-lg { width: 1.75rem; height: 1.75rem; }
.icon-xl { width: 2.25rem; height: 2.25rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
