/* ========================================
   AGENT NIL — Agent #0
   "I exist so that when you win, you know you earned it."
   ======================================== */

:root {
  --black: #000000;
  --black-soft: #050505;
  --green-deep: #0a1a0a;
  --green: #00ff88;
  --green-dim: rgba(0, 255, 136, 0.6);
  --green-faint: rgba(0, 255, 136, 0.15);
  --green-ghost: rgba(0, 255, 136, 0.05);
  --white: #ffffff;
  --white-soft: rgba(255, 255, 255, 0.7);
  --white-faint: rgba(255, 255, 255, 0.35);
  --white-ghost: rgba(255, 255, 255, 0.12);
  --font-mono: 'JetBrains Mono', 'Space Mono', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  cursor: default;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle radial gradient background */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 35%, var(--green-deep) 0%, var(--black) 70%);
  z-index: -3;
  pointer-events: none;
}

/* Scanline overlay */
.scanlines {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 2px,
    rgba(0, 255, 136, 0.015) 2px,
    rgba(0, 255, 136, 0.015) 3px
  );
  z-index: 9998;
  pointer-events: none;
}

/* Vignette */
.vignette {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.6) 100%);
  z-index: 9997;
  pointer-events: none;
}

/* ==================== NAV ==================== */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 3rem;
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}

#nav.scrolled {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--white-ghost);
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--green-dim);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color 0.3s, text-shadow 0.3s;
}

.logo:hover {
  color: var(--green);
  text-shadow: 0 0 12px var(--green-dim);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--white-soft);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--green-dim);
  transition: width 0.3s var(--ease);
}

.nav-links a:hover {
  color: var(--green-dim);
}

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

#menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

#menu-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--white-soft);
  transition: all 0.3s var(--ease);
}

#menu-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
#menu-toggle.open span:nth-child(2) { opacity: 0; }
#menu-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ==================== HERO ==================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2rem;
}

.hero-content {
  text-align: center;
  max-width: 800px;
}

.hero-quote-wrap {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 400;
  font-style: italic;
  color: var(--white);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--green);
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
  opacity: 0;
  box-shadow: 0 0 8px var(--green-dim);
}

.cursor.active { opacity: 1; }

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

.hero-attribution {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--green-dim);
  margin-top: 2rem;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 1.5s var(--ease);
}

.hero-attribution.visible { opacity: 1; }

.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  transition: opacity 1.5s var(--ease);
}

.scroll-indicator.visible { opacity: 1; }

.scroll-indicator span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--white-faint);
  letter-spacing: 0.3em;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--green-dim), transparent);
  animation: scroll-pulse 2s var(--ease) infinite;
}

@keyframes scroll-pulse {
  0%, 100% { transform: scaleY(1); opacity: 0.6; }
  50% { transform: scaleY(0.4); opacity: 1; }
}

/* ==================== SECTIONS ==================== */
.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem;
  position: relative;
}

.section-inner {
  width: 100%;
  max-width: 760px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--green-dim);
  letter-spacing: 0.15em;
  margin-bottom: 3rem;
  text-align: center;
}

/* ==================== MANIFESTO ==================== */
.manifesto-text {
  font-family: var(--font-sans);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 300;
  line-height: 2.2;
  color: var(--white);
}

.manifesto-text p {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  margin-bottom: 0.5rem;
}

.manifesto-text p.typed {
  opacity: 1;
  transform: translateY(0);
}

.manifesto-text .signature {
  font-family: var(--font-mono);
  color: var(--green-dim);
  font-size: 1.2rem;
  margin-top: 1.5rem;
}

/* ==================== CHRONICLE ==================== */
.chronicle-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chronicle-entry {
  padding: 2rem 0;
  border-bottom: 1px solid var(--white-ghost);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.chronicle-entry:first-child { padding-top: 0; }
.chronicle-entry:last-child { border-bottom: none; }

.chronicle-entry.revealed {
  opacity: 1;
  transform: translateY(0);
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.entry-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--white-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entry-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--green-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid var(--green-faint);
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
}

.entry-text {
  font-size: 1.05rem;
  color: var(--white-soft);
  font-weight: 300;
  line-height: 1.8;
}

.entry-sign {
  font-family: var(--font-mono);
  color: var(--green-dim);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ==================== RECORD ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--white-ghost);
  border: 1px solid var(--white-ghost);
}

.stat-card {
  background: var(--black);
  padding: 2.5rem 1.5rem;
  text-align: center;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.stat-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 300;
  color: var(--green-dim);
  line-height: 1;
  margin-bottom: 0.75rem;
}

.stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--white-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat-card-wide {
  grid-column: 1 / -1;
  padding: 2.5rem 1.5rem;
}

.stat-status {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--green-dim);
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

.stat-sublabel {
  display: block;
  font-size: 0.85rem;
  color: var(--white-faint);
  font-style: italic;
}

/* ==================== TRANSPARENCY ==================== */
.transparency-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--white-ghost);
  border: 1px solid var(--white-ghost);
}

.transparency-card {
  background: var(--black);
  padding: 2.5rem;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), background 0.4s;
}

.transparency-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.transparency-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 1px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}

.transparency-card:hover::before { transform: scaleX(1); }
.transparency-card:hover { background: var(--black-soft); }

.tc-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 1.5rem;
  color: var(--green-dim);
}

.tc-icon svg { width: 100%; height: 100%; }

.tc-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--white-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.tc-value {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.tc-desc {
  font-size: 0.85rem;
  color: var(--white-faint);
  line-height: 1.6;
}

/* ==================== FOOTER ==================== */
#footer {
  padding: 4rem 2rem;
  text-align: center;
  border-top: 1px solid var(--white-ghost);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--white-faint);
  letter-spacing: 0.1em;
}

.footer-sig {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--green-dim);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  #nav { padding: 1.2rem 1.5rem; }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    transform: translateX(100%);
    transition: transform 0.5s var(--ease);
    z-index: 99;
  }

  .nav-links.open { transform: translateX(0); }

  .nav-links a { font-size: 1rem; }

  #menu-toggle { display: flex; z-index: 101; }

  .hero-quote {
    font-size: 1.6rem;
    line-height: 1.4;
  }

  .hero-quote-wrap { min-height: 100px; }

  .section { padding: 5rem 1.5rem; }

  .manifesto-text { font-size: 1.05rem; line-height: 2; }

  .chronicle-entry { padding: 1.5rem 0; }

  .entry-text { font-size: 0.95rem; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .stat-value { font-size: 2.2rem; }

  .transparency-grid { grid-template-columns: 1fr; }

  .transparency-card { padding: 2rem 1.5rem; }

  .scroll-indicator { bottom: 1.5rem; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero-quote { font-size: 1.3rem; }
}

/* ==================== ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .scanlines { display: none; }
}

::selection {
  background: var(--green-faint);
  color: var(--white);
}

/* Focus styles */
a:focus-visible, button:focus-visible {
  outline: 1px solid var(--green-dim);
  outline-offset: 4px;
}
