/* =========================================================
   Retro base — black tube, scanlines, glowing mono type
   Scoped to <html data-ui="retro"> so the modern UI is untouched.
   ========================================================= */

html[data-ui="retro"] * {
  -webkit-tap-highlight-color: transparent;
}

html[data-ui="retro"] body {
  font-family: var(--font-sans);
  font-size: 1.3125rem;
  line-height: 1.35;
  color: var(--fg);
  background-color: #000;
  background-image:
    radial-gradient(120% 80% at 50% -12%, rgba(255, 159, 46, 0.1), transparent 62%);
  background-attachment: fixed;
  overflow-x: hidden;
  letter-spacing: 0.015em;
  text-shadow: 0 0 1px rgba(255, 190, 120, 0.45), 0 0 10px rgba(255, 130, 26, 0.18);
}

/* Scanlines, drawn over the whole page */
html[data-ui="retro"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.55;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0 2px,
    rgba(0, 0, 0, 0.32) 2px 3px
  );
  mask-image: none;
  -webkit-mask-image: none;
}

/* Vignette: the edges of the tube fall off */
html[data-ui="retro"] body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
  background: radial-gradient(
    130% 110%,
    rgba(0, 0, 0, 0) 58%,
    rgba(0, 0, 0, 0.5) 82%,
    rgba(0, 0, 0, 0.9) 100%
  );
}

html[data-ui="retro"] ::selection {
  background: var(--ph);
  color: var(--ph-ink);
  text-shadow: none;
}

/* ---------- Type ---------- */
html[data-ui="retro"] h1,
html[data-ui="retro"] h2,
html[data-ui="retro"] h3,
html[data-ui="retro"] h4,
html[data-ui="retro"] h5,
html[data-ui="retro"] h6 {
  font-family: var(--font-mono);
  color: var(--ph);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-shadow: 0 0 2px rgba(255, 190, 120, 0.6), 0 0 16px rgba(255, 130, 26, 0.3);
}

html[data-ui="retro"] h1 { font-size: clamp(2.5rem, 6vw, 3.75rem); }
html[data-ui="retro"] h2 { font-size: clamp(2rem, 3.6vw, 2.75rem); }
html[data-ui="retro"] h3 { font-size: clamp(1.5rem, 2vw, 1.875rem); }
html[data-ui="retro"] h4 { font-size: 1.375rem; }

html[data-ui="retro"] p {
  color: var(--muted);
  line-height: 1.45;
}

html[data-ui="retro"] .lede {
  font-size: clamp(1.25rem, 1.6vw, 1.5rem);
  line-height: 1.4;
  color: var(--muted);
}

html[data-ui="retro"] .eyebrow {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ph);
}

html[data-ui="retro"] .eyebrow::before {
  content: '> ';
  color: var(--ph-faint);
}

html[data-ui="retro"] .mono {
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
}

/* Kill the ember gradient text; the tube is one phosphor */
html[data-ui="retro"] .accent-text,
html[data-ui="retro"] .hero .accent-text,
html[data-ui="retro"] .brand-word,
html[data-ui="retro"] .hero-lockup-word,
html[data-ui="retro"] .vendor-badge-number {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: currentColor;
  color: var(--ph);
}

html[data-ui="retro"] .neon-text { color: var(--ph); }
html[data-ui="retro"] .neon-text-magenta { color: var(--ph-bright); }

/* ---------- Layout ---------- */
html[data-ui="retro"] .section-divider {
  border-top: 2px dotted var(--line);
}

html[data-ui="retro"] .section-head {
  gap: 14px;
}

/* ---------- Focus ---------- */
html[data-ui="retro"] :focus-visible {
  outline: 2px solid var(--ph);
  outline-offset: 3px;
  border-radius: 0;
  box-shadow: 0 0 0 4px #000, 0 0 14px rgba(255, 130, 26, 0.4);
}

/* ---------- Scroll reveal ---------- */
html[data-ui="retro"] [data-animate] {
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

/* ---------- Shared CRT animations ---------- */
@keyframes retro-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes retro-flicker {
  0%, 100% { opacity: 1; }
  8% { opacity: 0.975; }
  9% { opacity: 1; }
  47% { opacity: 0.985; }
  48% { opacity: 1; }
  71% { opacity: 0.96; }
  72% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-ui="retro"] body::before { display: none; }
  html[data-ui="retro"] *,
  html[data-ui="retro"] *::before,
  html[data-ui="retro"] *::after {
    animation: none !important;
  }
}

@media (max-width: 720px) {
  html[data-ui="retro"] body { font-size: 1.25rem; }
}
