/* ============================================================
   HERO — the manuscript stage
   ============================================================ */

.hero {
  position: relative;
  padding-top: 140px;
  padding-bottom: 80px;
  min-height: 100vh;
  overflow: hidden;
}

/* extremely subtle warm vignette behind the hero */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 70% 30%, rgba(198,154,91,0.10), transparent 55%),
    radial-gradient(ellipse at 10% 80%, rgba(198,154,91,0.03), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.18fr);
  gap: clamp(40px, 5vw, 80px);
  align-items: start;
}

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Hero — left column (editorial title)
   ============================================================ */
.hero-left {
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.hero-dot {
  width: 3px; height: 3px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0.7;
}

.hero-title {
  font-family: var(--display);
  font-size: clamp(54px, 6vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  color: var(--fg);
}
.hero-title em {
  font-style: italic;
  color: var(--gold);
}

.hero-sub {
  max-width: 480px;
  color: var(--fg-soft);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 300;
}

/* topic input */
.hero-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  max-width: 540px;
  flex-wrap: wrap;
}
.hero-input {
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 18px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--ink-2);
  transition: border-color .2s var(--ease);
}
.hero-input:focus-within {
  border-color: var(--gold);
}
.input-prefix {
  color: var(--gold);
  font-size: 12px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.hero-input input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg);
}
.hero-input input::placeholder { color: var(--fg-mute); font-style: italic; }
.hero-input input:disabled { color: var(--fg-mute); }
.input-spin {
  width: 12px; height: 12px;
  border: 1.5px solid var(--gold);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.btn:disabled { opacity: 0.55; cursor: wait; }

.vp-ai-badge {
  color: var(--gold);
  letter-spacing: 0.22em;
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  animation: ai-pulse 2.4s var(--ease) infinite;
}
@keyframes ai-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.vp-loading {
  display: flex; flex-direction: column; gap: 18px;
  max-width: 460px;
  animation: fadeIn 0.4s var(--ease-out);
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.vp-loading-dots {
  display: inline-flex; gap: 6px; margin-top: 16px;
}
.vp-loading-dots span {
  width: 7px; height: 7px; background: var(--gold); border-radius: 50%;
  opacity: 0.3; animation: dots 1.4s var(--ease) infinite;
}
.vp-loading-dots span:nth-child(2) { animation-delay: 0.18s; }
.vp-loading-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes dots { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* topic chips */
.hero-chips {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.chips-label {
  color: var(--fg-mute);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-right: 4px;
}
.chip {
  font-family: var(--display);
  font-style: italic;
  font-size: 17px;
  line-height: 1.2;
  color: var(--fg-soft);
  padding: 6px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  transition: all .2s var(--ease);
  white-space: nowrap;
}
.chip:hover { border-color: var(--fg-mute); color: var(--fg); }
.chip.active {
  border-color: var(--gold);
  color: var(--gold);
}

/* hero spec strip */
.hero-specstrip {
  display: flex; align-items: stretch; gap: 28px;
  padding-top: 28px;
  margin-top: 8px;
  border-top: 1px solid var(--rule);
}
.spec { display: flex; flex-direction: column; gap: 6px; }
.spec-num {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--fg);
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.spec-num .mono {
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.12em;
  align-self: flex-end;
  padding-bottom: 4px;
}
.spec-num .serif-italic { font-style: italic; color: var(--gold); font-size: 18px; }
.spec-formats {
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--fg);
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1;
  white-space: nowrap;
}
.spec-formats .sep {
  font-style: italic;
  color: var(--gold);
  font-size: 22px;
  line-height: 1;
  opacity: 0.85;
  transform: translateY(-2px);
}
.spec-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.spec-rule { width: 1px; background: var(--rule); }

/* ============================================================
   Hero — right column (the manuscript viewport)
   ============================================================ */
.hero-right {
  position: relative;
  height: clamp(560px, 78vh, 760px);
}

.viewport {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--ink-2);
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 1px 0 rgba(232,226,210,0.04) inset,
    0 30px 60px -30px rgba(0,0,0,0.6),
    0 80px 120px -60px rgba(0,0,0,0.5);
}

/* hairline cross at corners — film grain marks */
.viewport::before, .viewport::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  border-color: var(--rule-strong);
  border-style: solid;
  pointer-events: none;
  z-index: 3;
}
.viewport::before { top: 14px; left: 14px; border-width: 1px 0 0 1px; }
.viewport::after  { bottom: 14px; right: 14px; border-width: 0 1px 1px 0; }

/* top status bar */
.vp-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--rule);
  background: var(--ink);
  font-size: 11px;
  gap: 16px;
}
.vp-top-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vp-top-right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.vp-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(198,154,91,0.18);
  animation: vp-dot-pulse 1.6s var(--ease) infinite;
}
.vp-dot[data-phase="done"] { animation: none; background: var(--gold-soft); box-shadow: none; }
@keyframes vp-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(198,154,91,0.18); }
  50% { box-shadow: 0 0 0 6px rgba(198,154,91,0.04); }
}
.vp-phase {
  color: var(--gold);
  letter-spacing: 0.22em;
  font-weight: 500;
  white-space: nowrap;
}
.vp-hint {
  color: var(--fg-mute);
  letter-spacing: 0.08em;
  font-size: 11px;
  text-transform: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.vp-stat { color: var(--fg-mute); display: inline-flex; align-items: baseline; gap: 0; white-space: nowrap; }
.vp-stat-num { color: var(--fg); font-variant-numeric: tabular-nums; }
.vp-stat-unit { color: var(--fg-mute); }

/* body: ToC + page */
.vp-body {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
}

/* ToC sidebar */
.vp-toc {
  padding: 24px 22px 24px 22px;
  border-right: 1px solid var(--rule);
  background: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.vp-toc-head {
  display: flex; justify-content: space-between;
  font-size: 10px; letter-spacing: 0.22em;
  color: var(--fg-mute);
}
.vp-toc-title {
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--fg);
  font-style: italic;
}
.vp-toc-sub {
  font-size: 10px;
  letter-spacing: 0.18em;
  margin-bottom: 6px;
}
.vp-toc-list {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  flex: 1;
  margin: 0 -22px;
  padding: 0 22px;
}
.vp-toc-list::-webkit-scrollbar { width: 0; }

.vp-toc-row {
  display: grid;
  grid-template-columns: 22px 1fr 18px;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dotted var(--rule);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.vp-toc-row.revealed { opacity: 1; transform: translateY(0); }
.vp-toc-row .row-num {
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.12em;
}
.vp-toc-row .row-title {
  font-family: var(--display);
  font-style: italic;
  font-size: 15px;
  color: var(--fg-soft);
  line-height: 1.2;
  letter-spacing: -0.005em;
}
.vp-toc-row.active .row-title { color: var(--fg); }
.vp-toc-row.done .row-title { color: var(--fg-mute); }
.vp-toc-row.done .row-num { color: var(--gold); }
.vp-toc-row.active .row-num { color: var(--gold); }

.row-status { display: flex; align-items: center; justify-content: flex-end; }
.row-check { color: var(--gold); font-size: 11px; font-family: var(--mono); }
.row-pending { color: var(--fg-faint); }
.row-spin {
  width: 9px; height: 9px;
  border: 1.5px solid var(--gold);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* main page */
.vp-page {
  padding: 40px clamp(28px, 4vw, 64px) 32px;
  overflow-y: auto;
  scroll-behavior: smooth;
  position: relative;
  background:
    linear-gradient(to bottom, var(--ink-2), var(--ink-3) 70%, var(--ink-2));
}
.vp-page::-webkit-scrollbar { width: 0; }

.vp-blueprint {
  display: flex; flex-direction: column; gap: 18px;
  max-width: 480px;
}
.vp-blueprint-title {
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.vp-blueprint-title em { color: var(--gold); font-style: italic; }

.blueprint-list {
  list-style: none;
  display: flex; flex-direction: column; gap: 0;
  margin-top: 12px;
  border-top: 1px solid var(--rule);
}
.blueprint-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
  color: var(--fg);
}
.blueprint-list li > span:first-child {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 10px;
}

/* chapter */
.vp-chapter {
  max-width: 520px;
  margin: 0 auto;
}
.vp-chapter-head { margin-bottom: 28px; }
.vp-chapter-num {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 14px;
}
.vp-chapter-title {
  font-size: clamp(34px, 3.4vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--fg);
  font-style: italic;
  margin-bottom: 18px;
}
.vp-chapter-rule {
  width: 48px;
  height: 1px;
  background: var(--gold);
  opacity: 0.6;
}

/* prose */
.vp-prose {
  font-family: "Instrument Serif", "Times New Roman", serif;
  font-size: 18.5px;
  line-height: 1.62;
  color: var(--fg);
  letter-spacing: 0;
  font-weight: 400;
}
.vp-para { margin-bottom: 1em; text-wrap: pretty; }
.vp-para-first { display: block; }
.vp-dropcap {
  float: left;
  font-size: 64px;
  font-style: italic;
  color: var(--gold);
  line-height: 0.85;
  padding-right: 10px;
  padding-top: 6px;
  margin-bottom: -4px;
}

.vp-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  background: var(--gold);
  vertical-align: -3px;
  margin-left: 1px;
  animation: caret 0.9s steps(2, end) infinite;
}
@keyframes caret { 0%,50% { opacity: 1; } 50.01%,100% { opacity: 0; } }

/* bottom bar */
.vp-bottom {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--rule);
  background: var(--ink);
  gap: 20px;
}
.vp-progress { flex: 1; display: flex; align-items: center; gap: 14px; min-width: 0; }
.vp-progress-track {
  flex: 1;
  height: 2px;
  background: var(--rule);
  position: relative;
  overflow: hidden;
}
.vp-progress-fill {
  height: 100%;
  background: var(--gold);
  transition: width .5s var(--ease);
}
.vp-progress-label {
  font-size: 11px;
  color: var(--fg);
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

.vp-controls { display: flex; align-items: center; gap: 12px; }
.vp-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  color: var(--fg);
  transition: all .15s var(--ease);
}
.vp-btn:hover { border-color: var(--gold); color: var(--gold); }
.vp-btn.active { background: var(--gold); color: var(--ink); border-color: var(--gold); }

.vp-btn-restart {
  width: auto;
  height: 28px;
  border-radius: 999px;
  padding: 0 12px;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.vp-tempo {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.tempo-btn {
  padding: 3px 7px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-soft);
  border: 1px solid transparent;
  border-radius: 4px;
  letter-spacing: 0.05em;
}
.tempo-btn:hover { color: var(--fg); }
.tempo-btn.active { color: var(--ink); background: var(--fg); }

/* bound badge */
.vp-bound-badge {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--ink);
  border: 1px solid var(--gold);
  padding: 22px 28px;
  border-radius: 6px;
  z-index: 4;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7);
  animation: badge-in .5s var(--ease-out) both;
}
@keyframes badge-in {
  from { opacity: 0; transform: translate(-50%, -42%) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.badge-inner { display: flex; flex-direction: column; gap: 14px; min-width: 320px; align-items: flex-start; }
.badge-stats {
  display: flex; gap: 18px;
  font-size: 12px;
  color: var(--fg-mute);
}
.badge-stats strong { color: var(--fg); font-weight: 500; }

/* small screens */
@media (max-width: 960px) {
  .hero-right { height: 600px; }
  .vp-body { grid-template-columns: 200px 1fr; }
}
@media (max-width: 720px) {
  .hero-right { height: 540px; }
  .vp-body { grid-template-columns: 1fr; }
  .vp-toc { border-right: none; border-bottom: 1px solid var(--rule); max-height: 180px; }
  .vp-toc-list { display: none; }
  .hero-specstrip { flex-wrap: wrap; gap: 14px; }
  .spec-rule { display: none; }
}
