/* ==========================================================================
   Keep on Keeping On — home page
   ========================================================================== */

/* --- Hero --------------------------------------------------------------- */
.hero {
  background: var(--forest-900);
  color: var(--cream);
  padding: clamp(44px, 6vw, 88px) var(--gutter) clamp(52px, 6vw, 96px);
}
.hero__title {
  font-size: clamp(40px, 6.4vw, 74px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 22px 0 20px;
}
.hero__lede { font-size: clamp(18px, 2.2vw, 22px); line-height: 1.6; color: var(--on-dark); max-width: 30em; margin-bottom: 14px; }
.hero__sub { font-size: 17.5px; line-height: 1.7; color: var(--on-dark-mute); max-width: 30em; margin-bottom: 30px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Live counter */
.counter {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 34px;
  flex-wrap: wrap;
}
.counter__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  transition: transform 260ms var(--ease), color 260ms var(--ease);
  display: inline-block;
}
.counter__value.is-up   { transform: translateY(-4px); color: #FFD79B; }
.counter__value.is-down { transform: translateY(3px); }
.counter__label { font-size: 17px; color: var(--on-dark); }
.counter__pulse {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--amber);
  align-self: center;
  box-shadow: 0 0 0 0 rgba(240, 169, 78, 0.7);
  animation: koko-pulse 2s var(--ease) infinite;
  flex: none;
}
@keyframes koko-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(240, 169, 78, 0.55); }
  70%  { box-shadow: 0 0 0 12px rgba(240, 169, 78, 0); }
  100% { box-shadow: 0 0 0 0 rgba(240, 169, 78, 0); }
}

/* --- Ticker ------------------------------------------------------------- */
.ticker {
  background: var(--amber);
  color: var(--forest-900);
  overflow: hidden;
  padding: 14px 0;
  border-top: 3px solid var(--forest-900);
  border-bottom: 3px solid var(--forest-900);
}
.ticker__track {
  display: flex;
  width: max-content;
  animation: koko-ticker 34s linear infinite;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
}
.ticker__run { display: flex; gap: 26px; padding-right: 26px; }
@keyframes koko-ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker__track { animation: none; } }

/* --- Why (the section that used to overlap) ------------------------------
   The image column is a plain grid item in normal flow. Each frame sizes
   itself with aspect-ratio, so nothing is absolutely positioned and nothing
   can bleed into the section below.                                        */
.why__title { font-size: clamp(30px, 4.2vw, 48px); line-height: 1.08; color: var(--forest-700); margin-bottom: 22px; }

/* --- Habit cards -------------------------------------------------------- */
.habits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 22px;
}
.habit {
  background: #fff;
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
}
.habit:hover { transform: translateY(-5px); }
.habit__media { aspect-ratio: 16 / 10; }
.habit__media img { width: 100%; height: 100%; object-fit: cover; }
.habit__body { padding: 28px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.habit__head { display: flex; align-items: center; gap: 12px; }
.habit__badge {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  color: #fff;
  flex: none;
}
.habit__name { font-family: var(--font-display); font-weight: 700; font-size: 24px; }
.habit__copy { font-size: 17px; line-height: 1.65; color: var(--ink-soft); flex: 1; }

.habit--safe  { border: 1px solid rgba(29, 92, 130, 0.18); box-shadow: 0 3px 0 rgba(29, 92, 130, 0.14); }
.habit--safe:hover { box-shadow: 0 12px 26px rgba(29, 92, 130, 0.18); }
.habit--safe .habit__badge { background: var(--blue); }
.habit--safe .habit__name { color: var(--blue); }

.habit--clean { border: 1px solid rgba(47, 107, 60, 0.2); box-shadow: 0 3px 0 rgba(47, 107, 60, 0.16); }
.habit--clean:hover { box-shadow: 0 12px 26px rgba(47, 107, 60, 0.2); }
.habit--clean .habit__badge { background: var(--green); }
.habit--clean .habit__name { color: var(--green); }

.habit--left { border: 1px solid rgba(240, 169, 78, 0.4); box-shadow: 0 3px 0 rgba(190, 120, 30, 0.2); }
.habit--left:hover { box-shadow: 0 12px 26px rgba(190, 120, 30, 0.24); }
.habit--left .habit__badge { background: var(--amber); color: var(--forest-900); }
.habit--left .habit__name { color: var(--amber-ink); }

/* --- Film ---------------------------------------------------------------- */
.film-section { background: var(--forest-700); color: var(--cream); padding: clamp(52px, 7vw, 100px) var(--gutter); }
.film-section h2 { font-size: clamp(28px, 3.8vw, 42px); line-height: 1.1; margin-bottom: 12px; }
.film-section .lede { color: var(--on-dark); margin-bottom: 30px; }

.film {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--forest-900);
  border: 3px solid var(--amber);
}
.film__stage, .film video { position: absolute; inset: 0; width: 100%; height: 100%; }
.film video { object-fit: cover; }
.film__stage svg { width: 100%; height: 100%; }
.film[data-mode="video"] .film__stage { display: none; }
.film[data-mode="svg"] video { display: none; }

.film__controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(to top, rgba(20, 51, 39, 0.92), rgba(20, 51, 39, 0));
}
.film__btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--amber);
  color: var(--forest-900);
  display: grid; place-items: center;
  cursor: pointer;
  flex: none;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
  transition: transform 150ms var(--ease), background-color 150ms var(--ease);
}
.film__btn:hover { background: var(--amber-hi); transform: translateY(-2px); }
.film__btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
.film__btn svg { width: 20px; height: 20px; fill: currentColor; }
.film__status { font-size: 15.5px; color: var(--on-dark-soft); }

/* Scenes inside the SVG film loop */
.film.is-paused .film__stage * { animation-play-state: paused !important; }

/* --- Tuesday tiles ------------------------------------------------------ */
.tuesday { background: var(--forest-700); color: var(--cream); padding: clamp(52px, 7vw, 100px) var(--gutter); }
.tuesday h2 { font-size: clamp(28px, 3.8vw, 42px); line-height: 1.1; margin-bottom: 12px; }
.tuesday .lede { color: var(--on-dark); margin-bottom: 36px; }
.tuesday .tiles { margin-bottom: 38px; }

/* --- Suburbs ------------------------------------------------------------ */
.suburbs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.suburbs span {
  background: #fff;
  border: 1px solid rgba(31, 77, 58, 0.18);
  color: var(--forest-700);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15.5px;
  padding: 11px 18px;
  border-radius: 999px;
}
.strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.strip > * { aspect-ratio: 3 / 4; }

/* --- Sign-up ------------------------------------------------------------ */
.signup { padding: 0 var(--gutter) clamp(56px, 8vw, 104px); scroll-margin-top: 80px; }
.signup__card {
  max-width: 820px;
  margin-inline: auto;
  background: var(--forest-900);
  border-radius: var(--r-xl);
  padding: clamp(28px, 4.4vw, 54px);
  color: var(--cream);
  border: 3px solid var(--amber);
}
.signup__card h2 { font-size: clamp(28px, 4vw, 44px); line-height: 1.08; margin-bottom: 14px; }
.signup__lede { font-size: 18.5px; line-height: 1.7; color: var(--on-dark); max-width: 32em; margin-bottom: 10px; }
.signup__fine { font-size: 17px; line-height: 1.7; color: var(--on-dark-mute); max-width: 32em; margin-bottom: 30px; }

.signup form { display: grid; gap: 18px; }
.signup .field__label { color: var(--on-dark-soft); }
.signup .field__hint { color: var(--on-dark-mute); }
.signup .field input {
  border: 1.5px solid rgba(250, 246, 238, 0.25);
  background: rgba(250, 246, 238, 0.07);
  color: var(--cream);
}
.signup .field input::placeholder { color: rgba(250, 246, 238, 0.45); }
.signup .field input:focus { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(240, 169, 78, 0.2); }
.signup .field.is-invalid input { border-color: #F08A7A; background: rgba(240, 138, 122, 0.09); }
.signup .field__error { color: #FFB3A3; }

.pillars__label { font-size: 15px; font-weight: 600; color: var(--on-dark-soft); margin-bottom: 12px; }
.pillars__row { display: flex; flex-wrap: wrap; gap: 12px; }
.pillar {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16.5px;
  padding: 14px 24px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 54px;
  background: rgba(250, 246, 238, 0.07);
  color: var(--on-dark-soft);
  border: 1.5px solid rgba(250, 246, 238, 0.3);
  transition: transform 150ms var(--ease), background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
}
.pillar:hover { transform: translateY(-2px); }
.pillar:active { transform: translateY(2px); }
.pillar[aria-pressed="true"] { color: #fff; }
.pillar--safe[aria-pressed="true"]  { background: var(--blue);  border-color: var(--blue); }
.pillar--clean[aria-pressed="true"] { background: var(--green); border-color: var(--green); }
.pillar--left[aria-pressed="true"]  { background: var(--amber); border-color: var(--amber); color: var(--forest-900); }
.pillars.is-invalid .pillars__row { outline: 1.5px solid #F08A7A; outline-offset: 8px; border-radius: 999px; }

.signup .form-alert { background: rgba(240, 138, 122, 0.12); border: 1px solid rgba(240, 138, 122, 0.5); color: #FFC9BE; }

/* Success panel */
.signup__done { text-align: center; padding: clamp(12px, 3vw, 32px) 0; animation: koko-rise 500ms var(--ease) both; }
.signup__seal {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--amber);
  display: inline-grid; place-items: center;
  margin-bottom: 24px;
  color: var(--forest-900);
}
.signup__seal svg { width: 34px; height: 34px; }
.signup__seal path {
  stroke: currentColor;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: koko-tick 480ms var(--ease) 160ms forwards;
}
@keyframes koko-tick { to { stroke-dashoffset: 0; } }
.signup__done h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.12; margin-bottom: 16px; }
.signup__done p { font-size: 19px; line-height: 1.7; color: var(--on-dark); margin: 0 auto 10px; max-width: 30em; }
.signup__done .signup__sign { font-size: 17px; color: var(--amber); margin-bottom: 28px; }

@media (max-width: 720px) {
  .cluster__pair { grid-template-columns: 1fr; }
  .strip { grid-template-columns: 1fr 1fr; }
}
