/* Fallow promo site — palette + geometry from perch-app/theme.ts.
   The design borrows the app's own moves: state colours as full-bleed fields,
   art bled off the edge (StateCard / the pre-start screen), and the RING
   (viewBox 120, r 55, stroke 4) as the "one minute" mark. */

:root {
  --bg: #F5EBD9;
  --card: #FDF8EE;
  --ink: #4A3A2C;
  --ink55: rgba(74, 58, 44, 0.55);
  --hair: rgba(74, 58, 44, 0.09);
  --hair-strong: rgba(74, 58, 44, 0.15);
  --accent: #C77B48;
  --accent-ink: #A65F32;
  --on-accent: #FFF8EE;

  /* STATE_COLORS */
  --clear-bg: #5A6B51;  --clear-ink: #F3EAD8;
  --wake-bg: #A8481B;   --wake-ink: #F9EDDF;
  --focus-bg: #8A5D12;  --focus-ink: #F8EEDC;
  --loosen-bg: #6E5646; --loosen-ink: #F3EAD8;

  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

* { box-sizing: border-box; }

html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
p { margin: 0 0 1em; }

.wrap {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- type ---- */

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em; /* the app's tight display tracking */
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(3rem, 9.5vw, 6.25rem); font-weight: 800; }
h1 em { font-style: normal; color: var(--accent-ink); }
h2 { font-size: clamp(2rem, 5.5vw, 3.5rem); }

.kicker {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 1.1rem;
}

.lede {
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  color: var(--ink55);
  max-width: 30em;
  margin: 0 0 2.25rem;
}

/* ---- header ---- */

.top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem var(--gutter);
}

.wordmark {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Sized in em so the mark tracks the wordmark's type size at every breakpoint
   instead of needing a clamp of its own. */
.mark { width: 1.7em; height: 1.7em; flex: none; }

.top-link {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}
.top-link:hover, .top-link:focus-visible { color: var(--accent-ink); }

/* ---- shared CTA ---- */

.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }

.button {
  display: inline-block;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.button:hover, .button:focus-visible { background: var(--accent-ink); }

.cta-note { font-size: 0.875rem; color: var(--ink55); }

/* ---- hero: type left, art bled off the right edge ---- */

.hero {
  position: relative;
  min-height: min(92vh, 56rem);
  display: flex;
  align-items: center;
  padding: 7.5rem 0 4rem;
}

.hero-grid { position: relative; z-index: 1; width: 100%; }

.hero-copy { max-width: 48rem; }
.hero-copy .lede, .hero-copy .cta-row { max-width: 38rem; }

/* Oversized, cropped by the viewport edge, feathered into the page ground —
   the same move as the pre-start screen's off-canvas StateArt. */
.hero-art {
  position: absolute;
  z-index: 0;
  right: max(-14rem, -22vw);
  bottom: -6rem;
  width: clamp(24rem, 52vw, 46rem);
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 98%);
  mask-image: radial-gradient(closest-side, #000 55%, transparent 98%);
}

/* ---- the minute: RING geometry from theme.ts ---- */

.minute {
  background: var(--card);
  border-block: 1px solid var(--hair);
  padding: clamp(4rem, 9vw, 7rem) 0;
}

.minute-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.ring {
  position: relative;
  width: min(72vw, 22rem);
  justify-self: center;
}

.ring svg { display: block; width: 100%; height: auto; }

.ring-track, .ring-arc {
  fill: none;
  stroke-width: 4; /* RING.stroke */
}
.ring-track { stroke: var(--hair-strong); }
.ring-arc {
  stroke: var(--accent);
  stroke-linecap: round;
  /* RING_C = 2π·55 ≈ 345.6 */
  stroke-dasharray: 345.6;
  stroke-dashoffset: 86.4; /* three quarters swept */
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
}

@media (prefers-reduced-motion: no-preference) {
  /* one real minute per revolution; the negative delay means it never
     renders nearly-empty on first paint */
  .ring-arc { animation: sweep 60s linear infinite; animation-delay: -15s; }
  @keyframes sweep {
    from { stroke-dashoffset: 345.6; }
    to   { stroke-dashoffset: 0; }
  }
}

.ring-time {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(2.75rem, 8vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.minute-copy p:last-child { margin-bottom: 0; color: var(--ink55); max-width: 34em; }

/* ---- problem: art bled off the LEFT edge ---- */

.problem {
  position: relative;
  padding: clamp(5rem, 11vw, 9rem) 0;
}

.problem-art {
  position: absolute;
  z-index: 0;
  left: max(-12rem, -20vw);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(20rem, 44vw, 40rem);
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 98%);
  mask-image: radial-gradient(closest-side, #000 55%, transparent 98%);
}

.problem-grid { position: relative; z-index: 1; display: grid; }

.problem-copy {
  max-width: 34rem;
  justify-self: end;
}
.problem-copy p:last-child { margin-bottom: 0; }
.problem-copy p { color: var(--ink55); }
.problem-copy p:first-of-type { color: var(--ink); }

/* ---- the four states: full-bleed colour fields, like the home grid ---- */

.states { padding-top: clamp(4rem, 9vw, 7rem); }

.states-head { padding-bottom: clamp(2.5rem, 6vw, 4.5rem); max-width: 60rem; }
.states-lede { color: var(--ink55); max-width: 36em; margin: 0; }

.state-list { list-style: none; margin: 0; padding: 0; }

.state {
  position: relative;
  overflow: clip;
  padding: clamp(3.25rem, 8vw, 6rem) 0;
}

.state-clear  { background: var(--clear-bg);  color: var(--clear-ink); }
.state-wake   { background: var(--wake-bg);   color: var(--wake-ink); }
.state-focus  { background: var(--focus-bg);  color: var(--focus-ink); }
.state-loosen { background: var(--loosen-bg); color: var(--loosen-ink); }

.state-inner { position: relative; z-index: 1; }

.state h3 {
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  font-weight: 800;
  margin: 0;
}

.state-sub {
  font-size: clamp(1.0625rem, 2vw, 1.375rem);
  opacity: 0.78;
  margin: 0.5rem 0 0;
}

.state-breath {
  margin: 1.6rem 0 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
}

/* The app's own state art, not a decorative numeral.
   components/StateArt.tsx draws each state as the SAME primitive — a capsule
   in the state's ink colour — in four arrangements: clear scatters outward,
   wake radiates in five directions, focus converges to a point, loosen settles
   low. These SVGs are that geometry transcribed constant-for-constant (BAR_H
   24, STACK_STEP 12, wake's 12.5 petal radius, focus's +-70/35/0 fan), with the
   per-bar alphas already multiplied by StateCard's 0.5 fade. Inline rather than
   <img> so currentColor picks up each band's ink. */
.state-art {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: clamp(-2rem, -1vw, 0rem);
  transform: translateY(-50%);
  /* Blown up far past the app's 52px lane, which is the point — the same mark
     at poster scale. Height-driven so the four arrangements, whose aspect
     ratios differ, all read as one family. */
  height: clamp(13rem, 40vw, 26rem);
  width: auto;
  color: currentColor;
  pointer-events: none;
}

/* Alternate sides so the four bands don't repeat exactly. */
.state:nth-child(even) .state-art { right: auto; left: clamp(-2rem, -1vw, 0rem); }
.state:nth-child(even) .state-inner { text-align: right; }

/* ---- how it works: staggered steps, art bled right ---- */

.how {
  position: relative;
  padding: clamp(5rem, 11vw, 9rem) 0;
}

.how-art {
  position: absolute;
  z-index: 0;
  right: max(-11rem, -18vw);
  bottom: -4rem;
  width: clamp(18rem, 40vw, 36rem);
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 98%);
  mask-image: radial-gradient(closest-side, #000 55%, transparent 98%);
}

.how .wrap { position: relative; z-index: 1; }
.how h2 { max-width: 14em; }

.steps {
  list-style: none;
  margin: clamp(2rem, 5vw, 3.5rem) 0 0;
  padding: 0;
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.75rem);
}

.steps > li {
  display: flex;
  gap: 1.25rem;
  align-items: baseline;
  max-width: 30rem;
}

.step-num {
  flex: none;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--accent);
}

.steps h3 { font-size: 1.375rem; letter-spacing: -0.02em; margin: 0 0 0.35rem; }
.steps p { margin: 0; color: var(--ink55); }

/* ---- closing ---- */

.closing {
  background: var(--card);
  border-top: 1px solid var(--hair);
  padding: clamp(4.5rem, 10vw, 8rem) 0;
}

.closing-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.closing-copy p { color: var(--ink55); max-width: 26em; }

/* The figure sits in the ring: circular crop, RING's 4-unit stroke scaled up. */
.closing-figure {
  margin: 0;
  justify-self: center;
  width: min(66vw, 20rem);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--accent);
  padding: 8%;
  background: #FBEFDE; /* the art's own ground */
}
.closing-figure img { width: 100%; height: 100%; object-fit: cover; }

/* ---- footer ---- */

footer {
  border-top: 1px solid var(--hair-strong);
  padding: 2.5rem 0 3rem;
  color: var(--ink55);
  font-size: 0.875rem;
}

.safety { max-width: 44rem; }
footer p:last-child { margin: 0; }

/* ---- wider screens ---- */

@media (min-width: 52rem) {
  .minute-grid { grid-template-columns: 5fr 7fr; gap: clamp(3rem, 7vw, 6rem); }
  .ring { justify-self: start; }

  .closing-grid { grid-template-columns: 7fr 5fr; }

  /* stagger the steps — three equal cards in a row is the pattern to avoid */
  .steps > li:nth-child(2) { margin-left: 14%; }
  .steps > li:nth-child(3) { margin-left: 28%; }
}

/* below the split, keep the hero art from colliding with the copy */
@media (max-width: 51.99rem) {
  .hero { padding-top: 6.5rem; min-height: 0; display: block; }
  .hero-art {
    position: relative;
    right: auto; bottom: auto;
    width: min(78vw, 26rem);
    margin: 1rem calc(-1 * var(--gutter)) -4rem auto;
  }
  .hero { padding-bottom: 0; }

  .problem-art {
    position: relative;
    left: auto; top: auto; transform: none;
    width: min(70vw, 24rem);
    margin: 0 auto -3rem calc(-1 * var(--gutter));
  }
  .problem { padding-top: 3rem; }

  .how-art {
    position: relative;
    right: auto; bottom: auto;
    width: min(70vw, 24rem);
    margin: 2rem calc(-1 * var(--gutter)) -3rem auto;
  }
  .how { padding-bottom: 2rem; }
}

/* ---- waitlist dialog ---- */

#waitlist {
  width: min(26rem, calc(100vw - 2rem));
  padding: 2rem;
  border: 1px solid var(--hair-strong);
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
}

#waitlist::backdrop {
  /* Tinted with the page's own ink rather than neutral black, so the dimmed
     page reads as warm paper in shadow instead of a screenshot behind glass. */
  background: rgba(74, 58, 44, 0.45);
}

#waitlist h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.4rem;
}

.dialog-sub { color: var(--ink55); margin: 0 0 1.5rem; font-size: 0.95rem; line-height: 1.5; }

.dialog-close-form { position: absolute; top: 0.75rem; right: 0.75rem; margin: 0; }
.dialog-close {
  border: 0; background: none; cursor: pointer;
  font-size: 1.5rem; line-height: 1; padding: 0.35rem 0.5rem;
  color: var(--ink55); border-radius: 8px;
}
.dialog-close:hover { color: var(--ink); background: var(--hair); }

.field { display: block; margin-bottom: 1rem; }
.field-label {
  display: block; font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink55); margin-bottom: 0.4rem;
}
.field input {
  width: 100%; padding: 0.7rem 0.9rem; font: inherit; font-size: 1rem;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--hair-strong); border-radius: 10px;
}
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

#waitlist .button { width: 100%; text-align: center; border: 0; cursor: pointer; font: inherit; font-weight: 700; }
#waitlist .button[disabled] { opacity: 0.6; cursor: default; }

/* Off-screen rather than display:none — a bot reading styles can spot the
   latter, and some fill hidden fields precisely because they are hidden. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-msg { margin: 0.9rem 0 0; font-size: 0.9rem; line-height: 1.5; min-height: 1.4em; color: var(--ink55); }
.form-msg.is-bad { color: var(--wake-bg); }
.form-msg.is-good { color: var(--clear-bg); }
