* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #f6efe2;
  --bg-soft: #fbf7ee;
  --panel: rgba(255, 248, 238, 0.82);
  --panel-strong: rgba(255, 250, 244, 0.96);
  --line: rgba(103, 73, 34, 0.12);
  --line-strong: rgba(103, 73, 34, 0.24);
  --text: #2b241e;
  --muted: #6f665c;
  --accent: #c66533;
  --accent-deep: #8e4c1c;
  --accent-soft: #f0c27d;
  --green: #3f7b4c;
  --water: #6ca7a7;
  --sun: #f6dd8c;
  --shadow: 0 28px 60px rgba(72, 45, 17, 0.12);
  --radius-xl: 36px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --max-width: 1180px;
}

html[data-mode="night"] {
  color-scheme: dark;
  --bg: #10231c;
  --bg-soft: #183228;
  --panel: rgba(15, 35, 28, 0.78);
  --panel-strong: rgba(19, 44, 34, 0.94);
  --line: rgba(225, 218, 191, 0.12);
  --line-strong: rgba(225, 218, 191, 0.22);
  --text: #f6f1e6;
  --muted: #c4baa6;
  --accent: #e18d4f;
  --accent-deep: #f0b17a;
  --accent-soft: #d8c88b;
  --green: #7fc87d;
  --water: #7dc7cf;
  --sun: #f5d582;
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.26);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 12% 14%, rgba(240, 194, 125, 0.28), transparent 26%),
    radial-gradient(circle at 88% 10%, rgba(108, 167, 167, 0.24), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: "Bahnschrift", "Trebuchet MS", sans-serif;
  overflow-x: hidden;
}

a,
button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea {
  color: inherit;
}

.site-shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.hero,
.section,
.site-footer {
  position: relative;
}

.hero {
  padding: 18px 0 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--sun));
  color: #fffaf2;
  font-family: "Palatino Linotype", "Book Antiqua", serif;
  font-size: 1.5rem;
  box-shadow: var(--shadow);
}

.brand-text,
.toggle-copy {
  display: grid;
  gap: 4px;
}

.brand-text strong,
.hero h1,
.section-heading h2,
.mural-head h3,
.principle-card h3,
.route-card strong,
.idea-card h3,
.toggle-group legend {
  font-family: "Palatino Linotype", "Book Antiqua", serif;
}

.brand-text small {
  color: var(--muted);
}

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

.topbar-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 0;
  position: relative;
}

.topbar-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.topbar-links a:hover::after,
.topbar-links a:focus-visible::after {
  transform: scaleX(1);
}

.hero-grid,
.simulator-layout,
.pledge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 24px;
}

.hero-copy,
.panel,
.site-footer {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  padding: 32px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent),
    var(--panel);
}

.hero-copy::before,
.panel::before,
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.04),
      rgba(255, 255, 255, 0.04) 12px,
      transparent 12px,
      transparent 24px
    );
  opacity: 0.4;
  pointer-events: none;
}

.eyebrow,
.floating-label,
.output-label,
.principle-number {
  margin: 0 0 12px;
  color: var(--accent-deep);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 6vw, 5.2rem);
  line-height: 0.92;
  max-width: 10ch;
}

.hero-lead,
.section-heading p,
.stat-card p,
.principle-card p,
.route-card p,
.idea-card p,
.site-footer p,
.toggle-copy small,
.floating-card p:last-child,
.mural-head p {
  line-height: 1.7;
  color: var(--muted);
}

.hero-lead {
  max-width: 62ch;
  margin: 18px 0 24px;
  font-size: 1.04rem;
}

.hero-actions,
.hero-pills,
.footer-tags,
.output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #fffaf2;
  box-shadow: 0 16px 28px rgba(198, 101, 51, 0.24);
}

.button-soft {
  background: linear-gradient(135deg, rgba(63, 123, 76, 0.16), rgba(108, 167, 167, 0.18));
  color: var(--text);
  border: 1px solid var(--line);
}

.button-outline {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.full-width {
  width: 100%;
  justify-content: center;
}

.hero-pills span,
.footer-tags span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-stats,
.principles-grid,
.ideas-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.stat-card,
.principle-card,
.idea-card,
.route-card,
.impact-card,
.mural-card {
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

.stat-card,
.principle-card,
.idea-card,
.impact-card,
.route-card,
.mural-card {
  padding: 18px;
}

.stat-card span,
.impact-card span {
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-card strong,
.impact-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.3rem;
}

.hero-visual {
  display: grid;
  gap: 18px;
  align-content: start;
}

.sky-glow {
  position: absolute;
  top: 12px;
  right: 40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 221, 140, 0.46), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

.scene-card,
.floating-card {
  position: relative;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.scene-card {
  min-height: 500px;
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.78), rgba(255, 245, 233, 0.22)),
    linear-gradient(180deg, #d7ecf7 0%, #f0e6ca 58%, #d7b37d 100%);
  overflow: hidden;
}

html[data-mode="night"] .scene-card {
  background:
    linear-gradient(180deg, rgba(9, 21, 17, 0.22), rgba(9, 21, 17, 0.42)),
    linear-gradient(180deg, #1a3342 0%, #183227 56%, #5d4c34 100%);
}

.scene-sun {
  position: absolute;
  top: 74px;
  right: 88px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8d6, var(--sun));
  box-shadow: 0 0 60px rgba(246, 221, 140, 0.55);
}

html[data-mode="night"] .scene-sun {
  top: 64px;
  right: 78px;
  width: 86px;
  height: 86px;
  background: radial-gradient(circle at 35% 35%, #fff4c4, #c9b97e);
  box-shadow: 0 0 48px rgba(201, 185, 126, 0.42);
}

.scene-cloud {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  filter: blur(1px);
  animation: drift 10s ease-in-out infinite alternate;
}

.cloud-a {
  top: 78px;
  left: 64px;
  width: 128px;
  height: 34px;
}

.cloud-b {
  top: 138px;
  left: 150px;
  width: 88px;
  height: 26px;
  animation-duration: 13s;
}

html[data-mode="night"] .scene-cloud {
  background: rgba(234, 245, 255, 0.16);
}

.scene-hill,
.scene-fields,
.scene-river,
.scene-city,
.scene-windmill {
  position: absolute;
}

.scene-hill {
  border-radius: 50%;
}

.hill-back {
  inset: auto -10% 28% 8%;
  height: 230px;
  background: #73995c;
}

.hill-front {
  inset: auto -14% 8% -8%;
  height: 260px;
  background: #4e7e45;
}

html[data-mode="night"] .hill-back {
  background: #335940;
}

html[data-mode="night"] .hill-front {
  background: #254432;
}

.scene-fields {
  left: -4%;
  right: 18%;
  bottom: 0;
  height: 45%;
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.12) 100%),
    repeating-linear-gradient(
      -18deg,
      rgba(242, 221, 172, 0.9) 0 10px,
      rgba(182, 123, 64, 0.92) 10px 20px
    );
  clip-path: ellipse(72% 74% at 36% 100%);
}

html[data-mode="night"] .scene-fields {
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.08) 100%),
    repeating-linear-gradient(
      -18deg,
      rgba(162, 131, 82, 0.92) 0 10px,
      rgba(100, 67, 42, 0.95) 10px 20px
    );
}

.scene-river {
  right: 12%;
  bottom: 6%;
  width: 180px;
  height: 220px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(108, 167, 167, 0.95));
  clip-path: polygon(26% 0, 64% 10%, 74% 34%, 66% 56%, 84% 100%, 52% 100%, 38% 60%, 10% 28%);
}

.scene-city {
  right: 6%;
  bottom: 19%;
  width: 190px;
  height: 160px;
  display: flex;
  gap: 10px;
  align-items: end;
}

.building {
  display: block;
  width: 34px;
  border-radius: 12px 12px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent),
    #d28855;
}

.building-a { height: 76px; }
.building-b { height: 116px; }
.building-c { height: 92px; }
.building-d { height: 136px; }

html[data-mode="night"] .building {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent),
    #9b6a49;
}

.scene-windmill {
  left: 60%;
  bottom: 28%;
  width: 92px;
  height: 170px;
}

.windmill-stick {
  position: absolute;
  bottom: 0;
  left: 42px;
  width: 8px;
  height: 116px;
  border-radius: 99px;
  background: #eef1df;
}

.windmill-core {
  position: absolute;
  top: 34px;
  left: 33px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #eef1df;
}

.blade {
  position: absolute;
  top: 8px;
  left: 35px;
  width: 20px;
  height: 54px;
  border-radius: 99px;
  background: #eef1df;
  transform-origin: 50% 78%;
  animation: spin 7s linear infinite;
}

.blade-a { transform: rotate(0deg); }
.blade-b { transform: rotate(120deg); }
.blade-c { transform: rotate(240deg); }

.floating-card {
  padding: 20px;
  background: var(--panel-strong);
}

.floating-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.section {
  margin-top: 26px;
  padding: 34px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.6);
}

html[data-mode="night"] .section {
  background: rgba(14, 31, 24, 0.58);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 0.98;
}

.panel {
  position: relative;
  padding: 24px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.toggle-group {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 12px;
}

.toggle-group legend {
  margin-bottom: 14px;
  font-size: 1.24rem;
}

.toggle-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid var(--line);
  cursor: pointer;
}

.toggle-card input {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  accent-color: var(--green);
}

.range-block,
.select-block,
.pledge-form label {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.range-block label,
.select-block span,
.pledge-form span {
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.range-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

select,
input[type="text"],
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.42);
  outline: none;
}

html[data-mode="night"] select,
html[data-mode="night"] input[type="text"],
html[data-mode="night"] textarea {
  background: rgba(255, 255, 255, 0.08);
}

select:focus,
input[type="text"]:focus,
textarea:focus {
  border-color: rgba(198, 101, 51, 0.55);
  box-shadow: 0 0 0 3px rgba(198, 101, 51, 0.14);
}

.result-panel {
  display: grid;
  gap: 18px;
}

.gauge-shell {
  --score-angle: 0deg;
  width: min(100%, 290px);
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 18px;
  border-radius: 50%;
  background:
    conic-gradient(var(--green) 0deg, var(--green) var(--score-angle), rgba(255, 255, 255, 0.2) var(--score-angle) 360deg);
  display: grid;
  place-items: center;
}

.gauge-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--panel-strong);
  padding: 24px;
}

.gauge-core span,
.gauge-core small,
.impact-narrative,
.impact-highlights li,
.output-status {
  color: var(--muted);
}

.gauge-core strong {
  font-size: 3.4rem;
  line-height: 1;
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.impact-card strong {
  font-size: 1.5rem;
}

.impact-narrative,
.pledge-output blockquote,
.empty-state {
  margin: 0;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.22);
}

.impact-highlights {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.tone-earth {
  background: linear-gradient(180deg, rgba(179, 126, 70, 0.18), rgba(255, 255, 255, 0.24));
}

.tone-sun {
  background: linear-gradient(180deg, rgba(246, 221, 140, 0.28), rgba(255, 255, 255, 0.2));
}

.tone-water {
  background: linear-gradient(180deg, rgba(108, 167, 167, 0.22), rgba(255, 255, 255, 0.22));
}

.tone-city {
  background: linear-gradient(180deg, rgba(104, 119, 135, 0.18), rgba(255, 255, 255, 0.24));
}

.pledge-output {
  display: grid;
  gap: 18px;
}

.mural-head {
  margin: 28px 0 14px;
}

.mural-head h3 {
  margin: 0 0 6px;
  font-size: 1.5rem;
}

.pledge-wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mural-card strong {
  display: block;
  margin-bottom: 8px;
}

.mural-card p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.6;
}

.mural-card small {
  color: var(--accent-deep);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
}

.site-footer {
  margin-top: 26px;
  padding: 26px;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 500ms ease, transform 500ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(12px, -8px, 0); }
}

@keyframes spin {
  from { rotate: 0deg; }
  to { rotate: 360deg; }
}

@media (max-width: 1100px) {
  .hero-grid,
  .simulator-layout,
  .pledge-layout,
  .route-grid {
    grid-template-columns: 1fr;
  }

  .route-grid {
    list-style: decimal;
    padding-left: 20px;
  }

  .pledge-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .site-shell {
    width: min(calc(100% - 24px), var(--max-width));
    padding-top: 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-links {
    justify-content: flex-start;
  }

  .hero-copy,
  .panel,
  .section,
  .site-footer {
    padding: 20px;
  }

  .hero h1,
  .section-heading h2 {
    max-width: none;
  }

  .hero-stats,
  .principles-grid,
  .ideas-grid,
  .impact-grid,
  .pledge-wall {
    grid-template-columns: 1fr;
  }

  .scene-card {
    min-height: 420px;
  }
}

@media (max-width: 560px) {
  .button,
  .hero-actions a,
  .hero-actions button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .hero-pills,
  .footer-tags,
  .output-actions {
    flex-direction: column;
  }

  .scene-card {
    min-height: 360px;
  }

  .scene-sun {
    right: 42px;
  }

  .scene-city {
    right: 2%;
    scale: 0.88;
    transform-origin: bottom right;
  }

  .scene-windmill {
    left: 54%;
    scale: 0.88;
    transform-origin: bottom center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
