/* ============================================================
   Daylight — coming soon.
   Every value comes from /tokens.css, generated from
   design/tokens/tokens.json. Nothing is invented here.

   Deliberate restraint versus the app's own language: no glass
   cards, no feature grid, no centred hero, no stat band. The
   only glass surface is the one thing you interact with.
   ============================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;   /* guard: the page body must never scroll sideways */
  background: var(--surface-ground);
  color: var(--ink-primary);
  font-family: var(--font-stack);
  -webkit-font-smoothing: antialiased;
}

/* -- The dawn field. The gradient IS the name, so it has to read.
      Alphas come from tokens; only the geometry is tuned here, because a
      full page needs larger, overlapping radials than a 312px phone frame
      to reach the same presence. -- */
.field { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.field::before {
  content: ""; position: absolute; inset: -10%;
  background:
    radial-gradient(85% 65% at -5% 105%, rgba(var(--field-warmRgb), var(--field-warmAlpha)), transparent 62%),
    radial-gradient(75% 60% at 105% -5%, rgba(var(--field-coolRgb), var(--field-coolAlpha)), transparent 60%),
    radial-gradient(60% 45% at 60% 55%, rgba(var(--field-bloomRgb), var(--field-bloomAlpha)), transparent 70%),
    linear-gradient(168deg, var(--surface-ground2), var(--surface-ground));
}

main {
  position: relative; z-index: 1;
  max-width: 64rem;
  margin: 0 auto;
  padding: var(--space-5xl) var(--space-3xl) var(--space-4xl);
  display: flex; flex-direction: column;
  gap: var(--space-3xl);
  min-height: 100vh;
}

/* -- brand -- */
.brand { display: flex; align-items: center; gap: var(--space-md); margin-bottom: var(--space-4xl); }
.brand img { display: block; }
.wordmark {
  font: var(--type-title);
  letter-spacing: var(--track-title);
  color: var(--ink-primary);
}

/* -- type. Left aligned, never centred. -- */
/* ------------------------------------------------------------
   HERO. Two columns on desktop so the copy stays left aligned
   and the graphic occupies the space that was dead before.
   ------------------------------------------------------------ */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: var(--space-5xl);
  align-items: center;
}
.hero-copy { display: flex; flex-direction: column; gap: var(--space-3xl); min-width: 0; }

h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.75rem, 6.5vw, 4.5rem);
  font-weight: 200;
  letter-spacing: -0.04em;
  line-height: 0.98;
  text-wrap: balance;
}

/* ------------------------------------------------------------
   THE SUNRISE. The mark, the load animation, and the product's
   core value are one object: a disc clearing a horizon with the
   day's number on it. Not a stock hero illustration.
   ------------------------------------------------------------ */
.sun { margin: 0; display: flex; flex-direction: column; align-items: center; }

/* stage clips the disc so it can only ever rise TO the horizon, never past it */
.sun-stage {
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.sun-disc {
  width: 82%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gradient-mark);
  transform: translateY(50%);
}
.sun-horizon {
  display: block;
  width: 100%;
  height: var(--line-emphasis-w);
  background: var(--ink-primary);
  opacity: 0.38;
  transform-origin: center;
}

.sun-readout { display: flex; flex-direction: column; align-items: center; gap: var(--space-md); margin-top: var(--space-2xl); }
.sun-label {
  font: var(--type-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-muted);
}
.sun-figure {
  font-size: clamp(3rem, 7vw, 4rem);
  font-weight: 200;
  letter-spacing: -0.045em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
}
.sun-cur { font-size: 42%; vertical-align: 0.32em; opacity: 0.8; }

/* week strip: the Bank accumulating, in miniature */
.week {
  display: flex; align-items: flex-end; justify-content: center;
  gap: var(--space-sm);
  height: 2.25rem;
  margin-top: var(--space-3xl);
  width: 72%;
}
.week > i {
  flex: 1;
  background: var(--status-good);
  opacity: 0.85;
  transform-origin: bottom;
  transform: scaleY(0);
}
.week > i.over { background: var(--status-over); }
.d1 { height: 46%; } .d2 { height: 72%; } .d3 { height: 30%; }
.d4 { height: 88%; } .d5 { height: 24%; } .d6 { height: 61%; } .d7 { height: 100%; }

.week-note {
  margin: var(--space-lg) 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-muted);
  text-align: center;
  max-width: 26ch;
}

/* ---- the one orchestrated moment: sunrise on load ---- */
@media (prefers-reduced-motion: no-preference) {
  .sun-horizon { transform: scaleX(0); }
  .sun.rise .sun-horizon {
    animation: horizon var(--motion-settle) var(--ease-standard) forwards;
  }
  .sun.rise .sun-disc {
    animation: rise var(--motion-resolve) var(--ease-standard) var(--motion-quick) forwards;
  }
  .sun.rise .week > i {
    animation: stem var(--motion-base) var(--ease-standard) forwards;
  }
  .sun.rise .d1 { animation-delay: 0.62s; } .sun.rise .d2 { animation-delay: 0.68s; }
  .sun.rise .d3 { animation-delay: 0.74s; } .sun.rise .d4 { animation-delay: 0.80s; }
  .sun.rise .d5 { animation-delay: 0.86s; } .sun.rise .d6 { animation-delay: 0.92s; }
  .sun.rise .d7 { animation-delay: 0.98s; }

  @keyframes horizon { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes rise    { from { transform: translateY(100%); } to { transform: translateY(50%); } }
  @keyframes stem    { from { transform: scaleY(0); } to { transform: scaleY(1); } }
}

.lede {
  margin: 0;
  font-size: clamp(1.0625rem, 2.4vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-secondary);
  max-width: 38ch;
}

.body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-secondary);
  max-width: 62ch;
}

.honest {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--ink-muted);
  max-width: 54ch;
  padding-top: var(--space-lg);
  border-top: var(--line-rule-w) solid var(--line-hairline);
}

/* -- the one glass surface: the thing you interact with -- */
.signup {
  background:
    linear-gradient(168deg, var(--material-fillFrom), var(--material-fillTo)),
    radial-gradient(140% 100% at 12% 100%, var(--material-refractWarm), transparent 58%);
  backdrop-filter: blur(var(--material-blur)) saturate(var(--material-saturation));
  -webkit-backdrop-filter: blur(var(--material-blur)) saturate(var(--material-saturation));
  border: var(--line-hairline-w) solid var(--material-rim);
  box-shadow: var(--shadow-plane);
  border-radius: var(--radius-panel);
  padding: var(--space-3xl);
}

form { display: flex; gap: var(--space-md); flex-wrap: wrap; }

input[type="email"] {
  flex: 1 1 16rem;
  min-width: 0;
  background: var(--state-inputFill);
  border: var(--line-hairline-w) solid var(--status-neutralRim);
  border-radius: var(--radius-inner);
  color: var(--ink-onGlass);
  font-family: var(--font-stack);
  font-size: 1rem;
  padding: var(--space-lg) var(--space-xl);
  outline: none;
}
input[type="email"]::placeholder { color: var(--ink-onGlassMuted); }
input[type="email"]:focus-visible {
  border-color: var(--status-good);
  box-shadow: 0 0 0 var(--line-emphasis-w) var(--status-goodTint);
}

button {
  flex: 0 0 auto;
  background: var(--surface-inverted);
  color: var(--ink-inverted);
  border: none;
  border-radius: var(--radius-inner);
  font-family: var(--font-stack);
  font: var(--type-button);
  padding: var(--space-lg) var(--space-3xl);
  cursor: pointer;
  transition: opacity var(--motion-quick) var(--ease-standard);
}
button:hover { opacity: 0.88; }
button:focus-visible { outline: var(--line-emphasis-w) solid var(--status-good); outline-offset: var(--space-xs); }
button[disabled] { opacity: 0.5; cursor: default; }

.status { margin: var(--space-lg) 0 0; font-size: 0.875rem; line-height: 1.5; min-height: 1.2em; color: var(--ink-onGlassSecondary); }
.status.ok  { color: var(--status-good); }
.status.err { color: var(--status-over); }

.fineprint {
  margin: var(--space-lg) 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-onGlassMuted);
}

footer {
  margin-top: auto;
  padding-top: var(--space-3xl);
  display: flex; gap: var(--space-xl);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (max-width: 56rem) {
  /* minmax(0,1fr), never a bare 1fr: `1fr` is minmax(AUTO,1fr) and the auto
     minimum is min-content, so a long line of body copy forces the track
     wider than the viewport and the whole page scrolls sideways. */
  .hero { grid-template-columns: minmax(0, 1fr); gap: var(--space-4xl); }
  .sun { max-width: 22rem; margin-inline: auto; }
}

@media (max-width: 34rem) {
  main { padding: var(--space-4xl) var(--space-2xl) var(--space-3xl); gap: var(--space-2xl); }
  .signup { padding: var(--space-2xl); }
  button { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
