/* ==========================================================================
   Tokens. Every colour, type and spacing value lives here; see BRAND.md.
   ========================================================================== */

@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  /* Palette */
  --ink: #2e2a5a;           /* primary background */
  --night: #221f47;         /* deeper background for contrast bands */
  --cream: #f6efe4;         /* primary text */
  --mist: #c9c4e6;          /* secondary text, 7.8:1 on ink */
  --amber: #f2a65a;         /* accent, always paired with coral */
  --coral: #e87d72;         /* accent, always paired with amber */
  --amber-light: #f5b676;   /* hover state for amber buttons */
  --placeholder: #5f5a8a;   /* input placeholder on cream, 5.5:1 */
  --rule: rgba(201, 196, 230, 0.22); /* mist at low strength, for hairlines */

  /* Type */
  --font: "Nunito", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --weight-regular: 400;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;
  --weight-black: 900;

  --text-sm: 0.9375rem;                      /* 15px: fine print, footer */
  --text-base: 1.125rem;                     /* 18px: body */
  --text-lg: 1.25rem;                        /* 20px: lede */
  --text-xl: 1.5rem;                         /* 24px: step titles */
  --text-2xl: clamp(1.875rem, 5vw, 2.5rem);  /* section headings */
  --text-3xl: clamp(2.25rem, 7vw, 3.25rem);  /* page titles */
  --text-display: clamp(2rem, 10.5vw, 5.5rem); /* the hero headline */

  --leading-tight: 0.98;
  --leading-snug: 1.2;
  --leading-body: 1.6;
  --tracking-display: -0.025em;
  --tracking-heading: -0.015em;

  /* Space and shape */
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --measure: 34rem;
  --wrap: 66rem;
  --section: clamp(4rem, 10vw, 7rem);
  --radius-pill: 999px;
  --radius-focus: 4px;
  --focus-ring: 3px solid var(--amber);

  /* Motion */
  --turn: 3.6s;
  --dot: clamp(1.5rem, 2.4vw, 1.9rem);

  color-scheme: dark;
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

a {
  color: var(--cream);
  text-decoration-color: var(--amber);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 2px;
}
a:hover { color: var(--amber); }

:focus-visible { outline: var(--focus-ring); outline-offset: 3px; border-radius: var(--radius-focus); }

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--cream);
  color: var(--night);
  font-weight: var(--weight-bold);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  z-index: 10;
}
.skip:focus { top: 1rem; }

/* ==========================================================================
   Header and footer
   ========================================================================== */

header.site { padding: 1.75rem 0 0; }

.wordmark { display: inline-block; line-height: 0; border-radius: var(--radius-focus); }
.wordmark svg { display: block; width: 7.5rem; height: auto; }

footer.site {
  padding: 2rem 0 2.5rem;
  font-size: var(--text-sm);
  color: var(--mist);
  border-top: 1px solid var(--rule);
}
footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}
footer.site p { margin: 0; }
footer.site ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
footer.site a { color: var(--mist); }
footer.site a:hover { color: var(--amber); }

main { flex: 1; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero { padding-block: clamp(3rem, 9vw, 6rem) var(--section); }
.hero > * { max-width: var(--measure); }
.hero h1 { max-width: none; }

/* The one memorable moment: two dots taking turns, like a conversation.
   One swells and sends out a soft ring while the other settles and listens. */
.turns {
  display: flex;
  gap: 1.1rem;
  align-items: center;
  height: 3rem;
  margin-bottom: 2.25rem;
}
.turns span {
  position: relative;
  display: block;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  animation: speak var(--turn) ease-in-out infinite;
}
.turns span::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  animation: ring var(--turn) ease-out infinite;
}
.turns .a { background: var(--amber); color: var(--amber); }
.turns .c { background: var(--coral); color: var(--coral); }
.turns .c, .turns .c::after { animation-delay: calc(var(--turn) / 2); }

@keyframes speak {
  0%, 50%, 100% { transform: scale(1); }
  12% { transform: scale(1.4); }
  24% { transform: scale(1.15); }
  36% { transform: scale(1.3); }
  65% { transform: scale(0.9); }
  85% { transform: scale(0.95); }
}
@keyframes ring {
  0% { transform: scale(1); opacity: 0; }
  8% { opacity: 0.55; }
  45%, 100% { transform: scale(2.4); opacity: 0; }
}

.hero h1 {
  font-weight: var(--weight-black);
  font-size: var(--text-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  margin: 0 0 1.75rem;
}
.hero h1 span { display: block; }
.hero h1 .second { color: var(--mist); }

.lede { font-size: var(--text-lg); margin: 0 0 2.5rem; }

/* ==========================================================================
   Waitlist form
   ========================================================================== */

.waitlist { scroll-margin-top: 2rem; }
.waitlist .lbl { display: block; font-weight: var(--weight-bold); margin-bottom: 0.6rem; }
.field { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.field input[type="email"] {
  flex: 1 1 15rem;
  min-width: 0;
  font: inherit;
  font-size: 1.0625rem;
  color: var(--night);
  background: var(--cream);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0.85rem 1.25rem;
}
.field input[type="email"]::placeholder { color: var(--placeholder); opacity: 1; }
.field input[type="email"]:focus-visible { outline: var(--focus-ring); outline-offset: 2px; border-color: var(--amber); }
.field button,
.button {
  flex: 0 0 auto;
  display: inline-block;
  font: inherit;
  font-weight: var(--weight-extrabold);
  font-size: 1.0625rem;
  line-height: var(--leading-body);
  color: var(--night);
  background: var(--amber);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  text-decoration: none;
}
.field button:hover,
.button:hover { background: var(--amber-light); color: var(--night); }
.field button:focus-visible,
.button:focus-visible { border-radius: var(--radius-pill); }
.field button[disabled] { opacity: 0.6; cursor: progress; }
.fineprint { font-size: var(--text-sm); color: var(--mist); margin: 0.9rem 0 0; }
.status { margin: 1rem 0 0; font-weight: var(--weight-bold); min-height: 1.6em; }
.status:empty { margin: 0; min-height: 0; }
.status.ok { color: var(--amber); }
.status.err { color: var(--coral); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ==========================================================================
   Sections
   ========================================================================== */

.section { padding-block: var(--section); }
.section h2 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-heading);
  margin: 0 0 1rem;
}
.section p { max-width: var(--measure); color: var(--mist); }

/* How it works: a deeper band, three steps read left to right */
.how { background: var(--night); }
.how h2 { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2.5rem clamp(2rem, 5vw, 4rem);
  counter-reset: step;
}
.steps li { counter-increment: step; max-width: 22rem; }
.steps li::before {
  content: counter(step);
  display: block;
  font-size: var(--text-3xl);
  font-weight: var(--weight-black);
  line-height: 1;
  color: var(--mist);
  margin-bottom: 1rem;
}
.steps h3 {
  font-size: var(--text-xl);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-snug);
  margin: 0 0 0.5rem;
}
.steps p { margin: 0; }

/* The name */
.name .say { color: var(--cream); font-weight: var(--weight-bold); white-space: nowrap; }

/* Second waitlist prompt */
.again { border-top: 1px solid var(--rule); }
.again p { margin: 0 0 2rem; }

/* ==========================================================================
   Simple pages: privacy, thanks, 404
   ========================================================================== */

.prose { padding-block: 3rem 4rem; }
.prose > * { max-width: 36rem; }
.prose h1 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  margin: 0 0 1.5rem;
}
.prose h2 { font-size: 1.375rem; font-weight: var(--weight-extrabold); line-height: var(--leading-snug); margin: 2.25rem 0 0.5rem; }
.prose ul { padding-left: 1.25rem; }

.short { display: flex; align-items: center; }
.short .hero { padding-block: 3rem 5rem; }
.short .lede { margin-bottom: 1.5rem; }

/* ==========================================================================
   Responsive and motion preferences
   ========================================================================== */

@media (min-width: 48rem) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 30rem) {
  .field button { flex: 1 1 100%; }
  .turns { margin-bottom: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .turns span, .turns span::after { animation: none; }
}
