:root {
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --ink: #0a0a0a;
  --ink-muted: #525252;
  --ink-faint: #a3a3a3;
  --ink-inverted: #ffffff;
  --line: #e5e5e5;
  --line-strong: #0a0a0a;
  --font-display: "Syne", sans-serif;
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --shadow-block: 4px 4px 0 var(--ink);
  --shadow-block-sm: 2px 2px 0 var(--ink);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  /* Leave the right side for the ladder; measure() shortens the pipe if needed */
  --ladder-reserve: 380px;
}

html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a;
  --bg-subtle: #141414;
  --ink: #f2f2f2;
  --ink-muted: #a3a3a3;
  --ink-faint: #737373;
  --ink-inverted: #0a0a0a;
  --line: #2a2a2a;
  --line-strong: #f2f2f2;
}

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

html,
body {
  min-height: 100%;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: -1px -1px;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* Background cascade — full viewport; cards sit past the copy column */
.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.stage-rails {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.inlet-prompt {
  position: absolute;
  z-index: 4;
  max-width: 18ch;
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(20px, 2.1vw, 26px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: right;
  transform: translateY(-110%);
  transform-origin: 100% 100%;
  pointer-events: none;
  transition:
    transform 0.48s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.36s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.36s cubic-bezier(0.16, 1, 0.3, 1);
}

.inlet-prompt.is-morphing {
  opacity: 0;
  filter: blur(6px);
  transform: translate(18px, 14px) scale(0.06);
}

.poof {
  position: absolute;
  z-index: 3;
  width: 0;
  height: 0;
  pointer-events: none;
}

.poof::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  opacity: 0;
}

.poof.is-on::after {
  animation: poof-ring 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes poof-ring {
  0% {
    transform: scale(0.4);
    opacity: 1;
  }
  100% {
    transform: scale(3.4);
    opacity: 0;
  }
}

.poof span {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  background: var(--ink);
  border-radius: 50%;
  opacity: 0;
}

.poof.is-on span {
  animation: poof-speck 0.48s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.poof span:nth-child(1) { --dx: 22px; --dy: -8px; }
.poof span:nth-child(2) { --dx: 14px; --dy: 18px; animation-delay: 20ms; }
.poof span:nth-child(3) { --dx: -6px; --dy: 22px; animation-delay: 30ms; }
.poof span:nth-child(4) { --dx: -22px; --dy: 6px; animation-delay: 10ms; }
.poof span:nth-child(5) { --dx: -16px; --dy: -16px; animation-delay: 25ms; }
.poof span:nth-child(6) { --dx: 4px; --dy: -24px; animation-delay: 15ms; }
.poof span:nth-child(7) { --dx: 20px; --dy: 12px; animation-delay: 35ms; }
.poof span:nth-child(8) { --dx: -2px; --dy: 4px; --end: 0.55; animation-delay: 5ms; }

@keyframes poof-speck {
  0% {
    transform: translate(0, 0) scale(0.4);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(var(--end, 0.15));
    opacity: 0;
  }
}

.bubble {
  position: absolute;
  z-index: 1;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  background: var(--ink);
  border-radius: 50%;
  pointer-events: none;
}

.bubble.is-popping {
  animation: bubble-pop 0.48s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes bubble-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.tier-cards {
  position: absolute;
  inset: 0;
  z-index: 2;
  list-style: none;
}

.tier-card {
  position: absolute;
  z-index: 1;
  width: 220px;
  isolation: isolate;
  background: var(--bg);
  border: 1.5px solid var(--ink);
  padding: 10px 12px 8px;
  transform: translate(-100%, -50%);
}

.tier-card.is-hit {
  box-shadow: 3px 3px 0 var(--ink);
}

.tier-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.tier-id {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.tier-role {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.tier-models {
  list-style: none;
  display: grid;
  gap: 4px;
}

.tier-models li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.tier-models .model {
  font-weight: 600;
  color: var(--ink);
}

.tier-models .prov {
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tier-dock {
  display: flex;
  gap: 4px;
  min-height: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.dock-dot {
  width: 8px;
  height: 8px;
  background: var(--ink);
  border-radius: 50%;
  flex-shrink: 0;
}

.fore {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: min(560px, calc(100% - var(--ladder-reserve)));
  padding:
    clamp(24px, 4vh, 48px)
    clamp(20px, 4vw, 48px)
    clamp(16px, 2.5vh, 28px);
  background: linear-gradient(
    90deg,
    var(--bg) 0%,
    var(--bg) calc(100% - 56px),
    color-mix(in srgb, var(--bg) 40%, transparent) 100%
  );
}

.mast {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
}

.brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.mast-end {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.mast-meta {
  display: flex;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.theme-switch {
  position: fixed;
  top: clamp(24px, 4vh, 48px);
  right: clamp(20px, 4vw, 48px);
  z-index: 5;
  display: flex;
  border: 1.5px solid var(--ink);
  background: var(--bg);
}

.theme-switch button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  appearance: none;
}

.theme-switch button + button {
  border-left: 1.5px solid var(--ink);
}

.theme-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--ink-inverted);
}

.theme-switch button:hover {
  background: var(--ink);
  color: var(--ink-inverted);
}

.theme-icon {
  display: none;
  width: 16px;
  height: 16px;
}

.theme-icon-bulb {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: miter;
  stroke-linecap: square;
}

.theme-icon-moon {
  fill: currentColor;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(20px, 4vh, 40px) 0 8px;
}

.headline {
  font-family: var(--font-display);
  font-size: clamp(40px, 7.2vw, 72px);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.045em;
  max-width: min(12ch, 100%);
  animation: enter 720ms var(--ease-out-expo) both;
}

.thesis {
  margin-top: 24px;
  max-width: 42ch;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink-muted);
}

.waitlist {
  margin-top: 32px;
  max-width: 420px;
}

.waitlist.is-success {
  background: var(--ink);
  color: var(--ink-inverted);
  padding: 20px 22px;
}

.form-fields {
  display: grid;
  gap: 12px;
}

.waitlist.is-success .form-fields {
  display: none;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.optional {
  font-weight: 400;
  color: var(--ink-faint);
}

.field input[type="email"],
.field select {
  width: 100%;
  height: 44px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0 12px;
  appearance: none;
}

.field input[type="email"]:hover,
.field select:hover {
  background: var(--bg-subtle);
}

.field input[type="email"].is-invalid {
  box-shadow: inset 0 0 0 1px var(--ink);
}

.field-select {
  position: relative;
}

.field-select::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 18px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg);
  pointer-events: none;
}

.field select {
  padding-right: 36px;
  cursor: pointer;
}

.gotcha {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn-block-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 180px;
  height: 44px;
  margin-top: 4px;
  background-color: var(--ink);
  color: var(--ink-inverted);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.12s ease-out, color 0.12s ease-out, box-shadow 0.12s ease-out, transform 0.12s ease-out;
  user-select: none;
}

.btn-block-primary:hover {
  background-color: var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow-block);
  transform: translate(-2px, -2px);
}

.btn-block-primary:active {
  transform: translate(1px, 1px);
  box-shadow: var(--shadow-block-sm);
}

.btn-block-primary:disabled {
  cursor: wait;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.form-error {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  border-left: 2px solid var(--ink);
  padding-left: 10px;
}

.form-success {
  display: none;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.waitlist.is-success .form-success {
  display: block;
}

.colophon {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  max-width: 48ch;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

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

@media (max-width: 860px) {
  body {
    display: grid;
    grid-template-columns: 1fr;
    padding:
      clamp(24px, 4vh, 48px)
      clamp(20px, 4vw, 32px)
      clamp(16px, 2.5vh, 28px);
    background-image: none;
  }

  .fore {
    display: contents;
    width: auto;
    min-height: 0;
    padding: 0;
    background: none;
  }

  .mast {
    grid-row: 1;
    gap: 8px 16px;
  }

  .main {
    grid-row: 2;
    justify-content: flex-start;
    padding: 24px 0 8px;
  }

  .stage {
    position: relative;
    inset: auto;
    grid-row: 3;
    width: 100%;
    height: 272px;
    margin: 20px 0 16px;
    opacity: 1;
    background-color: var(--bg);
    background-image:
      linear-gradient(var(--line) 1px, transparent 1px),
      linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 72px 72px;
    background-position: -1px -1px;
  }

  .colophon {
    grid-row: 4;
  }

  .brand {
    font-size: 18px;
  }

  .mast-meta {
    display: none;
  }

  .theme-switch {
    position: static;
  }

  .headline {
    font-size: clamp(34px, 10vw, 48px);
  }

  .waitlist {
    margin-top: 24px;
  }

  .tier-models {
    display: none;
  }

  .tier-card {
    width: 118px;
    padding: 6px 8px 5px;
  }

  .tier-card-head {
    margin-bottom: 4px;
    padding-bottom: 0;
    border-bottom: none;
  }

  .tier-dock {
    margin-top: 4px;
    padding-top: 6px;
    min-height: 6px;
  }

  .dock-dot {
    width: 6px;
    height: 6px;
  }

  .inlet-prompt {
    font-size: 13px;
    max-width: 12ch;
  }
}

@media (max-width: 520px) {
  .theme-switch .theme-label {
    display: none;
  }

  .theme-switch button {
    width: 36px;
    height: 36px;
    padding: 0;
    display: grid;
    place-items: center;
  }

  .theme-icon {
    display: block;
  }
}

@media (max-width: 1056px) and (min-width: 861px) {
  .headline {
    font-size: clamp(36px, 5.6vw, 56px);
  }
}

@media (max-height: 820px) {
  .thesis {
    margin-top: 16px;
  }

  .waitlist {
    margin-top: 24px;
  }
}

@media (max-height: 820px) and (min-width: 1057px) {
  .headline {
    font-size: clamp(36px, 6vw, 56px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .headline {
    animation: none;
  }

  .btn-block-primary {
    transition: none;
  }

  .inlet-prompt,
  .bubble,
  .poof span,
  .poof::after {
    animation: none;
    transition: none;
  }
}
