/* intima — poem-focused reading view (layered over app.css) */

/* ---------------- scrim: a quiet spotlight behind the poem ---------------- */

#scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* fades only directly behind the text column — the constellation stays
     faintly visible as the backdrop everywhere else */
  background: radial-gradient(ellipse 56% 66% at 50% 46%,
    rgba(4, 5, 9, 0.66) 0%,
    rgba(4, 5, 9, 0.38) 48%,
    rgba(4, 5, 9, 0.05) 82%,
    rgba(4, 5, 9, 0) 100%);
}

#field { z-index: 0; }
#topbar, #hud { z-index: 20; }

/* ---------------- the poem hero ---------------- */

#hero {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  pointer-events: none;
  padding: 72px 24px 150px;
}

#poem-card {
  max-width: 560px;
  max-height: 100%;
  overflow-y: auto;
  pointer-events: auto;
  padding: 30px 38px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 480ms cubic-bezier(0.4, 0.0, 0.2, 1),
              transform 480ms cubic-bezier(0.4, 0.0, 0.2, 1);
}
#poem-card.filled, #hero.filled #poem-card { opacity: 1; transform: none; }

#hero-viz {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(216, 178, 106, 0.4);
  box-shadow: 0 0 34px rgba(216, 178, 106, 0.16);
  margin-bottom: 18px;
  display: block;
}

.hero-coll {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

#hero-title {
  font-size: clamp(30px, 4.6vw, 44px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.15;
  margin-bottom: 20px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.7);
}

#hero-body {
  font-family: var(--serif);
  font-size: 18.5px;
  line-height: 1.95;
  white-space: pre-wrap;
  color: var(--ink);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8);
}

/* long poems scroll inside the card — keep the scrollbar nearly invisible */
#poem-card {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}
#poem-card::-webkit-scrollbar { width: 5px; }
#poem-card::-webkit-scrollbar-track { background: transparent; }
#poem-card::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

/* ---------------- nearest-poems rail ---------------- */

#rail {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  padding: 14px 20px 16px;
  background: linear-gradient(rgba(5, 6, 10, 0) 0%, rgba(5, 6, 10, 0.88) 42%);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 480ms cubic-bezier(0.4, 0.0, 0.2, 1),
              transform 480ms cubic-bezier(0.4, 0.0, 0.2, 1);
  pointer-events: none;
}
#rail.filled { opacity: 1; transform: none; }
#rail.filled .rail-row { pointer-events: auto; }

#rail h2 {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.rail-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.rail-row::-webkit-scrollbar { display: none; }

.rail-card {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 12, 18, 0.66);
  backdrop-filter: blur(8px);
  opacity: 0.78;
  transition: opacity 0.25s, border-color 0.25s, transform 0.25s;
}
.rail-card:hover {
  opacity: 1;
  border-color: var(--accent-soft);
  transform: translateY(-2px);
}
.rail-card img { width: 34px; height: 34px; border-radius: 50%; }
.rail-title {
  font-style: italic;
  font-size: 13.5px;
  color: var(--ink);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- axis strip (right edge) ---------------- */

#axis-strip {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  width: 190px;
  opacity: 0;
  transition: opacity 480ms cubic-bezier(0.4, 0.0, 0.2, 1);
  pointer-events: none;
}
#axis-strip.filled { opacity: 1; }

#axis-strip h2 {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
  text-align: center;
}

.as-row {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}
.as-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  text-align: center;
}
.as-label:first-child { text-align: right; }
.as-track {
  position: relative;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
}
.as-dot {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(216, 178, 106, 0.7);
}

/* ---------------- quiet chrome ---------------- */

.theme-reading #topbar {
  background: linear-gradient(rgba(5, 6, 10, 0.75), rgba(5, 6, 10, 0));
}
.theme-reading .brand a {
  color: var(--ink);
  text-decoration: none;
}
.theme-reading .brand a:hover { color: var(--accent); }
.brand a { text-decoration: none; color: inherit; }
.brand a:hover { color: var(--accent); }

.hud-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  align-self: center;
}

.theme-reading #hud { bottom: 118px; } /* above the rail */

/* field nodes sit fully behind the poem stage */
.theme-reading #field { z-index: 0; }

/* ---------------- small screens ---------------- */

@media (max-width: 720px) {
  #hero { padding: 64px 16px 190px; }
  #poem-card { padding: 20px 20px; }
  #hero-body { font-size: 16.5px; }
  #axis-strip { display: none; }
  #rail .rail-title { max-width: 110px; }
}
