/* Talen — ink and cream. Editorial poetry: one saying, huge, alive. */

:root {
  --ink: #161210;
  --ink-soft: #241d18;
  --cream: #efe6d3;
  --cream-dim: #a89a80;
  --gold: #d9a441;
  --rust: #b4642d;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

html { height: 100%; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(90% 45% at 50% 108%, rgba(180, 100, 45, 0.18), transparent 70%),
    repeating-linear-gradient(115deg, transparent 0 110px, rgba(239, 230, 211, 0.016) 110px 112px),
    var(--ink);
  color: var(--cream);
  font-family: "Archivo", system-ui, sans-serif;
}

[lang^="dux"] { font-family: "Charis SIL", serif; }

#top { padding: max(20px, env(safe-area-inset-top)) 22px 0; }

#top h1 {
  font-size: 1.7rem;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.tag { font-size: 0.78rem; color: var(--cream-dim); letter-spacing: 0.06em; margin-top: 2px; }
.tag [lang] { color: var(--gold); }

#net-badge {
  display: inline-block;
  margin-top: 6px;
  border: 1px solid var(--rust);
  color: var(--gold);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 0.7rem;
}

/* ---------- stage ---------- */

#stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 24px 30px;
  max-width: 620px;
  margin: 0 auto;
  width: 100%;
}

#kind {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 18px;
}

#kind::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--rust);
  vertical-align: middle;
  margin-right: 10px;
}

#parole {
  font-size: clamp(1.9rem, 8.6vw, 3rem);
  line-height: 1.32;
  font-weight: 400;
  color: var(--cream);
  overflow-wrap: break-word;
}

#parole .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.45em) rotate(1.2deg);
  animation: word-in 0.7s cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
  animation-delay: calc(var(--i) * 90ms);
  margin-right: 0.28em;
}

@keyframes word-in {
  to { opacity: 1; transform: none; }
}

#parole .w:first-child::first-letter { color: var(--gold); }

#trans {
  margin-top: 26px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--cream-dim);
  max-width: 46ch;
  opacity: 0;
  animation: fade-up 0.8s ease forwards;
  animation-delay: var(--trans-delay, 1s);
}

#source {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--cream-dim);
  opacity: 0;
  animation: fade-up 0.8s ease forwards;
  animation-delay: calc(var(--trans-delay, 1s) + 0.15s);
}

#source b { font-family: "Charis SIL", serif; font-weight: 400; color: var(--gold); font-size: 0.95rem; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 0.95; transform: none; }
}

/* ---------- controls ---------- */

#controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  opacity: 0;
  animation: fade-up 0.8s ease forwards;
  animation-delay: calc(var(--trans-delay, 1s) + 0.3s);
}

#play {
  width: 62px;
  height: 62px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  background: rgba(217, 164, 65, 0.08);
  color: var(--gold);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s;
}

#play:active { transform: scale(0.9); }
#play svg { width: 24px; height: 24px; }

#play.playing { background: var(--gold); color: var(--ink); }

#play.playing::before, #play.playing::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  animation: ripple 1.5s ease-out infinite;
}

#play.playing::after { animation-delay: 0.75s; }

@keyframes ripple {
  from { transform: scale(1); opacity: 0.8; }
  to { transform: scale(1.8); opacity: 0; }
}

#another, #share {
  border: 1px solid #3a2f24;
  background: var(--ink-soft);
  color: var(--cream);
  border-radius: 999px;
  padding: 13px 20px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s;
}

#another:active, #share:active { transform: scale(0.94); }
#share { color: var(--cream-dim); }

/* ---------- footer ---------- */

#foot {
  display: flex;
  justify-content: space-between;
  padding: 10px 22px calc(12px + env(safe-area-inset-bottom));
  font-size: 0.76rem;
  color: var(--cream-dim);
}

#foot a { color: var(--gold); text-decoration: none; font-weight: 600; }

.toast {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cream);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  animation: fade-up 0.3s ease;
  z-index: 50;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}
