/* ==========================================================================
   Watch the Grass Grow — minimalist theme
   Pure CSS, no libraries, no external fonts.
   ========================================================================== */

:root {
  --ink: #1c2b21;
  --ink-soft: #46584c;
  --paper: #f4f7f2;
  --paper-edge: #e4ebe0;
  --line: #d3ddcd;
  --grass: #4a8a3d;
  --grass-deep: #2f6a2a;
  --accent: #6fb04a;
  --shadow: 0 6px 24px rgba(28, 43, 33, 0.14);
  --radius: 14px;
  --hud-bg: rgba(244, 247, 242, 0.82);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Stage & canvas
   -------------------------------------------------------------------------- */
#stage {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 70vh;
  overflow: hidden;
}

#scene {
  display: block;
  /* Absolute-fill the stage. A plain height:100% doesn't resolve reliably
     against a flex-grown parent, which left a gap above the footer. */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* --------------------------------------------------------------------------
   HUD
   -------------------------------------------------------------------------- */
.hud {
  position: absolute;
  top: clamp(12px, 2.4vw, 26px);
  left: clamp(12px, 2.4vw, 26px);
  width: min(260px, 72vw);
  padding: 14px 16px;
  background: var(--hud-bg);
  border: 1px solid var(--line);
  /* Cut corners echo the low-poly scene (clip-path swallows box-shadow,
     so the border + blur carry the depth instead). */
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px),
                     calc(100% - 12px) 100%, 0 100%, 0 12px);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  user-select: none;
}

.hud-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.hud-badge {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 4px 9px;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px),
                     calc(100% - 6px) 100%, 0 100%, 0 6px);
  background: var(--grass);
  color: #fff;
  white-space: nowrap;
}

.hud-badge--muted {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.hud-meter {
  height: 8px;
  background: var(--paper-edge);
  overflow: hidden;
  border: 1px solid var(--line);
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px),
                     calc(100% - 4px) 100%, 0 100%, 0 4px);
}

.hud-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--grass-deep), var(--accent));
  transition: width 0.6s ease;
}

.hud-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

#hud-progress { font-weight: 700; }
.hud-muted { color: var(--ink-soft); }

.mow-btn {
  margin-top: 12px;
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--grass-deep);
  background: transparent;
  border: 1px solid var(--grass);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px),
                     calc(100% - 8px) 100%, 0 100%, 0 8px);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.05s ease;
}

.mow-btn:hover { background: var(--grass); color: #fff; }
.mow-btn:active { transform: translateY(1px); }

.mow-btn--solid {
  background: var(--grass);
  color: #fff;
  margin-top: 18px;
  padding: 11px 20px;
  width: auto;
}
.mow-btn--solid:hover { background: var(--grass-deep); }

/* --------------------------------------------------------------------------
   Finale overlay
   -------------------------------------------------------------------------- */
.finale {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}

.finale[hidden] { display: none; }

.finale-card {
  pointer-events: auto;
  text-align: center;
  padding: clamp(24px, 4vw, 40px) clamp(28px, 5vw, 56px);
  background: rgba(244, 247, 242, 0.9);
  border: 1px solid var(--line);
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px),
                     calc(100% - 22px) 100%, 0 100%, 0 22px);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: pop-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.86) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.finale-title {
  margin: 0;
  font-size: clamp(30px, 6vw, 52px);
  letter-spacing: -0.02em;
  color: var(--grass-deep);
}

.finale-sub {
  margin: 6px 0 0;
  font-size: clamp(16px, 2.6vw, 22px);
  color: var(--ink);
}

.finale-detail {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 34ch;
  margin-inline: auto;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  flex: 0 0 auto;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.footer-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  max-width: 1100px;
  margin: 0 auto;
}

.footer-summary {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.footer-summary strong { color: var(--ink); }

.learn-btn {
  flex: 0 0 auto;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 650;
  color: #fff;
  background: var(--grass);
  border: none;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px),
                     calc(100% - 8px) 100%, 0 100%, 0 8px);
  cursor: pointer;
  transition: background 0.18s ease;
  white-space: nowrap;
}
.learn-btn:hover { background: var(--grass-deep); }

.footer-details {
  border-top: 1px solid var(--line);
  background: var(--paper-edge);
  animation: slide-down 0.35s ease both;
}
.footer-details[hidden] { display: none; }

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(18px, 3vw, 36px);
  padding: clamp(22px, 4vw, 40px) clamp(16px, 4vw, 40px);
  max-width: 1100px;
  margin: 0 auto;
}

.footer-grid h2 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--grass-deep);
}

.footer-grid p {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.footer-grid p strong,
.footer-grid li strong { color: var(--ink); }

.scale-list,
.sources {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.scale-list li { margin-bottom: 2px; }

.scale-note,
.disclaimer {
  font-size: 12.5px !important;
  font-style: italic;
  color: var(--ink-soft);
}

.sources { list-style: none; padding-left: 0; }
.sources li { margin-bottom: 10px; }

.sources a {
  color: var(--grass-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}
.sources a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .finale-card,
  .footer-details { animation: none; }
  .hud-meter-fill { transition: none; }
}

@media (max-width: 560px) {
  .footer-bar { flex-direction: column; align-items: flex-start; }
  .hud { top: 10px; left: 10px; padding: 12px; }
}
