/* ==========================================================================
   Compost League — site design system
   --------------------------------------------------------------------------
   This file owns the look of the site: tokens, type, layout, header/nav,
   wave dividers, worms, and page sections.

   Compost-league-styles.css is the calculator/dashboard *component* sheet
   (it is also loaded by the live Webflow embed, so keep it stable). Load it
   first, then this file — anything here that touches calculator classes is a
   deliberate site-level override and lives in the "Calculator harmony"
   section at the bottom.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Palette */
  --sky: #ace1fa;
  --grass: #1c5429;
  --soil: #541b1e;
  --soil-deep: #3f1416;
  --worm: #f0b4a9;
  --worm-ink: #511a1d;
  --cream: #fef0e7;
  --gold: #ffc857;
  --gold-hot: #f4b400;
  --brick: #ba3226;
  --navy: #2c3e50;
  --army: #455425;
  --white: #ffffff;

  /* Type */
  --font-body: 'League Spartan', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-display: 'Jost', 'Futura', 'League Spartan', sans-serif;
  --tracking-wide: 0.25em;
  --tracking-wider: 0.3em;

  /* Layout */
  --content-width: 1100px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-pill: 999px;
  --radius-card: 14px;

  /* Waves */
  --wave-height: 64px;
  --wave-tile: 160px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--cream);
  background: var(--soil);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Type ---------- */
.display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
}

.display--xl {
  font-size: clamp(3rem, 8vw, 6rem);
}

.display--lg {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.eyebrow {
  font-weight: 700;
  font-size: clamp(0.85rem, 1.6vw, 1.25rem);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  margin: 0;
}

.section-title {
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
}

.text-worm { color: var(--worm); }
.text-sky { color: var(--sky); }
.text-grass { color: var(--grass); }
.text-cream { color: var(--cream); }
.text-gold { color: var(--gold); }

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding: clamp(32px, 6vw, 72px) var(--gutter);
}

.section--sky { background: var(--sky); color: var(--grass); }
.section--grass { background: var(--grass); color: var(--worm); }
.section--soil { background: var(--soil); color: var(--cream); }

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  position: relative;
}

.container--narrow {
  max-width: 720px;
}

.center {
  text-align: center;
}

.cta-row {
  margin-top: 40px;
}

.stack > * + * {
  margin-top: 1rem;
}

/* ---------- Beta banner ---------- */
.beta-banner {
  background: var(--grass);
  color: var(--cream);
  font-size: 0.9rem;
  padding: 6px 44px;
  text-align: center;
  position: relative;
}

.beta-banner[hidden] {
  display: none;
}

.beta-banner__tag {
  background: var(--brick);
  color: var(--white);
  font-weight: 800;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 8px;
  vertical-align: middle;
}

.beta-banner__link {
  color: var(--cream);
  font-weight: 700;
  margin-left: 12px;
}

.beta-banner__close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: var(--cream);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

/* ---------- Header + nav ---------- */
.site-header {
  background: var(--sky);
  color: var(--grass);
  text-align: center;
  padding: 18px var(--gutter) 4px;
}

.site-logo {
  display: inline-block;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  color: var(--grass);
  text-transform: uppercase;
}

.site-nav {
  margin-top: 14px;
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 20px;
}

.nav-link {
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--grass);
  padding: 6px 12px 4px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  transition: background-color 0.2s, color 0.2s;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  background: var(--grass);
  color: var(--sky);
}

.nav-link--outline {
  border-color: var(--grass);
}

.nav-link--solid {
  background: var(--grass);
  color: var(--sky);
}

.nav-link--solid:hover {
  background: var(--soil);
  color: var(--cream);
}

/* Auth-dependent nav items. site.js sets data-auth on <html>. */
[data-auth="signed-in"] .when-signed-out,
[data-auth="signed-out"] .when-signed-in,
html:not([data-auth]) .when-signed-in {
  display: none !important;
}

/* ---------- Wave dividers ----------
   Three layers: the lower section colour (background), a white layer, and the
   upper section colour on top. The two masks in /img cut the wavy edges, so
   colours are controlled entirely from here. */
.wave {
  --wave-above: var(--sky);
  --wave-below: var(--grass);
  position: relative;
  height: var(--wave-height);
  background: var(--wave-below);
  margin-top: -1px;
  overflow: hidden;
}

.wave::before,
.wave::after {
  content: '';
  position: absolute;
  inset: 0;
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: var(--wave-tile) var(--wave-height);
  mask-size: var(--wave-tile) var(--wave-height);
}

.wave::before {
  background: var(--white);
  -webkit-mask-image: url('/img/wave-under.svg');
  mask-image: url('/img/wave-under.svg');
}

.wave::after {
  background: var(--wave-above);
  -webkit-mask-image: url('/img/wave-over.svg');
  mask-image: url('/img/wave-over.svg');
}

.wave--sky-grass { --wave-above: var(--sky); --wave-below: var(--grass); }
.wave--sky-soil { --wave-above: var(--sky); --wave-below: var(--soil); }
.wave--grass-soil { --wave-above: var(--grass); --wave-below: var(--soil); }
.wave--soil-grass { --wave-above: var(--soil); --wave-below: var(--grass); }
.wave--grass-sky { --wave-above: var(--grass); --wave-below: var(--sky); }
.wave--soil-sky { --wave-above: var(--soil); --wave-below: var(--sky); }

/* ---------- Worms ---------- */
.worm {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  height: auto;
  transform-origin: 50% 95%;
  animation: worm-jiggle 1.6s ease-in-out infinite;
}

.worm--delay {
  animation-delay: -0.8s;
}

.worm--wiggle {
  animation-name: worm-wiggle;
  animation-duration: 1.1s;
}

@keyframes worm-jiggle {
  0%, 100% { transform: rotate(0deg) scale(1, 1); }
  20% { transform: rotate(-3deg) scale(1.02, 0.97); }
  40% { transform: rotate(2.5deg) scale(0.98, 1.03); }
  60% { transform: rotate(-1.5deg) scale(1.01, 0.99); }
  80% { transform: rotate(1deg) scale(1, 1.01); }
}

@keyframes worm-wiggle {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  25% { transform: rotate(3deg) translateY(-4px); }
  50% { transform: rotate(-2deg) translateY(0); }
  75% { transform: rotate(4deg) translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .worm,
  .worm-lab__svg {
    animation: none;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  text-align: center;
  border: 0;
  border-radius: 10px;
  padding: 14px 28px;
  cursor: pointer;
  transition: transform 0.15s, background-color 0.2s;
}

.btn:active {
  transform: scale(0.97);
}

.btn--gold {
  background: var(--gold);
  color: var(--navy);
}

.btn--gold:hover {
  background: var(--gold-hot);
}

.btn--worm {
  background: var(--worm);
  color: var(--soil);
}

.btn--worm:hover {
  background: var(--cream);
}

.btn--grass {
  background: var(--grass);
  color: var(--sky);
}

.btn--block {
  display: block;
  width: 100%;
}

/* Chunky answer buttons on the home hero */
.btn--answer {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
  padding: 0.25em 0.45em;
  border-radius: 18px;
  letter-spacing: -0.02em;
}

/* ---------- Home: hero ---------- */
.hero {
  text-align: center;
  padding-bottom: clamp(60px, 10vw, 140px);
  min-height: 560px;
  /* Clip sideways only, so the worm can hang down into the soil section */
  overflow-x: clip;
  overflow-y: visible;
}

.hero__title {
  margin-top: clamp(28px, 5vw, 60px);
}

.hero__answers {
  display: flex;
  justify-content: center;
  gap: clamp(40px, 9vw, 120px);
  margin-top: clamp(50px, 8vw, 100px);
  position: relative;
  z-index: 2;
}

/* The worm stands on the soil: its coil drops past the wave into the brown section */
.hero__worm {
  --worm-sink: clamp(40px, 6vw, 90px);
  width: clamp(160px, 18vw, 270px);
  left: max(2vw, calc(50% - 600px));
  bottom: calc(-1 * (var(--wave-height) + var(--worm-sink)));
  z-index: 5;
}

/* ---------- Home: impact ---------- */
.impact-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.impact-stat {
  text-align: center;
  padding: 24px 16px;
  border: 2px solid rgba(240, 180, 169, 0.35);
  border-radius: var(--radius-card);
}

.impact-stat__value {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--sky);
  line-height: 1.1;
}

.impact-stat__label {
  margin-top: 6px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--worm);
}

/* ---------- Log page ---------- */
.log-page {
  overflow: hidden;
  padding-top: clamp(24px, 4vw, 48px);
}

.log-page__title {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
  padding: 0 clamp(80px, 12vw, 200px);
}

.log-page__worm-left {
  width: clamp(130px, 15vw, 240px);
  left: -20px;
  top: 30px;
}

.log-page__worm-right {
  position: fixed;
  width: clamp(130px, 14vw, 240px);
  right: 10px;
  bottom: -10px;
}

/* ---------- Worm Lab ---------- */
.worm-lab__back {
  display: inline-block;
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 16px;
}

.worm-lab__back:hover {
  text-decoration: underline;
}

.worm-lab__welcome {
  max-width: 560px;
  margin: 0 auto 20px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 800;
  text-align: center;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
}

.worm-lab__welcome[hidden] {
  display: none;
}

.worm-lab__intro {
  color: var(--worm);
  font-size: 1.1rem;
  margin: 12px 0 0;
}

.worm-lab__grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 440px);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  margin-top: 32px;
}

.worm-lab__stage {
  position: sticky;
  top: 24px;
  background: radial-gradient(circle at 50% 70%, rgba(240, 180, 169, 0.18), transparent 65%);
  border-radius: var(--radius-card);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 460px;
  padding: 20px;
}

.worm-lab__preview {
  width: 100%;
  max-width: 420px;
}

.worm-lab__svg {
  width: 100%;
  height: auto;
  max-height: 560px;
  display: block;
  transform-origin: 50% 95%;
  animation: worm-jiggle 1.6s ease-in-out infinite;
}

.worm-lab__panel {
  background: var(--army);
  border-radius: var(--radius-card);
  padding: 22px;
}

.worm-picker {
  border: 0;
  margin: 0 0 16px;
  padding: 0;
}

.worm-picker__label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--worm);
  margin-bottom: 8px;
  padding: 0;
}

.worm-picker__options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.worm-picker__note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--cream);
  opacity: 0.8;
}

.worm-chip {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  padding: 7px 14px 5px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.worm-chip:hover {
  background: rgba(255, 255, 255, 0.22);
}

.worm-chip[aria-pressed="true"] {
  border-color: var(--gold);
  background: rgba(255, 200, 87, 0.2);
}

.worm-chip--swatch {
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--swatch);
  border-color: rgba(0, 0, 0, 0.25);
  font-size: 0.8rem;
}

.worm-chip--swatch:hover {
  background: var(--swatch);
  transform: scale(1.08);
}

.worm-chip--swatch[aria-pressed="true"] {
  background: var(--swatch);
  border-color: var(--cream);
  box-shadow: 0 0 0 3px var(--gold);
}

.worm-chip.is-locked {
  opacity: 0.55;
  cursor: help;
}

.worm-lab__actions {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.worm-lab__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Challenge page (/c/{uid}, rendered by the share Cloud Function) */
.challenge__card {
  width: 100%;
  height: auto;
  margin: 28px 0;
  border-radius: var(--radius-card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.challenge__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

/* Worm avatars (profile + Hall of Fame) */
.worm-avatar svg {
  display: block;
  width: 100%;
  height: auto;
}

.dashboard__worm {
  width: clamp(140px, 18vw, 200px);
  margin: 0 auto 8px;
}

.dashboard__worm-edit {
  display: block;
  text-align: center;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 12px;
}

.dashboard__worm-edit[hidden] {
  display: none;
}

.leaderboard__worm {
  display: inline-block;
  width: 44px;
  vertical-align: middle;
  margin-right: 10px;
}

/* ---------- Leaderboard ---------- */
.leaderboard {
  width: 100%;
  border-collapse: collapse;
  margin-top: 32px;
  font-size: 1.05rem;
}

.leaderboard th {
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sky);
  padding: 10px 12px;
  border-bottom: 2px solid rgba(172, 225, 250, 0.4);
}

.leaderboard td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(240, 180, 169, 0.2);
}

.leaderboard .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.leaderboard__rank {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--worm);
  width: 3em;
}

.leaderboard tr:nth-child(1) .leaderboard__rank { color: var(--gold); }

.leaderboard a {
  color: var(--cream);
  font-weight: 700;
  text-decoration: none;
}

.leaderboard a:hover {
  text-decoration: underline;
}

.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--worm);
  font-style: italic;
}

/* ---------- Content cards (About / Get started) ---------- */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.card {
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--radius-card);
  padding: 24px;
}

.card__step {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 2.6rem;
  color: var(--gold);
  line-height: 1;
}

.card__title {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 10px 0 8px;
  color: var(--sky);
}

.card p,
.prose p {
  line-height: 1.6;
  margin: 0 0 1em;
}

.prose {
  font-size: 1.1rem;
}

.split {
  display: grid;
  grid-template-columns: 1fr minmax(160px, 280px);
  gap: 40px;
  align-items: center;
}

.split .worm {
  position: relative;
}

/* ---------- Compost 101 (/guide) ---------- */
.jump-links {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.jump-links a {
  display: inline-block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--cream);
  text-decoration: none;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-pill);
  padding: 8px 16px 6px;
}

.jump-links a:hover {
  background: rgba(0, 0, 0, 0.35);
}

/* Six-card sections: three across instead of four-then-two */
.content-grid--wide {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.lookup__intro {
  max-width: 640px;
  margin: 16px auto 0;
  line-height: 1.5;
}

.lookup {
  max-width: 560px;
  margin: 28px auto 0;
}

.lookup .lookup__input {
  font-size: 1.15rem;
  padding: 14px 18px;
  border-radius: var(--radius-pill);
}

.lookup__count {
  min-height: 1.2em;
  margin: 10px 0 0;
  text-align: center;
  color: var(--worm);
  font-size: 0.9rem;
}

.lookup__results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.lookup__results .empty-state {
  grid-column: 1 / -1;
}

.lookup-card {
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--radius-card);
  padding: 20px;
}

.lookup-card__name {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--sky);
  margin: 0 0 12px;
}

.lookup-card__verdicts {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lookup-card__note {
  margin: 0;
  line-height: 1.5;
}

.verdict {
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 5px 10px 3px;
}

.verdict--yes { background: var(--grass); color: var(--cream); }
.verdict--maybe { background: var(--gold); color: var(--worm-ink); }
.verdict--no { background: var(--brick); color: var(--white); }

.trouble {
  margin-top: 28px;
}

.trouble__item {
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  color: var(--cream);
}

.trouble__item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 18px 20px 16px;
}

.trouble__item p {
  margin: 0;
  padding: 0 20px 18px;
  line-height: 1.6;
}

.guide__sources {
  margin-top: 32px;
  font-size: 0.85rem;
  line-height: 1.6;
  opacity: 0.85;
}

/* ---------- Auth forms ---------- */
.auth-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--army);
  border-radius: var(--radius-card);
  padding: 32px 28px;
  color: var(--cream);
}

.auth-card .display {
  color: var(--worm);
  text-align: center;
  margin-bottom: 20px;
}

.form-field {
  display: block;
  margin-bottom: 14px;
}

.form-field__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.form-field__input {
  width: 100%;
  font: inherit;
  padding: 12px;
  border: 0;
  border-radius: 6px;
  background: var(--cream);
  color: var(--navy);
}

.form-error {
  background: rgba(186, 50, 38, 0.9);
  color: var(--white);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

.form-error[hidden] {
  display: none;
}

.auth-providers {
  display: grid;
  gap: 10px;
}

.btn--provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--cream);
  color: var(--navy);
}

.btn--provider:hover {
  background: var(--white);
}

.btn__icon {
  width: 18px;
  height: 18px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.8;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(254, 240, 231, 0.35);
}

.auth-card__alt {
  text-align: center;
  margin-top: 16px;
  font-size: 0.95rem;
}

.auth-card__alt a {
  color: var(--gold);
  font-weight: 700;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 150%);
  background: var(--grass);
  color: var(--cream);
  font-weight: 700;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1001;
}

.toast.is-visible {
  transform: translate(-50%, 0);
}

.toast--error {
  background: var(--brick);
}

/* ---------- Live-data badge (local ?live=1 mode, see firebase-init.js) ---------- */
.env-badge {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 1002;
  background: var(--brick);
  color: var(--white);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

[data-env="live"] .site-header {
  box-shadow: inset 0 6px 0 var(--brick);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--grass);
  color: var(--worm);
  text-align: center;
  padding: 28px var(--gutter);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.site-footer a {
  color: var(--sky);
  text-decoration: none;
  font-weight: 700;
}

/* ==========================================================================
   Calculator harmony
   Site-level overrides for Compost-league-styles.css components so the
   calculator and dashboard sit on the soil background like the live site.
   ========================================================================== */
.compost-calculator {
  min-height: 0;
  position: relative;
  z-index: 2;
}

.calculator-container {
  max-width: 560px;
  padding-top: clamp(32px, 5vw, 64px);
}

.impact-preview-grid {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 900px) {
  .impact-preview-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.motivational-message {
  background: var(--soil-deep);
}

.achievement-progress-preview,
.achievement-progress {
  margin: 0 0 14px;
}

.achievement-progress-preview .progress-bar {
  width: 0;
}

.impact-preview-grid {
  margin-bottom: 14px;
}

.preview-item {
  background: transparent;
}

.preview-label {
  color: var(--worm);
}

.method-field-group {
  margin-bottom: 14px;
}

#status-message {
  margin-top: 15px;
  padding: 10px;
  border-radius: 5px;
  text-align: center;
  font-weight: 600;
}

/* Champion dashboard */
.dashboard {
  max-width: 900px;
}

.dashboard .impact-stat__value {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.dashboard .achievement-progress {
  margin: 32px 0;
}

.dashboard .badges-grid {
  margin-top: 20px;
}

.achievement-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 32px;
}

.achievement-badge {
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
}

.achievement-badge.locked {
  opacity: 0.45;
  filter: grayscale(1);
}

.badge-icon {
  font-size: 1.8rem;
}

.error-message {
  background: rgba(186, 50, 38, 0.9);
  color: var(--white);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  text-align: center;
}

.loading-indicator {
  text-align: center;
  font-style: italic;
  color: var(--worm);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .log-page__title {
    padding: 0 12px;
  }

  .log-page__worm-left {
    position: relative;
    left: auto;
    top: auto;
    margin: 0 auto 12px;
  }

  .log-page__worm-right {
    display: none;
  }

  .split,
  .worm-lab__grid {
    grid-template-columns: 1fr;
  }

  .worm-lab__stage {
    position: relative;
    top: auto;
    min-height: 0;
  }

  .worm-lab__preview {
    max-width: 260px;
  }

  .split .worm {
    max-width: 200px;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .hero__worm {
    position: relative;
    left: auto;
    bottom: auto;
    margin: 40px auto calc(-1 * (var(--wave-height) + 32px + var(--worm-sink)));
  }

  .hero {
    padding-bottom: 32px;
  }

  .nav-link {
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    padding: 5px 9px 3px;
  }

  .leaderboard .hide-sm {
    display: none;
  }
}
