@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/vt323-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/vt323-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/press-start-2p-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/press-start-2p-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --dirt-dark: #4a2f1c;
  --dirt: #6b4527;
  --dirt-light: #8a5a36;
  --cave-dark: #1c1a17;
  --cave: #2b2722;
  --cave-mid: #3a352e;
  --cave-light: #55503f;
  --rock-dark: #4a4a4a;
  --rock: #6e6e6e;
  --rock-light: #9a9a9a;
  --lava-dark: #8a1a0c;
  --lava: #d83920;
  --lava-glow: #ff6a2c;
  --moss: #4a6b2f;
  --moss-light: #7a9a4a;
  --bone: #e8dcc4;
  --ink: #f4ecd8;
  --ink-muted: #b8ad94;
  --line: #2a2620;
  --shadow: 0 2px 0 #00000040, 0 6px 18px #00000060;
  --pixel-font: "VT323", "Courier New", monospace;
  --display-font: "Press Start 2P", monospace;
  --body-font: "Inter", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  background: var(--cave-dark);
  color: var(--ink);
  font-family: var(--body-font);
  background-image:
    radial-gradient(circle at 20% 30%, #3a352e55 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, #3a352e55 0%, transparent 40%),
    repeating-linear-gradient(45deg, #1c1a17 0 8px, #15130f 8px 16px),
    repeating-linear-gradient(-45deg, transparent 0 12px, #0a0907 12px 24px);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Ember canvas ─────────────────────────────────── */
#embers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* ─── Hero ─────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 2;
  padding: 40px 20px;
}

/* lava glow strip at bottom of hero */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 180px;
  background: linear-gradient(180deg, transparent 0%, var(--lava-dark) 50%, var(--lava) 85%, var(--lava-glow) 100%);
  opacity: 0.12;
  pointer-events: none;
  animation: lava-pulse 4s ease-in-out infinite;
}

@keyframes lava-pulse {
  0%, 100% { opacity: 0.10; height: 180px; }
  50%      { opacity: 0.20; height: 200px; }
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-logo {
  width: clamp(76px, 12vw, 112px);
  height: auto;
  display: block;
  margin: 0 auto 20px;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.55)) drop-shadow(0 0 20px rgba(0, 0, 0, 0.45));
}

.hero-title {
  font-family: var(--display-font);
  font-size: clamp(20px, 4.5vw, 40px);
  color: var(--bone);
  text-shadow:
    3px 3px 0 #000,
    0 0 30px var(--lava-glow),
    0 0 60px var(--lava-dark);
  letter-spacing: 1px;
  margin-bottom: 20px;
  line-height: 1.4;
  white-space: nowrap;
  animation: title-flicker 5s ease-in-out infinite;
}

@keyframes title-flicker {
  0%, 100% {
    text-shadow:
      3px 3px 0 #000,
      0 0 30px var(--lava-glow),
      0 0 60px var(--lava-dark);
  }
  48% {
    text-shadow:
      3px 3px 0 #000,
      0 0 22px var(--lava-glow),
      0 0 45px var(--lava-dark);
  }
  52% {
    text-shadow:
      3px 3px 0 #000,
      0 0 35px var(--lava-glow),
      0 0 70px var(--lava-dark);
  }
}

.hero-tagline {
  font-family: var(--pixel-font);
  font-size: clamp(18px, 3vw, 24px);
  color: var(--ink-muted);
  margin-bottom: 36px;
  letter-spacing: 0.5px;
}

.hero-enter {
  font-family: var(--display-font);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 16px 28px;
  background: var(--lava);
  color: var(--bone);
  border: 3px solid var(--lava-dark);
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 4px 0 #00000060;
  transition: transform 100ms, box-shadow 100ms, background 150ms;
}

.hero-enter:hover  { background: var(--lava-glow); }
.hero-enter:active { transform: translateY(3px); box-shadow: 0 1px 0 #00000060; }

/* scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-muted);
  animation: bounce 2s ease-in-out infinite;
  z-index: 2;
}
.scroll-indicator svg { width: 24px; height: 24px; }

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(10px); }
}

/* ─── Navigation Section ───────────────────────────── */
.nav-section {
  padding: 90px 24px 60px;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.section-title {
  font-family: var(--display-font);
  font-size: clamp(14px, 3vw, 20px);
  color: var(--bone);
  text-align: center;
  margin-bottom: 48px;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 #000;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

/* ─── Cards ────────────────────────────────────────── */
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(180deg, var(--cave) 0%, var(--cave-dark) 100%);
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
  padding: 32px 20px;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: transform 150ms, border-color 150ms, box-shadow 150ms;
}

/* Cards start hidden ONLY when JS is on (progressive enhancement).
   Without JS (or on JS error) they stay visible — content is never lost. */
html.js .card {
  opacity: 0;
  transform: translateY(30px);
}

html.js .card.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 600ms ease-out, transform 600ms ease-out,
              border-color 150ms, box-shadow 150ms;
}

/* active (clickable) card */
.card-active { cursor: pointer; }

.card-active:hover {
  transform: translateY(-5px);
  border-color: var(--lava);
  box-shadow: 0 0 24px #ff6a2c44, 0 8px 0 #00000060;
}

.card-active:active {
  transform: translateY(-2px);
}

/* coming-soon card — sneak peek: full card (icon+title+desc) soft-blurred,
   "Coming Soon" badge pinned at the bottom like the active card */
.card-soon {
  position: relative;
  align-items: center;
  min-height: 200px;
  opacity: 0.7;
  padding: 24px 20px 20px;
}

/* sneak-peek content — readable but soft focus so the card is clearly locked */
.card-soon-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  filter: blur(2px) saturate(0.85);
  pointer-events: none;
  user-select: none;
}

.card-soon.revealed {
  opacity: 0.7;
}

html.js .card-soon.revealed {
  opacity: 0.7;
}

/* badge sits in normal flow at the bottom (like .status-active on the active card) */
.card-soon .card-status {
  margin-top: 14px;
  align-self: center;
}

/* empty coming-soon card — just the badge, centered */
.card-soon-empty {
  justify-content: center;
}
.card-soon-empty .card-status {
  margin-top: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--cave-dark);
  box-shadow: 0 0 0 6px var(--cave-dark);
}

.card-soon:hover {
  opacity: 0.85;
  border-color: var(--cave-light);
}

/* card icon */
.card-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cave-dark);
  border: 2px solid var(--cave-light);
}

.card-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--ink-muted);
}

.card-active .card-icon svg {
  stroke: var(--lava-glow);
}

.card-active:hover .card-icon {
  border-color: var(--lava);
  background: var(--dirt-dark);
}

/* card text */
.card h3 {
  font-family: var(--display-font);
  font-size: 11px;
  color: var(--bone);
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.card p {
  font-family: var(--pixel-font);
  font-size: 16px;
  color: var(--ink-muted);
  line-height: 1.35;
  margin-bottom: 20px;
  flex: 1;
}

/* card status badge */
.card-status {
  font-family: var(--display-font);
  font-size: 8px;
  padding: 5px 12px;
  border: 2px solid;
  letter-spacing: 0.5px;
}

.status-active {
  color: var(--moss-light);
  border-color: var(--moss);
  background: rgba(74, 107, 47, 0.15);
}

.status-soon {
  color: var(--ink-muted);
  border-color: var(--cave-light);
}

/* ─── Footer ───────────────────────────────────────── */
footer {
  text-align: center;
  padding: 40px 20px;
  position: relative;
  z-index: 2;
  border-top: 3px solid var(--line);
  margin-top: 40px;
  background: var(--cave-dark);
}

footer p {
  font-family: var(--pixel-font);
  font-size: 15px;
  color: var(--ink-muted);
  letter-spacing: 0.5px;
}

.footer-credit {
  margin-bottom: 4px;
}

/* ─── Discord credit card ──────────────────────────── */
.discord-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: linear-gradient(180deg, var(--cave) 0%, var(--cave-dark) 100%);
  border: 2px solid var(--cave-light);
  color: var(--ink-muted);
  font-family: var(--pixel-font);
  font-size: 17px;
  text-decoration: none;
  margin-top: 14px;
  transition: border-color 150ms, color 150ms, transform 100ms;
  box-shadow: 0 3px 0 #00000040;
}

.discord-card:hover {
  border-color: #5865F2;
  color: var(--bone);
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #00000040;
}

.discord-card:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #00000040;
}

.discord-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: color 150ms;
}

.discord-card:hover .discord-icon {
  color: #5865F2;
}

/* ─── Responsive ───────────────────────────────────── */
@media (max-width: 600px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
  .nav-section {
    padding: 60px 16px 40px;
  }
}

/* narrow screens — keep the pixel title inside the viewport.
   white-space:normal lets it wrap at the space instead of overflowing;
   font drops to 16px so it stays on one line up to ~420px. The wrap rule
   extends to 520px because the 20px clamp-min line can overflow between
   380-520px on a longer title (e.g. "ROTOPIA HELPER"). */
@media (max-width: 520px) {
  .hero-title { white-space: normal; line-height: 1.4; }
}
@media (max-width: 420px) {
  .hero-title { font-size: 16px; letter-spacing: 0.5px; }
  .hero-enter { padding: 14px 18px; font-size: 11px; }
}

/* keyboard focus visibility for clickable cards */
a.card:focus-visible { outline: 2px solid var(--lava); outline-offset: 2px; }
.hero-enter:focus-visible { outline: 2px solid var(--lava-glow); outline-offset: 3px; }

/* ─── Reduced motion ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-title, .hero::after, .scroll-indicator { animation: none !important; }
}
