:root {
  --ink: #0c1210;
  --paper: #e8f2ec;
  --muted: #8aa396;
  --accent: #1fa87a;
  --accent-hot: #ff5c3a;
  --accent-dim: #147a58;
  --line: rgba(232, 242, 236, 0.12);
  --glass: rgba(12, 18, 16, 0.55);
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--paper);
  background: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(31, 168, 122, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 168, 122, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black, transparent);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  width: min(90vw, 720px);
  height: min(90vw, 720px);
  top: -12%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(31, 168, 122, 0.28), transparent 65%);
  pointer-events: none;
  z-index: 0;
  animation: pulse-glow 8s ease-in-out infinite;
}

.listen-glow {
  background: radial-gradient(circle, rgba(255, 92, 58, 0.18), transparent 65%);
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.06); }
}

.top,
.hero,
.page,
.foot {
  position: relative;
  z-index: 1;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--paper);
  text-decoration: none;
}

nav {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--paper);
  background: rgba(232, 242, 236, 0.06);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(2.5rem, 8vh, 5rem) 1.25rem 3rem;
  max-width: 720px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  animation: fade-up 0.7s ease both;
}

.logo-hero {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 12vw, 5.5rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  background: linear-gradient(135deg, #e8f2ec 30%, #1fa87a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: fade-up 0.8s 0.08s ease both;
}

.lede {
  margin: 1rem 0 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.05rem;
  animation: fade-up 0.8s 0.16s ease both;
}

.lede.narrow {
  max-width: 28rem;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.controls {
  width: 100%;
  margin-top: 2.5rem;
  padding: 1.75rem;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  animation: fade-up 0.9s 0.24s ease both;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.field input {
  font: inherit;
  font-size: 1rem;
  color: var(--paper);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus {
  border-color: var(--accent);
}

.meter {
  margin-top: 1.25rem;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: inherit;
  transition: width 0.08s linear;
}

.timer {
  margin: 1.25rem 0 0.25rem;
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.status {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 1.35em;
}

.status.is-error { color: var(--accent-hot); }
.status.is-ok { color: var(--accent); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 0.85rem 1.35rem;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, opacity 0.2s;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn:not(:disabled):active {
  transform: translateY(1px);
}

.btn-rec {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--accent-hot);
  color: #fff;
}

.btn-rec.is-live {
  background: var(--accent);
  animation: rec-pulse 1.4s ease-in-out infinite;
}

.btn-rec .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
}

.btn-rec.is-live .dot {
  animation: dot-ping 1.4s ease-out infinite;
}

@keyframes rec-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

@keyframes dot-ping {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55); }
  100% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
}

.btn-ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line);
}

.btn-ghost:not(:disabled):hover {
  background: rgba(232, 242, 236, 0.06);
}

.btn-danger {
  background: transparent;
  color: var(--accent-hot);
  border: 1px solid rgba(255, 92, 58, 0.35);
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
}

.latest,
.page {
  width: 100%;
  max-width: 720px;
  margin: 2.5rem auto 0;
  padding: 0 1.25rem 3rem;
  text-align: left;
}

.page {
  margin-top: 2rem;
}

.page-title,
.latest h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.latest h2 {
  font-size: 1.15rem;
  color: var(--muted);
  font-weight: 600;
}

.page-title {
  font-size: clamp(2rem, 6vw, 2.75rem);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0 1rem;
}

.meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.list.big li {
  grid-template-columns: 1fr;
}

.list .empty {
  display: block;
  text-align: center;
  color: var(--muted);
  border-style: dashed;
}

.item-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
}

.item-name {
  font-weight: 600;
  font-size: 0.95rem;
  word-break: break-all;
}

.item-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.list audio {
  width: 100%;
  margin-top: 0.35rem;
  height: 36px;
}

.list.big audio {
  margin-top: 0.75rem;
  height: 40px;
}

.foot {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--line);
}

.foot code {
  font-size: 0.85em;
  color: var(--accent);
}

@media (max-width: 520px) {
  .cta-row {
    flex-direction: column;
  }
  .btn {
    width: 100%;
    justify-content: center;
  }
}
