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

::selection {
  background: #fff;
  color: #000;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: #0a0a0a;
  color: #d8d8d8;
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 1.35rem;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
}

body.is-hot::after {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.04) 2px,
    rgba(255, 255, 255, 0.04) 4px
  );
  animation: scan-hot 0.12s steps(2) infinite;
}

body.unlocking {
  animation: screen-kick 0.35s ease-out;
}

a {
  color: #d8d8d8;
  text-decoration: none;
}

a:hover {
  color: #fff;
}

strong {
  color: #fff;
  font-weight: normal;
}

em {
  font-style: normal;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 4px;
}

h1, h2, h3 {
  font-family: 'Press Start 2P', monospace;
  font-weight: normal;
  line-height: 1.6;
}

#gate {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.5s ease, visibility 0.5s;
}

#gate.gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-inner {
  text-align: center;
}

.gate-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1.4rem, 6vw, 3rem);
  color: #fff;
  letter-spacing: 6px;
  margin-bottom: 1.2rem;
  animation: gate-flicker 2.4s infinite;
}

.gate-sub {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  color: #888;
  letter-spacing: 3px;
  animation: bob 1.6s ease-in-out infinite;
}

.gate-hint {
  margin-top: 1.4rem;
  color: #333;
  font-size: 1.1rem;
}

.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(4px);
  border-bottom: 1px dashed #2a2a2a;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
}

.topnav-logo {
  color: #fff;
  letter-spacing: 2px;
}

.topnav-links {
  display: flex;
  gap: 1.5rem;
}

.topnav-links a {
  color: #666;
  transition: color 0.2s;
  text-transform: lowercase;
}

.topnav-links a:hover {
  color: #fff;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem 3rem;
  text-align: center;
}

.hero-badge {
  position: absolute;
  top: 5rem;
  right: 2rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  color: #000;
  background: #fff;
  padding: 0.4rem 0.8rem;
  transform: rotate(4deg);
  border: 2px solid #000;
  white-space: nowrap;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  letter-spacing: 4px;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.hero-title-og {
  color: #fff;
}

.hero-title-meme {
  color: #555;
}

.hero-tagline {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.45rem, 1.5vw, 0.7rem);
  color: #666;
  letter-spacing: 1px;
  margin-bottom: 2.5rem;
  text-transform: lowercase;
}

.hero-letter {
  max-width: 620px;
  text-align: left;
  border: 1px dashed #333;
  padding: 2rem 2.2rem;
  position: relative;
  background: #0e0e0e;
}

.hero-letter::before {
  content: 'readme.txt';
  position: absolute;
  top: -0.75rem;
  left: 1rem;
  background: #0a0a0a;
  padding: 0 0.5rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: #555;
}

.hero-letter p {
  margin-bottom: 1rem;
}

.hero-letter p:last-child {
  margin-bottom: 0;
}

.smiley {
  display: inline-block;
  transform: none;
  font-size: 1.1em;
}

.hero-sticker {
  position: absolute;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  padding: 0.35rem 0.7rem;
  border: 2px dashed #444;
  color: #888;
  pointer-events: none;
  white-space: nowrap;
}

.hero-sticker--2 {
  bottom: 7rem;
  right: 5%;
  transform: rotate(3deg);
}

.scroll-hint {
  margin-top: 2.5rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: #444;
  animation: bob 2s ease-in-out infinite;
  text-decoration: none;
  letter-spacing: 1px;
}

.scroll-hint:hover {
  color: #888;
}

.mc-bar {
  border-top: 1px dashed #222;
  border-bottom: 1px dashed #222;
  padding: 1.5rem;
  background: #0e0e0e;
  position: relative;
}

body.is-hot .mc-bar {
  box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.04);
}

body.is-critical .mc-bar {
  animation: bar-strobe 0.7s steps(2) infinite;
}

.mc-bar-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
}

.mc-bar-label {
  color: #666;
}

.mc-bar-value {
  color: #fff;
  font-size: 0.8rem;
}

body.is-critical .mc-bar-value {
  animation: value-glitch 0.18s steps(2) infinite;
}

.mc-bar-recovered {
  color: #555;
}

.mc-bar-next {
  color: #444;
  margin-left: auto;
}

body.is-hot .mc-bar-next {
  color: #ccc;
}

.mc-progress-track {
  max-width: 700px;
  margin: 0.8rem auto 0;
  height: 6px;
  background: #1a1a1a;
  border: 1px solid #222;
  overflow: hidden;
}

.mc-progress-fill {
  height: 100%;
  background: #fff;
  transition: width 0.6s ease;
}

body.is-hot .mc-progress-fill {
  animation: fill-pulse 0.9s ease-in-out infinite;
}

.mc-heat {
  max-width: 700px;
  margin: 0.6rem auto 0;
  min-height: 1rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: #888;
  letter-spacing: 1px;
}

.unlocks {
  padding: 4rem 1.5rem 7rem;
  max-width: 900px;
  margin: 0 auto;
}

.section-title {
  font-size: clamp(0.7rem, 2.5vw, 1rem);
  text-align: center;
  margin-bottom: 0.5rem;
  color: #fff;
}

.doodle-underline {
  position: relative;
  display: inline-block;
}

.doodle-underline::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: -4px;
  right: -4px;
  height: 3px;
  background: #fff;
  transform: rotate(-0.5deg);
  border-radius: 2px;
}

.section-sub {
  text-align: center;
  color: #555;
  margin-bottom: 3rem;
  font-size: 1.1rem;
}

.milestone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.milestone-card {
  border: 1px dashed #2a2a2a;
  background: #111;
  padding: 1.2rem;
  position: relative;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.milestone-card:hover {
  border-color: #444;
}

.milestone-card:nth-child(3n+1) { transform: rotate(-0.4deg); }
.milestone-card:nth-child(3n+2) { transform: rotate(0.3deg); }
.milestone-card:nth-child(3n)   { transform: rotate(-0.2deg); }
.milestone-card:nth-child(5n+1) { transform: rotate(0.5deg); }

.card-number {
  position: absolute;
  top: -0.5rem;
  right: 0.8rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  background: #0a0a0a;
  padding: 0.15rem 0.4rem;
  color: #555;
  border: 1px solid #2a2a2a;
}

.card-image {
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
  overflow: hidden;
}

.card-image.locked-img {
  background: #141414;
  border: 1px solid #1e1e1e;
}

.card-image.locked-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' 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)' opacity='0.08'/%3E%3C/svg%3E");
  background-size: 150px;
  animation: static-drift 0.3s steps(3) infinite;
}

.card-image.locked-img .lock-icon {
  position: relative;
  z-index: 1;
  color: #333;
  font-family: 'Press Start 2P', monospace;
  font-size: 1.1rem;
  user-select: none;
}

.card-image.unlocked-img {
  border: 2px solid #fff;
  background: #111;
}

.card-image.unlocked-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.milestone-card.unlocked {
  animation: unlock-land 0.7s cubic-bezier(0.2, 1.4, 0.3, 1);
}

.card-mc {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: #fff;
  margin-bottom: 0.3rem;
}

.card-name {
  font-size: 1.3rem;
  color: #888;
}

.card-name.locked-name {
  color: #333;
  letter-spacing: 3px;
}

.card-name.unlocked-name {
  color: #fff;
}

.card-hint {
  font-size: 1rem;
  color: #2a2a2a;
  margin-top: 0.2rem;
  font-style: italic;
}

.milestone-card.next-unlock .card-hint {
  color: #555;
}

.card-status {
  display: inline-block;
  margin-top: 0.6rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.35rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid;
}

.card-status.status-locked {
  color: #444;
  border-color: #2a2a2a;
}

.card-status.status-unlocked {
  color: #fff;
  border-color: #fff;
  animation: unlock-pulse 2s ease-in-out infinite;
}

.milestone-card.next-unlock {
  border-color: #444;
  border-style: solid;
}

.milestone-card.next-unlock .card-image.locked-img {
  border-color: #333;
}

.milestone-card.next-unlock .lock-icon {
  animation: wiggle 3s ease-in-out infinite;
}

.milestone-card.approaching {
  border-color: #aaa;
  box-shadow: 0 0 0 1px #fff, 0 0 24px rgba(255, 255, 255, 0.12);
  animation: approach-shake 0.5s linear infinite;
}

.milestone-card.approaching .card-image.locked-img::before {
  animation: static-drift 0.08s steps(2) infinite;
  opacity: 1;
}

.milestone-card.approaching .lock-icon {
  color: #ccc;
  animation: heartbeat 0.55s ease-in-out infinite;
}

.milestone-card.critical {
  border-color: #fff;
  animation: critical-slam 0.28s steps(2) infinite;
}

.milestone-card.critical .card-status {
  color: #fff;
  border-color: #fff;
}

.footer {
  border-top: 1px dashed #222;
  padding: 3rem 1.5rem 5rem;
  text-align: center;
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
}

.footer-ascii {
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  white-space: pre;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer-links a {
  color: #666;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 4px;
}

.footer-links a:hover {
  color: #fff;
}

.footer-divider {
  color: #333;
}

.footer-ca {
  color: #555;
  font-family: 'VT323', monospace;
}

.footer-copy {
  color: #333;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.footer-visitor {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.35rem;
  color: #2a2a2a;
  margin-top: 1rem;
}

.radio-wrap {
  position: fixed;
  left: 1.1rem;
  bottom: 2.6rem;
  z-index: 150;
  width: 300px;
}

.radio-note {
  position: absolute;
  top: -1.35rem;
  right: -1rem;
  z-index: 2;
  background: #fff;
  color: #000;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.42rem;
  line-height: 1.5;
  padding: 0.45rem 0.55rem;
  transform: rotate(8deg);
  border: 2px solid #000;
  box-shadow: 3px 3px 0 #000;
  pointer-events: none;
}

.radio {
  position: relative;
  width: 100%;
  background: #111;
  border: 2px solid #fff;
  padding: 0.7rem;
  font-family: 'Press Start 2P', monospace;
  box-shadow: 5px 5px 0 #000;
}

.radio-screen {
  background: #050505;
  border: 1px solid #333;
  box-shadow: inset 0 0 0 1px #1a1a1a;
  padding: 0.55rem 0.6rem 0.5rem;
  margin-bottom: 0.65rem;
}

.radio-screen-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.radio-live,
.radio-freq {
  font-size: 0.34rem;
  letter-spacing: 1px;
  color: #444;
}

.radio.playing .radio-live {
  color: #fff;
  animation: unlock-pulse 1.2s ease-in-out infinite;
}

.radio-track {
  font-size: 0.52rem;
  color: #fff;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radio-artist {
  font-size: 0.34rem;
  color: #777;
  margin: 0.28rem 0 0.45rem;
}

.radio-bar {
  height: 5px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
}

.radio-bar-fill {
  height: 100%;
  width: 0;
  background: #fff;
}

.radio-controls {
  display: grid;
  grid-template-columns: 44px 64px 1fr;
  gap: 0.45rem;
  align-items: center;
}

.radio-btn {
  height: 36px;
  background: #0a0a0a;
  border: 1px solid #fff;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.4rem;
  letter-spacing: 0.5px;
  padding: 0;
}

.radio-toggle {
  font-size: 0.7rem;
}

.radio-skip {
  font-size: 0.38rem;
}

.radio-btn:hover {
  background: #fff;
  color: #000;
}

.radio-vol {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  height: 36px;
  padding: 0 0.45rem;
  border: 1px solid #333;
  background: #0a0a0a;
}

.radio-vol span {
  font-size: 0.32rem;
  color: #888;
}

.radio-vol input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #222;
  border: 1px solid #444;
  outline: none;
  cursor: pointer;
}

.radio-vol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 14px;
  background: #fff;
  border: 0;
}

.radio-vol input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 14px;
  background: #fff;
  border: 0;
  border-radius: 0;
}

.radio-grill {
  margin-top: 0.55rem;
  height: 18px;
  background: repeating-linear-gradient(
    90deg,
    #1a1a1a 0,
    #1a1a1a 3px,
    #0a0a0a 3px,
    #0a0a0a 6px
  );
  border: 1px solid #222;
}

.ticker {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 140;
  overflow: hidden;
  border-top: 1px solid #1a1a1a;
  background: #080808;
  height: 1.5rem;
}

.ticker-track {
  white-space: nowrap;
  color: #333;
  font-size: 1rem;
  animation: ticker-move 28s linear infinite;
  padding: 0.15rem 0;
}

#unlock-fx {
  position: fixed;
  inset: 0;
  z-index: 18000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
}

#unlock-fx[hidden] {
  display: none;
}

.unlock-fx-static {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.18;
  animation: static-drift 0.06s steps(2) infinite;
  pointer-events: none;
}

.unlock-fx-body {
  position: relative;
  text-align: center;
  padding: 1rem;
}

.unlock-fx-kicker {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  letter-spacing: 2px;
  color: #888;
  margin-bottom: 1rem;
}

.unlock-fx-img {
  width: min(72vw, 340px);
  height: min(72vw, 340px);
  object-fit: contain;
  background: #111;
  border: 3px solid #fff;
  transform: scale(2.4);
  opacity: 0;
}

#unlock-fx.play .unlock-fx-img {
  animation: slam-in 0.55s cubic-bezier(0.12, 1.4, 0.3, 1) forwards;
}

.unlock-fx-name {
  margin-top: 1rem;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.55rem, 2.4vw, 0.9rem);
  color: #fff;
  opacity: 0;
}

#unlock-fx.play .unlock-fx-name {
  animation: name-in 0.4s ease 0.35s forwards;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@keyframes static-drift {
  0%   { background-position: 0 0; }
  33%  { background-position: 10px -15px; }
  66%  { background-position: -8px 12px; }
  100% { background-position: 5px -5px; }
}

@keyframes wiggle {
  0%, 80%, 100% { transform: rotate(0deg); }
  85% { transform: rotate(-8deg); }
  90% { transform: rotate(8deg); }
  95% { transform: rotate(-4deg); }
}

@keyframes unlock-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.25); }
}

@keyframes approach-shake {
  0%, 100% { transform: translate(0, 0) rotate(0.2deg); }
  25% { transform: translate(-1px, 0.5px) rotate(-0.3deg); }
  50% { transform: translate(1px, -0.5px) rotate(0.4deg); }
  75% { transform: translate(-0.5px, 0) rotate(-0.2deg); }
}

@keyframes critical-slam {
  0% { filter: none; }
  50% { filter: contrast(1.4) brightness(1.15); }
}

@keyframes slam-in {
  0% { transform: scale(2.6) rotate(-8deg); opacity: 0; filter: contrast(3) invert(0.2); }
  55% { transform: scale(0.92) rotate(1deg); opacity: 1; filter: none; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes name-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes unlock-land {
  0% { transform: scale(0.86); filter: brightness(3); }
  100% { transform: scale(1); filter: none; }
}

@keyframes screen-kick {
  0% { transform: translate(4px, -3px); }
  30% { transform: translate(-3px, 2px); }
  100% { transform: none; }
}

@keyframes gate-flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: 0.3; }
  95% { opacity: 1; }
  97% { opacity: 0.5; }
}

@keyframes scan-hot {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

@keyframes bar-strobe {
  0% { background: #0e0e0e; }
  50% { background: #161616; }
}

@keyframes value-glitch {
  0% { transform: translateX(0); }
  50% { transform: translateX(1px); }
}

@keyframes fill-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

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

@media (max-width: 600px) {
  .hero {
    padding: 4rem 1rem 2.5rem;
  }

  .hero-letter {
    padding: 1.5rem 1.2rem;
  }

  .hero-badge {
    top: 4rem;
    right: 1rem;
    font-size: 0.4rem;
  }

  .hero-sticker {
    display: none;
  }

  .milestone-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .mc-bar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .mc-bar-next {
    margin-left: 0;
  }

  .topnav {
    font-size: 0.45rem;
    padding: 0.6rem 1rem;
  }

  .radio-wrap {
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    bottom: 2.2rem;
  }
}

@media (max-width: 400px) {
  .milestone-grid {
    grid-template-columns: 1fr;
  }
}
