/* ==========================================================================
   YQ — pre-launch waitlist
   Palette: warm bone / deep aubergine. Solid colour only, no gradients.
   Type: Jost (geometric sans) + Newsreader (serif, benefit titles).
   ========================================================================== */

/* --- Fonts: self-hosted, latin subset. No third-party requests. ---------- */
@font-face {
  font-family: 'Jost';
  src: url('../assets/fonts/jost-latin-var.woff2') format('woff2-variations'),
       url('../assets/fonts/jost-latin-var.woff2') format('woff2');
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Newsreader';
  src: url('../assets/fonts/newsreader-latin-var.woff2') format('woff2-variations'),
       url('../assets/fonts/newsreader-latin-var.woff2') format('woff2');
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

/* --- Tokens -------------------------------------------------------------- */
:root {
  --bone: #f8f2eb;
  --bone-deep: #f1e8de;
  --surface: #fffdfa;

  --aubergine: #2b1220;
  --aubergine-lift: #3f1b2f;
  --plum: #33132a;
  --ink: #2e1f28;
  --muted: #6e5763;

  --line: rgba(43, 18, 32, 0.15);
  --line-soft: rgba(43, 18, 32, 0.09);
  --ring: rgba(43, 18, 32, 0.16);
  --danger: #8c2f39;

  --radius: 3px;
  /* The page edge inset. Capped lower than the old 5.5rem so a wide desktop
     spends its extra pixels on content rather than on margin. */
  --gutter: clamp(1.5rem, 5vw, 4rem);
  --measure: 46rem;
  /* Outer container. Inert on mobile — below 901px the shell is simply full
     width inside the gutter. The desktop block sets the real, viewport-
     relative container; nothing here scales or shrinks the page. */
  --shell: 94rem;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  width: 100%;
  background: var(--bone);
  color: var(--ink);
  font-family: 'Jost', 'Avenir Next', 'Segoe UI', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

/* Warm paper grain. Fixed, non-interactive layer — never on a scroller. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

.hp {
  display: none;
}

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

/* --- Header -------------------------------------------------------------- */
.masthead {
  position: relative;
  z-index: 10;
  padding-block: clamp(1.5rem, 3.5vw, 2.5rem);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  /* Optical alignment: the ™ adds visual weight to the right. */
  margin-left: -0.1em;
}

.brand img {
  height: clamp(2.76rem, 5.29vw, 3.74rem);
  width: auto;
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  --btn-bg: var(--aubergine);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.6rem;
  border: 1px solid var(--btn-bg);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--bone);
  font: inherit;
  font-size: 0.735rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease),
    transform 0.35s var(--ease);
}

.btn:hover {
  --btn-bg: var(--aubergine-lift);
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled] {
  opacity: 0.62;
  cursor: default;
  transform: none;
}

/* Masthead button: identical fill to the form's submit, slightly tighter
   padding so the header keeps its height. */
.btn--nav {
  padding: 0.8rem 1.35rem;
}

:where(a, button, input):focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 3px;
}

/* --- Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  z-index: 1;
  /* Right-hand side stays empty. The whitespace is the composition. */
  padding-block: clamp(3.5rem, 11vh, 8.5rem) clamp(4.5rem, 13vh, 10rem);
}

.hero__content {
  max-width: var(--measure);
}

.eyebrow {
  margin: 0 0 clamp(1.25rem, 2.6vw, 2rem);
  font-size: 0.73rem;
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__title {
  margin: 0;
  font-size: clamp(2.5rem, 7.2vw, 4.6rem);
  font-weight: 400;
  line-height: 1.03;
  letter-spacing: -0.022em;
  color: var(--plum);
  text-wrap: balance;
}

.rule {
  width: 3rem;
  height: 1px;
  margin: clamp(1.9rem, 4vw, 2.75rem) 0;
  border: 0;
  background: var(--plum);
  opacity: 0.5;
}

.hero__lead {
  max-width: 34rem;
  margin: 0 0 clamp(2.1rem, 4.4vw, 3rem);
  font-size: clamp(1.05rem, 1.35vw, 1.2rem);
  line-height: 1.65;
  color: var(--muted);
}

/* --- Waitlist form ------------------------------------------------------- */
.waitlist {
  max-width: 34rem;
}

.waitlist__field {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  /* Clip the button's square corners to the wrapper's radius. */
  overflow: hidden;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.waitlist__field:focus-within {
  border-color: var(--plum);
  box-shadow: 0 0 0 3px var(--ring);
}

.waitlist__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1.15rem 1.25rem;
  border: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.waitlist__input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.waitlist__input:focus-visible {
  outline: 0;
}

.waitlist__field .btn {
  border-radius: 0 var(--radius) var(--radius) 0;
  padding-inline: clamp(1.25rem, 2.6vw, 1.9rem);
}

/* Invalid state */
.waitlist.is-invalid .waitlist__field {
  border-color: var(--danger);
}

.waitlist.is-invalid .waitlist__field:focus-within {
  box-shadow: 0 0 0 3px rgba(140, 47, 57, 0.16);
}

.waitlist__note {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.05rem 0 0;
  font-size: 0.855rem;
  line-height: 1.5;
  color: var(--muted);
}

.waitlist__note svg {
  flex: none;
  width: 15px;
  height: 15px;
  opacity: 0.65;
}

.waitlist__error {
  margin: 0.85rem 0 0;
  font-size: 0.855rem;
  color: var(--danger);
}

.waitlist__error:empty {
  display: none;
}

/* Success — replaces the form in place */
.waitlist__success {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  max-width: 34rem;
  padding: 1.45rem 1.5rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--plum);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--plum);
  font-size: 1.02rem;
  line-height: 1.55;
  animation: rise 0.6s var(--ease) both;
}

.waitlist__success svg {
  flex: none;
  width: 19px;
  height: 19px;
  margin-top: 0.18rem;
}

[hidden] {
  display: none !important;
}

/* --- Benefits ------------------------------------------------------------ */
.benefits {
  position: relative;
  z-index: 1;
  background: var(--bone-deep);
  border-top: 1px solid var(--line-soft);
  padding-block: clamp(3.25rem, 7vw, 5rem);
}

.benefits__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.benefit {
  padding-inline: clamp(1rem, 2.4vw, 2.25rem);
  text-align: center;
}

.benefit + .benefit {
  border-left: 1px solid var(--line-soft);
}

.benefit__icon {
  width: 26px;
  height: 26px;
  margin: 0 auto 1.15rem;
  color: var(--plum);
  opacity: 0.85;
}

.benefit__title {
  margin: 0 0 0.5rem;
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  font-size: 1.32rem;
  font-weight: 400;
  letter-spacing: 0.002em;
  color: var(--plum);
}

.benefit__copy {
  margin: 0;
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--muted);
  text-wrap: pretty;
}

/* --- Footer -------------------------------------------------------------- */
.footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  background: var(--aubergine);
  color: var(--bone);
  padding-block: clamp(2.5rem, 5vw, 3.25rem);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.footer__identity {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 1.75rem);
}

.footer__mark {
  height: 1.65rem;
  width: auto;
}

.footer__divider {
  width: 1px;
  align-self: stretch;
  min-height: 2.4rem;
  background: rgba(248, 242, 235, 0.24);
}

.footer__legal {
  font-size: 0.86rem;
  line-height: 1.55;
}

.footer__legal strong {
  display: block;
  font-weight: 500;
}

.footer__legal span {
  color: rgba(248, 242, 235, 0.68);
}

.footer__copy {
  margin: 0;
  font-size: 0.855rem;
  color: rgba(248, 242, 235, 0.68);
}

.footer__links {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.25rem);
}

.footer__links a {
  font-size: 0.735rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(248, 242, 235, 0.78);
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.footer__links a:hover {
  color: var(--bone);
  border-bottom-color: rgba(248, 242, 235, 0.55);
}

.footer :where(a):focus-visible {
  outline: 2px solid var(--bone);
  outline-offset: 3px;
}

/* --- Legal pages (privacy / terms / fallback confirmation) --------------- */
.page {
  position: relative;
  z-index: 1;
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(4rem, 9vw, 6.5rem);
}

.page__inner {
  max-width: 42rem;
}

.page h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(2rem, 4.6vw, 2.9rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.018em;
  color: var(--plum);
}

.page__meta {
  margin: 0 0 clamp(2rem, 4vw, 2.75rem);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.page h2 {
  margin: clamp(2.1rem, 4vw, 2.75rem) 0 0.7rem;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.28rem;
  font-weight: 400;
  color: var(--plum);
}

.page p,
.page li {
  margin: 0 0 0.9rem;
  color: var(--ink);
  font-size: 0.99rem;
  line-height: 1.72;
}

.page ul {
  margin: 0 0 0.9rem;
  padding-left: 1.15rem;
}

.page li {
  margin-bottom: 0.45rem;
}

.page a {
  color: var(--plum);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.page__back {
  display: inline-block;
  margin-top: clamp(2.25rem, 4vw, 3rem);
  font-size: 0.735rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--plum);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.3rem;
}

.page__back:hover {
  border-bottom-color: var(--plum);
}

/* --- Motion: one restrained load sequence -------------------------------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.reveal > * {
  animation: rise 0.85s var(--ease) both;
}

.reveal > *:nth-child(1) { animation-delay: 0.05s; }
.reveal > *:nth-child(2) { animation-delay: 0.14s; }
.reveal > *:nth-child(3) { animation-delay: 0.23s; }
.reveal > *:nth-child(4) { animation-delay: 0.3s; }
.reveal > *:nth-child(5) { animation-delay: 0.38s; }

/* --- Responsive ---------------------------------------------------------- */

/* Desktop / laptop: compact vertical rhythm.
   Everything the visitor needs to convert — logo, eyebrow, headline, rule,
   lead, form, privacy note and all four benefit blocks — has to land above
   the fold on a 1366x768 laptop. Type sizes are untouched; only the gaps
   move. Spacing is keyed to vh rather than vw so a short laptop gets the
   tight end and a taller screen relaxes back out, and each clamp keeps a
   floor so nothing ever collapses. Mobile keeps the base values below. */
@media (min-width: 901px) {
  /* The hero column grows with the wider shell so the headline still commands
     the left of the grid instead of sitting as a narrow centred block. The
     right-hand third stays empty on purpose — that is the composition, and it
     now reads as designed whitespace rather than a shrunken page. */
  :root {
    --measure: 53rem;
    /* The container tracks the viewport (94%) and its ceiling is expressed in
       rem, so it rises with the root size set for large displays below and
       only stops growing past ~2200px. A 1366-2000px desktop is filled rather
       than letterboxed, and the edge inset scales with the page instead of
       eating a flat 4rem. */
    --shell: min(94vw, 92rem);
    --gutter: clamp(1.5rem, 1.7vw, 2.5rem);
  }

  .hero__lead,
  .waitlist,
  .waitlist__success {
    max-width: 37rem;
  }

  /* Leftover viewport height is absorbed by the hero rather than left as an
     empty strip above the footer, so a tall monitor simply gets more air
     around the headline while a laptop is unaffected. */
  main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
  }

  .hero {
    display: grid;
    align-content: center;
    flex: 1 1 auto;
    padding-block: clamp(0.7rem, 2.1vh, 3rem) clamp(0.85rem, 2.2vh, 4rem);
  }

  .masthead {
    padding-block: clamp(0.9rem, 2vh, 2.25rem) clamp(0.55rem, 1.4vh, 1.25rem);
  }

  .eyebrow {
    margin-bottom: clamp(0.5rem, 1.4vh, 1.25rem);
  }

  .rule {
    margin-block: clamp(0.55rem, 1.4vh, 1.6rem);
  }

  .hero__lead {
    margin-bottom: clamp(0.85rem, 2.2vh, 2rem);
  }

  .waitlist__input {
    padding-block: 1rem;
  }

  .waitlist__note {
    margin-top: 0.65rem;
  }

  /* The benefits band is pulled up tight under the form. */
  .benefits {
    padding-block: clamp(1.05rem, 2.7vh, 2.75rem);
  }

  /* A touch more room per column so only the longest line needs to wrap. */
  .benefit {
    padding-inline: clamp(1rem, 1.8vw, 1.75rem);
  }

  .benefit__icon {
    width: 24px;
    height: 24px;
    margin-bottom: clamp(0.5rem, 1.3vh, 1.15rem);
  }

  .benefit__title {
    margin-bottom: 0.3rem;
    line-height: 1.25;
  }

  .benefit__copy {
    line-height: 1.45;
  }
}

/* Large displays: scale the whole composition, not just the container.
   On a 1900px+ monitor every cap in the page used to bottom out at once —
   the shell stopped at 1600px, the headline at 4.6rem, the lead and form at
   34-37rem — so the design read as a small page floating in a big window
   even though the markup was unchanged. Raising the root size lifts every
   rem-based measure (type, form, gutters, the shell cap above) together, so
   proportions hold and a wide screen looks like the preview rather than a
   shrunken copy of it.

   The clamp is expressed in rem, not px: on the root element rem resolves
   against the browser's default size, so a visitor who has raised their base
   font size keeps that increase. Below ~1525px the floor wins and laptops —
   including the 1366x768 above-the-fold target — are untouched. */
@media (min-width: 1400px) {
  html {
    font-size: clamp(1rem, 1.05vw, 1.375rem);
  }
}

@media (max-width: 900px) {
  .benefits__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: clamp(2.25rem, 5vw, 3rem);
  }

  /* Two columns: divider only where a column actually starts. */
  .benefit {
    border-left: 0;
  }

  .benefit:nth-child(even) {
    border-left: 1px solid var(--line-soft);
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.75rem;
  }
}

@media (max-width: 640px) {
  .masthead__inner {
    gap: 0.75rem;
  }

  .btn--nav {
    padding: 0.7rem 0.95rem;
    font-size: 0.66rem;
    letter-spacing: 0.11em;
  }

  /* Stack the form so the target stays comfortably tappable. */
  .waitlist__field {
    flex-direction: column;
  }

  .waitlist__input {
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 1.05rem 1.1rem;
  }

  .waitlist__field .btn {
    border-radius: 0 0 var(--radius) var(--radius);
    padding-block: 1.05rem;
  }
}

@media (max-width: 520px) {
  .benefits__grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0;
  }

  .benefit {
    padding-block: clamp(1.75rem, 6vw, 2.25rem);
    padding-inline: 0;
  }

  /* Single column: horizontal rules replace the vertical dividers. */
  .benefit,
  .benefit:nth-child(even) {
    border-left: 0;
  }

  .benefit + .benefit {
    border-top: 1px solid var(--line-soft);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
