/* ============ WAVE 39 — THE SPOKEN INDEX ============
 * The archive's speech behind one query; results that SPEAK. The motion
 * grammar is the house's: staggered spring arrivals, glass fields, the
 * flare answering the query, and words illuminating as the voice plays
 * the exact second. All of it dies cleanly under reduced motion. */

.spoken-page { max-width: 860px; margin: 0 auto; padding: clamp(28px, 6vw, 72px) 20px 120px; }
.spoken-hero .kicker { letter-spacing: 0.22em; font-size: 11px; text-transform: uppercase; }
.spoken-hero h1 { margin: 10px 0 8px; }
.spoken-sub { color: #9cc0ac; font-size: 15px; max-width: 560px; }

.spoken-form { display: flex; gap: 10px; margin-top: 26px; }
.spoken-inputwrap { position: relative; flex: 1 1 auto; }
.spoken-input {
  width: 100%; box-sizing: border-box;
  background: rgb(6 17 12 / 0.7); color: #eef7f1;
  border: 1px solid rgb(138 200 160 / 0.4); border-radius: 999px;
  padding: 14px 22px; font-size: 16px; outline: none;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.spoken-input:focus { border-color: rgb(143 227 180 / 0.85); box-shadow: 0 0 0 4px rgb(143 227 180 / 0.12); }
.spoken-input::placeholder { color: rgb(167 216 187 / 0.5); }
.spoken-go {
  flex: none; border-radius: 999px; border: 1px solid rgb(224 133 133 / 0.55);
  background: rgb(224 133 133 / 0.16); color: #ffd9d9;
  padding: 0 26px; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .2s ease, transform .15s ease;
}
.spoken-go:hover { background: rgb(224 133 133 / 0.26); }
.spoken-go:active { transform: scale(0.96); }

/* the flare: a thin signal line under the query, answering every keystroke */
.spoken-flare {
  position: absolute; left: 22px; right: 22px; bottom: -2px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgb(143 227 180 / 0.9), transparent);
  transform: scaleX(0); opacity: 0;
  transition: transform .3s cubic-bezier(.2,.9,.3,1), opacity .3s ease;
}
.spoken-flare.is-answering { transform: scaleX(1); opacity: 1; }

.spoken-count { margin: 34px 0 14px; color: #9cc0ac; font-size: 13px; letter-spacing: 0.04em; }
.spoken-ms { opacity: 0.6; font-variant-numeric: tabular-nums; margin-left: 8px; }

/* ---- THE HITS: staggered arrival, glass cards, the read progress ---- */
.spoken-hit {
  --read: 0;
  position: relative;
  border: 1px solid rgb(138 200 160 / 0.22);
  background: linear-gradient(180deg, rgb(10 24 17 / 0.82), rgb(6 15 11 / 0.9));
  border-radius: 18px; overflow: hidden;
  margin: 0 0 14px;
  animation: spoken-in .55s cubic-bezier(.18,.9,.24,1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes spoken-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.spoken-hit::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, rgb(143 227 180 / 0.9), rgb(255 196 110 / 0.9));
  transform: scaleY(var(--read)); transform-origin: top;
  transition: transform .2s linear;
}
.spoken-say {
  display: grid; grid-template-columns: auto auto 1fr; gap: 14px; align-items: start;
  width: 100%; text-align: start; background: none; border: 0; cursor: pointer;
  padding: 16px 18px 10px; color: inherit; font: inherit;
}
.spoken-face {
  width: 48px; height: 48px; border-radius: 12px; overflow: hidden; flex: none;
  border: 1px solid rgb(138 200 160 / 0.3); display: grid; place-items: center;
  background: rgb(6 17 12 / 0.8);
}
.spoken-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spoken-face-fallback { color: #7fb99a; font-size: 20px; }
.spoken-tc {
  font-size: 11px; color: #ffd0a0; background: rgb(255 196 110 / 0.1);
  border: 1px solid rgb(255 196 110 / 0.3); border-radius: 7px;
  padding: 3px 8px; height: fit-content; white-space: nowrap;
  font-variant-numeric: tabular-nums; flex: none;
}
.spoken-words { font-family: Georgia, 'Times New Roman', serif; font-size: 17px; line-height: 1.65; color: #c9dcd0; }
.spoken-words b { font-weight: inherit; transition: color .18s ease, text-shadow .25s ease; }
/* THE VOICE'S PATH: spoken words glow as the archive says them */
.spoken-words b.is-lit { color: #f2fbf5; text-shadow: 0 0 14px rgb(143 227 180 / 0.45); }
.spoken-hit.is-speaking { border-color: rgb(143 227 180 / 0.55); }
.spoken-hit.is-speaking .spoken-tc { background: rgb(143 227 180 / 0.16); border-color: rgb(143 227 180 / 0.5); color: #c9f2da; }

.spoken-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 6px 18px 14px 80px; font-size: 12px; color: #8fae9b;
}
.spoken-meta a { color: #9fe6b8; text-decoration: none; }
.spoken-meta a:hover { text-decoration: underline; }
.spoken-actions { margin-left: auto; display: flex; gap: 6px; }
.spoken-quote, .spoken-mint {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  border: 1px solid rgb(138 200 160 / 0.3); background: rgb(6 17 12 / 0.6);
  color: #9fe6b8; text-decoration: none; font-size: 15px; cursor: pointer;
  transition: background .18s ease, transform .15s ease;
}
.spoken-quote:hover, .spoken-mint:hover { background: rgb(143 227 180 / 0.14); }
.spoken-mint:active, .spoken-quote:active { transform: scale(0.92); }
.spoken-mint.is-minted { color: #ffd98f; border-color: rgb(255 196 110 / 0.5); }

@media (max-width: 640px) {
  .spoken-form { flex-direction: column; }
  .spoken-go { padding: 13px 26px; }
  .spoken-say { grid-template-columns: auto 1fr; }
  .spoken-tc { grid-column: 2; justify-self: start; }
  .spoken-words { grid-column: 2; }
  .spoken-face { grid-row: 1 / span 2; }
  .spoken-meta { padding-left: 18px; }
}

/* touch targets and honest motion */
@media (pointer: coarse) {
  .spoken-quote, .spoken-mint { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .spoken-hit { animation: none; }
  .spoken-flare { display: none; }
  .spoken-words b, .spoken-words b.is-lit { transition: none; }
  .spoken-hit::before { transition: none; }
}
