:root {
  color-scheme: light dark;

  --bg: #f8f9fb;
  --bg-elevated: #ffffff;
  --text: #0f1115;
  --text-muted: #6b7280;
  --text-subtle: #9ca3af;
  --border: #e5e7eb;
  --line: #c5c9d1;
  --accent: #ec9f30;
  --accent-hover: #e09222;
  --accent-text: #0f1115;
  --focus: #ec9f30;
  --footer: #8b919c;
  --radius: 6px;
  --font-sans: "Space Grotesk", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --max: 40rem;
  --page-pad: clamp(1.25rem, 4vw, 2rem);
}

html[data-theme="dark"] {
  --bg: #0c0d0f;
  --bg-elevated: #12141a;
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;
  --border: #2a2e36;
  --line: #ffffff;
  --accent: #ec9f30;
  --accent-hover: #f0aa45;
  --accent-text: #0f1115;
  --focus: #ec9f30;
  --footer: #6b7280;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    transform 0.2s ease;
}

.theme-toggle:hover {
  color: var(--text);
  transform: scale(1.04);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.theme-toggle__icon {
  display: none;
  line-height: 0;
}

html[data-theme="light"] .theme-toggle__icon--moon,
html[data-theme="dark"] .theme-toggle__icon--sun {
  display: block;
}

.page {
  width: min(100%, 52rem);
  margin: 0 auto;
  padding: clamp(3.5rem, 10vh, 5.5rem) var(--page-pad) 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
}

.hero {
  width: min(100%, var(--max));
  text-align: center;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.status {
  margin: 0.55rem 0 0;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.headline {
  margin: 1.75rem 0 0;
  font-size: clamp(1.85rem, 4.5vw, 2.65rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--text);
}

.lede {
  margin: 1.1rem auto 0;
  max-width: 34rem;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  line-height: 1.65;
  color: var(--text-muted);
}

.waitlist {
  margin: 1.75rem auto 0;
  width: min(100%, 28rem);
  animation: rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.waitlist__row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.waitlist__input {
  width: 100%;
  height: 2.85rem;
  padding: 0 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.waitlist__input::placeholder {
  color: var(--text-subtle);
}

.waitlist__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}

.waitlist__input.is-invalid {
  border-color: #d97757;
}

.waitlist__submit {
  width: 100%;
  height: 2.85rem;
  padding: 0 1.15rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.waitlist__submit:hover {
  background: var(--accent-hover);
}

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

.waitlist__submit:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.waitlist__submit:disabled {
  opacity: 0.7;
  cursor: default;
}

.waitlist__note {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--text-subtle);
  transition: color 0.2s ease;
}

.waitlist.is-success .waitlist__note {
  color: var(--accent);
}

.timeline {
  width: min(100%, 42rem);
  margin: clamp(2.5rem, 6vh, 3.75rem) 0 0;
  padding: 0;
  color: var(--line);
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
  --draw-duration: 2.4s;
  --draw-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline__canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 1024 / 109;
}

.timeline__stroke {
  position: absolute;
  inset: 0;
  background-color: var(--line);
  -webkit-mask: url("assets/timeline-r.png") center / 100% 100% no-repeat;
  mask: url("assets/timeline-r.png") center / 100% 100% no-repeat;
  transition: background-color 0.25s ease;
  clip-path: inset(0 100% 0 0);
}

.timeline.is-playing .timeline__stroke {
  animation: timeline-draw var(--draw-duration) var(--draw-ease) 0.15s forwards;
}

.timeline__svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.timeline__ticks line {
  stroke: currentColor;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scaleY(0.2);
}

.timeline.is-playing .timeline__ticks line {
  animation: timeline-tick 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.timeline.is-playing .timeline__ticks line:nth-child(1) {
  animation-delay: 0.28s;
}
.timeline.is-playing .timeline__ticks line:nth-child(2) {
  animation-delay: 0.4s;
}
.timeline.is-playing .timeline__ticks line:nth-child(3) {
  animation-delay: 0.52s;
}
.timeline.is-playing .timeline__ticks line:nth-child(4) {
  animation-delay: 0.64s;
}
.timeline.is-playing .timeline__ticks line:nth-child(5) {
  animation-delay: 0.76s;
}
.timeline.is-playing .timeline__ticks line:nth-child(6) {
  animation-delay: 0.88s;
}
.timeline.is-playing .timeline__ticks line:nth-child(7) {
  animation-delay: 1s;
}
.timeline.is-playing .timeline__ticks line:nth-child(8) {
  animation-delay: 1.12s;
}
.timeline.is-playing .timeline__ticks line:nth-child(9) {
  animation-delay: 1.24s;
}
.timeline.is-playing .timeline__ticks line:nth-child(10) {
  animation-delay: 1.36s;
}
.timeline.is-playing .timeline__ticks line:nth-child(11) {
  animation-delay: 1.48s;
}

.timeline__start {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.4);
}

.timeline.is-playing .timeline__start {
  animation: timeline-pop 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
}

.timeline__marker {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: translateX(-24px) scale(0.6);
}

.timeline.is-playing .timeline__marker {
  animation: timeline-marker-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.9s
    forwards;
}

.timeline__marker-ring {
  fill: var(--bg);
  stroke: var(--line);
  stroke-width: 2;
  transition: fill 0.25s ease;
}

.timeline__marker-dot,
.timeline__marker-caret,
.timeline__eye {
  fill: var(--accent);
}

.timeline__marker-dot {
  transform-box: fill-box;
  transform-origin: center;
}

.timeline.is-playing .timeline__marker-dot {
  animation: timeline-pulse 2.2s ease-in-out 1.5s infinite;
}

.timeline__eye {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.3);
}

.timeline.is-playing .timeline__eye {
  animation: timeline-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1) 2.15s forwards;
}

@keyframes timeline-draw {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes timeline-tick {
  from {
    opacity: 0;
    transform: scaleY(0.2);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes timeline-pop {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes timeline-marker-in {
  from {
    opacity: 0;
    transform: translateX(-28px) scale(0.55);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes timeline-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.72;
  }
}

.footer {
  margin-top: auto;
  padding-top: clamp(2.5rem, 8vh, 4rem);
  width: min(100%, var(--max));
  text-align: center;
  animation: rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

.footer__domain {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--footer);
}

.footer__tagline {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--footer);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 640px) {
  .waitlist {
    width: min(100%, 30rem);
  }

  .waitlist__row {
    flex-direction: row;
    align-items: stretch;
    gap: 0.55rem;
  }

  .waitlist__input {
    flex: 1 1 auto;
  }

  .waitlist__submit {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .timeline__stroke {
    clip-path: none;
  }

  .timeline__ticks line,
  .timeline__start,
  .timeline__marker,
  .timeline__eye {
    opacity: 1;
    transform: none;
  }
}
