/* ═══════ SCRAWLS PAGE ═══════ */
:root {
  --rule: rgba(145,145,145,0.12);
}

body {
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

/* ═══════ BACK LINK (fixed position override) ═══════ */
.back-link {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 10;
}

/* ═══════ PAGE LAYOUT ═══════ */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem 4rem;
}

/* ═══════ PAGE TITLE ═══════ */
.page-title {
  font-family: 'Azeret Mono', monospace;
  font-weight: 500;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--fg-bright);
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeIn 1.5s ease 0.3s both;
  text-align: center;
}

/* ═══════ SUMMON LINK ═══════ */
.summon-link {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  color: var(--muted);
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.4s ease, text-shadow 0.4s ease;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeIn 1.5s ease 0.8s both;
  user-select: none;
  text-align: center;
}

.summon-link:hover {
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
}

.summon-link.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* ═══════ BLACKOUT HINT ═══════ */
.blackout-hint {
  font-family: 'Azeret Mono', monospace;
  font-size: clamp(0.7rem, 1.3vw, 0.8rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
  text-align: center;
  opacity: 0;
  transition: opacity 1.5s ease;
  max-width: 550px;
  line-height: 1.8;
}

.blackout-hint.visible { opacity: 1; }

.blackout-hint em {
  color: var(--accent);
  font-style: normal;
}

/* ═══════ NOTEPAD ═══════ */
.notepad {
  position: relative;
  width: min(92vw, 700px);
  min-height: 400px;
  background: transparent;
  padding: 0.5rem 2rem 2rem;
  opacity: 0;
  animation: fadeIn 1.5s ease 1s both;
}

.notepad-rules {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 35px,
    var(--rule) 35px,
    var(--rule) 36px
  );
}

/* ═══════ POEM CONTENT ═══════ */
.poem-title {
  font-family: 'Azeret Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.75rem 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  position: relative;
  z-index: 2;
}

.poem-title.visible { opacity: 1; }

.poem-body {
  position: relative;
  z-index: 2;
  padding: 0.25rem 0 1rem;
}

.poem-line-wrap {
  min-height: 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
  padding: 1px 0;
  line-height: 36px;
}

.poem-word {
  font-family: 'Caveat', cursive;
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2rem);
  color: var(--fg);
  cursor: pointer;
  padding: 2px 5px;
  margin: 0 1px;
  border-radius: 2px;
  transition: color 0.15s ease, background 0.15s ease;
  position: relative;
  user-select: none;
  display: inline-block;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(4px);
}

.poem-word.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease, color 0.15s ease, background 0.15s ease;
}

.poem-word:hover:not(.blacked-out) {
  color: var(--accent);
}

.poem-word.blacked-out {
  background: var(--bg);
  color: var(--bg);
  cursor: default;
  border-radius: 1px;
}

.poem-word.blacked-out::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: var(--bg);
  border-radius: 1px;
  z-index: -1;
}

/* ═══════ CONTROLS ═══════ */
.controls {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  justify-content: center;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

.controls.visible {
  opacity: 1;
  pointer-events: auto;
}

.control-btn {
  font-family: 'Azeret Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg);
  background: none;
  border: 1px solid var(--muted);
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.control-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ═══════ SCANLINE (z-index override) ═══════ */
.scanline {
  z-index: 9998;
}

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 600px) {
  .notepad { padding: 0.5rem 1rem 2rem; width: 96vw; }
  .poem-body { padding-left: 0.25rem; }
  .poem-title { padding-left: 0.25rem; }
  .back-link { top: 1rem; left: 1rem; }
  .page-title { margin-bottom: 1.5rem; }
}
