@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/barlowcondensed-BarlowCondensed-Medium.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/barlowcondensed-BarlowCondensed-SemiBold.ttf') format('truetype');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/barlowcondensed-BarlowCondensed-Bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/barlowcondensed-BarlowCondensed-ExtraBold.ttf') format('truetype');
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: 'DM Mono';
  src: url('fonts/dmmono-DMMono-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'DM Mono';
  src: url('fonts/dmmono-DMMono-Medium.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b0c0b;
  --panel: #141514;
  --fg: #e9e9e3;
  --muted: #92958f;
  --line: #50534e;
  --accent: #f0f0e8;
  --raster-line: #000;
  --scanline-strength: .5;
  --phosphor-mask-strength: .25;
  --static-noise-strength: .05;
  --vignette-strength: .02;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #e2e6e4;
  --panel: #edf0eb;
  --fg: #24323a;
  --muted: #637076;
  --line: #9ca8a5;
  --accent: #293d46;
  --raster-line: #26383e;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: #000;
  color: var(--fg);
  font-family: 'DM Mono', monospace;
  -webkit-font-smoothing: antialiased;
}

a, button { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.svg-defs { position: absolute; pointer-events: none; }

.screen {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
  background: var(--bg);
  border-radius: 5% / 3%;
  clip-path: url(#crt-screen-clip);
  transition: background .35s;
}

.curved-raster, .screen-grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.curved-raster { z-index: 6; opacity: var(--scanline-strength); }
.raster-row {
  fill: none;
  stroke: var(--raster-line);
  stroke-width: .85;
  vector-effect: non-scaling-stroke;
}

.screen-grain {
  z-index: 7;
  opacity: var(--static-noise-strength);
  mix-blend-mode: soft-light;
}

html[data-theme="light"] .screen-grain { mix-blend-mode: multiply; }

.phosphor-mask, .screen-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.phosphor-mask {
  z-index: 8;
  background: repeating-linear-gradient(90deg,
    rgba(242,74,82,.42) 0 1px,
    rgba(87,200,125,.38) 1px 2px,
    rgba(80,143,245,.42) 2px 3px);
  opacity: var(--phosphor-mask-strength);
  mix-blend-mode: soft-light;
}

html[data-theme="light"] .phosphor-mask { mix-blend-mode: multiply; }

.screen-vignette {
  z-index: 9;
  background: radial-gradient(ellipse at center,
    transparent 62%, rgba(0,0,0,var(--vignette-strength)) 100%);
}

.page-shell {
  position: relative;
  z-index: 2;
  max-width: 1480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: auto;
  padding: clamp(22px, 3.2vw, 48px) clamp(32px, 7vw, 104px) clamp(45px, 7vw, 90px);
  display: flex;
  flex-direction: column;
  text-shadow: 0 0 .13em color-mix(in srgb, currentColor 68%, transparent);
}

html[data-theme="light"] .page-shell {
  text-shadow: 0 0 .1em color-mix(in srgb, currentColor 60%, transparent);
}

.topbar {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.topbar-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
}

.topbar-controls, .quick-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-links a, .theme-toggle {
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 13px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-decoration: none;
  transition: background .2s, border-color .2s, transform .2s;
}

.quick-links a:hover, .theme-toggle:hover {
  background: var(--bg);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.quick-links a span { color: var(--accent); font-size: 15px; line-height: 1; }
.theme-toggle { border-color: var(--accent); }
.toggle-icon { color: var(--accent); font-size: 21px; line-height: 1; }

.crt-content {
  flex: 1;
  min-width: 0;
}

.legal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 28px;
  padding-top: 36px;
  font-size: 10px;
  letter-spacing: .18em;
}

.legal-footer a {
  color: var(--muted);
  text-decoration: none;
}

.legal-footer a:hover { color: var(--fg); }

.hero {
  padding: clamp(42px, 5vw, 72px) 0 clamp(34px, 4vw, 58px);
}

.hero-pretitle {
  margin: 0 0 15px;
  color: var(--accent);
  font-size: clamp(10px, 1vw, 13px);
  letter-spacing: .15em;
}

.glitch-title {
  position: relative;
  margin: 0 0 27px -8px;
  font-family: 'Barlow Condensed', Impact, sans-serif;
  font-size: clamp(86px, 15.5vw, 220px);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: .83;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 0 .18em color-mix(in srgb, currentColor 72%, transparent);
}

.glitch-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(42% 0 49% 0);
  color: var(--accent);
  opacity: 0;
  transform: translateX(3px);
  pointer-events: none;
}

.screen.signal-glitch .glitch-title::after { animation: glitch .28s steps(2,end) 2; }
.title-period { color: var(--accent); }

.hero-divider {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 17px;
  overflow: hidden;
}

.hero-divider span { height: 1px; flex: 1; background: var(--line); }
.hero-divider span:nth-child(3n) { height: 3px; background: var(--accent); }
.hero-divider span:nth-child(5n) { height: 8px; }
.hero-divider span:nth-child(7n) { height: 15px; background: var(--fg); }

.hero-bottom { margin-top: 25px; }
.hero-line {
  margin: 0;
  font-family: 'Barlow Condensed', Impact, sans-serif;
  font-size: clamp(25px, 3vw, 42px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .015em;
}

.cursor { color: var(--accent); animation: cursor 8s linear infinite; }

.content-grid {
  max-width: 1120px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.panel { min-width: 0; padding: clamp(24px, 3vw, 42px); }
.readout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(20px, 3vw, 48px);
  margin: 0;
}

.readout-row {
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.readout dt {
  color: var(--accent);
  font-size: 10px;
  line-height: 1.65;
  letter-spacing: .12em;
}

.readout dd {
  margin: 0;
  font-size: clamp(11px, .94vw, 13px);
  line-height: 1.65;
}

.slash { color: var(--muted); padding: 0 2px; }

@keyframes cursor {
  0%,92% { opacity: 1; }
  93%,100% { opacity: 0; }
}

@keyframes glitch {
  0%,100% { opacity: 0; transform: translateX(0); }
  25% { opacity: .8; transform: translateX(6px); }
  50% { opacity: .7; transform: translateX(-5px); }
  75% { opacity: .9; transform: translateX(3px); }
}

@media (max-width: 900px) {
  .readout { grid-template-columns: 1fr; }
  .glitch-title { font-size: clamp(76px, 15vw, 128px); }
}

@media (max-width: 600px) {
  .page-shell { padding: max(28px, env(safe-area-inset-top)) 25px 48px; }
  .topbar { min-height: 84px; }
  .topbar-label { display: none; }
  .topbar-controls { width: 100%; justify-content: space-between; gap: 7px; }
  .quick-links { gap: 7px; }
  .quick-links a, .theme-toggle { min-height: 37px; padding: 0 8px; font-size: 9px; gap: 5px; }
  .toggle-icon { font-size: 18px; }
  .hero { padding: 55px 0 35px; }
  .hero-pretitle { font-size: 9px; line-height: 1.6; }
  .glitch-title { font-size: clamp(43px, 13.5vw, 78px); margin-bottom: 22px; }
  .hero-line { font-size: clamp(22px, 6vw, 35px); }
  .panel { padding: 23px 20px; }
  .readout-row { grid-template-columns: 91px minmax(0, 1fr); gap: 10px; }
  .readout dt, .readout dd { font-size: 10px; }
}

@media (max-width: 420px) {
  .page-shell { padding-inline: 22px; }
  .quick-links a, .theme-toggle { padding-inline: 7px; letter-spacing: .04em; }
  .readout-row { grid-template-columns: 1fr; gap: 4px; }
  .readout dt { font-size: 9px; }
  .readout dd { font-size: 11px; overflow-wrap: anywhere; }
}

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