/* ============================================
   Thomas Favilla — Editor | 90s Style
   ============================================ */

/* CSS Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --purple: #9B2FEB;
  --pink: #FF2D78;
  --yellow: #FFD600;
  --cyan: #00E5FF;
  --orange: #FF6B00;
  --dark: #0d0d0d;
  --dark2: #1a1a1a;
  --plastic: #2a2a2e;
  --plastic-light: #3a3a3f;
  --plastic-dark: #1a1a1e;
  --screen-black: #050508;
  --led-green: #39ff14;
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--dark);
  color: #fff;
  font-family: 'Share Tech Mono', monospace;
  min-height: 100vh;
  position: relative;
}

/* ============================================
   BACKGROUND GRID
   ============================================ */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* ============================================
   FLOATING GEO SHAPES
   ============================================ */
.geo-shapes {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Isometric shape items */
.shape-item {
  position: absolute;
  opacity: 0.85;
}

.shape-item svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Positions & sizes — matching reference image layout */
.si-1 { /* small gray cube — top right */
  top: 6%; right: 18%;
  width: 50px; height: 58px;
  animation: floatA 7s ease-in-out infinite;
}
.si-2 { /* small white cube — upper center */
  top: 4%; left: 32%;
  width: 36px; height: 42px;
  animation: floatB 9s ease-in-out infinite;
}
.si-3 { /* orange 2-cube pair — left side */
  top: 24%; left: 3%;
  width: 80px; height: 80px;
  animation: floatA 8s ease-in-out infinite reverse;
}
.si-4 { /* orange L-piece (3 cube) — upper center */
  top: 7%; left: 40%;
  width: 78px; height: 108px;
  animation: floatB 11s ease-in-out infinite;
}
.si-5 { /* big orange L-piece (4 cube) — bottom left */
  bottom: 14%; left: 3%;
  width: 105px; height: 108px;
  animation: floatA 10s ease-in-out infinite;
}
.si-6 { /* medium gray cube — right side */
  top: 38%; right: 5%;
  width: 66px; height: 75px;
  animation: floatB 9s ease-in-out infinite reverse;
}
.si-7 { /* small orange cube — bottom right */
  bottom: 22%; right: 16%;
  width: 40px; height: 46px;
  animation: floatA 6s ease-in-out infinite;
}
.si-8 { /* white staircase — right mid */
  top: 50%; right: 20%;
  width: 55px; height: 46px;
  opacity: 0.9;
  animation: floatB 10s ease-in-out infinite;
}
.si-9 { /* white staircase small — left mid */
  bottom: 38%; left: 16%;
  width: 40px; height: 34px;
  opacity: 0.7;
  animation: floatA 8s ease-in-out infinite reverse;
}

@keyframes floatA {
  0%, 100% { transform: translateY(0px); }
  40%       { transform: translateY(-16px); }
  70%       { transform: translateY(8px); }
}
@keyframes floatB {
  0%, 100% { transform: translateY(0px); }
  30%       { transform: translateY(12px); }
  65%       { transform: translateY(-14px); }
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 18px 40px;
  border-bottom: 2px solid rgba(155, 47, 235, 0.4);
  background: linear-gradient(180deg, rgba(13,13,13,0.95) 0%, rgba(13,13,13,0.85) 100%);
  backdrop-filter: blur(4px);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.site-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1;
}

.title-main {
  font-size: 1.6em;
  background-image:
    repeating-linear-gradient(
      -52deg,
      transparent 0px,
      transparent 2px,
      rgba(0,0,0,0.22) 2px,
      rgba(0,0,0,0.22) 3px
    ),
    linear-gradient(90deg, var(--purple) 0%, var(--pink) 50%, var(--yellow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(155,47,235,0.5));
}

.title-dash {
  font-size: 1.4em;
  background-image:
    repeating-linear-gradient(
      -52deg,
      transparent 0px,
      transparent 2px,
      rgba(0,0,0,0.22) 2px,
      rgba(0,0,0,0.22) 3px
    ),
    linear-gradient(90deg, var(--yellow) 0%, var(--yellow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-role {
  background-image:
    repeating-linear-gradient(
      -52deg,
      transparent 0px,
      transparent 2px,
      rgba(0,0,0,0.22) 2px,
      rgba(0,0,0,0.22) 3px
    ),
    linear-gradient(90deg, var(--pink) 0%, var(--yellow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: italic;
}

/* Nav */
.site-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-link {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  letter-spacing: 3px;
  text-decoration: none;
  color: #fff;
  padding: 6px 16px;
  border: 2px solid transparent;
  position: relative;
  transition: all 0.2s ease;
}

.nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: -1;
}

.nav-link:hover {
  border-color: var(--pink);
  color: var(--yellow);
  text-shadow: 0 0 10px var(--yellow);
  transform: translateY(-2px);
}

.nav-link:hover::before {
  opacity: 0.15;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 90px);
  padding: 30px 20px 60px;
}

.tv-scene {
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1200px;
}

/* ============================================
   TUBE TV / VCR UNIT
   ============================================ */
.tv-unit {
  filter: drop-shadow(0 30px 60px rgba(0,0,0,0.8)) drop-shadow(0 0 40px rgba(155,47,235,0.2));
}

.tv-body {
  position: relative;
  width: clamp(280px, 65vw, 860px);
}

/* ANTENNA */
.antenna {
  position: absolute;
  top: -55px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 55px;
}
.antenna-left,
.antenna-right {
  position: absolute;
  bottom: 0;
  width: 4px;
  height: 55px;
  background: #555;
  border-radius: 2px;
}
.antenna-left {
  left: 30px;
  transform-origin: bottom center;
  transform: rotate(-25deg);
}
.antenna-right {
  right: 30px;
  transform-origin: bottom center;
  transform: rotate(25deg);
}
.antenna-base {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 10px;
  background: #444;
  border-radius: 3px;
}

/* TV TOP (screen area + side controls) */
.tv-top {
  display: flex;
  align-items: stretch;
  background: linear-gradient(180deg, var(--plastic-light) 0%, var(--plastic) 60%, var(--plastic-dark) 100%);
  border-radius: 18px 18px 0 0;
  padding: 22px 16px 16px 22px;
  border: 3px solid #444;
  border-bottom: none;
  box-shadow:
    inset 0 2px 6px rgba(255,255,255,0.07),
    inset 0 -3px 8px rgba(0,0,0,0.5);
}

/* Bezel + Screen */
.tv-bezel {
  flex: 1;
  background: #111;
  border-radius: 10px;
  padding: 14px;
  box-shadow:
    inset 0 0 20px rgba(0,0,0,0.9),
    inset 0 0 6px rgba(0,0,0,0.7),
    0 0 0 3px #222,
    0 0 0 5px #333;
}

.tv-screen {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 ratio */
  background: var(--screen-black);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    inset 0 0 40px rgba(0,0,200,0.05),
    0 0 20px rgba(0,229,255,0.05);
}

.video-element {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}

/* Scanlines */
.scanlines {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.12) 2px,
    rgba(0,0,0,0.12) 4px
  );
  pointer-events: none;
  border-radius: 4px;
}

/* Screen glare */
.screen-glare {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: radial-gradient(
    ellipse at 20% 15%,
    rgba(255,255,255,0.06) 0%,
    transparent 55%
  );
  pointer-events: none;
}

/* Screen vignette */
.screen-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 60%,
    rgba(0,0,0,0.5) 100%
  );
  pointer-events: none;
}

/* Power-off overlay */
.power-off-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.power-off-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.power-off-line {
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.6);
  transform: scaleX(0);
  transition: transform 0.4s ease;
  box-shadow: 0 0 10px rgba(255,255,255,0.8);
}

.power-off-overlay.animating .power-off-line {
  transform: scaleX(1);
}

/* UNMUTE overlay */
.unmute-overlay {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  background: rgba(0,0,0,0.75);
  border: 1px solid var(--yellow);
  border-radius: 4px;
  padding: 5px 14px;
  cursor: pointer;
  transition: opacity 0.4s ease;
  white-space: nowrap;
}

.unmute-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.unmute-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--yellow);
  animation: blink 1.5s step-end infinite;
}

.mute-btn.muted-active {
  color: var(--yellow);
}

/* PRESS PLAY overlay */
.press-play-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.press-play-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.press-play-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--yellow);
  text-shadow: 0 0 20px var(--yellow);
  animation: blink 1.2s step-end infinite;
}

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

/* SIDE CONTROLS */
.tv-side-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  padding: 8px 0 8px 14px;
  gap: 12px;
  min-width: 60px;
}

.channel-knob,
.volume-knob {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.volume-knob {
  cursor: ns-resize;
}

.volume-knob:hover .knob {
  box-shadow:
    0 4px 8px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 0 6px rgba(155,47,235,0.4);
}

.knob-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.55rem;
  color: #aaa;
  letter-spacing: 1px;
}

.knob {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #666, #222);
  border: 2px solid #555;
  box-shadow:
    0 3px 6px rgba(0,0,0,0.6),
    inset 0 1px 2px rgba(255,255,255,0.15);
  position: relative;
  transition: transform 0.3s ease;
}

.knob::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 10px;
  background: #aaa;
  border-radius: 2px;
}

.knob.rotated {
  transform: rotate(30deg);
}

.power-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #333;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.8);
  transition: all 0.3s ease;
}

.power-indicator.on {
  background: var(--led-green);
  box-shadow: 0 0 8px var(--led-green), 0 0 16px rgba(57,255,20,0.4);
}

/* VCR DECK */
.vcr-deck {
  background: linear-gradient(180deg, var(--plastic-dark) 0%, #141416 100%);
  border: 3px solid #333;
  border-top: 2px solid #444;
  border-radius: 0 0 12px 12px;
  padding: 14px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* VCR tape slot row */
.vcr-tape-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tape-slot-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: #888;
  letter-spacing: 3px;
  align-self: flex-start;
  padding-left: 10%;
}

.tape-slot-opening {
  width: 48%;
  height: 45px;
  background: #0a0a0a;
  border-radius: 3px 3px 6px 6px;
  border: 2px solid #2a2a2a;
  border-top: 3px solid #333;
  overflow: hidden;
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.95), inset 0 0 0 1px rgba(255,255,255,0.03);
}

.tape-slot-inner {
  height: 100%;
  width: 70%;
  background: linear-gradient(90deg, transparent, rgba(80,50,20,0.3), transparent);
}

/* VCR display */
.vcr-display {
  display: flex;
  justify-content: center;
}

.vcr-time {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--led-green);
  text-shadow: 0 0 10px var(--led-green), 0 0 20px rgba(57,255,20,0.3);
  background: #080808;
  border: 2px solid #1a1a1a;
  padding: 6px 18px;
  border-radius: 4px;
  letter-spacing: 4px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.8);
}

/* VCR BUTTONS */
.vcr-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vcr-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 10px 6px;
  background: linear-gradient(180deg, #4a4a4f 0%, #2e2e33 60%, #222226 100%);
  border: 2px solid #555;
  border-bottom: 3px solid #111;
  border-radius: 5px;
  color: #ccc;
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 1px;
  min-width: 50px;
  transition: all 0.1s ease;
  box-shadow:
    0 3px 6px rgba(0,0,0,0.6),
    inset 0 1px 2px rgba(255,255,255,0.1);
  user-select: none;
}

.vcr-btn svg {
  width: 18px;
  height: 18px;
}

.vcr-btn:hover {
  background: linear-gradient(180deg, #5a5a60 0%, #3e3e44 100%);
  color: #fff;
  transform: translateY(-1px);
}

.vcr-btn:active,
.vcr-btn.active {
  transform: translateY(2px);
  border-bottom-width: 1px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.8), inset 0 2px 4px rgba(0,0,0,0.4);
}

.btn-play.active {
  background: linear-gradient(180deg, #1a3a1a 0%, #0d200d 100%);
  border-color: var(--led-green);
  color: var(--led-green);
  box-shadow: 0 0 8px rgba(57,255,20,0.3), inset 0 2px 4px rgba(0,0,0,0.4);
}

.btn-pause.active {
  background: linear-gradient(180deg, #3a2a00 0%, #201800 100%);
  border-color: var(--yellow);
  color: var(--yellow);
}

.btn-stop.active {
  background: linear-gradient(180deg, #3a0000 0%, #200000 100%);
  border-color: #ff4444;
  color: #ff4444;
}


/* TV LEGS */
.tv-legs {
  display: flex;
  justify-content: space-between;
  padding: 0 40px;
}

.leg {
  width: 18px;
  height: 20px;
  background: linear-gradient(180deg, #2a2a2e 0%, #1a1a1e 100%);
  border: 2px solid #333;
  border-top: none;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

/* ============================================
   TAPE REEL DECORATION
   ============================================ */
.tape-reel-decoration {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0 30px;
  gap: 0;
}

.reel {
  position: relative;
  width: 50px;
  height: 50px;
}

.reel-inner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid #444;
  background: radial-gradient(circle, #2a2a2a 30%, #1a1a1a 100%);
  animation: reelSpin 4s linear infinite;
}

.reel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #555;
  border: 2px solid #777;
}

.tape-line {
  flex: 1;
  max-width: 200px;
  height: 3px;
  background: linear-gradient(90deg, #444, #666, #444);
  border-radius: 2px;
}

@keyframes reelSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* ---- Tablet (768px) ---- */
@media (max-width: 768px) {
  .site-header { padding: 12px 20px; }
  /* Hide floating shapes on tablet/mobile — they overlap content */
  .geo-shapes { display: none; }
}

/* ---- Mobile (600px) ---- */
@media (max-width: 600px) {
  /* Header — title above nav, nav stays on ONE line */
  .site-header { padding: 10px 16px; }
  .header-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .site-title { font-size: 4.8vw; white-space: nowrap; }
  .title-main { font-size: 1.15em; }
  .site-nav { flex-wrap: nowrap; gap: 4px; }
  .nav-link { font-size: 0.9rem; letter-spacing: 0.5px; padding: 4px 5px; white-space: nowrap; }

  /* TV — slightly larger now shapes are gone */
  .tv-body { width: 95vw; }
  .tv-top { padding: 10px 8px 8px 10px; }
  .tv-screen-wrap { border-radius: 10px; border-width: 6px; }

  /* Side controls */
  .tv-controls { padding: 8px 6px; gap: 12px; min-width: 44px; }
  .knob { width: 26px; height: 26px; }
  .knob-label { font-size: 0.45rem; }
  .power-indicator { width: 6px; height: 6px; }

  /* VCR deck */
  .vcr-deck { padding: 8px 10px 10px; gap: 8px; }
  .vcr-time { font-size: 1rem; padding: 4px 12px; letter-spacing: 2px; }
  .vcr-buttons { gap: 5px; }
  .vcr-btn { min-width: 36px; padding: 5px 5px 4px; font-size: 0.45rem; }
  .vcr-btn svg { width: 13px; height: 13px; }
  .tape-slot-label { font-size: 0.55rem; }

  /* Main content padding */
  .main-content { padding: 16px 0 40px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 3px; }

/* ============================================
   KONAMI CODE EASTER EGG
   ============================================ */
.konami-egg {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.82);
  animation: konamiFadeIn 0.2s steps(3) forwards;
}

.konami-egg.konami-exit {
  animation: konamiFadeOut 0.35s steps(4) forwards;
}

.konami-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: konamiPop 0.4s steps(6) forwards;
}

.konami-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--yellow);
  letter-spacing: 5px;
  text-shadow: 0 0 12px var(--yellow), 0 0 24px rgba(255,214,0,0.4);
  animation: konamilBlink 0.7s steps(1) infinite;
}

.konami-link {
  display: block;
  line-height: 0;
}

.konami-chest {
  width: 180px;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 0 18px rgba(255,214,0,0.55)) drop-shadow(0 0 40px rgba(255,150,0,0.3));
  transition: transform 0.08s steps(2), filter 0.1s steps(2);
  cursor: pointer;
}

.konami-chest:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 28px rgba(255,214,0,0.9)) drop-shadow(0 0 50px rgba(255,150,0,0.5));
}

.konami-hint {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: #888;
  letter-spacing: 3px;
  animation: konamilBlink 1.1s steps(1) infinite;
}

.konami-close {
  position: absolute;
  top: -36px;
  right: -10px;
  background: none;
  border: 1px solid #444;
  color: #666;
  font-size: 1.1rem;
  width: 26px;
  height: 26px;
  border-radius: 3px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.15s, border-color 0.15s;
}
.konami-close:hover { color: #fff; border-color: var(--pink); }

@keyframes konamiPop {
  from { transform: scale(0.2); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
@keyframes konamiفadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes konamiFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes konamiFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes konamilBlink {
  50% { opacity: 0; }
}
