:root {
  --bg: #000000;
  --fg-bright: #e8e8e8;
  --fg-mid: #888888;
  --fg-faint: #444444;
  --accent: #e7d61b;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg-mid);
  font-family: "JetBrains Mono", "Fira Code", "Courier New", monospace;
  overflow: hidden;
}

#screen {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 32px 16px;
  position: relative;
}

/* Scanline grain overlay */
#screen::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.02),
      rgba(255,255,255,0.02) 1px,
      transparent 1px,
      transparent 3px
    );
  pointer-events: none;
  z-index: 10;
  mix-blend-mode: overlay;
}

#canvas {
  font-family: "JetBrains Mono", "Cascadia Mono", "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 18px;
  line-height: 1.0;
  letter-spacing: 0;
  color: #e6e6e6;
  white-space: pre;
  margin: 0;
  display: block;

  /* Crispness stack — ANSI Shadow glyphs already carry their own shadow,
     so we kill every browser feature that would smear or antialias them
     against a clean grid. */
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0, "dlig" 0;
  font-kerning: none;
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  transform: translateZ(0);
  text-shadow: none;

  /* Soft outer bloom via filter — no per-glyph smearing */
  filter: drop-shadow(0 0 10px rgba(230, 230, 230, 0.15));
  transition: filter 300ms ease, opacity 300ms ease, transform 500ms ease;
}

#screen { position: relative; }

/* ── EXIT ANIMATION ─────────────────────────────────────────────── */
/* Triggered when body gets .exiting (on ENTER BARKROOMS click). */
body.exiting #canvas {
  animation: canvas-exit 620ms steps(6, end) forwards;
}
body.exiting #hero-meta {
  animation: meta-exit 420ms ease forwards;
}

@keyframes canvas-exit {
  0%   { transform: translateZ(0) scale(1);       opacity: 1; filter: drop-shadow(0 0 10px rgba(230,230,230,0.15)); }
  20%  { transform: translateZ(0) scale(1.015);   opacity: 1; filter: drop-shadow(0 0 14px rgba(230,230,230,0.35)) brightness(1.25); }
  50%  { transform: translateZ(0) scale(0.995);   opacity: 0.85; filter: drop-shadow(0 0 10px rgba(230,230,230,0.25)) contrast(1.2); }
  80%  { transform: translateZ(0) scale(1.01);    opacity: 0.35; filter: blur(2px) brightness(0.6); }
  100% { transform: translateZ(0) scale(1.05);    opacity: 0;    filter: blur(6px) brightness(0.2); }
}

@keyframes meta-exit {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(4px); }
}

.hidden { display: none !important; }

#hero-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  opacity: 0;
  transition: opacity 900ms ease;
}

#hero-meta.visible { opacity: 1; }

#title {
  font-family: inherit;
  font-size: 20px;
  font-weight: normal;
  color: var(--fg-bright);
  letter-spacing: 6px;
  text-shadow: 0 0 2px rgba(232,232,232,0.35);
}

#eyebrow {
  font-family: inherit;
  font-size: 11px;
  color: var(--fg-mid);
  letter-spacing: 8px;
  text-transform: uppercase;
  text-align: center;
  padding: 0 0 0 8px; /* compensate for the trailing letter-spacing so it optically centers */
  margin-bottom: 14px;
  opacity: 0.55;
  font-feature-settings: "tnum";
  text-shadow: 0 0 6px rgba(232, 232, 232, 0.08);
}

#tagline {
  color: var(--fg-mid);
  font-size: 13px;
  letter-spacing: 2px;
}

#button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

#enter-btn {
  font-family: inherit;
  font-size: 15px;
  color: var(--fg-bright);
  text-decoration: none;
  padding: 10px 22px;
  border: 1px solid var(--fg-bright);
  letter-spacing: 2px;
  transition: all 120ms ease;
  background: transparent;
  text-shadow: 0 0 2px rgba(232,232,232,0.4);
}

#enter-btn:hover,
#enter-btn:focus {
  background: var(--fg-bright);
  color: var(--bg);
  text-shadow: none;
  outline: none;
}

/* ── Top-right social link ─────────────────────────────────── */
#social {
  position: fixed;
  top: 22px;
  right: 26px;
  z-index: 20;
  color: var(--fg-mid);
  text-decoration: none;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 6px 4px;
  transition: color 160ms ease, text-shadow 160ms ease;
}

#social .bracket { color: var(--fg-faint); }
#social .label   { color: var(--fg-mid); }
#social .x       {
  color: var(--fg-bright);
  font-weight: 600;
  font-size: 14px;
  text-shadow: 0 0 2px rgba(232,232,232,0.4);
}

#social:hover,
#social:focus {
  outline: none;
}
#social:hover .bracket,
#social:focus .bracket { color: var(--fg-bright); }
#social:hover .label,
#social:focus .label   { color: var(--fg-bright); }
#social:hover .x,
#social:focus .x       {
  text-shadow: 0 0 4px rgba(232,232,232,0.8), 0 0 10px rgba(232,232,232,0.35);
}

#cursor {
  color: var(--fg-bright);
  font-size: 16px;
  animation: blink 1.1s steps(2) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 900px) {
  #canvas { font-size: 14px; }
}
@media (max-width: 640px) {
  #canvas { font-size: 10px; }
  #enter-btn { font-size: 13px; padding: 8px 16px; }
}
