@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700&family=IBM+Plex+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
  --bg: #f8f1e6;
  --bg-deep: #f1d5b3;
  --ink: #1e1a14;
  --muted: #6a5644;
  --card: #fff6ea;
  --stroke: rgba(30, 26, 20, 0.12);
  --accent: #0f766e;
  --accent-2: #c2410c;
  --accent-3: #f59e0b;
  --shadow: 0 20px 60px rgba(30, 26, 20, 0.12);
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-sans: "Space Grotesk", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  background: radial-gradient(circle at 15% 15%, #fff7ed 0%, transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(245, 158, 11, 0.18), transparent 40%),
    linear-gradient(135deg, var(--bg), var(--bg-deep));
  min-height: 100vh;
}

.noise {
  position: fixed;
  inset: 0;
  opacity: 0.08;
  background-image: radial-gradient(rgba(30, 26, 20, 0.15) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 20px 80px;
  position: relative;
}

.hero {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: end;
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 4vw, 4rem);
  margin: 8px 0 12px;
}

.hero-text p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 520px;
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--accent-2);
  font-weight: 600;
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  gap: 14px;
}

.hero-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.pill {
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
}

.hero-total {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 600;
  color: var(--accent);
}

.hero-sub {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--muted);
}

.hero-meta {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  font-size: 0.95rem;
}

.hero-meta .label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.controls {
  margin-top: 28px;
}

#controls-form {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #fffdf9;
  font-family: var(--font-sans);
  font-size: 1rem;
}

.actions {
  display: flex;
  gap: 10px;
}

button {
  border-radius: 999px;
  border: none;
  padding: 10px 18px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 24px rgba(15, 118, 110, 0.25);
}

button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(15, 118, 110, 0.35);
}

button:hover {
  transform: translateY(-1px);
}

.status {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  color: var(--accent-2);
  min-height: 1.2rem;
}

.grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 24px;
}

.card-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 600;
  font-size: 1.1rem;
}

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

.list {
  margin-top: 16px;
  display: grid;
  gap: 16px;
}

.list-item {
  display: grid;
  gap: 8px;
  animation: rise 0.4s ease both;
  animation-delay: calc(var(--i, 0) * 60ms);
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  font-size: 0.95rem;
}

.list-name {
  font-weight: 500;
}

.list-count {
  font-family: var(--font-mono);
  color: var(--accent-2);
}

.list-sub {
  font-size: 0.8rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.bar {
  height: 8px;
  background: rgba(15, 118, 110, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  border-radius: 999px;
  transition: width 0.6s ease;
}

.footnote {
  margin-top: 26px;
}

.footnote-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.mono {
  font-family: var(--font-mono);
}

.meta {
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
}

body.is-ready .reveal {
  animation: rise 0.7s ease forwards;
  animation-delay: var(--delay, 0ms);
}

.hero .reveal:nth-child(1) {
  --delay: 80ms;
}

.hero .reveal:nth-child(2) {
  --delay: 160ms;
}

.controls.reveal {
  --delay: 240ms;
}

.grid .reveal:nth-child(1) {
  --delay: 300ms;
}

.grid .reveal:nth-child(2) {
  --delay: 380ms;
}

.footnote.reveal {
  --delay: 440ms;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .hero-card {
    order: 2;
  }

  .hero-text {
    order: 1;
  }

  .hero-meta {
    grid-template-columns: 1fr;
  }

  #controls-form {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
