@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=VT323&family=IBM+Plex+Mono:wght@300;400;500&display=swap');

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

:root {
  --black: #080808;
  --white: #f0f0f0;
  --accent: #ffffff;
  --font-display: 'VT323', monospace;
  --font-mono: 'Share Tech Mono', monospace;
  --font-body: 'IBM Plex Mono', monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── NAVIGATION ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3rem;
  height: 80px;
  background: rgba(8, 8, 8, 0.94);
  border-bottom: 1px solid rgba(240, 240, 240, 0.1);
  backdrop-filter: blur(6px);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: 0.15em;
  color: var(--white);
  text-decoration: none;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 3rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(240, 240, 240, 0.55);
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--page-accent, var(--white));
  transition: width 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--page-accent, var(--white));
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* ── SCANLINE OVERLAY ── */
body::before {
  content: '';
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
}

/* ── NOISE / GRAIN OVERLAY ── */
body::after {
  content: '';
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: overlay;
  animation: grain-shift 0.35s steps(1) infinite;
}

@keyframes grain-shift {
  0%   { background-position: 0 0; }
  14%  { background-position: -40px 20px; }
  28%  { background-position: 20px -30px; }
  42%  { background-position: -25px -15px; }
  57%  { background-position: 35px 10px; }
  71%  { background-position: -10px 35px; }
  85%  { background-position: 15px -10px; }
  100% { background-position: -20px 5px; }
}

/* ── GLITCH TEXT ── */
.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.glitch:hover::before {
  animation: glitch-before 0.3s steps(2) forwards;
  color: var(--page-accent, var(--white));
  clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
  transform: translate(-2px, 0);
  opacity: 1;
}

.glitch:hover::after {
  animation: glitch-after 0.3s steps(2) forwards;
  color: rgba(240, 240, 240, 0.4);
  clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
  transform: translate(2px, 0);
  opacity: 1;
}

@keyframes glitch-before {
  0%   { transform: translate(-2px, 0); }
  50%  { transform: translate(2px, -1px); }
  100% { transform: translate(-1px, 0); }
}

@keyframes glitch-after {
  0%   { transform: translate(2px, 0); }
  50%  { transform: translate(-2px, 1px); }
  100% { transform: translate(1px, 0); }
}

/* ── FLICKER ANIMATION ── */
@keyframes flicker {
  0%, 96%, 100% { opacity: 1; }
  97%            { opacity: 0.7; }
  98%            { opacity: 1; }
  99%            { opacity: 0.6; }
}

/* ── PAGE WRAPPER ── */
.page-wrapper {
  padding-top: 80px;
  min-height: 100vh;
}

/* ── SECTION LABEL ── */
.section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--page-accent, var(--white));
  margin-bottom: 1rem;
  opacity: 0.8;
}

/* ── ACCENT LINE ── */
.accent-line {
  width: 48px;
  height: 2px;
  background: var(--page-accent, var(--white));
  margin: 1rem 0 2rem;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--page-accent, #333); }

/* ── ANIMATED BACKGROUND GRID ── */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(240, 240, 240, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 240, 240, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  animation: grid-drift 24s linear infinite;
}

.bg-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 30%, var(--black) 90%);
}

@keyframes grid-drift {
  from { background-position: 0 0; }
  to   { background-position: 0 56px; }
}

/* horizontal accent sweep that travels down the screen */
.bg-grid::before {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--page-accent, #555), transparent);
  opacity: 0.12;
  animation: sweep-down 9s linear infinite;
}

@keyframes sweep-down {
  0%   { top: -2%; }
  100% { top: 102%; }
}

/* ── CRT POWER-ON (page load) ── */
.page-wrapper {
  animation: crt-on 0.55s steps(3) 1;
}

@keyframes crt-on {
  0%   { opacity: 0;    filter: brightness(3) contrast(2); }
  35%  { opacity: 0.4;  filter: brightness(2); }
  60%  { opacity: 0.85; filter: brightness(1.4); }
  100% { opacity: 1;    filter: none; }
}

/* ── NAV STATUS CLUSTER ── */
.nav-status {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: rgba(240, 240, 240, 0.35);
}

.nav-status .rec {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--page-accent, var(--white));
}

.nav-status .rec::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--page-accent, #e63030);
  animation: rec-blink 1.4s steps(1) infinite;
}

@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.15; }
}

@media (max-width: 900px) {
  .nav-status { display: none; }
}

/* ── BLINKING CURSOR ON SECTION LABELS ── */
.section-label::after {
  content: '▌';
  margin-left: 0.35em;
  animation: cursor-blink 1.1s steps(1) infinite;
}

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

/* ── MARQUEE TICKER ── */
.ticker {
  width: 100%;
  overflow: hidden;
  border-top: 1px solid rgba(240, 240, 240, 0.08);
  border-bottom: 1px solid rgba(240, 240, 240, 0.08);
  padding: 0.55rem 0;
  background: rgba(240, 240, 240, 0.02);
}

.ticker-inner {
  display: flex;
  width: max-content;
  gap: 3rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(240, 240, 240, 0.4);
  animation: ticker-scroll 28s linear infinite;
}

.ticker-inner span b {
  color: var(--page-accent, var(--white));
  font-weight: normal;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
