/* ══════════════════════════════════════════════
   EthnoVault — custom layer
   Tailwind handles layout; this file handles the
   hand-made details: seals, waveforms, map, modals.
   ══════════════════════════════════════════════ */

:root {
  --forest-950: #101a10;
  --forest-900: #1b2a19;
  --forest-600: #37552f;
  --terracotta: #c4674a;
  --sand: #faf8f5;
  --cream: #f4eee4;
}

* { -webkit-tap-highlight-color: transparent; }
html { scroll-padding-top: 90px; }
body { text-rendering: optimizeLegibility; }
[hidden] { display: none !important; }

::selection { background: #ebbfa9; color: #101a10; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(27, 42, 25, 0.18); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(27, 42, 25, 0.3); background-clip: content-box; }
.dark ::-webkit-scrollbar-thumb { background: rgba(244, 238, 228, 0.18); background-clip: content-box; }

/* ── Grain ─────────────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.dark .grain { opacity: 0.055; }

/* ── Accessibility ─────────────────────────── */
.skip-link {
  position: fixed;
  left: 1rem;
  top: -100px;
  z-index: 200;
  border-radius: 999px;
  background: var(--forest-900);
  color: var(--cream);
  padding: 0.7rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 3px; }

.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ── Nav & buttons ─────────────────────────── */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.55rem 0.65rem;
  font-size: 12.5px;
  font-weight: 500;
  color: #37552f;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  text-align: left;
}
.nav-link:hover { background: rgba(27, 42, 25, 0.06); color: #101a10; }
.dark .nav-link { color: rgba(244, 238, 228, 0.62); }
.dark .nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #f4eee4; }

.icon-btn {
  display: grid;
  place-items: center;
  height: 40px;
  width: 40px;
  border-radius: 999px;
  border: 1px solid rgba(27, 42, 25, 0.12);
  background: rgba(255, 255, 255, 0.55);
  color: #37552f;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.icon-btn:hover { background: #fff; border-color: rgba(27, 42, 25, 0.22); transform: rotate(-8deg); }
.dark .icon-btn { border-color: rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.05); color: rgba(244, 238, 228, 0.75); }
.dark .icon-btn:hover { background: rgba(255, 255, 255, 0.1); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
}
.btn:active { transform: scale(0.975); }
.btn-primary {
  background: #1b2a19;
  color: #f4eee4;
  box-shadow: 0 10px 24px -12px rgba(27, 42, 25, 0.6);
}
.btn-primary:hover { background: #2b4426; box-shadow: 0 14px 30px -12px rgba(27, 42, 25, 0.65); }
.dark .btn-primary { background: #f4eee4; color: #101a10; box-shadow: 0 10px 26px -14px rgba(0, 0, 0, 0.8); }
.dark .btn-primary:hover { background: #fff; }
.btn-ghost {
  border-color: rgba(27, 42, 25, 0.14);
  background: rgba(255, 255, 255, 0.5);
  color: #22341f;
}
.btn-ghost:hover { background: #fff; border-color: rgba(27, 42, 25, 0.25); }
.dark .btn-ghost { border-color: rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.05); color: rgba(244, 238, 228, 0.8); }
.dark .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn-light { background: #f4eee4; color: #101a10; }
.btn-light:hover { background: #fff; }
.btn-outline-light { border-color: rgba(244, 238, 228, 0.25); color: #f4eee4; background: transparent; }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(244, 238, 228, 0.4); }
.btn-sm { padding: 0.55rem 0.85rem; font-size: 11px; }

/* ── Typography accents ────────────────────── */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #486b3d;
}
.dark .eyebrow { color: #b9cfb1; }

.avatar {
  display: grid;
  place-items: center;
  height: 32px;
  width: 32px;
  border-radius: 999px;
  border: 2px solid #faf8f5;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.dark .avatar { border-color: #0d0c0a; }

/* ── Hero chips + seal ─────────────────────── */
.glass-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(13, 12, 10, 0.32);
  padding: 0.35rem 0.65rem;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
}

.seal {
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 74px;
  width: 74px;
  border-radius: 999px;
  border: 1px dashed rgba(27, 42, 25, 0.35);
  background: #f4eee4;
  color: #1b2a19;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 3px #f4eee4, inset 0 0 0 4px rgba(27, 42, 25, 0.12), 0 16px 30px -14px rgba(27, 42, 25, 0.6);
  transform: rotate(-9deg);
}
.seal svg { color: #486b3d; }
.seal--float { position: absolute; bottom: -1.6rem; left: 1.2rem; z-index: 10; }

/* ── Stats ─────────────────────────────────── */
.stat-card {
  border-radius: 1.4rem;
  border: 1px solid rgba(27, 42, 25, 0.09);
  background: rgba(255, 255, 255, 0.66);
  padding: 1.05rem;
  box-shadow: 0 1px 2px rgba(27, 42, 25, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -30px rgba(27, 42, 25, 0.5); border-color: rgba(27, 42, 25, 0.16); }
.dark .stat-card { border-color: rgba(255, 255, 255, 0.09); background: rgba(255, 255, 255, 0.035); }
.stat-icon {
  display: grid;
  place-items: center;
  height: 32px;
  width: 32px;
  border-radius: 10px;
  background: rgba(27, 42, 25, 0.06);
  color: #37552f;
}
.dark .stat-icon { background: rgba(255, 255, 255, 0.06); color: rgba(244, 238, 228, 0.65); }
.stat-trend {
  border-radius: 999px;
  background: rgba(72, 107, 61, 0.09);
  padding: 0.22rem 0.5rem;
  font-size: 9px;
  font-weight: 600;
  color: #37552f;
  white-space: nowrap;
}
.dark .stat-trend { background: rgba(185, 207, 177, 0.1); color: rgba(222, 234, 216, 0.6); }

/* ── Map ───────────────────────────────────── */
.map-grid path { stroke: rgba(27, 42, 25, 0.07); stroke-width: 1; stroke-dasharray: 2 7; }
.continent path {
  fill: rgba(72, 107, 61, 0.15);
  stroke: rgba(43, 68, 38, 0.26);
  stroke-width: 1.1;
  transition: fill 0.3s ease;
}
.map-route path {
  fill: none;
  stroke: rgba(196, 103, 74, 0.42);
  stroke-width: 1.2;
  stroke-dasharray: 3 6;
  stroke-linecap: round;
}
.map-compass circle { fill: none; stroke: rgba(27, 42, 25, 0.28); stroke-width: 1; }
.map-compass path { fill: rgba(27, 42, 25, 0.5); stroke: none; }
.map-compass text { fill: rgba(27, 42, 25, 0.4); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; }
.dark .map-grid path { stroke: rgba(255, 255, 255, 0.06); }
.dark .continent path { fill: rgba(185, 207, 177, 0.1); stroke: rgba(220, 231, 215, 0.18); }
.dark .map-compass circle { stroke: rgba(244, 238, 228, 0.25); }
.dark .map-compass path { fill: rgba(244, 238, 228, 0.45); }
.dark .map-compass text { fill: rgba(244, 238, 228, 0.4); }

.map-pin {
  position: absolute;
  z-index: 10;
  display: grid;
  place-items: center;
  height: 40px;
  width: 40px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  cursor: pointer;
}
.map-pin .pin-dot {
  position: relative;
  z-index: 2;
  height: 11px;
  width: 11px;
  border-radius: 999px;
  background: #c4674a;
  border: 2px solid #faf8f5;
  box-shadow: 0 2px 8px rgba(95, 44, 31, 0.4);
  transition: transform 0.2s ease, background 0.2s ease;
}
.map-pin .pin-ring {
  position: absolute;
  inset: 6px;
  border-radius: 999px;
  border: 1px solid rgba(196, 103, 74, 0.55);
  animation: pinPulse 2.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.map-pin:hover .pin-dot,
.map-pin:focus-visible .pin-dot,
.map-pin.is-active .pin-dot { transform: scale(1.35); background: #2b4426; }
.map-pin.is-active .pin-ring { border-color: rgba(43, 68, 38, 0.5); }
.map-pin .pin-label {
  position: absolute;
  bottom: calc(100% + 1px);
  left: 50%;
  transform: translate(-50%, 4px);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid rgba(27, 42, 25, 0.1);
  background: rgba(250, 248, 245, 0.96);
  padding: 0.28rem 0.55rem;
  font-size: 9.5px;
  font-weight: 600;
  color: #1b2a19;
  box-shadow: 0 8px 20px -12px rgba(27, 42, 25, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.map-pin .pin-label em { font-style: normal; color: #a94a28; }
.map-pin:hover .pin-label,
.map-pin:focus-visible .pin-label,
.map-pin.is-active .pin-label { opacity: 1; transform: translate(-50%, 0); }
.map-pin.pin--right .pin-label { left: auto; right: -6px; transform: translate(0, 4px); }
.map-pin.pin--right:hover .pin-label,
.map-pin.pin--right:focus-visible .pin-label,
.map-pin.pin--right.is-active .pin-label { transform: translate(0, 0); }
.map-pin.pin--left .pin-label { left: -6px; transform: translate(0, 4px); }
.map-pin.pin--left:hover .pin-label,
.map-pin.pin--left:focus-visible .pin-label,
.map-pin.pin--left.is-active .pin-label { transform: translate(0, 0); }
.dark .map-pin .pin-dot { border-color: #101a10; }
.dark .map-pin .pin-label { background: #1c1a17; color: #f4eee4; border-color: rgba(255, 255, 255, 0.12); }

/* Labels stay readable on larger screens without hovering */
@media (min-width: 768px) {
  .map-pin .pin-label { opacity: 0.92; transform: translate(-50%, 0); }
  .map-pin.pin--right .pin-label { transform: translate(0, 0); }
  .map-pin.pin--left .pin-label { transform: translate(0, 0); }
  .map-pin:hover .pin-label,
  .map-pin:focus-visible .pin-label,
  .map-pin.is-active .pin-label { opacity: 1; }
}

/* ── Category pills ────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(27, 42, 25, 0.1);
  background: rgba(255, 255, 255, 0.55);
  padding: 0.5rem 0.8rem;
  font-size: 11px;
  font-weight: 500;
  color: #37552f;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.pill:hover { border-color: rgba(27, 42, 25, 0.22); background: #fff; }
.pill .pill-count {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(27, 42, 25, 0.07);
  padding: 0 4px;
  font-size: 9px;
  font-weight: 600;
  color: #486b3d;
}
.pill.is-active { background: #1b2a19; border-color: #1b2a19; color: #f4eee4; }
.pill.is-active .pill-count { background: rgba(255, 255, 255, 0.15); color: #f4eee4; }
.dark .pill { border-color: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.04); color: rgba(244, 238, 228, 0.65); }
.dark .pill:hover { background: rgba(255, 255, 255, 0.08); }
.dark .pill .pill-count { background: rgba(255, 255, 255, 0.08); color: rgba(244, 238, 228, 0.5); }
.dark .pill.is-active { background: #f4eee4; border-color: #f4eee4; color: #101a10; }
.dark .pill.is-active .pill-count { background: rgba(16, 26, 16, 0.12); color: #101a10; }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 103, 74, 0.25);
  background: rgba(196, 103, 74, 0.09);
  padding: 0.32rem 0.65rem;
  font-size: 10px;
  font-weight: 600;
  color: #8c3b22;
}
.filter-chip button { display: grid; place-items: center; border-radius: 999px; padding: 1px; }
.filter-chip button:hover { background: rgba(140, 59, 34, 0.12); }
.dark .filter-chip { border-color: rgba(222, 154, 121, 0.2); background: rgba(196, 103, 74, 0.13); color: #ebbfa9; }

/* ── Story cards ───────────────────────────── */
.story-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1.65rem;
  border: 1px solid rgba(27, 42, 25, 0.1);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 2px rgba(27, 42, 25, 0.03);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}
.story-card:hover {
  transform: translateY(-5px);
  border-color: rgba(27, 42, 25, 0.18);
  box-shadow: 0 28px 50px -34px rgba(27, 42, 25, 0.55);
}
.dark .story-card { border-color: rgba(255, 255, 255, 0.09); background: #1c1a17; }
.dark .story-card:hover { border-color: rgba(255, 255, 255, 0.18); }

.card-media { position: relative; height: 13rem; overflow: hidden; background: linear-gradient(135deg, #2b4426, #648b56 55%, #c4674a); }
.card-media img { height: 100%; width: 100%; object-fit: cover; transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
.story-card:hover .card-media img { transform: scale(1.055); }
.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(16, 26, 16, 0.88), rgba(16, 26, 16, 0.12) 52%, rgba(16, 26, 16, 0.28));
  pointer-events: none;
}
.card-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(244, 238, 228, 0.75);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}
.status-verified { background: rgba(244, 238, 228, 0.94); color: #1b2a19; }
.status-oral { background: rgba(222, 154, 121, 0.95); color: #3d1c0f; }
.status-endangered { background: rgba(140, 59, 34, 0.94); color: #fbefe9; }
.status-pending { background: rgba(255, 246, 224, 0.96); color: #7a4a06; }
.dark .status-pending { background: rgba(122, 74, 6, 0.9); color: #ffecc7; }

.card-seal {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  height: 52px;
  width: 52px;
  border-radius: 999px;
  border: 1px dashed rgba(27, 42, 25, 0.3);
  background: rgba(244, 238, 228, 0.94);
  color: #1b2a19;
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.15;
  transform: rotate(-8deg);
  box-shadow: inset 0 0 0 2px rgba(244, 238, 228, 0.9), inset 0 0 0 3px rgba(27, 42, 25, 0.1);
}
.card-seal svg { color: #486b3d; }
.card-seal.is-pending { color: #7a4a06; background: rgba(255, 246, 224, 0.94); }
.card-seal.is-pending svg { color: #a16207; }

.listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(27, 42, 25, 0.12);
  background: rgba(255, 255, 255, 0.6);
  padding: 0.3rem 0.55rem 0.3rem 0.3rem;
  font-size: 10.5px;
  font-weight: 600;
  color: #22341f;
  transition: all 0.2s ease;
}
.listen-btn:hover { background: #fff; border-color: rgba(27, 42, 25, 0.25); }
.listen-btn:disabled { cursor: not-allowed; opacity: 0.55; }
.dark .listen-btn { border-color: rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04); color: rgba(244, 238, 228, 0.75); }
.dark .listen-btn:hover { background: rgba(255, 255, 255, 0.09); }
.listen-icon {
  display: grid;
  place-items: center;
  height: 24px;
  width: 24px;
  border-radius: 999px;
  background: #1b2a19;
  color: #f4eee4;
  flex-shrink: 0;
}
.dark .listen-icon { background: #f4eee4; color: #101a10; }
.listen-btn[data-playing="true"] { border-color: rgba(196, 103, 74, 0.4); background: rgba(196, 103, 74, 0.1); color: #8c3b22; }
.dark .listen-btn[data-playing="true"] { background: rgba(196, 103, 74, 0.16); color: #ebbfa9; }

.icon-pause { display: none; }
[data-playing="true"] .icon-play { display: none; }
[data-playing="true"] .icon-pause { display: block; }

.dir-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  background: rgba(27, 42, 25, 0.05);
  padding: 0.18rem 0.42rem;
  font-size: 8.5px;
  font-weight: 600;
  color: #486b3d;
}
.dark .dir-badge { background: rgba(255, 255, 255, 0.06); color: rgba(244, 238, 228, 0.45); }

.story-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 11px;
  font-weight: 600;
  color: #37552f;
  transition: color 0.2s ease, gap 0.2s ease;
}
.story-link:hover { color: #a94a28; gap: 0.4rem; }
.dark .story-link { color: rgba(244, 238, 228, 0.6); }
.dark .story-link:hover { color: #de9a79; }

.card-body { display: flex; flex: 1; flex-direction: column; padding: 1.1rem 1.15rem 1.15rem; }

/* ── Mini wave / equalizer ─────────────────── */
.mini-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  width: 38px;
  flex-shrink: 0;
}
.mini-wave span {
  flex: 1;
  min-width: 1.5px;
  border-radius: 99px;
  background: currentColor;
  opacity: 0.3;
  transform-origin: bottom;
}
.mini-wave--light { width: 56px; height: 18px; color: #f4eee4; }
.mini-wave--light span { opacity: 0.35; }
[data-playing="true"] .mini-wave span {
  background: #c4674a;
  opacity: 0.95;
  animation: miniEq 0.9s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * 0.055s);
}
[data-playing="true"] .mini-wave--light span { background: #ebbfa9; }

/* ── Player ────────────────────────────────── */
.player-tab {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.65rem;
  border-radius: 0.9rem;
  border: 1px solid transparent;
  padding: 0.55rem;
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.player-tab:hover { background: rgba(255, 255, 255, 0.05); }
.player-tab.is-active { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.1); }
.player-tab .tab-art {
  height: 36px;
  width: 36px;
  border-radius: 0.6rem;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.player-tab.is-active .tab-art { outline: 1px solid rgba(235, 191, 169, 0.6); outline-offset: 2px; }
.eq-tab { display: block; width: 2px; border-radius: 99px; background: #ebbfa9; animation: eqTab 0.75s ease-in-out infinite alternate; }
.eq-tab:nth-child(1) { height: 38%; animation-delay: 0s; }
.eq-tab:nth-child(2) { height: 90%; animation-delay: 0.18s; }
.eq-tab:nth-child(3) { height: 60%; animation-delay: 0.34s; }
@keyframes eqTab { from { transform: scaleY(0.35); } to { transform: scaleY(1); } }

.wave-bar {
  flex: 1 1 0%;
  min-width: 1px;
  border-radius: 999px;
  background: rgba(244, 238, 228, 0.17);
  transition: background 0.12s linear, opacity 0.2s ease;
}
.wave-bar.is-played { background: #c4674a; }
.wave-bar.is-current { background: #ebbfa9; }
#waveform:hover .wave-bar { background: rgba(244, 238, 228, 0.28); }
#waveform:hover .wave-bar.is-played { background: #d07650; }
.wave-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: rgba(244, 238, 228, 0.65);
  box-shadow: 0 0 12px rgba(235, 191, 169, 0.75);
  pointer-events: none;
  transition: left 0.1s linear;
}
.wave-playhead::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  height: 7px;
  width: 7px;
  border-radius: 999px;
  background: #f4eee4;
  transform: translateX(-50%);
}

.player-icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  height: 40px;
  width: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(244, 238, 228, 0.6);
  transition: all 0.2s ease;
}
.player-icon-btn:hover { border-color: rgba(255, 255, 255, 0.28); color: #f4eee4; background: rgba(255, 255, 255, 0.05); }

.subtitle-btn {
  border-radius: 999px;
  padding: 0.32rem 0.55rem;
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(244, 238, 228, 0.45);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.subtitle-btn:hover { color: rgba(244, 238, 228, 0.8); }
.subtitle-btn.is-active { background: #f4eee4; color: #101a10; }

.transcript-line {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.65rem 1rem;
  text-align: left;
  border-left: 2px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.transcript-line:hover { background: rgba(255, 255, 255, 0.04); }
.transcript-line.is-active { background: rgba(196, 103, 74, 0.1); border-left-color: #c4674a; }
.transcript-line .t-time { padding-top: 1px; font-size: 9px; font-variant-numeric: tabular-nums; color: rgba(244, 238, 228, 0.28); flex-shrink: 0; }
.transcript-line .t-text { font-size: 12px; line-height: 1.55; color: rgba(244, 238, 228, 0.58); }
.transcript-line.is-active .t-text { color: rgba(244, 238, 228, 0.95); }
.transcript-line .t-note { display: block; margin-top: 0.15rem; font-family: "DM Sans", sans-serif; font-size: 9px; font-style: normal; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(244, 238, 228, 0.25); }

/* ── Forms ─────────────────────────────────── */
.field-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #2b4426;
}
.dark .field-label { color: rgba(244, 238, 228, 0.7); }

.field {
  margin-top: 0.4rem;
  width: 100%;
  border-radius: 0.8rem;
  border: 1px solid rgba(27, 42, 25, 0.13);
  background: rgba(255, 255, 255, 0.72);
  padding: 0.65rem 0.8rem;
  font-size: 12px;
  line-height: 1.5;
  color: #101a10;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.field::placeholder { color: rgba(72, 107, 61, 0.5); }
.field:focus { outline: none; border-color: #486b3d; box-shadow: 0 0 0 4px rgba(72, 107, 61, 0.1); background: #fff; }
textarea.field { min-height: 108px; }
select.field { height: 40px; padding-top: 0; padding-bottom: 0; cursor: pointer; }
.dark .field { border-color: rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.045); color: #f4eee4; }
.dark .field::placeholder { color: rgba(244, 238, 228, 0.25); }
.dark .field:focus { border-color: rgba(185, 207, 177, 0.5); box-shadow: 0 0 0 4px rgba(185, 207, 177, 0.08); background: rgba(255, 255, 255, 0.06); }
.dark select.field option { background: #1c1a17; color: #f4eee4; }

.field-error { margin-top: 0.3rem; font-size: 10px; font-weight: 500; color: #a94a28; }
.dark .field-error { color: #e8a58b; }
.field.is-invalid { border-color: rgba(169, 74, 40, 0.65); box-shadow: 0 0 0 3px rgba(169, 74, 40, 0.08); }

.type-card {
  display: flex;
  cursor: pointer;
  flex-direction: column;
  gap: 0.15rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(27, 42, 25, 0.12);
  background: rgba(255, 255, 255, 0.45);
  padding: 0.6rem;
  transition: all 0.2s ease;
}
.type-card:hover { border-color: rgba(27, 42, 25, 0.28); background: #fff; }
.type-card .type-icon {
  display: grid;
  place-items: center;
  height: 28px;
  width: 28px;
  border-radius: 0.5rem;
  background: rgba(27, 42, 25, 0.06);
  color: #37552f;
  margin-bottom: 0.2rem;
}
.type-card.is-active { border-color: #37552f; background: rgba(72, 107, 61, 0.09); box-shadow: 0 0 0 2px rgba(72, 107, 61, 0.12); }
.type-card.is-active .type-icon { background: #1b2a19; color: #f4eee4; }
.dark .type-card { border-color: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.03); }
.dark .type-card:hover { border-color: rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.06); }
.dark .type-card .type-icon { background: rgba(255, 255, 255, 0.06); color: rgba(244, 238, 228, 0.6); }
.dark .type-card.is-active { border-color: #b9cfb1; background: rgba(185, 207, 177, 0.12); box-shadow: 0 0 0 2px rgba(185, 207, 177, 0.1); }
.dark .type-card.is-active .type-icon { background: #f4eee4; color: #101a10; }

.dropzone {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.9rem;
  border: 1px dashed rgba(27, 42, 25, 0.22);
  background: rgba(255, 255, 255, 0.35);
  padding: 0.7rem;
  transition: all 0.2s ease;
}
.dropzone:hover { border-color: #486b3d; background: rgba(72, 107, 61, 0.05); }
.dark .dropzone { border-color: rgba(255, 255, 255, 0.17); background: rgba(255, 255, 255, 0.025); }
.dark .dropzone:hover { border-color: rgba(185, 207, 177, 0.5); background: rgba(255, 255, 255, 0.05); }

.consent-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(27, 42, 25, 0.1);
  background: rgba(72, 107, 61, 0.045);
  padding: 0.8rem;
  cursor: pointer;
}
.dark .consent-card { border-color: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.03); }

.success-seal {
  display: grid;
  place-items: center;
  height: 68px;
  width: 68px;
  border-radius: 999px;
  background: #1b2a19;
  color: #f4eee4;
  border: 1px dashed rgba(244, 238, 228, 0.45);
  box-shadow: 0 0 0 6px rgba(27, 42, 25, 0.06);
  animation: sealPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ── Verification queue ────────────────────── */
.verify-item {
  border-radius: 1rem;
  border: 1px solid rgba(27, 42, 25, 0.1);
  background: rgba(255, 255, 255, 0.55);
  padding: 0.85rem;
}
.dark .verify-item { border-color: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.035); }
.endorse-dot { height: 7px; width: 7px; border-radius: 999px; background: rgba(27, 42, 25, 0.14); }
.endorse-dot.is-filled { background: #486b3d; }
.dark .endorse-dot { background: rgba(255, 255, 255, 0.15); }
.dark .endorse-dot.is-filled { background: #b9cfb1; }
.endorse-btn {
  border-radius: 999px;
  background: #1b2a19;
  color: #f4eee4;
  padding: 0.42rem 0.8rem;
  font-size: 10px;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.endorse-btn:hover { background: #2b4426; transform: translateY(-1px); }
.endorse-btn:disabled { cursor: default; background: rgba(72, 107, 61, 0.15); color: #37552f; transform: none; }
.dark .endorse-btn { background: #f4eee4; color: #101a10; }
.dark .endorse-btn:hover { background: #fff; }
.dark .endorse-btn:disabled { background: rgba(255, 255, 255, 0.08); color: rgba(244, 238, 228, 0.45); }

/* ── Modals ────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 12, 10, 0.62);
  backdrop-filter: blur(7px);
}
.modal-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  max-height: 91vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 1.75rem;
  border: 1px solid rgba(27, 42, 25, 0.12);
  background: #faf8f5;
  box-shadow: 0 45px 100px -30px rgba(0, 0, 0, 0.6);
}
.dark .modal-panel { border-color: rgba(255, 255, 255, 0.12); background: #171512; }
.modal-panel--story { max-width: 60rem; }
.modal-panel--form { max-width: 48rem; }
.modal-panel::-webkit-scrollbar { width: 8px; }
.modal-panel::-webkit-scrollbar-thumb { background: rgba(27, 42, 25, 0.2); border-radius: 99px; }
.modal:not([hidden]) .modal-backdrop { animation: fadeIn 0.25s ease both; }
.modal:not([hidden]) .modal-panel { animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
.modal-close {
  position: absolute;
  right: 0.9rem;
  top: 0.9rem;
  z-index: 30;
  display: grid;
  place-items: center;
  height: 36px;
  width: 36px;
  border-radius: 999px;
  border: 1px solid rgba(27, 42, 25, 0.12);
  background: rgba(250, 248, 245, 0.9);
  color: #22341f;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.4);
}
.modal-close:hover { background: #fff; transform: rotate(90deg); }
.dark .modal-close { border-color: rgba(255, 255, 255, 0.15); background: rgba(28, 26, 23, 0.9); color: #f4eee4; }

.story-hero { position: relative; height: 15rem; overflow: hidden; background: linear-gradient(135deg, #2b4426, #648b56 55%, #c4674a); }
.story-hero img { height: 100%; width: 100%; object-fit: cover; }
.story-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(16, 26, 16, 0.92), rgba(16, 26, 16, 0.1) 60%); }
.story-hero-content { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.5rem; }
.story-blockquote {
  border-left: 2px solid #c4674a;
  padding: 0.2rem 0 0.2rem 1rem;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #22341f;
}
.dark .story-blockquote { color: rgba(244, 238, 228, 0.85); }
.detail-row { display: flex; align-items: flex-start; gap: 0.6rem; }
.detail-label { font-size: 9px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(72, 107, 61, 0.75); }
.dark .detail-label { color: rgba(244, 238, 228, 0.35); }
.detail-value { font-size: 11.5px; font-weight: 500; color: #22341f; }
.dark .detail-value { color: rgba(244, 238, 228, 0.75); }

/* ── Toasts ────────────────────────────────── */
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1c1a17;
  color: #f4eee4;
  padding: 0.75rem 0.8rem;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.toast.is-leaving { animation: toastOut 0.25s ease forwards; }
.toast-icon { display: grid; place-items: center; height: 28px; width: 28px; flex-shrink: 0; border-radius: 0.55rem; background: rgba(196, 103, 74, 0.18); color: #ebbfa9; }
.toast-close { display: grid; place-items: center; height: 22px; width: 22px; border-radius: 999px; color: rgba(244, 238, 228, 0.4); transition: all 0.2s ease; flex-shrink: 0; }
.toast-close:hover { background: rgba(255, 255, 255, 0.1); color: #f4eee4; }

/* ── Footer ────────────────────────────────── */
.footer-link { display: inline-block; text-align: left; font-size: 11px; transition: color 0.2s ease; }
.footer-link:hover { color: #101a10; }
.dark .footer-link:hover { color: #f4eee4; }

/* ── Reveal ────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.75s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.in { opacity: 1; transform: none; }
.story-card.is-new { animation: newCard 2.4s ease both; }

/* ── Keyframes ─────────────────────────────── */
@keyframes pinPulse {
  0% { transform: scale(0.45); opacity: 0.9; }
  70%, 100% { transform: scale(1.9); opacity: 0; }
}
@keyframes miniEq {
  from { transform: scaleY(0.35); }
  to { transform: scaleY(1); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(14px) scale(0.97); }
}
@keyframes sealPop {
  from { opacity: 0; transform: scale(0.6) rotate(-20deg); }
  to { opacity: 1; transform: none; }
}
@keyframes newCard {
  0%, 100% { box-shadow: 0 1px 2px rgba(27, 42, 25, 0.03); }
  20%, 70% { box-shadow: 0 0 0 4px rgba(196, 103, 74, 0.28), 0 20px 50px -26px rgba(196, 103, 74, 0.4); border-color: rgba(196, 103, 74, 0.5); }
}

@media (max-width: 639px) {
  .seal--float { display: none; }
  .card-media { height: 12rem; }
  #waveBars, #waveform { gap: 2px; }
  .modal { padding: 0.5rem; align-items: flex-end; }
  .modal-panel { max-height: 94vh; border-radius: 1.4rem; }
  .story-hero { height: 12rem; }
  .story-hero-content { padding: 1.1rem; }
}

@media (min-width: 640px) {
  .stat-card { padding: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
