:root {
  --ink: #f7f5ff;
  --muted: #b8b3d4;
  --night: #0d102b;
  --night-2: #141943;
  --panel: #1b2050;
  --panel-2: #242861;
  --cyan: #55e9df;
  --yellow: #ffd452;
  --coral: #ff6d68;
  --violet: #9678ff;
  --line: rgba(173, 181, 255, .22);
  --shadow: 8px 8px 0 rgba(4, 5, 20, .42);
  --measure: 1180px;
  --font-display: 'Instrument Serif', serif;
  --font-body: 'Instrument Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  color-scheme: dark;
}

html[data-theme="light"], html.light {
  --ink: #181634;
  --muted: #5c5a78;
  --night: #f6f4ff;
  --night-2: #ebe9fa;
  --panel: #ffffff;
  --panel-2: #dedcff;
  --cyan: #087f8b;
  --yellow: #e8ab00;
  --coral: #d94b56;
  --violet: #674de1;
  --line: rgba(24, 22, 52, .18);
  --shadow: 8px 8px 0 rgba(72, 65, 150, .14);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--night); }
body {
  margin: 0;
  background:
    linear-gradient(rgba(110, 112, 210, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 112, 210, .045) 1px, transparent 1px),
    var(--night);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  overflow-x: hidden;
}
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 85% 0%, rgba(150, 120, 255, .16), transparent 32rem); z-index: -1; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
button { cursor: pointer; }

.site-header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--night) 88%, transparent); position: relative; z-index: 5; }
.header-inner, .site-footer-inner, .page-wrap { width: min(calc(100% - 3rem), var(--measure)); margin: 0 auto; }
.header-inner { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; min-width: max-content; }
.brand-mark { width: 2.65rem; height: 2.65rem; padding: .38rem; background: var(--cyan); color: var(--night); box-shadow: 4px 4px 0 var(--yellow); }
.brand-name { font-family: var(--font-mono); font-size: clamp(1rem, 2vw, 1.28rem); font-weight: 700; letter-spacing: -.08em; }
.brand-name span { color: var(--cyan); }
.header-tools { display: flex; align-items: center; gap: .65rem; margin-left: auto; }
.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.site-nav a { color: var(--muted); font-size: .9rem; font-weight: 700; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--cyan); }
[data-theme-toggle], .menu-toggle { width: 2.65rem; height: 2.65rem; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
[data-theme-toggle] { font-size: 1.1rem; }
.menu-toggle { display: none; }

.hero { padding: 3.25rem 0 2rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(19rem, .92fr); gap: 2.5rem; align-items: end; }
.eyebrow, .section-kicker { color: var(--cyan); font-family: var(--font-mono); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.hero h1, .page-intro h1 { font-family: var(--font-display); font-size: clamp(3.3rem, 8vw, 7.4rem); font-weight: 600; letter-spacing: -.07em; line-height: .87; margin: .8rem 0 1.35rem; max-width: 8ch; }
.hero h1 em { color: var(--yellow); font-style: normal; }
.hero-lede { color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.28rem); max-width: 34rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: .75rem 1rem; border: 1px solid var(--cyan); background: var(--cyan); color: var(--night); font-family: var(--font-mono); font-size: .76rem; font-weight: 700; text-decoration: none; }
.button:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--yellow); }
.button.secondary { border-color: var(--line); background: transparent; color: var(--ink); }
.hero-art { position: relative; min-height: 28rem; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.hero-art img { width: 100%; height: 100%; min-height: 28rem; object-fit: cover; filter: saturate(1.15) contrast(1.05); }
.hero-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(7, 8, 26, .82)); pointer-events: none; }
.hero-caption { position: absolute; right: 1.2rem; bottom: 1.1rem; left: 1.2rem; z-index: 1; }
.hero-caption p { margin: .45rem 0 0; color: #fff; font-weight: 600; }

.section { padding: 3.8rem 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.35rem; }
.section-heading h2, .page-intro h2 { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 600; letter-spacing: -.045em; line-height: .95; margin: .3rem 0 0; }
.text-link { color: var(--yellow); font-family: var(--font-mono); font-size: .76rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.text-link:hover { color: var(--cyan); }
.category-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.category-tile { min-height: 7.25rem; padding: 1.1rem; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); background: var(--panel); text-decoration: none; box-shadow: 4px 4px 0 rgba(150, 120, 255, .18); }
.category-tile:hover { border-color: var(--cyan); transform: translateY(-3px); }
.category-tile strong { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; }
.category-tile small { color: var(--muted); font-family: var(--font-mono); font-size: .66rem; }
.category-tile:nth-child(2) { background: #2d235b; } .category-tile:nth-child(3) { background: #153d50; } .category-tile:nth-child(4) { background: #4a263d; }

.news-grid, .archive-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1.15rem; align-items: start; }
.story-card { border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.story-image { display: block; position: relative; aspect-ratio: 1.5 / 1; overflow: hidden; background: var(--panel-2); }
.story-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.story-card:hover .story-image img { transform: scale(1.05); }
.story-body { padding: 1.1rem; }
.story-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .75rem; color: var(--muted); font-family: var(--font-mono); font-size: .66rem; text-transform: uppercase; }
.category-label { color: var(--cyan); }
.story-card h3 { margin: .6rem 0 .5rem; font-family: var(--font-display); font-size: 1.65rem; font-weight: 600; line-height: 1; }
.story-card p { margin: 0; color: var(--muted); }
.empty-state { border: 1px dashed var(--line); color: var(--muted); padding: 1rem; grid-column: 1 / -1; }

.feature-band { display: grid; grid-template-columns: .78fr 1.22fr; gap: 2.2rem; align-items: center; padding: 1.5rem; border: 1px solid var(--line); background: linear-gradient(110deg, var(--panel), #272151); }
.feature-band img { width: 100%; aspect-ratio: 1.35 / 1; object-fit: cover; }
.feature-band h2 { font-family: var(--font-display); font-size: clamp(2.4rem, 5vw, 4.7rem); font-weight: 600; letter-spacing: -.06em; line-height: .9; margin: .55rem 0 1rem; }
.feature-band p { color: var(--muted); max-width: 33rem; }
.rating { display: inline-flex; align-items: center; gap: .5rem; margin-top: .7rem; color: var(--yellow); font-family: var(--font-mono); font-weight: 700; }
.rating strong { font-size: 1.45rem; }

.newsletter { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; padding: 2.25rem; border: 1px solid var(--cyan); background: var(--night-2); }
.newsletter h2 { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 600; line-height: .95; margin: .4rem 0 .7rem; }
.newsletter p { color: var(--muted); margin: 0; }
.newsletter-form { display: flex; gap: .5rem; }
.newsletter-form input, .search-form input { min-width: 0; flex: 1; padding: .85rem 1rem; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.form-note { margin-top: .65rem; min-height: 1.5em; color: var(--cyan); font-family: var(--font-mono); font-size: .7rem; }

.page-intro { padding: 4rem 0 2rem; max-width: 48rem; }
.page-intro h1 { font-size: clamp(3.2rem, 7vw, 6.6rem); max-width: 10ch; }
.page-intro p { color: var(--muted); font-size: 1.15rem; max-width: 40rem; }
.archive-shell { display: grid; grid-template-columns: minmax(0, 1fr) 11rem; gap: 2rem; align-items: start; }
.search-form { display: flex; gap: .5rem; margin-bottom: 1.25rem; }
.filter-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.filter-list a { border: 1px solid var(--line); color: var(--muted); padding: .45rem .65rem; font-family: var(--font-mono); font-size: .68rem; text-decoration: none; }
.filter-list a:hover { border-color: var(--cyan); color: var(--cyan); }

.rail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 11rem; gap: 2rem; align-items: start; }
.rail-layout:has([data-side-links][hidden]) { grid-template-columns: minmax(0, 1fr); }
[data-side-links][hidden] { display: none; }
.side-links { position: sticky; top: 1.5rem; border-left: 2px solid var(--yellow); padding-left: 1rem; }
.side-links h2 { margin: 0 0 .8rem; color: var(--yellow); font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; }
.side-links ol { margin: 0; padding-left: 1rem; color: var(--muted); font-size: .85rem; }
.side-links a { text-decoration: none; } .side-links a:hover { color: var(--cyan); }

.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: start; }
.about-grid h2 { font-family: var(--font-display); font-size: 3rem; line-height: .95; margin-top: 0; }
.about-grid p { color: var(--muted); font-size: 1.08rem; }
.fact-list { display: grid; gap: .75rem; }
.fact { padding: 1rem; background: var(--panel); border: 1px solid var(--line); }
.fact b { display: block; color: var(--cyan); font-family: var(--font-mono); font-size: .7rem; margin-bottom: .25rem; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 11rem; gap: 2rem; align-items: start; }
.article-main { min-width: 0; }
.byline { display: flex; align-items: center; gap: .75rem; margin: 0 0 1.5rem; color: var(--muted); }
.byline[hidden] { display: none; }
.byline img { width: 2.8rem; height: 2.8rem; border-radius: 50%; object-fit: cover; }
.byline strong { color: var(--ink); display: block; } .byline p { margin: 0; font-size: .85rem; }
.article-header h1 { font-family: var(--font-display); font-size: clamp(3rem, 7vw, 6rem); font-weight: 600; letter-spacing: -.06em; line-height: .9; max-width: 15ch; margin: 1rem 0; }
.article-deck { color: var(--muted); font-size: 1.25rem; max-width: 44rem; }
.article-cover { margin: 2rem 0; } .article-cover img { width: 100%; max-height: 34rem; object-fit: cover; }
.prose { max-width: 46rem; font-size: 1.13rem; }
.prose p { margin: 0 0 1.35rem; } .prose h2, .prose h3 { font-family: var(--font-display); line-height: 1; margin: 2.1rem 0 .8rem; }
.prose h2 { font-size: 2.4rem; } .prose h3 { font-size: 1.7rem; }
.prose a { color: var(--cyan); text-decoration-thickness: .12em; text-underline-offset: .18em; }
.prose ul, .prose ol { padding-left: 1.35rem; } .prose li { margin: .5rem 0; }

.site-footer { margin-top: 3rem; border-top: 1px solid var(--line); background: var(--night-2); }
.site-footer-inner { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 2rem; padding: 2.5rem 0; }
.site-footer h2 { font-family: var(--font-display); font-size: 1.7rem; margin: 0 0 .65rem; }
.site-footer p, .site-footer a { color: var(--muted); font-size: .88rem; }
.site-footer a { display: block; margin: .3rem 0; text-decoration: none; } .site-footer a:hover { color: var(--cyan); }
.footer-bottom { border-top: 1px solid var(--line); padding: 1rem 0; color: var(--muted); font-family: var(--font-mono); font-size: .65rem; }

@media (max-width: 800px) {
  .header-inner, .site-footer-inner, .page-wrap { width: min(calc(100% - 2rem), var(--measure)); }
  .header-inner { min-height: 72px; }
  .site-nav { display: none; position: absolute; top: 100%; right: 1rem; left: 1rem; padding: .75rem; flex-direction: column; align-items: stretch; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: .55rem; }
  .menu-toggle { display: block; }
  .hero-grid, .feature-band, .newsletter, .about-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 2.5rem; } .hero-art { min-height: 20rem; } .hero-art img { min-height: 20rem; }
  .category-strip { grid-template-columns: repeat(2, 1fr); }
  .newsletter-form { flex-direction: column; }
  .archive-shell, .rail-layout, .article-layout { grid-template-columns: minmax(0, 1fr); }
  .side-links { position: static; order: 2; }
  .site-footer-inner { grid-template-columns: 1fr 1fr; }
  .site-footer-inner > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .brand-name { font-size: .86rem; }
  .brand-mark { width: 2.25rem; height: 2.25rem; }
  .category-strip { grid-template-columns: 1fr; }
  .hero h1, .page-intro h1 { font-size: 3.3rem; }
  .section { padding: 2.6rem 0; }
  .section-heading { display: block; } .section-heading .text-link { display: inline-block; margin-top: .8rem; }
  .site-footer-inner { grid-template-columns: 1fr; }
}

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