/* ===== TOKENS ===== */
:root {
  --bg-void: #0a0a12;
  --bg-panel: #12121e;
  --bg-panel-raised: #181826;
  --line: #2a2a3e;

  --text-primary: #e8e6f0;
  --text-dim: #8a87a3;

  --nerv-orange: #ff6b1a;
  --nerv-orange-dim: #cc5414;
  --eva-green: #3dff8f;
  --eva-purple: #8c6fff;
  --warn-red: #ff3b3b;

  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 2px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-display);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

a { color: inherit; text-decoration: none; }

img.photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.85) contrast(1.05);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== CRT / RETRO TEXTURE ===== */
.crt-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0,0,0,0.18) 0px,
      rgba(0,0,0,0.18) 1px,
      transparent 1px,
      transparent 3px
    );
  mix-blend-mode: multiply;
  opacity: 0.5;
}

.scanline {
  pointer-events: none;
  position: fixed;
  left: 0; right: 0;
  height: 120px;
  z-index: 9998;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(61,255,143,0.04),
    transparent
  );
  animation: scan 9s linear infinite;
}

@keyframes scan {
  0% { top: -120px; }
  100% { top: 100vh; }
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9997;
  opacity: 0.025;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48ZmlsdGVyIGlkPSJuIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iMC44NSIgbnVtT2N0YXZlcz0iMyIgc3RpdGNoVGlsZXM9InN0aXRjaCIvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbHRlcj0idXJsKCNuKSIvPjwvc3ZnPg==");
}

/* ===== BOOT SCREEN ===== */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  color: var(--eva-green);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  animation: boot-fade 2.6s ease forwards;
}

.boot-text p {
  font-size: clamp(0.8rem, 2vw, 1.1rem);
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: boot-line 0.4s ease forwards;
  text-shadow: 0 0 8px currentColor;
}
.boot-text p:nth-child(1) { animation-delay: 0.1s; }
.boot-text p:nth-child(2) { animation-delay: 0.7s; }
.boot-text p:nth-child(3) { animation-delay: 1.3s; }
.boot-text p:nth-child(4) { animation-delay: 1.8s; }

.boot-text .ok { color: var(--nerv-orange); }
.cursor { animation: blink 0.8s step-end infinite; }

@keyframes boot-line {
  to { opacity: 1; }
}
@keyframes boot-fade {
  0% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; pointer-events: none; }
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 3rem;
  background: radial-gradient(ellipse at 50% 0%, #1a1530 0%, var(--bg-void) 60%);
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.25;
  mask-image: radial-gradient(ellipse at 50% 30%, black 0%, transparent 70%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  width: 100%;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--nerv-orange);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

h1.glitch {
  font-size: clamp(2.4rem, 9vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(140,111,255,0.35);
}

h1.glitch::before,
h1.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0; right: 0;
  opacity: 0.8;
}
h1.glitch::before {
  color: var(--eva-green);
  animation: glitch-1 4.5s infinite linear;
  clip-path: inset(0 0 60% 0);
}
h1.glitch::after {
  color: var(--nerv-orange);
  animation: glitch-2 4.5s infinite linear;
  clip-path: inset(60% 0 0 0);
}

@keyframes glitch-1 {
  0%, 92%, 100% { transform: translate(0,0); opacity: 0; }
  93% { transform: translate(-3px, 1px); opacity: 0.7; }
  95% { transform: translate(3px, -1px); opacity: 0.7; }
  97% { transform: translate(-2px, 0); opacity: 0; }
}
@keyframes glitch-2 {
  0%, 90%, 100% { transform: translate(0,0); opacity: 0; }
  91% { transform: translate(3px, -1px); opacity: 0.7; }
  94% { transform: translate(-3px, 1px); opacity: 0.7; }
  96% { transform: translate(2px, 0); opacity: 0; }
}

.nickname {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 1rem;
}
.nickname span { color: var(--eva-purple); }

.tagline {
  margin-top: 1.1rem;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* player */
.player-wrap {
  margin: 2.5rem auto 0;
  max-width: 480px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
  text-align: left;
}
.player-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--eva-green);
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.sc-player { border-radius: var(--radius); display: block; }
.sc-credit {
  margin-top: 0.4rem;
  font-size: 0.65rem;
  color: var(--text-dim);
}
.sc-credit a { color: var(--text-dim); }
.sc-credit a:hover { color: var(--nerv-orange); }

.hero-nav {
  margin-top: 2.5rem;
  display: flex;
  gap: 1.75rem;
  justify-content: center;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.hero-nav a {
  color: var(--text-dim);
  letter-spacing: 0.05em;
  position: relative;
  padding-bottom: 3px;
  transition: color 0.2s ease;
}
.hero-nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  height: 1px;
  width: 0;
  background: var(--nerv-orange);
  transition: width 0.25s ease;
}
.hero-nav a:hover { color: var(--text-primary); }
.hero-nav a:hover::after { width: 100%; }

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}
.scroll-hint span {
  display: inline-block;
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ===== SECTIONS (general) ===== */
.section {
  max-width: 920px;
  margin: 0 auto;
  padding: 6rem 1.5rem;
  position: relative;
}
.section + .section {
  border-top: 1px solid var(--line);
  position: relative;
}
.section + .section::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1px;
  background: var(--eva-green);
  box-shadow: 0 0 8px rgba(61,255,143,0.6);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 0.5rem;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--nerv-orange);
  border: 1px solid var(--nerv-orange-dim);
  padding: 0.15rem 0.5rem;
  letter-spacing: 0.08em;
  position: relative;
}
.tag::before {
  content: '●';
  margin-right: 0.4rem;
  font-size: 0.5rem;
  color: var(--eva-green);
  animation: tag-pulse 2.4s ease-in-out infinite;
}
@keyframes tag-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
.section-head h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.01em;
}
.section-intro {
  color: var(--text-dim);
  margin: 0.75rem 0 2.5rem;
  font-size: 0.95rem;
}

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 2.5rem;
  margin-top: 2.5rem;
  align-items: start;
}

.about-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  align-content: start;
}
.photo-feature {
  grid-column: 1 / -1;
}
.photo-square {
  aspect-ratio: 1/1;
  border: 1px solid var(--line);
  filter: saturate(0.8) contrast(1.05);
  transition: filter 0.3s ease, transform 0.3s ease;
}
.photo-square:hover { filter: saturate(1) contrast(1.05); transform: translateY(-2px); }
.photo-feature.photo-square {
  filter: saturate(0.95) contrast(1.08);
}

.about-text .lead {
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 1.1rem;
  font-weight: 500;
}
.about-text p { color: var(--text-dim); margin-bottom: 1rem; font-size: 0.95rem; }
.about-text strong { color: var(--eva-purple); font-weight: 600; }

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.pill-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border: 1px solid var(--line);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: var(--text-dim);
  transition: all 0.2s ease;
}
.pill-link:hover {
  border-color: var(--eva-green);
  color: var(--eva-green);
  transform: translateY(-1px);
}

.photo-strip {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.strip-item {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  padding: 0.85rem;
}
.photo-tall {
  aspect-ratio: 3/4;
  border: 1px solid var(--line);
  margin-bottom: 0.85rem;
}
.strip-caption {
  font-size: 0.85rem;
  color: var(--text-dim);
}
.strip-caption span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--nerv-orange);
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

/* ===== FUN ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.card {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(140,111,255,0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--eva-purple);
  background: var(--bg-panel-raised);
}
.card:hover::before { opacity: 1; }
.card-icon { font-size: 1.5rem; }
.card-title { font-weight: 600; font-size: 1rem; margin-top: 0.4rem; }
.card-sub { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); }
.card-arrow {
  position: absolute;
  top: 1.25rem; right: 1.25rem;
  color: var(--text-dim);
  transition: transform 0.2s ease, color 0.2s ease;
}
.card:hover .card-arrow { transform: translate(3px, -3px); color: var(--eva-purple); }

.card-discord:hover { border-color: #5865F2; }
.card-discord:hover .card-arrow { color: #5865F2; }
.card-spotify:hover { border-color: #1DB954; }
.card-spotify:hover .card-arrow { color: #1DB954; }

.fun-note {
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  font-style: italic;
}

/* ===== CHESS ===== */
.chess-terminal {
  background: #06060c;
  border: 1px solid var(--line);
  box-shadow: 0 0 40px rgba(61,255,143,0.04);
}
.chess-terminal-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
}
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-red { background: var(--warn-red); opacity: 0.7; }
.dot-amber { background: var(--nerv-orange); opacity: 0.7; }
.dot-green { background: var(--eva-green); opacity: 0.7; }
.chess-terminal-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-left: 0.5rem;
  letter-spacing: 0.05em;
}

.chess-board-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
}
.chess-platform {
  background: #06060c;
  padding: 1.5rem;
}
.chess-platform-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chess-platform-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.chess-platform-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--eva-purple);
  transition: color 0.2s ease;
}
.chess-platform-link:hover { color: var(--eva-green); }

.chess-loading {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.loading-dots::after {
  content: '';
  animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

.chess-rating-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
}
.chess-rating-row:last-child { border-bottom: none; }
.chess-rating-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.chess-rating-value {
  font-size: 1.05rem;
  color: var(--eva-green);
  text-shadow: 0 0 6px rgba(61,255,143,0.4);
}
.chess-rating-record {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-left: 0.5rem;
}
.chess-error {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--warn-red);
}

.chess-footnote {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--line);
  opacity: 0.7;
}

@media (max-width: 600px) {
  .chess-board-grid { grid-template-columns: 1fr; }
}

/* ===== SOCIALS ===== */
.social-grid {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}
.social-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0.5rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease, padding-left 0.2s ease;
}
.social-row:hover {
  background: var(--bg-panel);
  padding-left: 1rem;
}
.social-icon { color: var(--eva-purple); font-size: 1rem; }
.social-name { font-weight: 600; }
.social-handle { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }

/* ===== PROFESSIONAL ===== */
.pro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.pro-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  padding: 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.pro-card:hover {
  border-color: var(--eva-green);
  transform: translateY(-2px);
}
.pro-icon {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--eva-green);
}
.pro-title { display: block; font-weight: 600; }
.pro-sub { display: block; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); }

/* ===== FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 5rem 1.5rem 3rem;
  border-top: 1px solid var(--line);
}
.footer-photo {
  width: 110px;
  height: 110px;
  margin: 0 auto 2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  overflow: hidden;
}
.footer-photo img { border-radius: 50%; }
.footer-line {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-bottom: 2rem;
}

.visitor-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
}
.counter-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}
.counter-widget {
  display: inline-flex;
  align-items: center;
  filter: drop-shadow(0 0 4px rgba(61,255,143,0.35));
}
.counter-widget img {
  display: block;
  vertical-align: middle;
}
.counter-credit {
  margin-top: 0.6rem;
  font-size: 0.6rem;
  color: var(--text-dim);
  opacity: 0.5;
}
.counter-credit a { color: var(--text-dim); }
.counter-credit a:hover { color: var(--eva-green); opacity: 1; }

.footer-credit {
  margin-top: 1.5rem;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  opacity: 0.6;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .photo-strip { grid-template-columns: 1fr; }
  .section { padding: 4rem 1.25rem; }
  .hero { padding-top: 5rem; }
}

@media (max-width: 480px) {
  .hero-nav { gap: 1.1rem; font-size: 0.72rem; }
}

/* focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--eva-green);
  outline-offset: 2px;
}
