/* ---------- Tokens ---------- */
:root {
  --fall: #e8641b;
  --leaf: #b8460f;
  --winter: #cfe8ff;
  --snow: #ffffff;
  --pumpkin: #f28c28;
  --ink: #1a1a1a;

  --split: 50%;                 /* width of the fall side, set by js/dial.js */

  --font-display: "Bagel Fat One", system-ui, sans-serif;
  --font-body: Outfit, system-ui, sans-serif;
}

/* ---------- Base: exactly one screen, never scrolls ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--winter);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, p { margin: 0; }

/* ---------- Scene layers ---------- */
.scene {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--winter);
}

.fall {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--split);
  background: var(--fall);
  overflow: hidden;
  transition: width 90ms linear;
}

.leaves { width: 100%; height: 100%; }
.leaves g { fill: var(--leaf); opacity: 0.55; }

.snow {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  pointer-events: none;
}
.snow g { fill: var(--snow); }

.pumpkin {
  position: absolute;
  bottom: 6%;
  left: clamp(50px, var(--split), calc(100% - 50px));
  width: clamp(90px, 22vh, 220px);
  transform: translateX(-50%);
  transition: left 90ms linear;
}

/* ---------- Content ---------- */
.content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 3.5vh, 40px) clamp(18px, 4vw, 56px) 12vh;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  font-weight: 800;
  font-size: clamp(12px, 1.7vh, 15px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.center {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(8px, 2vh, 20px);
}

h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, min(13vw, 17vh), 220px);
  line-height: 0.9;
  letter-spacing: -0.01em;
}

.lead {
  max-width: 520px;
  font-size: clamp(15px, 2.3vh, 21px);
  font-weight: 600;
  line-height: 1.4;
}

/* ---------- Dial card ---------- */
.dial-card {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: clamp(12px, 2vh, 20px) clamp(16px, 2.5vw, 26px);
  background: #ffffff;
  border: 3px solid var(--ink);
  border-radius: 22px;
  text-align: left;
}

.dial-label {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

input[type="range"] {
  width: 100%;
  min-height: 32px;
  margin: 0;
  accent-color: var(--ink);
  cursor: pointer;
}

input[type="range"]:focus-visible {
  outline: 3px solid var(--fall);
  outline-offset: 4px;
  border-radius: 4px;
}

.dial-ends {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.status {
  min-height: 2.6em;
  font-size: clamp(14px, 2vh, 17px);
  font-weight: 600;
  line-height: 1.3;
}

/* ---------- Short screens (landscape phones, small laptops) ---------- */
@media (max-height: 560px) {
  .content { padding-bottom: 10vh; }
  h1 { font-size: clamp(34px, min(10vw, 14vh), 120px); }
  .lead { font-size: 14px; max-width: 460px; }
  .dial-card { gap: 4px; padding: 8px 16px; border-width: 2px; }
  input[type="range"] { min-height: 24px; }
  .status { min-height: 0; font-size: 13px; }
  .pumpkin { width: clamp(64px, 20vh, 120px); }
}

@media (max-height: 440px) {
  .lead { display: none; }
  .dial-ends { display: none; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .fall,
  .pumpkin { transition: none; }
}
