:root {
  --bg: #020408;
  --phosphor: #4af2ff;
  --phosphor-dim: #2a8ea8;
  --phosphor-bright: #b8fbff;
  --amber: #ffb000;
  --green: #6bff9e;
  --magenta: #ff6bd6;
  --orange: #ff9a3c;
  --glow: 0 0 6px rgba(74, 242, 255, 0.75), 0 0 18px rgba(74, 242, 255, 0.35);
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--phosphor);
  font-family: 'VT323', 'IBM Plex Mono', monospace;
  font-size: 20px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.crt {
  position: relative;
  min-height: 100vh;
  background: radial-gradient(ellipse at center, #05101a 0%, #010308 70%, #000 100%);
  padding: clamp(16px, 3vw, 48px);
}

.crt::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.25) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  pointer-events: none;
  z-index: 3;
}

.crt::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
  z-index: 2;
}

.screen {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px);
  animation: flicker 5s infinite steps(1);
  text-shadow: var(--glow);
  letter-spacing: 0.02em;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  97%      { opacity: 0.97; }
  98%      { opacity: 1; }
  99%      { opacity: 0.94; }
}

/* Top bar */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid rgba(74, 242, 255, 0.25);
  margin-bottom: 1.5em;
  font-size: 0.85em;
  letter-spacing: 0.1em;
}

.brand { color: var(--phosphor-bright); }
.beta { color: var(--amber); margin-left: 0.5em; text-shadow: 0 0 6px rgba(255,176,0,0.6); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 1.25em;
}

.toggle {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--phosphor-dim);
  cursor: pointer;
  letter-spacing: inherit;
  text-shadow: inherit;
  transition: color 120ms;
}
.toggle:hover { color: var(--phosphor-bright); }
.toggle:focus-visible { outline: 1px dashed var(--phosphor); outline-offset: 3px; }

.home {
  color: var(--phosphor-dim);
  text-decoration: none;
  transition: color 120ms;
}
.home:hover { color: var(--phosphor-bright); }

/* Meta */
.meta { margin-bottom: 1.5em; }
.line { letter-spacing: 0.08em; }
.line.dim { color: var(--phosphor-dim); }

/* Archive navigation */
.archive-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: 1.5em;
  padding: 0.5em 0.75em;
  border-top: 1px dashed rgba(74, 242, 255, 0.25);
  border-bottom: 1px dashed rgba(74, 242, 255, 0.25);
  font-size: 0.9em;
  letter-spacing: 0.08em;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: none;
  border: none;
  padding: 0.25em 0.5em;
  font: inherit;
  color: var(--phosphor);
  text-shadow: inherit;
  cursor: pointer;
  transition: color 120ms, background 120ms;
}
.nav-btn:hover:not(:disabled) {
  color: var(--phosphor-bright);
  background: rgba(74, 242, 255, 0.08);
}
.nav-btn:focus-visible {
  outline: 1px dashed var(--phosphor);
  outline-offset: 2px;
}
.nav-btn:disabled {
  color: var(--phosphor-dim);
  opacity: 0.4;
  cursor: not-allowed;
}
.nav-btn .arrow { font-family: inherit; }
.nav-btn .nav-label { font-size: 0.9em; }

.archive-picker { flex: 0 1 auto; }

.date-select {
  background: rgba(74, 242, 255, 0.05);
  border: 1px solid rgba(74, 242, 255, 0.35);
  color: var(--phosphor-bright);
  font: inherit;
  padding: 0.3em 0.6em;
  text-shadow: inherit;
  letter-spacing: 0.1em;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--phosphor) 50%),
                    linear-gradient(135deg, var(--phosphor) 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 9px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 1.75em;
}
.date-select:focus { outline: 1px dashed var(--phosphor); outline-offset: 2px; }
.date-select option { background: #020408; color: var(--phosphor-bright); }

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

@media (max-width: 640px) {
  .archive-nav { flex-wrap: wrap; gap: 0.5em; justify-content: center; }
  .nav-btn .nav-label { display: none; }
}

/* Summary */
.summary-block {
  border: 1px solid rgba(74, 242, 255, 0.3);
  padding: 1em 1.25em;
  margin-bottom: 2em;
  background: rgba(74, 242, 255, 0.02);
}

.summary-block .label {
  color: var(--phosphor-dim);
  font-size: 0.85em;
  letter-spacing: 0.15em;
  margin-bottom: 0.5em;
}

.summary { color: var(--phosphor-bright); line-height: 1.55; }

#date { color: var(--phosphor-bright); letter-spacing: 0.15em; }

/* Items */
.items {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
  margin-bottom: 2.5em;
}

.item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.25em;
  padding: 0.75em 0;
  border-left: 2px solid transparent;
  padding-left: 1em;
  transition: background 120ms, border-color 120ms;
}

.item:hover {
  background: rgba(74, 242, 255, 0.04);
  border-left-color: var(--phosphor);
}

.item .cat {
  font-size: 0.8em;
  letter-spacing: 0.15em;
  padding-top: 0.15em;
  text-align: right;
  color: var(--phosphor);
}

.item[data-cat="ENTERPRISE"] .cat { color: var(--phosphor); }
.item[data-cat="RESEARCH"]   .cat { color: var(--green);  text-shadow: 0 0 6px rgba(107,255,158,0.5); }
.item[data-cat="MODELS"]     .cat { color: var(--magenta); text-shadow: 0 0 6px rgba(255,107,214,0.5); }
.item[data-cat="OPEN-SRC"]   .cat { color: var(--amber);  text-shadow: 0 0 6px rgba(255,176,0,0.5); }
.item[data-cat="POLICY"]     .cat { color: var(--orange); text-shadow: 0 0 6px rgba(255,154,60,0.5); }

.item .body .headline {
  color: var(--phosphor-bright);
  font-size: 1.05em;
  margin-bottom: 0.4em;
  letter-spacing: 0.02em;
}

.item .body .text {
  color: var(--phosphor);
  line-height: 1.55;
  margin-bottom: 0.5em;
}

.item .body .sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 1em;
  color: var(--phosphor-dim);
  font-size: 0.85em;
}

.item .body .sources a {
  color: var(--phosphor-dim);
  text-decoration: none;
  border-bottom: 1px dotted rgba(74, 242, 255, 0.3);
}
.item .body .sources a::before { content: '→ '; }
.item .body .sources a:hover { color: var(--phosphor-bright); border-bottom-color: var(--phosphor-bright); }

/* Footer */
.footer {
  padding-top: 1.5em;
  border-top: 1px solid rgba(74, 242, 255, 0.25);
  color: var(--phosphor-dim);
  font-size: 0.85em;
  letter-spacing: 0.1em;
  text-align: center;
}

.cursor {
  display: inline-block;
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Responsive */
@media (max-width: 640px) {
  html, body { font-size: 17px; }
  .item {
    grid-template-columns: 1fr;
    gap: 0.5em;
    padding-left: 0.75em;
  }
  .item .cat { text-align: left; }
  .top { flex-direction: column; align-items: flex-start; gap: 0.25em; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .cursor { animation: none; }
}

/* Readable mode: swap the pixel font for IBM Plex Mono and tone down the
   glow so the text is easier on the eyes for long reading sessions. */
body.readable {
  font-family: 'IBM Plex Mono', 'Menlo', monospace;
  font-size: 15px;
  line-height: 1.55;
}
body.readable .screen {
  --glow: 0 0 2px rgba(74, 242, 255, 0.35);
  text-shadow: var(--glow);
  animation: none;
}
body.readable .crt::before { opacity: 0.35; }
body.readable .item .body .headline { font-size: 1.05em; font-weight: 500; }
body.readable .summary { line-height: 1.65; }

@media (max-width: 640px) {
  body.readable { font-size: 14px; }
}
