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

:root {
  --red: #c83c1e;
  --red-bright: #e04a26;
  --red-glow: #ff5533;
  --green: #2daa5a;
  --green-bright: #3ddd6a;
  --green-dim: #1e7a3e;
  --dark: #0e0c0a;
  --dark-surface: #1a1714;
  --text-light: #ccbfaa;
}

html, body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: #000;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== POSTER ========== */
.poster {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--dark);
  overflow: hidden;
  cursor: crosshair;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ========== AMBIENT GLOW ========== */
.ambient-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 50% 35%, rgba(200,60,30,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 50% 80%, rgba(45,170,90,0.04) 0%, transparent 60%);
  animation: ambientPulse 6s ease-in-out infinite alternate;
}

@keyframes ambientPulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* ========== PERSPECTIVE GRID ========== */
.grid-container {
  position: absolute;
  top: 10%; left: 4%; right: 4%;
  height: 44%;
  z-index: 3;
  perspective: 400px;
  overflow: hidden;
  animation: gridIn 1.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

@keyframes gridIn {
  from { opacity: 0; filter: blur(4px); }
  to { opacity: 1; filter: blur(0); }
}

.grid-svg { width: 100%; height: 100%; }
.grid-svg line { filter: drop-shadow(0 0 2px rgba(200,60,30,0.3)); }

/* ========== WIREFRAME GLOBE ========== */
.globe-container {
  position: absolute;
  top: 1.2%; left: 50%;
  transform: translateX(-50%);
  width: clamp(60px, 8vw, 100px);
  height: clamp(60px, 8vw, 100px);
  z-index: 5;
  animation: globeIn 1s ease 0.3s both;
  transform-style: preserve-3d;
}

@keyframes globeIn {
  from { opacity: 0; transform: translateX(-50%) scale(0.5); }
  to { opacity: 1; transform: translateX(-50%) scale(1); }
}

.globe-svg {
  width: 100%; height: 100%;
  filter: drop-shadow(0 0 6px rgba(45,170,90,0.4));
  animation: globeSpin 18s linear infinite;
}

@keyframes globeSpin {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

/* ========== HEADER ========== */
.header {
  position: absolute;
  top: 1.4%; left: 0; right: 0;
  z-index: 6;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0 24px;
  gap: clamp(80px, 12vw, 160px);
  animation: fadeDown 0.8s ease 0.2s both;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.header-text {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 2.8vw, 36px);
  color: var(--red);
  letter-spacing: 3px;
  border: 2.5px solid var(--red);
  padding: 4px 10px;
  line-height: 1;
  text-shadow: 0 0 8px rgba(200,60,30,0.4);
  box-shadow: 0 0 12px rgba(200,60,30,0.15), inset 0 0 12px rgba(200,60,30,0.05);
  transition: text-shadow 0.3s, box-shadow 0.3s;
}

.header-text:hover {
  text-shadow: 0 0 16px rgba(200,60,30,0.7);
  box-shadow: 0 0 20px rgba(200,60,30,0.3), inset 0 0 20px rgba(200,60,30,0.1);
}

/* ========== YEAR MARKERS ========== */
.year-markers {
  position: absolute;
  top: 2.2%; left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  text-align: center;
  animation: fadeDown 0.8s ease 0.4s both;
}

.year-markers span {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(8px, 1vw, 12px);
  color: var(--green);
  letter-spacing: 1px;
  display: block;
  line-height: 1.5;
  text-shadow: 0 0 6px rgba(45,170,90,0.5);
}

/* ========== DECADE LABELS ========== */
.decade-label {
  position: absolute;
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(9px, 1.1vw, 14px);
  color: var(--green);
  letter-spacing: 1px;
  z-index: 3;
  opacity: 0;
  animation: labelIn 0.6s ease both;
  text-shadow: 0 0 8px rgba(45,170,90,0.5);
}

@keyframes labelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 0.85; transform: translateY(0); }
}

.label-2019 { top: 46%; left: 8%; animation-delay: 0.8s; }
.label-2005 { top: 28%; left: 12%; animation-delay: 0.9s; }
.label-1990 { top: 38%; left: 28%; animation-delay: 1.0s; }
.label-2000 { top: 28%; right: 20%; animation-delay: 1.1s; }
.label-2010 { top: 39%; right: 14%; animation-delay: 1.2s; }
.label-2015 { top: 21%; right: 11%; animation-delay: 1.3s; }

/* ========== WAVEFORM ========== */
.waveform-row {
  position: absolute;
  top: 55%; left: 5%; right: 5%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: fadeUp 0.8s ease 0.9s both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.waveform-year {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: clamp(14px, 1.6vw, 20px);
  color: var(--green);
  letter-spacing: 4px;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(45,170,90,0.6);
}

.waveform-canvas {
  flex: 1;
  height: 28px;
  display: block;
}

/* ========== THREE DOTS ========== */
.dots-row {
  position: absolute;
  top: 59.5%; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 5;
  animation: fadeUp 0.6s ease 1.0s both;
}

.dot {
  width: clamp(8px, 1vw, 12px);
  height: clamp(8px, 1vw, 12px);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(45,170,90,0.6);
  animation: dotPulse 2s ease-in-out infinite;
}

.dot:nth-child(2) { animation-delay: 0.3s; }
.dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(45,170,90,0.4); transform: scale(1); }
  50% { box-shadow: 0 0 14px rgba(45,170,90,0.8); transform: scale(1.15); }
}

/* ========== MAIN CHINESE TYPOGRAPHY ========== */
.main-type {
  position: absolute;
  top: 61%; left: 4%; right: 4%;
  z-index: 5;
  animation: typeIn 1s cubic-bezier(0.22, 1, 0.36, 1) 0.6s both;
}

@keyframes typeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.chinese-line {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  line-height: 1;
}

.cn-char {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 900;
  font-size: clamp(48px, 10vw, 120px);
  color: var(--red-bright);
  letter-spacing: -2px;
  display: inline-block;
  text-shadow:
    3px 3px 0 rgba(0,0,0,0.5),
    0 0 20px rgba(200,60,30,0.3);
  position: relative;
  transition: text-shadow 0.2s;
}

.cn-char:hover {
  text-shadow:
    3px 3px 0 rgba(0,0,0,0.5),
    0 0 40px rgba(255,85,51,0.5),
    0 0 80px rgba(255,85,51,0.2);
}

.cn-char.glitch {
  animation: charGlitch 0.15s steps(2) both;
}

@keyframes charGlitch {
  0% { transform: translate(0); filter: none; }
  20% { transform: translate(-3px, 1px); filter: hue-rotate(40deg); }
  40% { transform: translate(2px, -2px); clip-path: inset(20% 0 40% 0); }
  60% { transform: translate(-1px, 2px); filter: hue-rotate(-20deg); }
  80% { transform: translate(3px, 0px); clip-path: inset(60% 0 10% 0); }
  100% { transform: translate(0); filter: none; clip-path: none; }
}

.or-text {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: clamp(16px, 2.2vw, 28px);
  color: var(--red-bright);
  letter-spacing: 2px;
  margin: 0 4px;
  align-self: center;
  transform: translateY(-20px);
  text-shadow: 0 0 12px rgba(200,60,30,0.4);
}

.cn-line-1 { justify-content: center; }
.cn-line-2 { justify-content: center; margin-top: -6px; }

/* ========== SUBTITLE ========== */
.subtitle {
  position: absolute;
  bottom: 5%; left: 0; right: 0;
  text-align: center;
  z-index: 5;
  animation: fadeUp 0.8s ease 1.1s both;
}

.subtitle .cn-sub {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 400;
  font-size: clamp(14px, 1.8vw, 22px);
  color: var(--text-light);
  letter-spacing: 4px;
  text-shadow: 0 0 8px rgba(204,191,170,0.2);
}

.subtitle .en-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(9px, 1vw, 13px);
  color: var(--text-light);
  letter-spacing: 2px;
  opacity: 0.6;
  margin-top: 12px;
  display: block;
}

/* ========== SIDE VERTICAL TEXT ========== */
.side-left, .side-right {
  position: absolute;
  z-index: 6;
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(8px, 0.9vw, 11px);
  color: var(--green-dim);
  letter-spacing: 3px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  opacity: 0;
  animation: fadeIn 1s ease both;
  text-shadow: 0 0 6px rgba(30,122,62,0.4);
}

.side-left { left: 10px; top: 22%; animation-delay: 1.2s; }
.side-right { right: 10px; bottom: 10%; animation-delay: 1.3s; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 0.7; }
}

/* ========== RED SCAN LINE ========== */
.scanline {
  position: absolute;
  top: 43%; left: 5%; right: 5%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--red-glow), transparent);
  opacity: 0.5;
  z-index: 3;
  animation: scanPulse 4s ease-in-out infinite;
}

@keyframes scanPulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.7; }
}

/* ========== MOVING HORIZONTAL SCAN ========== */
.h-scan {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, rgba(45,170,90,0.15), transparent 95%);
  z-index: 7;
  pointer-events: none;
  animation: hScan 8s linear infinite;
}

@keyframes hScan {
  0% { top: -2px; }
  100% { top: 100%; }
}

/* ========== CORNER BRACKETS ========== */
.corner {
  position: absolute;
  width: 20px; height: 20px;
  z-index: 6;
  opacity: 0;
  animation: cornerIn 0.5s ease both;
}

.corner::before, .corner::after {
  content: '';
  position: absolute;
  background: var(--green);
}

.corner-tl { top: 8px; left: 8px; animation-delay: 1.4s; }
.corner-tl::before { top: 0; left: 0; width: 12px; height: 1.5px; }
.corner-tl::after { top: 0; left: 0; width: 1.5px; height: 12px; }

.corner-tr { top: 8px; right: 8px; animation-delay: 1.5s; }
.corner-tr::before { top: 0; right: 0; width: 12px; height: 1.5px; }
.corner-tr::after { top: 0; right: 0; width: 1.5px; height: 12px; }

.corner-bl { bottom: 8px; left: 8px; animation-delay: 1.6s; }
.corner-bl::before { bottom: 0; left: 0; width: 12px; height: 1.5px; }
.corner-bl::after { bottom: 0; left: 0; width: 1.5px; height: 12px; }

.corner-br { bottom: 8px; right: 8px; animation-delay: 1.7s; }
.corner-br::before { bottom: 0; right: 0; width: 12px; height: 1.5px; }
.corner-br::after { bottom: 0; right: 0; width: 1.5px; height: 12px; }

@keyframes cornerIn {
  from { opacity: 0; }
  to { opacity: 0.5; }
}

/* ========== NOISE ========== */
.noise {
  position: absolute;
  inset: 0;
  z-index: 10;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px;
}

/* ========== CRT VIGNETTE ========== */
.vignette {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 45%, rgba(0,0,0,0.55) 100%);
}

/* ========== SCANLINES OVERLAY ========== */
.scanlines {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.1) 2px,
    rgba(0,0,0,0.1) 4px
  );
}

/* ========== RGB SPLIT FLASH ========== */
.rgb-flash {
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background: linear-gradient(90deg, rgba(255,0,0,0.03), rgba(0,255,0,0.03), rgba(0,0,255,0.03));
  animation: rgbFlash 6s ease-in-out infinite;
}

@keyframes rgbFlash {
  0%, 92%, 100% { opacity: 0; }
  94% { opacity: 1; }
  96% { opacity: 0; }
  97% { opacity: 0.5; }
  98% { opacity: 0; }
}

/* ========== BOTTOM DATA BAR ========== */
.data-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  z-index: 6;
  display: flex;
  gap: 2px;
  padding: 0 5%;
  opacity: 0;
  animation: fadeIn 1s ease 1.8s both;
}

.data-bar span {
  flex: 1;
  background: var(--green);
  opacity: 0.3;
  animation: barPulse 3s ease-in-out infinite;
}

.data-bar span:nth-child(odd) { animation-delay: 0.5s; }
.data-bar span:nth-child(3n) { animation-delay: 1s; }

@keyframes barPulse {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.5; }
}

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

/* Tablet portrait */
@media (max-width: 768px) {
  .header { gap: clamp(60px, 10vw, 120px); }
  .header-text { font-size: clamp(16px, 4vw, 28px); padding: 3px 8px; letter-spacing: 2px; }
  .globe-container { width: clamp(40px, 10vw, 70px); height: clamp(40px, 10vw, 70px); }
  .year-markers { display: none; }
  .decade-label { font-size: clamp(7px, 1.8vw, 11px); }
  .waveform-year { letter-spacing: 2px; }
  .cn-char { font-size: clamp(42px, 12vw, 90px); }
  .or-text { font-size: clamp(14px, 3vw, 22px); }
  .side-left, .side-right { display: none; }
  .subtitle .cn-sub { letter-spacing: 2px; }
}

/* Phone portrait */
@media (max-width: 480px) {
  .header { gap: clamp(50px, 20vw, 100px); top: 1%; }
  .header-text {
    font-size: clamp(14px, 4.5vw, 22px);
    padding: 3px 6px;
    letter-spacing: 1px;
    border-width: 2px;
  }
  .globe-container {
    width: 36px; height: 36px;
    top: 0.8%;
  }
  .grid-container { top: 8%; height: 46%; left: 2%; right: 2%; }
  .decade-label { font-size: 7px; }
  .label-2005, .label-2000, .label-2015 { display: none; }
  .scanline { top: 44%; left: 2%; right: 2%; }
  .waveform-row { top: 55%; left: 3%; right: 3%; gap: 8px; }
  .waveform-year { font-size: clamp(10px, 3vw, 14px); letter-spacing: 2px; }
  .waveform-canvas { height: 20px; }
  .dots-row { top: 59%; gap: 7px; }
  .dot { width: 6px; height: 6px; }
  .main-type { top: 61%; left: 2%; right: 2%; }
  .cn-char {
    font-size: clamp(36px, 14vw, 70px);
    letter-spacing: -1px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.5), 0 0 14px rgba(200,60,30,0.3);
  }
  .or-text { font-size: clamp(12px, 3.5vw, 18px); transform: translateY(-12px); }
  .cn-line-2 { margin-top: -4px; }
  .subtitle { bottom: 3%; }
  .subtitle .cn-sub { font-size: clamp(12px, 3.5vw, 18px); letter-spacing: 2px; }
  .subtitle .en-sub { font-size: clamp(8px, 2.2vw, 11px); margin-top: 8px; }
  .corner-tl { top: 4px; left: 4px; }
  .corner-tr { top: 4px; right: 4px; }
  .corner-bl { bottom: 4px; left: 4px; }
  .corner-br { bottom: 4px; right: 4px; }
}

/* Very small phones */
@media (max-width: 360px) {
  .cn-char { font-size: clamp(30px, 13vw, 50px); }
  .header { gap: 50px; }
  .header-text { font-size: 13px; }
  .globe-container { width: 28px; height: 28px; }
  .main-type { top: 62%; }
  .decade-label { display: none; }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .header { top: 0.5%; }
  .header-text { font-size: clamp(12px, 2.5dvh, 22px); padding: 2px 6px; }
  .globe-container {
    width: clamp(28px, 8dvh, 50px);
    height: clamp(28px, 8dvh, 50px);
    top: 0.5%;
  }
  .year-markers { display: none; }
  .grid-container { top: 8%; height: 40%; }
  .decade-label { display: none; }
  .scanline { top: 40%; }
  .waveform-row { top: 50%; }
  .waveform-year { font-size: clamp(10px, 2.5dvh, 16px); }
  .waveform-canvas { height: 18px; }
  .dots-row { top: 55%; }
  .dot { width: 6px; height: 6px; }
  .main-type { top: 57%; }
  .cn-char { font-size: clamp(28px, 10dvh, 60px); }
  .or-text { font-size: clamp(10px, 3dvh, 18px); transform: translateY(-8px); }
  .cn-line-2 { margin-top: -2px; }
  .subtitle { bottom: 2%; }
  .subtitle .cn-sub { font-size: clamp(10px, 3dvh, 16px); }
  .subtitle .en-sub { font-size: clamp(7px, 1.8dvh, 10px); margin-top: 4px; }
  .side-left, .side-right { display: none; }
}

/* Tall phones (extra vertical space) */
@media (min-height: 800px) and (max-width: 480px) {
  .grid-container { height: 40%; }
  .waveform-row { top: 52%; }
  .dots-row { top: 56%; }
  .main-type { top: 58%; }
  .subtitle { bottom: 6%; }
}

/* Large desktops */
@media (min-width: 1400px) {
  .header { gap: clamp(140px, 14vw, 220px); }
  .globe-container { width: 110px; height: 110px; }
}
