/* The Dreams.fm identity (lib/studio/templates/landing-kit.ts): carbon ground, bone ink, ash for quiet lines,
   tally for the one accent. Display in Anybody, text in Atkinson Hyperlegible Next, labels in Azeret Mono. */

@font-face { font-family: "Anybody Head"; src: url("/fonts/anybody-64-780.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Anybody Wide"; src: url("/fonts/anybody-128-300.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Anybody Mark"; src: url("/fonts/anybody-62-800.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Azeret Mono"; src: url("/fonts/azeret-mono-400.ttf") format("truetype"); font-display: swap; }
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --carbon: #121110;
  --bone: #e8e2d4;
  --ash: #a39d90;
  --graphite: #5e5a53;
  --tally: #ff4a2e;
  --quiet: #cbc5b8; /* small text over the stage, light enough to hold 4.5:1 with the lamp behind the veil */
  --veil: rgba(18, 17, 16, 0.72); /* the carbon wash that sits between the stage and every word */
  --pad: clamp(20px, 5vw, 76px);
  --column: min(560px, 100vw - 2 * var(--pad));
  --text: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Azeret Mono", ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --head: "Anybody Head", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
}

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

html {
  background: var(--carbon);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--bone);
  font: 400 1.0625rem/1.5 var(--text);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- The stage ---- */

.stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  display: block;
  opacity: 0;
  transition: opacity 900ms ease;
}
.stage.is-drawn { opacity: 1; }

/* A frame of the same shader for a browser that cannot run it. */
.no-webgl .stage {
  opacity: 1;
  background: var(--carbon) url("/hero-still.jpg") 70% 50% / cover no-repeat;
}

.scrim {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(var(--pad) + var(--column) + 260px);
  background: linear-gradient(90deg, var(--veil) 0, var(--veil) calc(100% - 260px), rgba(18, 17, 16, 0) 100%);
  pointer-events: none;
}

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

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px var(--pad) 0;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  color: var(--bone);
  font: 400 1.75rem/1 "Anybody Mark", var(--head);
  letter-spacing: 0.005em;
  text-decoration: none;
}
.wordmark .tally { align-self: flex-end; width: 0.24em; height: 0.24em; margin: 0 0.1em 0.17em; }

.tally {
  display: inline-block;
  width: 0.3em;
  height: 0.3em;
  border-radius: 50%;
  background: var(--tally);
  flex: none;
}

.soon,
.eyebrow,
.label,
.foot {
  font: 400 0.75rem/1.4 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.soon {
  margin: 0;
  padding: 7px 12px;
  color: var(--bone);
  background: var(--veil);
  border: 1px solid rgba(232, 226, 212, 0.22);
}

.copy {
  align-self: center;
  width: calc(var(--column) + 2 * var(--pad));
  max-width: 100%;
  padding: 40px var(--pad);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7em;
  margin: 0 0 18px;
  color: var(--bone);
}
.eyebrow .tally { width: 0.62em; height: 0.62em; }

h1 {
  margin: 0;
  font: 400 clamp(2.6rem, 5.4vw, 4.5rem)/0.98 var(--head);
  letter-spacing: -0.005em;
}
h1 .line { display: block; white-space: nowrap; }
h1 .wide { font-family: "Anybody Wide", var(--head); line-height: 1.08; }

.lede {
  margin: 22px 0 0;
  max-width: 30em;
  font-size: 1.1875rem;
  line-height: 1.45;
  color: var(--bone);
}

/* ---- Signup ---- */

.signup { margin: 34px 0 0; max-width: 500px; }

.label { display: block; margin: 0 0 10px; color: var(--bone); }

.field {
  display: flex;
  border: 1px solid rgba(232, 226, 212, 0.5);
  background: rgba(18, 17, 16, 0.6);
  transition: border-color 160ms ease;
}
.field:focus-within { border-color: var(--bone); }

.field input {
  flex: 1 1 auto;
  min-width: 0;
  height: 54px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--bone);
  font: 400 1.0625rem/1 var(--text);
  appearance: none;
}
.field input::placeholder { color: var(--ash); opacity: 1; }
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--bone);
  box-shadow: 0 0 0 100px var(--carbon) inset;
  caret-color: var(--bone);
}
.field input[aria-invalid="true"] { box-shadow: inset 0 -2px 0 var(--tally); }

.field button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  background: var(--tally);
  color: var(--carbon);
  font: 600 1rem/1 var(--text);
  cursor: pointer;
  transition: background-color 160ms ease;
}
.field button:hover { background: #ff6a52; }
.field button:focus-visible,
.field input:focus-visible,
.wordmark:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; }
.field button[disabled] { cursor: default; background: var(--graphite); color: var(--bone); }
.field button svg { transition: transform 160ms ease; }
.field button:hover:not([disabled]) svg { transform: translateX(3px); }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.status {
  margin: 12px 0 0;
  min-height: 1.5em;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--quiet);
}
.status[data-tone="ok"] { color: var(--bone); }
.status[data-tone="ok"]::before,
.status[data-tone="error"]::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.6em;
  border-radius: 50%;
  background: var(--tally);
  vertical-align: 0.08em;
}
.status[data-tone="ok"]::before { background: var(--bone); }
.status[data-tone="error"] { color: var(--bone); }

/* Without script the form posts and the function sends the visitor back to one of these. */
.after-post { display: none; }
.after-post:target { display: block; }
.signup:has(.after-post:target) #signup-status { display: none; }

.signup[data-state="done"] .field { border-color: rgba(232, 226, 212, 0.28); }
.signup[data-state="done"] .field input { color: var(--ash); }

.suite {
  margin: 30px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(232, 226, 212, 0.2);
  max-width: 36em;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--quiet);
}

.foot {
  display: flex;
  gap: 22px;
  padding: 0 var(--pad) 24px;
  color: var(--quiet);
}
.foot p { margin: 0; }

/* ---- Tall and narrow views: the lamp sits above, the words below it. hero.js places the lamp by the same query. ---- */

@media (max-width: 900px), (max-aspect-ratio: 21 / 20) {
  .scrim { display: none; }

  .top {
    padding-bottom: 46px;
    background: linear-gradient(180deg, var(--veil) 0, var(--veil) 58%, rgba(18, 17, 16, 0) 100%);
  }
  .wordmark { font-size: 1.5rem; }

  .copy {
    --rise: 72px; /* how far the veil takes to come up under the first line */
    align-self: end;
    width: 100%;
    margin-top: clamp(96px, 27svh, 280px);
    padding: var(--rise) var(--pad) 26px;
    background: linear-gradient(180deg, rgba(18, 17, 16, 0) 0, var(--veil) var(--rise), var(--veil) 100%);
  }
  .foot { padding-top: 4px; background: var(--veil); }

  h1 { font-size: clamp(2.3rem, 11.4vw, 3.6rem); }
  .lede { font-size: 1.0625rem; margin-top: 16px; }
  .signup { margin-top: 24px; max-width: none; }
  .suite { margin-top: 24px; }
  .no-webgl .stage { background-position: 78% 50%; }
}

/* A short screen gives the lamp less room so the signup field stays on the first screen. */
@media (max-width: 900px) and (max-height: 700px), (max-aspect-ratio: 21 / 20) and (max-height: 700px) {
  .top { padding-top: 18px; padding-bottom: 30px; }
  .copy { --rise: 52px; margin-top: clamp(48px, 12svh, 110px); }
  .eyebrow { margin-bottom: 12px; }
  h1 { font-size: clamp(2rem, 9.8vw, 3rem); }
  .lede { font-size: 1rem; margin-top: 12px; }
  .signup { margin-top: 18px; }
}

@media (max-width: 400px) {
  .field button { padding: 0 14px; }
  .field button svg { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .stage, .field, .field button, .field button svg { transition: none; }
}
