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

:root {
  --ink: rgba(28, 24, 20, 0.92);
  --ink-shadow: rgba(28, 24, 20, 0.04);
  --ink-chroma: rgba(80, 40, 100, 0.12);
  --ink-highlight: rgba(255, 255, 255, 0.055);
  --text-primary: #1c1814;
  --text-muted: #9a968f;
  --text-hint: #c2bdb5;
  --border-soft: #e0dbd3;
  --bg: #faf9f7;
  --font-sans: system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

#wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 40px;
  position: relative;
}

/* Only lock overflow when the page requests it via the `no-scroll` body class */
.no-scroll #wrap {
  overflow: hidden;
  touch-action: none;
}

/* ── Stage ── */

#stage {
  position: relative;
  width: 560px;
  height: 420px;
  cursor: crosshair;
  max-width: 100%;
}

#blot,
#ripple-c {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#ripple-c {
  pointer-events: none;
}

/* ── Labels ── */

#label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 560px;
  max-width: 100%;
  margin-top: 18px;
}

#card-num,
#card-title {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Card navigation dots ── */

#cards-nav {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-soft);
  cursor: pointer;
  transition: background 0.25s ease;
}

.nav-dot.active,
.nav-dot:hover {
  background: var(--text-primary);
}

/* ── Scroll hint ── */

#scroll-hint {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-hint);
  margin-top: 14px;
  transition: opacity 0.6s ease;
  user-select: none;
}

/* ── Question input ── */

#question-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

#question-row.show {
  opacity: 1;
  pointer-events: all;
}

#q-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#q-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-primary);
  font-size: 18px;
  font-family: var(--font-serif);
  font-style: italic;
  text-align: center;
  width: 320px;
  max-width: 90vw;
  outline: none;
  padding: 6px 0;
  caret-color: var(--text-primary);
  transition: border-color 0.2s ease;
}

#q-input::placeholder {
  color: var(--text-hint);
  font-style: italic;
}

#q-input:focus {
  border-bottom-color: var(--text-muted);
}

/* ── Echo words ── */

#echo-area {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.echo {
  position: absolute;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-hint);
  opacity: 0;
  animation: floatEcho 14s ease-in-out forwards;
  white-space: nowrap;
  font-family: var(--font-serif);
  font-style: italic;
  user-select: none;
}

@keyframes floatEcho {
  0%   { opacity: 0; transform: translateY(6px); }
  8%   { opacity: 0.55; }
  80%  { opacity: 0.35; }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* ── Responsive ── */

@media (max-width: 600px) {
  #stage {
    width: 100%;
    height: 300px;
  }
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  .echo {
    animation: none;
    opacity: 0;
  }
  #question-row {
    transition: none;
  }
}
