@font-face {
  font-family: 'Satoshi';
  src: url('/fonts/satoshi-variable.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #000;
  --paper: #fff;
  --signal-red: #ff2d2d;
  --signal-cyan: #00e5ff;
  --edge: max(18px, env(safe-area-inset-right));
  --floor: max(16px, env(safe-area-inset-bottom));
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-tear: cubic-bezier(0.76, 0, 0.24, 1);
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  overflow: hidden;
}

body {
  font-family: 'Satoshi', system-ui, sans-serif;
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
}

video,
.teaser-still {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  object-fit: contain;
  background: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* iOS draws a big native play button when autoplay is blocked (Low Power Mode).
   The page starts the video on first touch instead, so the button is never shown. */
video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

video::-webkit-media-controls {
  display: none !important;
}

/* Dock ------------------------------------------------------------------ */

.dock {
  position: fixed;
  right: var(--edge);
  bottom: var(--floor);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.dock-main {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.6vw, 44px);
}

.dock-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  padding: 0.08em 0;
  border: 0;
  background: none;
  color: inherit;
  font: 700 clamp(26px, 3.4vw, 54px) / 1 'Satoshi', system-ui, sans-serif;
  letter-spacing: -0.035em;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  /* Legibility halo: keeps white text readable on mid-tone frames of the video. */
  text-shadow: 0 0 22px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.6);
}

.dock-icon {
  width: 0.66em;
  height: 0.66em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.dock-icon-dot {
  fill: currentColor;
  stroke: none;
}

.dock-text {
  position: relative;
  isolation: isolate;
  display: inline-block;
  white-space: nowrap;
  overflow: visible;
  text-align: left;
}

/* RGB split: two colour channels sit behind the white text and separate on hover,
   echoing the chromatic fringes in the video. */
.dock-text::before,
.dock-text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  text-shadow: none;
  mix-blend-mode: screen;
  transition: transform 240ms ease-in, opacity 240ms ease-in;
}

.dock-text::before { color: var(--signal-red); }
.dock-text::after { color: var(--signal-cyan); }

@media (hover: hover) {
  .dock-link:hover .dock-text::before,
  .dock-link:hover .dock-text::after {
    opacity: 1;
    transition: transform 160ms ease-out, opacity 120ms ease-out;
  }
  .dock-link:hover .dock-text::before { transform: translate(-3px, 1px); }
  .dock-link:hover .dock-text::after { transform: translate(3px, -1px); }
}

/* Touch devices get the split as a short pulse on tap (class set in app.js). */
.dock-link.is-pulsing .dock-text::before,
.dock-link.is-pulsing .dock-text::after {
  animation: split-pulse 360ms ease-out;
}
.dock-link.is-pulsing .dock-text::after { animation-direction: reverse; }

@keyframes split-pulse {
  0%   { opacity: 1; transform: translate(-4px, 1px); }
  100% { opacity: 0; transform: none; }
}

.dock-link:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 6px;
}

.dock-legal {
  display: flex;
  gap: 18px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.005em;
}

.dock-legal a {
  color: inherit;
  text-decoration: none;
  opacity: 0.6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  transition: opacity 180ms ease-out;
}

.lang-switch {
  display: inline-flex;
  gap: 8px;
  margin-left: 6px;
}

.lang-switch a[aria-current] {
  opacity: 1;
  font-weight: 700;
}

.dock-legal a:hover,
.dock-legal a:focus-visible {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Before the reveal the words are hidden; icons and legal links wait too. */
.js .dock-text,
.js .dock-icon,
.js .dock-legal {
  opacity: 0;
}

.js .dock.is-revealed .dock-text,
.js .dock.is-revealed .dock-icon {
  opacity: 1;
}

.js .dock.is-revealed .dock-icon {
  transition: opacity 240ms ease-out;
}

.js .dock.is-revealed .dock-legal {
  opacity: 1;
  transition: opacity 600ms ease-out 700ms;
}

/* Waiting-list dialog ------------------------------------------------------- */

.waitlist {
  position: fixed;
  inset: auto var(--edge) calc(var(--floor) + 96px) auto;
  box-sizing: border-box;
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  margin: 0;
  padding: 28px 28px 26px;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  overflow: auto;
}

.waitlist[open] {
  animation: tear-in 380ms var(--ease-tear) both;
}

.waitlist.is-closing {
  animation: tear-out 220ms ease-in both;
}

.waitlist::backdrop {
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.waitlist[open]::backdrop {
  animation: backdrop-in 300ms ease-out both;
}

.waitlist.is-closing::backdrop {
  animation: backdrop-out 220ms ease-in both;
}

/* The panel tears into place in horizontal bands, like the scan-line breaks in the video. */
@keyframes tear-in {
  0%   { clip-path: inset(100% 0 0 0); transform: translate(0, 14px); }
  22%  { clip-path: inset(68% 0 0 0); transform: translate(-7px, 10px); }
  44%  { clip-path: inset(38% 0 22% 0); transform: translate(6px, 6px); }
  64%  { clip-path: inset(16% 0 0 0); transform: translate(-3px, 3px); }
  82%  { clip-path: inset(3% 0 0 0); transform: translate(2px, 1px); }
  100% { clip-path: inset(0); transform: none; }
}

@keyframes tear-out {
  0%   { clip-path: inset(0); transform: none; }
  45%  { clip-path: inset(0 0 40% 0); transform: translate(5px, 4px); }
  100% { clip-path: inset(0 0 100% 0); transform: translate(-4px, 10px); }
}

@keyframes backdrop-in { from { opacity: 0; } }
@keyframes backdrop-out { to { opacity: 0; } }

.waitlist-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.waitlist-close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.waitlist-title {
  margin: 0 44px 12px 0;
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
}

.waitlist-lede {
  margin: 0 0 24px;
  max-width: 34ch;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

.waitlist-label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
}

.waitlist-input {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 0 8px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: 500 20px/1.2 'Satoshi', system-ui, sans-serif;
  letter-spacing: -0.01em;
  outline: none;
}

.waitlist-input:focus {
  border-bottom-width: 3px;
  padding-bottom: 7px;
}

.waitlist-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
}

.waitlist-consent input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: none;
  accent-color: var(--ink);
}

.waitlist-consent a {
  color: inherit;
  text-underline-offset: 2px;
}

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

.waitlist-error {
  min-height: 1.35em;
  margin: 12px 0 0;
  color: #c4001a;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.waitlist-submit {
  width: 100%;
  margin-top: 8px;
  padding: 15px 18px;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font: 700 20px/1 'Satoshi', system-ui, sans-serif;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: background-color 160ms ease-out;
}

.waitlist-submit:hover { background: #262626; }
.waitlist-submit:disabled { cursor: progress; opacity: 0.7; }

.waitlist-submit:focus-visible,
.waitlist-close:focus-visible,
.waitlist-consent input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.waitlist-done [aria-hidden] {
  display: block;
  overflow: visible;
}

.waitlist-done {
  margin: 4px 0 0;
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* Cookie consent ------------------------------------------------------------ */

.consent {
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  bottom: var(--floor);
  z-index: 3;
  box-sizing: border-box;
  width: min(400px, calc(100vw - 36px));
  padding: 16px 16px 14px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.consent[hidden] {
  display: none;
}

.consent.is-visible {
  animation: consent-in 320ms var(--ease-out-expo) both;
}

.consent.is-leaving {
  animation: consent-out 200ms ease-in both;
}

@keyframes consent-in {
  from { opacity: 0; transform: translateY(8px); }
}

@keyframes consent-out {
  to { opacity: 0; transform: translateY(6px); }
}

.consent-text {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.consent-text a {
  color: inherit;
  text-underline-offset: 2px;
}

.consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Both choices carry the same visual weight: declining is as easy as accepting. */
.consent-button {
  padding: 11px 10px;
  border: 1px solid var(--paper);
  background: transparent;
  color: var(--paper);
  font: 700 15px/1 'Satoshi', system-ui, sans-serif;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 160ms ease-out, color 160ms ease-out;
}

.consent-button:hover,
.consent-button:focus-visible {
  background: var(--paper);
  color: var(--ink);
}

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

/* Phones: the dock wraps tighter and the dialog becomes a bottom sheet. */
@media (max-width: 600px) {
  .dock { gap: 8px; }
  .dock-main { gap: 16px; }
  .consent {
    top: max(12px, env(safe-area-inset-top));
    bottom: auto;
    left: 12px;
    width: calc(100vw - 24px);
  }
  .waitlist {
    inset: auto 16px calc(var(--floor) + 84px) 16px;
    width: auto;
    padding: 24px 20px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .consent.is-visible,
  .consent.is-leaving,
  .waitlist[open],
  .waitlist.is-closing,
  .waitlist[open]::backdrop,
  .waitlist.is-closing::backdrop,
  .dock-link.is-pulsing .dock-text::before,
  .dock-link.is-pulsing .dock-text::after {
    animation: none;
  }
  .dock-text::before,
  .dock-text::after {
    display: none;
  }
  .js .dock.is-revealed .dock-legal,
  .js .dock.is-revealed .dock-icon {
    transition: none;
  }
}

/* Page transitions ----------------------------------------------------------
   Moving between the teaser and the terms tears the new page in, in horizontal
   bands, the same language as the dialog and the video's scan-line breaks.
   Browsers without cross-document view transitions simply navigate as before. */

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: page-dim 420ms ease-in both;
}

::view-transition-new(root) {
  animation: page-tear-in 520ms var(--ease-tear) both;
}

@keyframes page-dim {
  to { opacity: 0.35; filter: blur(2px); }
}

@keyframes page-tear-in {
  0%   { clip-path: inset(100% 0 0 0); transform: translateX(0); }
  18%  { clip-path: inset(74% 0 8% 0); transform: translateX(-10px); }
  36%  { clip-path: inset(46% 0 30% 0); transform: translateX(8px); }
  54%  { clip-path: inset(22% 0 12% 0); transform: translateX(-5px); }
  74%  { clip-path: inset(6% 0 0 0); transform: translateX(3px); }
  100% { clip-path: inset(0); transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}
