/* storia.sh — waitlist landing */

:root {
  color-scheme: light;

  --bg: #ffffff;
  --surface: #fafafc;
  --raised: #f3f3f6;
  --border: #e5e4e9;
  --border-strong: #d1d0d6;
  --text-faint: #92919a;
  --text-muted: #72707a;
  --text: #161519;
  --observed: #1670d1;
  --brand: #964bb4;
  --brand-wash: #f8eefc;

  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --font-ui: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}

/* ---- masthead ---- */

.masthead {
  padding-top: 28px;
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 4px 8px 4px 0;
  text-decoration: none;
  color: var(--text);
}

.mark {
  flex: none;
  transform: translateY(2.3px);  /* centre the glyph on the wordmark's x-height (measured) */
}

.wordmark {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0.01em;
}

/* ---- hero ---- */

.hero {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding: clamp(40px, 8vh, 96px) 0 72px;
}

.hero-copy {
  max-width: 480px;
  justify-self: center;
}

h1 {
  margin: 0 0 20px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 76px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.subhead {
  margin: 0 0 32px;
  max-width: 46ch;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.55;
}

/* ---- waitlist form ---- */

.waitlist-form[hidden] {
  display: none;
}

.waitlist-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 480px;
}

.waitlist-form input[type="email"] {
  flex: 1 1 230px;
  min-height: 48px;
  padding: 0 16px;
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
}

.waitlist-form input[type="email"]::placeholder {
  color: var(--text-faint);
  opacity: 1;
}

.waitlist-form button {
  min-height: 48px;
  padding: 0 24px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--bg);
  background: var(--text);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.waitlist-form button:hover {
  opacity: 0.88;
}

.waitlist-form button:disabled {
  opacity: 0.55;
  cursor: default;
}

.waitlist-form input:focus-visible,
.waitlist-form button:focus-visible,
.lockup:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.form-status {
  margin: 14px 0 0;
  min-height: 1.4em;
  font-size: 14px;
}

.form-status.is-error {
  color: var(--text-muted);
}

.form-status.is-success {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 17px;
}

.confirm-square {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  background: var(--brand);
}

.noscript-note {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---- animated hero art ---- */

.hero-art {
  background: var(--bg);
}

.hero-frames {
  position: relative;
  aspect-ratio: 620 / 646;
  background: var(--bg);
}

.hero-frames img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  opacity: 0;
  mix-blend-mode: multiply; /* white paper melts into --bg in light theme */
  animation: cyc 1.5s steps(1, end) infinite;
}

.hero-frames img:nth-child(1) { animation-delay: 0s; }
.hero-frames img:nth-child(2) { animation-delay: 0.25s; }
.hero-frames img:nth-child(3) { animation-delay: 0.5s; }
.hero-frames img:nth-child(4) { animation-delay: 0.75s; }
.hero-frames img:nth-child(5) { animation-delay: 1s; }
.hero-frames img:nth-child(6) { animation-delay: 1.25s; }

@keyframes cyc {
  0% { opacity: 1; }
  16.667%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-frames img {
    animation: none;
  }
  .hero-frames img:first-child {
    opacity: 1;
  }
}

/* ---- responsive ---- */

@media (max-width: 780px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 40px;
    gap: 48px;
  }
  .hero-art {
    max-width: 90vw;
    width: 100%;
    margin: 0 auto;
  }
}

/* ---- utilities ---- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
