/* Transitions.dev snippets: modal, success check, error shake, input clear, and text reveal. */

/* Source: 06-modal.md — tokens and transition rules copied verbatim. */

:root {
  --modal-open-dur: 250ms;
  --modal-close-dur: 150ms;
  --modal-scale: 0.96;
  --modal-scale-close: 0.96;
  --modal-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.t-modal {
  transform-origin: center;
  transform: scale(var(--modal-scale));
  opacity: 0;
  pointer-events: none;
  transition:
    transform var(--modal-open-dur) var(--modal-ease),
    opacity   var(--modal-open-dur) var(--modal-ease);
  will-change: transform, opacity;
}
.t-modal.is-open {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}
.t-modal.is-closing {
  transform: scale(var(--modal-scale-close));
  opacity: 0;
  pointer-events: none;
  transition:
    transform var(--modal-close-dur) var(--modal-ease),
    opacity   var(--modal-close-dur) var(--modal-ease);
}

@media (prefers-reduced-motion: reduce) {
  .t-modal { transition: none !important; }
}

/* Source: 10-success-check.md — tokens and transition rules copied verbatim. */

:root {
  --check-opacity-dur: 500ms;
  --check-rotate-dur: 500ms;
  --check-rotate-from: 80deg;
  --check-bob-dur: 500ms;
  --check-y-amount: 40px;
  --check-blur-dur: 500ms;
  --check-blur-from: 10px;
  --check-path-dur: 500ms;
  --check-path-delay: 80ms;
  --check-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-opacity: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-rotate: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-bob: cubic-bezier(0.34, 1.35, 0.64, 1);
  --check-ease-path: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Wrapper drives the appear animation; it doesn't own any
   sizing or color so you can drop in any icon. */
.t-success-check {
  display: inline-block;
  transform-origin: center;
  opacity: 0;
  will-change: transform, opacity, filter;
}
/* overflow: visible keeps the stroke from clipping while it
   draws; display: block kills the inline whitespace under SVGs. */
.t-success-check svg { display: block; overflow: visible; }
/* Stroke-draw setup. Replace 20 with the result of
   path.getTotalLength() for your path; round caps mean any
   sub-pixel overshoot is invisible. */
.t-success-check svg path {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}

.t-success-check[data-state="in"] {
  animation:
    t-check-fade   var(--check-opacity-dur) var(--check-ease-opacity) forwards,
    t-check-rotate var(--check-rotate-dur)  var(--check-ease-rotate)  forwards,
    t-check-blur   var(--check-blur-dur)    var(--check-ease-out)     forwards,
    t-check-bob    var(--check-bob-dur)     var(--check-ease-bob)     forwards;
}
.t-success-check[data-state="in"] svg path {
  animation: t-check-draw var(--check-path-dur) var(--check-ease-path) var(--check-path-delay, 0ms) forwards;
}

@keyframes t-check-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes t-check-rotate {
  from { transform: rotate(var(--check-rotate-from)); }
  to   { transform: rotate(0deg); }
}
@keyframes t-check-blur {
  from { filter: blur(var(--check-blur-from)); }
  to   { filter: blur(0); }
}
@keyframes t-check-bob {
  from { translate: 0 var(--check-y-amount); }
  to   { translate: 0 0; }
}
@keyframes t-check-draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .t-success-check { animation: none !important; opacity: 1; }
  .t-success-check svg path { animation: none !important; stroke-dashoffset: 0 !important; }
}

/* Source: 12-error-state-shake.md — tokens and transition rules copied verbatim. */

:root {
  --shake-distance: 6px;
  --shake-overshoot: 4px;
  --shake-dur-a: 80ms;
  --shake-dur-b: 60ms;
  --shake-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --revert-hold: 3000ms;
  --revert-dur: 280ms;
}

/* Border-color tween. Define your input's default / focused
   / error border-color in your own component CSS — this rule
   only owns the interpolation. Use a constant border-width
   across states so the tween never shifts inner content. */
.t-input {
  transition: border-color 150ms ease-out;
  will-change: transform;
}
.t-input.is-error {
  /* Error border auto-reverts on the hold timer, so the
     fade-out uses the slower revert duration (matches the
     message fade). */
  transition: border-color var(--revert-dur, 280ms) ease-out;
}

/* Error message reveal. Visibility is delayed by --revert-dur
   on hide so the message stays painted for the full opacity
   fade-out. Entering .is-error drops the delay to 0 so the
   message becomes visible immediately. */
.t-error-msg {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity    var(--revert-dur, 280ms) ease-out,
    visibility 0s linear var(--revert-dur, 280ms);
}
.t-input-wrap.is-error .t-error-msg {
  opacity: 1;
  visibility: visible;
  transition:
    opacity    var(--revert-dur, 280ms) ease-out,
    visibility 0s linear 0s;
}

/* Multi-segment keyframe with per-stop easing so each leg
   of the shake follows its own cubic-bezier independently.
   %-stops are cumulative durations as a fraction of the
   total (80, 60, 80, 60 = 280ms): 28.57%, 57.14%, 78.57%,
   100%. Recompute if any segment duration changes. */
.t-input.is-shaking {
  animation: t-input-shake calc(
      var(--shake-dur-a) * 2 + var(--shake-dur-b) * 2
    ) linear;
}
@keyframes t-input-shake {
  0%      { transform: translateX(0);                                 animation-timing-function: var(--shake-ease); }
  28.57%  { transform: translateX(var(--shake-distance));             animation-timing-function: var(--shake-ease); }
  57.14%  { transform: translateX(calc(var(--shake-distance) * -1)); animation-timing-function: var(--shake-ease); }
  78.57%  { transform: translateX(var(--shake-overshoot));            animation-timing-function: var(--shake-ease); }
  100%    { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .t-input { animation: none !important; transform: none !important; }
}

/* Source: 13-input-clear-dissolve.md — tokens and transition rules copied verbatim. */

:root {
  --clear-dur: 1000ms;
  --clear-out-dur: 400ms;
  --clear-in-dur: 400ms;
  --clear-out-fly: 12px;
  --clear-in-fly: 12px;
  --clear-out-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --clear-in-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --clear-blur: 2px;
  --glow-delay: 50ms;
  --glow-peak-at: 0.15;
  --glow-opacity: 0.42;
  --glow-spread: 1.5;
}

/* The wrap clips the glow to its rounded box. The hairline
   border is `inset` so it sits inside that clip — when the
   glow's mix-blend-mode darkens its area, the border
   underneath darkens with it. Bring your own width / height /
   border-radius / surface color. */
.t-clear {
  position: relative;
  overflow: hidden;
}
.t-clear-mirror,
.t-clear-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  z-index: 2;
}
.t-clear-mirror { opacity: 0; }
.t-clear.has-value .t-clear-mirror,
.t-clear.is-clearing .t-clear-mirror { opacity: 1; }
/* Hide the input's own glyphs while the mirror owns them so
   the cleared text doesn't double-render with the fly-up. */
.t-clear.has-value > input,
.t-clear.is-clearing > input {
  -webkit-text-fill-color: transparent;
}
.t-clear.has-value .t-clear-placeholder { opacity: 0; }
/* The streak overlay: empty by default; JS writes a stack of
   `radial-gradient(...)` layers into background during a clear,
   then animates opacity. mix-blend-mode: multiply darkens the
   underlying input + hairline; flip to `screen` in dark mode
   so the same alpha values lighten instead of vanish. */
.t-clear-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 3;
  mix-blend-mode: multiply;
}

/* The transitions live in JS (per-frame transform/opacity/
   filter writes), so this stylesheet only owns the resting
   state + the variables that JS reads. Read them with
   `parseFloat(getComputedStyle(root).getPropertyValue(...))`
   so live tweaks apply on the next clear without a reload. */

@media (prefers-reduced-motion: reduce) {
  .t-clear-glow { opacity: 0 !important; }
}

/* Source: 18-texts-reveal.md — tokens and transition rules copied verbatim. */

:root {
  --stagger-dur: 500ms;
  --stagger-distance: 12px;
  --stagger-stagger: 40ms;
  --stagger-blur: 3px;
  --stagger-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Lines start translated down + blurred + invisible; .is-shown
   on the parent flips them to their resting state. The second
   line's transition-delay holds it back by --stagger-stagger
   so the eye lands on the headline first. */
.t-stagger-line {
  display: block;
  opacity: 0;
  transform: translateY(var(--stagger-distance));
  filter: blur(var(--stagger-blur));
  transition:
    opacity   var(--stagger-dur) var(--stagger-ease),
    transform var(--stagger-dur) var(--stagger-ease),
    filter    var(--stagger-dur) var(--stagger-ease);
  will-change: transform, opacity, filter;
}
.t-stagger-line--2 { transition-delay: var(--stagger-stagger); }

.t-stagger.is-shown .t-stagger-line {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
/* Exit decouples from the stagger: same fade for every line,
   no Y return, no blur — so the disappearance reads as a
   single quiet fade instead of a reverse reveal. */
.t-stagger.is-hiding .t-stagger-line {
  opacity: 0;
  transform: translateY(0);
  filter: blur(0);
  transition:
    opacity 200ms ease,
    transform 0s linear,
    filter 0s linear;
  transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
  .t-stagger-line { transition: none !important; }
}

/* Site-specific monochrome waitlist presentation. */

/* Licensed Transitions.dev Confetti Burst (Pro): https://transitions.dev/detail.html?t=confetti-burst
   The canvas implementation reads these source tokens from :root. */
:root {
  --confetti-count: 32;
  --confetti-gravity: 1050;
  --confetti-size: 5px;
  --confetti-sway: 11;
  --confetti-bounce: .24;
  --confetti-hold: 750ms;
  --confetti-fade: 500ms;
}

body.waitlist-open {
  overflow: hidden;
}

.waitlist-overlay[hidden],
.waitlist-intro[hidden],
.waitlist-form[hidden],
.waitlist-success[hidden],
.waitlist-submit-error[hidden],
.waitlist-smooth-caret[hidden] {
  display: none !important;
}

.waitlist-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(0, 0, 0, .78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.waitlist-dialog.t-modal {
  position: relative;
  isolation: isolate;
  width: min(100%, 540px);
  max-height: calc(100dvh - 36px);
  margin: auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #66666b;
  border-radius: 26px;
  background: #111113;
  box-shadow: 0 28px 100px rgba(0, 0, 0, .68), 0 0 0 1px rgba(255, 255, 255, .05) inset;
  color: #fff;
  -webkit-overflow-scrolling: touch;
}

.waitlist-dialog-inner {
  position: relative;
  z-index: 1;
  padding: clamp(24px, 4vw, 39px);
}

.waitlist-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #65656a;
  border-radius: 50%;
  background: #222225;
  color: #fff;
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.waitlist-close:hover {
  border-color: #fff;
  background: #343438;
}

.waitlist-kicker {
  max-width: calc(100% - 60px);
  margin: 0 0 25px;
  color: #c0c0c4;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2em;
  line-height: 1.4;
}

.waitlist-heading {
  max-width: 460px;
  margin: 0;
  color: #fff;
  font-family: var(--font-display, monospace);
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 400;
  letter-spacing: -.05em;
  line-height: 1.09;
  overflow-wrap: anywhere;
}

.waitlist-summary {
  max-width: 410px;
  margin: 15px 0 0;
  color: #c5c5c9;
  font-size: 15px;
  line-height: 1.6;
}

.waitlist-form {
  display: grid;
  gap: 17px;
  margin-top: 31px;
}

.waitlist-email-wrap {
  min-width: 0;
}

.waitlist-email-wrap > label {
  display: block;
  margin: 0 0 9px;
  color: #e8e8ea;
  font-size: 13px;
  font-weight: 600;
}

.waitlist-email-field.t-clear.t-input {
  position: relative;
  min-height: 56px;
  overflow: hidden;
  border: 1px solid #747479;
  border-radius: 15px;
  background: #1e1e21;
  color: #fff;
  font: 500 16px var(--font-sans, system-ui, sans-serif);
}

.waitlist-email-field:focus-within {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .17);
}

.waitlist-email-field.is-error {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .5);
}

.waitlist-email-input {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 56px;
  padding: 0 65px 0 18px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  caret-color: #fff;
  font: inherit;
  line-height: normal;
}

.waitlist-email-input::placeholder {
  color: transparent;
}

.waitlist-email-field .t-clear-mirror,
.waitlist-email-field .t-clear-placeholder {
  padding: 0 65px 0 18px;
  color: #fff;
  font: inherit;
}

.waitlist-email-field .t-clear-placeholder {
  color: #aaaab0;
}

/* Keep selection and browser autofill legible while the real input has focus. */
.waitlist-email-field:focus-within:not(.is-clearing) .t-clear-mirror {
  opacity: 0;
}

.waitlist-email-field:focus-within:not(.is-clearing) > .waitlist-email-input {
  -webkit-text-fill-color: #fff;
}

.waitlist-email-field .t-clear-glow {
  mix-blend-mode: screen;
}

.waitlist-email-field .t-clear-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #e8e8ea;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 150ms ease, background 150ms ease;
}

.waitlist-email-field.has-value .t-clear-btn {
  opacity: 1;
  pointer-events: auto;
}

.waitlist-email-field .t-clear-btn[hidden] {
  display: none !important;
}

.waitlist-email-field .t-clear-btn:hover {
  background: #434347;
}

.waitlist-caret-measure {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  visibility: hidden;
  border: 0;
  padding: 0;
  font: inherit;
  white-space: pre;
  pointer-events: none;
}

.waitlist-smooth-caret {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  width: 2px;
  height: 22px;
  border-radius: 1px;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  animation: none;
}

.waitlist-email-field.is-caret-active > .waitlist-email-input {
  caret-color: transparent;
}

.waitlist-email-field.is-caret-active .waitlist-smooth-caret {
  animation: waitlist-caret-blink 1.05s steps(1, end) infinite;
}

@keyframes waitlist-caret-blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0; }
}

.waitlist-email-wrap .t-error-msg {
  margin: 8px 0 0;
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
}

.waitlist-honeypot {
  position: absolute;
  top: auto;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

.waitlist-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #c4c4c8;
  font-size: 13px;
  line-height: 1.55;
  cursor: pointer;
}

.waitlist-consent input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: #fff;
  cursor: pointer;
}

.waitlist-consent strong {
  color: #fff;
  font-weight: 600;
}

.waitlist-consent a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.waitlist-consent a:hover {
  text-decoration-thickness: 2px;
}

.waitlist-consent.is-error {
  color: #fff;
}

.waitlist-submit-error {
  margin: 0;
  padding: 10px 12px;
  border-left: 2px solid #fff;
  background: #28282b;
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
}

.waitlist-status {
  margin: 0;
  color: #d0d0d4;
  font-size: 12px;
  line-height: 1.45;
}

.waitlist-status:empty {
  display: none;
}

.waitlist-submit,
.waitlist-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid #fff;
  border-radius: 999px;
  background: #fff;
  color: #111113;
  font: 600 14px var(--font-sans, system-ui, sans-serif);
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.waitlist-submit {
  width: 100%;
  margin-top: 1px;
}

.waitlist-submit:hover:not(:disabled),
.waitlist-done:hover {
  background: #dddde0;
  transform: translateY(-1px);
}

.waitlist-submit:disabled {
  border-color: #aeaeB2;
  background: #aeaeB2;
  color: #111113;
  cursor: wait;
}

.waitlist-cloud {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  padding: 10px 16px;
  border: 1px solid #55555a;
  border-radius: 999px;
  background: #222225;
  color: #f3f3f4;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease;
}

.waitlist-cloud:hover {
  border-color: #a0a0a6;
  background: #303034;
  color: #fff;
}

.waitlist-success {
  display: grid;
  justify-items: center;
  padding: 23px 0 0;
  text-align: center;
}

.waitlist-celebration.t-confetti-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin: 0 0 18px;
  border: 1px solid #77777d;
  border-radius: 50%;
  background: #27272a;
  color: #fff;
}

.waitlist-celebration .t-success-check {
  position: relative;
  z-index: 1;
}

.waitlist-celebration .t-success-check svg {
  width: 44px;
  height: 44px;
}

/* M11 25l9 9 17-21 measures about 39.8 SVG units. */
.waitlist-celebration .t-success-check svg path {
  stroke-dasharray: 41;
  stroke-dashoffset: 41;
}

.waitlist-celebration .t-confetti-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 280px;
  height: 280px;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.waitlist-fireworks {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.waitlist-success h3 {
  margin: 0;
  color: #fff;
  font-family: var(--font-display, monospace);
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 400;
  letter-spacing: -.06em;
  line-height: 1.12;
}

.waitlist-success-message {
  max-width: 390px;
  margin: 15px 0 25px;
  color: #d5d5d8;
  font-size: 14px;
  line-height: 1.6;
}

.waitlist-done {
  min-width: 145px;
}

@media (max-width: 500px) {
  .waitlist-overlay {
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .waitlist-dialog.t-modal {
    max-height: calc(100dvh - 20px);
    border-radius: 21px;
  }

  .waitlist-dialog-inner {
    padding: 27px 23px 22px;
  }

  .waitlist-close {
    top: 14px;
    right: 14px;
  }

  .waitlist-kicker {
    margin-bottom: 24px;
  }

  .waitlist-heading {
    font-size: clamp(32px, 8vw, 40px);
  }

  .waitlist-form {
    margin-top: 25px;
  }
}

@media (max-height: 620px) {
  .waitlist-overlay {
    place-items: start center;
  }

  .waitlist-dialog.t-modal {
    margin: auto 0;
  }

  .waitlist-dialog-inner {
    padding-top: 22px;
    padding-bottom: 18px;
  }

  .waitlist-kicker {
    margin-bottom: 14px;
  }

  .waitlist-form {
    gap: 11px;
    margin-top: 20px;
  }

}

@media (pointer: coarse), (max-width: 720px), (prefers-reduced-motion: reduce) {
  .waitlist-email-field.is-caret-active > .waitlist-email-input {
    caret-color: auto !important;
  }

  .waitlist-smooth-caret {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .waitlist-close,
  .waitlist-email-field .t-clear-btn,
  .waitlist-submit,
  .waitlist-done,
  .waitlist-smooth-caret {
    animation: none !important;
    transition: none !important;
  }
}
