/* ==========================================================================
   Clara site — layout and page styling.
   Every color and type decision references a token or a named class from
   tokens.css. There is exactly one raw color in this file, and it is
   commented where it appears.
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--clara-background);
  color: var(--clara-primary-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Layout primitives ---------------------------------------------- */

:root {
  /* Total space between two adjacent sections. Split evenly above and below
     the hairline divider so one rule governs the whole page rhythm. */
  --section-gap: 120px;
  --section-pad: calc(var(--section-gap) / 2);
  --container-pad: 28px;
}

@media (max-width: 700px) {
  :root {
    --section-gap: 72px;
  }
}

@media (max-width: 600px) {
  :root {
    --container-pad: 20px;
  }
}

.container {
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* Reading measure for continuous prose. */
.measure {
  max-width: 62ch;
}

/* Off-screen but available to screen readers — used for the form labels. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- Sections -------------------------------------------------------- */

/* The single rhythm rule: every section after the hero carries half the gap
   above and below its content, with the hairline divider sitting between
   them. Adjacent sections therefore sit exactly --section-gap apart. */
.section > .container {
  padding-block: var(--section-pad);
  border-top: 1px solid var(--clara-tile-border);
}

.section h2,
.section p {
  margin: 0;
}

/* Rhythm inside a section: eyebrow, title, prose, closing line. */
.section__eyebrow {
  margin: 0 0 14px;
}

.section__title {
  margin: 0 0 20px;
}

.section__prose + .section__note {
  margin-top: 20px;
}

/* ---- Hero ------------------------------------------------------------ */

.hero {
  display: flex;
  align-items: center;
  min-height: max(88vh, 640px);
}

@supports (height: 88svh) {
  .hero {
    min-height: max(88svh, 640px);
  }
}

.hero > .container {
  width: 100%;
  padding-block: var(--section-pad);
}

.hero__eyebrow {
  margin: 0 0 18px;
}

.hero__title {
  margin: 0 0 24px;
  max-width: 18ch;
}

.hero__prose {
  margin: 0 0 36px;
}

.hero__note {
  margin: 14px 0 0;
}

/* ---- Waitlist form (used in both the hero and the close) -------------- */

.waitlist {
  max-width: 520px;
}

.waitlist__row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.waitlist__input {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--clara-tile-surface);
  border: 1px solid var(--clara-tile-border);
  border-radius: 10px;
  padding: 14px 16px;
  /* Type comes from .clara-row-label in the markup; inputs do not inherit
     font by default, so the class carries family/size/weight/color. */
  transition: border-color 0.18s ease;
}

.waitlist__input::placeholder {
  color: var(--clara-secondary-text);
  opacity: 1;
}

.waitlist__input:focus {
  border-color: var(--clara-amber-accent);
  outline: 2px solid var(--clara-amber-accent);
  outline-offset: 2px;
}

.waitlist__button {
  flex: 0 0 auto;
  background: var(--clara-amber-accent);
  border: 1px solid var(--clara-amber-accent);
  border-radius: 10px;
  padding: 14px 22px;
  cursor: pointer;
  /* Label type comes from .clara-on-accent in the markup. */
  transition: filter 0.18s ease;
}

.waitlist__button:hover {
  filter: brightness(1.08);
}

.waitlist__button:focus-visible {
  outline: 2px solid var(--clara-primary-text);
  outline-offset: 2px;
}

.waitlist__button[disabled] {
  opacity: 0.6;
  cursor: default;
  filter: none;
}

/* Honeypot. Positioned off-canvas rather than display:none or
   visibility:hidden — bots commonly skip fields hidden those ways, which is
   exactly the population this field exists to catch. The input inside is
   tabindex="-1" and the wrapper is aria-hidden, so it is unreachable by
   keyboard and silent to screen readers. */
.waitlist__honeypot {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Reserved height so a status message does not shift the layout. */
.waitlist__status {
  margin: 10px 0 0;
  min-height: calc(13px * var(--clara-line-tight));
}

.waitlist__status--success {
  color: var(--clara-sage-accent);
}

@media (max-width: 560px) {
  .waitlist,
  .waitlist__row {
    max-width: none;
  }

  .waitlist__row {
    flex-direction: column;
  }

  .waitlist__button {
    width: 100%;
  }
}

/* ---- Signature moment: the Decompress dim ---------------------------- */

.decompress {
  position: relative;
  isolation: isolate;
  opacity: 0.55;
  transition: opacity var(--clara-motion-dimmer) var(--clara-motion-dimmer-ease);
}

.decompress__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  /* The one intentional off-token value on the page: a shade deeper than
     --clara-background so the section reads as the room dimming. It exists
     only as this veil and is never used as a text or surface color. */
  background: #151312;
  opacity: 0;
  transition: opacity var(--clara-motion-dimmer) var(--clara-motion-dimmer-ease);
}

.decompress .section__eyebrow {
  opacity: 0;
  transition: opacity var(--clara-motion-glow-bloom) var(--clara-motion-glow-ease)
    var(--clara-motion-stagger);
}

.decompress.is-lit,
.decompress.is-lit .decompress__veil,
.decompress.is-lit .section__eyebrow {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .decompress,
  .decompress__veil,
  .decompress .section__eyebrow {
    transition: none;
  }

  /* Reduced-motion visitors get the final state immediately. */
  .decompress,
  .decompress .section__eyebrow {
    opacity: 1;
  }

  .decompress__veil {
    opacity: 1;
  }
}

/* ---- Close ----------------------------------------------------------- */

.close__title {
  margin: 0 0 24px;
}

/* ---- Footer ---------------------------------------------------------- */

.footer > .container {
  padding-block: var(--section-pad);
}

.footer p {
  margin: 0;
}
