@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --bg: #0a0a0f;
  --fg: #f4f4f8;
  --accent: #7cfcae;
  --accent-2: #ff4fd8;
  --muted: #8a8a99;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  overflow-x: hidden;
}

.chapter {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.chapter-title {
  font-size: clamp(3rem, 12vw, 8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.chapter-subtitle {
  margin-top: 1rem;
  font-size: clamp(1rem, 2vw, 1.5rem);
  color: var(--muted);
}

.js .chapter-title,
.js .chapter-subtitle {
  opacity: 0;
  animation: chapter-in 1s ease-out forwards;
}

.js .chapter-subtitle {
  animation-delay: 0.4s;
}

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

.chapter-line {
  max-width: 900px;
  font-size: clamp(2rem, 7vw, 4.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.word {
  display: inline-block;
}

.js .word {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.word.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.accent-word {
  color: var(--accent);
  text-shadow: 0 0 24px rgba(124, 252, 174, 0.45);
}

.scroll-cue {
  position: absolute;
  bottom: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: bob 2s ease-in-out infinite;
}

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

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  padding: 4rem 2rem 8rem;
  max-width: 1100px;
  margin: 0 auto;
}

.tile {
  display: block;
  text-decoration: none;
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.03);
}

.js .tile {
  opacity: 0;
  transform: translateY(30px);
}

.tile.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.tile:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-4px);
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.tile-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tile-desc {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.fallback-message {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.back-link {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  color: var(--fg);
  text-decoration: none;
  font-size: 0.9rem;
  z-index: 10;
  opacity: 0.7;
}

.back-link:hover {
  opacity: 1;
}
