/*
 * Palette reused from the Raiseboard landing (components/new-landing/ui.css + hero.css), unchanged:
 * five greens base #06130F, shadow #0A2E21, deep #0F5A3C, core #17C97E, bright #4ADE80; headline #F4F7F6;
 * warm white 250 246 238; hero background rgb(0 13 9); hero glow colours as in hero.css.
 */
@font-face {
  font-family: 'Noto Sans';
  src: url('/fonts/noto-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --base: #06130f;
  --shadow: #0a2e21;
  --deep: #0f5a3c;
  --core: #17c97e;
  --bright: #4ade80;
  --head: #f4f7f6;
  --warm: 250 246 238;
  --bg: rgb(0 13 9);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --grain-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.5' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='1.5 0 0 0 -.5 1.5 0 0 0 -.5 1.5 0 0 0 -.5 0 0 0 0 .06'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--head);
  font-family: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
:where(h1, h2, p) { margin: 0; }
:focus-visible { outline: 2px solid var(--bright); outline-offset: 3px; }
body.dragging { cursor: grabbing; -webkit-user-select: none; user-select: none; }

/* ---------- Aurora: soft radial glows from the landing's greens, drifting slowly (transform only) ---------- */
.aurora { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; will-change: transform; }
.a1 { /* big deep-green wash across the top */
  width: 150vmax; height: 80vmax; left: -25vmax; top: -48vmax;
  background: radial-gradient(closest-side, rgb(12 114 73 / 0.85), rgb(12 114 73 / 0.5) 40%, rgb(12 114 73 / 0.12) 75%, transparent);
  animation: drift1 26s ease-in-out infinite alternate;
}
.a2 { /* bright mint glow, left */
  width: 90vmax; height: 90vmax; left: -48vmax; top: -22vmax;
  background: radial-gradient(closest-side, rgb(31 255 170 / 0.24), rgb(31 255 170 / 0.1) 50%, transparent);
  animation: drift2 21s ease-in-out infinite alternate;
}
.a3 { /* core-green ribbon, lower right */
  width: 130vmax; height: 40vmax; right: -50vmax; bottom: -16vmax;
  background: radial-gradient(closest-side, rgb(23 255 158 / 0.26), rgb(23 255 158 / 0.1) 55%, transparent);
  transform: rotate(-12deg);
  animation: drift3 30s ease-in-out infinite alternate;
}
.a4 { /* low teal haze */
  width: 100vmax; height: 36vmax; left: -10vmax; bottom: -22vmax;
  background: radial-gradient(closest-side, rgb(42 255 189 / 0.14), transparent);
  animation: drift2 34s ease-in-out infinite alternate-reverse;
}
@keyframes drift1 { from { transform: translate3d(-4vmax, 0, 0) scale(1); } to { transform: translate3d(6vmax, 5vmax, 0) scale(1.1); } }
@keyframes drift2 { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(14vmax, 8vmax, 0) scale(1.15); } }
@keyframes drift3 { from { transform: translate3d(0, 0, 0) rotate(-12deg); } to { transform: translate3d(-16vmax, -6vmax, 0) rotate(-6deg); } }
.grain { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--grain-img) 0 0 / 256px 256px; }

/* ---------- Page ---------- */
.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 150px;
  text-align: center;
}
.chip {
  padding: 7px 16px;
  border: 1px solid rgb(74 222 128 / 0.6);
  border-radius: 999px;
  background: rgb(6 19 15 / 0.6);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.name {
  margin-top: 28px;
  font-size: clamp(22px, 5.4vw, 30px);
  font-weight: 700;
  color: var(--core);
}
.headline {
  margin-top: 14px;
  max-width: 15ch;
  font-size: clamp(40px, 11.4vw, 84px);
  line-height: 1.08;
  font-weight: 700;
  text-wrap: balance;
}
.play { position: relative; margin-top: 40px; }

/* The entrance */
.chip, .name, .headline, .play { animation: rise 800ms var(--ease-out) both; }
.name { animation-delay: 80ms; }
.headline { animation-delay: 160ms; }
.play { animation-delay: 280ms; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- The glossy pill ---------- */
.pill {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 0 36px;
  border: 1px solid rgb(74 222 128 / 0.55);
  border-radius: 999px;
  background:
    radial-gradient(120% 140% at 50% 130%, rgb(23 201 126 / 0.5), transparent 60%),
    linear-gradient(180deg, #0f5a3c 0%, #0a2e21 48%, #06130f 100%);
  color: var(--head);
  font: 700 19px/1 'Noto Sans', system-ui, sans-serif;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    0 0 22px rgb(23 201 126 / 0.45),
    0 14px 24px -10px rgb(0 0 0 / 0.7),
    inset 0 -6px 12px rgb(0 0 0 / 0.45),
    inset 0 1px 0 rgb(220 255 238 / 0.55);
  will-change: transform;
}
.pill::before { /* the reflective highlight across the top */
  content: '';
  position: absolute;
  z-index: -1;
  left: 7%;
  right: 7%;
  top: 4px;
  height: 44%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgb(235 255 245 / 0.46), rgb(235 255 245 / 0.04) 90%);
}
.pill::after { /* a small specular dot */
  content: '';
  position: absolute;
  z-index: -1;
  left: 13%;
  top: 9px;
  width: 22px;
  height: 5px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.7);
  filter: blur(1.5px);
}
.pill:focus-visible { outline-offset: 5px; }
.pill:active { filter: brightness(0.92); }

/* ---------- Threads and hand ---------- */
.threads { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.hand {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 3;
  width: 56px;
  height: 64px;
  margin: -6px 0 0 -28px; /* the transform places the hand's top centre */
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  will-change: transform;
}
.hand::before { /* a 44px+ touch target around the 56px glyph */
  content: '';
  position: absolute;
  inset: -12px;
}
.hand svg { display: block; overflow: visible; filter: drop-shadow(0 0 7px rgb(74 222 128 / 0.7)) drop-shadow(0 6px 6px rgb(0 0 0 / 0.5)); }
.hand-shape path:first-child { fill: rgb(250 246 238); stroke: var(--bright); stroke-width: 1.5; stroke-linejoin: round; }
.hand-shape .crease { fill: none; stroke: rgb(6 19 15 / 0.35); stroke-width: 1.4; stroke-linecap: round; }
body.dragging .hand { cursor: grabbing; }

/* ---------- Signup panel (glass) ---------- */
.panel {
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 28px 24px 24px;
  border: 1px solid rgb(220 255 238 / 0.3);
  border-radius: 22px;
  color: var(--head);
  background:
    linear-gradient(170deg, rgb(230 255 240 / 0.14) 0%, rgb(230 255 240 / 0.04) 30%, rgb(230 255 240 / 0) 60%),
    linear-gradient(rgb(90 230 170 / 0.06), rgb(90 230 170 / 0.06)),
    linear-gradient(rgb(6 19 15 / 0.78), rgb(6 19 15 / 0.78)); /* a darker scrim than the landing's .27 so text stays readable */
  box-shadow: 0 0 14px rgb(23 201 126 / 0.4), inset 0 0 9px rgb(23 201 126 / 0.14), 0 30px 60px -20px rgb(0 0 0 / 0.7);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  overflow: auto;
}
.panel[open] { animation: panel-in 320ms var(--ease-out) both; }
.panel::backdrop { background: rgb(0 13 9 / 0.62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.panel[open]::backdrop { animation: fade-in 320ms ease-out both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 520px) {
  .panel { margin: 12vh auto auto; } /* sits high so the on-screen keyboard doesn't cover it */
}
.panel-x {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgb(var(--warm) / 0.85);
  cursor: pointer;
}
.panel-x:hover { background: rgb(74 222 128 / 0.12); color: var(--head); }
.panel-title { padding-right: 36px; font-size: 24px; line-height: 1.25; font-weight: 700; }
.field-label { display: block; margin-top: 20px; font-size: 15px; font-weight: 600; }
.field {
  display: block;
  width: 100%;
  height: 52px;
  margin-top: 8px;
  padding: 0 14px;
  border: 1px solid rgb(220 255 238 / 0.4);
  border-radius: 14px;
  background: rgb(6 19 15 / 0.75);
  color: var(--head);
  font: 400 17px/1 'Noto Sans', system-ui, sans-serif; /* 16px+ so iOS doesn't zoom */
}
.field::placeholder { color: rgb(var(--warm) / 0.5); }
.field:focus-visible { outline: 2px solid var(--bright); outline-offset: 2px; border-color: var(--bright); }
.field[aria-invalid='true'] { border-color: #ff8a8a; }
.note { margin-top: 10px; font-size: 14px; line-height: 1.5; color: rgb(var(--warm) / 0.78); }
.error { margin-top: 10px; font-size: 14px; line-height: 1.45; font-weight: 600; color: #ffb3b3; }
.error[hidden] { display: none; }
.submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  margin-top: 20px;
  border: 1px solid var(--bright);
  border-radius: 14px;
  background: var(--core);
  color: var(--base);
  font: 700 17px/1 'Noto Sans', system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 0 14px rgb(23 201 126 / 0.55);
}
.submit:hover { box-shadow: 0 0 18px rgb(23 201 126 / 0.8); }
.submit[aria-disabled='true'] { opacity: 0.7; cursor: progress; }
.submit-quiet { background: transparent; color: var(--head); border-color: rgb(74 222 128 / 0.6); box-shadow: none; }
.done { padding: 8px 40px 0 0; outline: none; }
.done-message { font-size: 19px; line-height: 1.55; font-weight: 600; }
.done-sign { margin-top: 14px; font-size: 17px; color: var(--core); font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.noscript { margin-top: 24px; color: rgb(var(--warm) / 0.78); }

/* Short screens (phone in landscape): keep everything reachable */
@media (max-height: 560px) {
  .stage { justify-content: flex-start; padding-bottom: 150px; }
  .headline { font-size: clamp(30px, 7vw, 52px); }
}

/* Reduced motion: no drifting, no entrance, no panel animation, no hand dragging. Signup is unchanged. */
@media (prefers-reduced-motion: reduce) {
  .aurora i, .chip, .name, .headline, .play, .panel[open], .panel[open]::backdrop { animation: none !important; }
  .hand { cursor: default; pointer-events: none; }
}
