/* ============================================================================
   TICKITIN — waitlist lander (waitlist.tickitin.com)
   One screen: a dial with the signup form in its face, twelve image wedges
   radiating out behind it. Brand tokens match tickitin-landing/styles.css;
   this page is the one sanctioned dark surface, so the on-dark values lead.
   ============================================================================ */

:root {
  --color-primary:         #007BA7;
  --color-primary-hover:   #1A93C0;
  --color-primary-on-dark: #7FD4EA;
  --color-secondary:       #00416A;

  --bg:      #0A1118;            /* page + dial face */
  --bg-rgb:  10, 17, 24;
  --ink:     #FFFFFF;
  --ink-2:   rgba(255,255,255,0.78);
  --ink-3:   rgba(255,255,255,0.56);
  --line:    rgba(255,255,255,0.14);
  --tick:    rgba(255,255,255,0.42);

  --font-display: 'Fraunces', Georgia, serif;
  --font-ui:      'Figtree', -apple-system, sans-serif;

  --radius-pill: 999px;
  --size-input:  48px;
  --size-cta:    48px;

  /* Dial face diameter. The ring SVG is 1.3x this so the rim words sit
     outside the face, over the images. */
  --dial: clamp(300px, min(80vw, 74vh), 760px);
  --ring: calc(var(--dial) * 1.3);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  position: relative;
  min-height: 100svh;
}

img, svg { display: block; }
a { color: inherit; text-decoration: none; }

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

/* ============ SCENE: wedges, spokes, halo ============ */
.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.wedges {
  position: absolute;
  inset: 0;
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
  transition: transform 0.9s var(--ease-out);
}

/* Each wedge is a full-screen box clipped to a 30° slice (polygon set by
   JS). The image sits on the slice's centre line; ::after dims it. */
.wedge {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  cursor: default;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.1s var(--ease-out), transform 1.4s var(--ease-out);
  transition-delay: calc(var(--i) * 45ms);
}
body.is-ready .wedge { opacity: 1; transform: none; }

.wedge__img {
  position: absolute;
  left: 0; top: 0;
  width: var(--s); height: var(--s);
  transform: translate(calc(var(--x) - 50%), calc(var(--y) - 50%)) scale(1);
  object-fit: cover;
  filter: saturate(1);
  animation: drift 22s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -1.9s);
  transition: filter 0.6s var(--ease-out);
}
@keyframes drift {
  from { scale: 1; }
  to   { scale: 1.09; }
}

.wedge::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(var(--bg-rgb), 0.28);
  transition: background 0.6s var(--ease-out);
}
.wedge.is-on::after { background: rgba(var(--bg-rgb), 0); }
.wedge.is-on .wedge__img { filter: saturate(1.08) brightness(1.1); }

/* The hover image sits on top of the resting one and fades in while the
   wedge is tuned in. Both share the same position and size. */
.wedge__img--hover {
  opacity: 0;
  transition: opacity 0.7s var(--ease-out), filter 0.6s var(--ease-out);
}
.wedge.is-on .wedge__img--hover { opacity: 1; }

.spokes {
  position: absolute;
  left: 50%; top: 50%;
  width: 4000px; height: 4000px;
  transform: translate(-50%, -50%);
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  opacity: 0;
  transition: opacity 1.2s ease 0.3s;
}
body.is-ready .spokes { opacity: 1; }

/* Darkens the images toward the dial so the rim words stay legible, and
   fades the far corners so the page never feels like a photo wall. */
.halo {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center,
      var(--bg) 0,
      var(--bg) calc(var(--dial) / 2),
      rgba(var(--bg-rgb), 0.62) calc(var(--dial) / 2 + 36px),
      rgba(var(--bg-rgb), 0.12) calc(var(--dial) * 0.74),
      rgba(var(--bg-rgb), 0) 100%);
}

/* ============ DIAL ============ */
.dial {
  position: relative;
  z-index: 2;
  width: var(--ring);
  height: var(--ring);
  margin: 0 auto;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  pointer-events: none;   /* the square's corners must not block wedge hover */
}
.face { pointer-events: auto; }

.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 2;             /* ticks and kicker sit over the face's edge */
  opacity: 0;
  transform: rotate(-14deg);
  transition: opacity 1s var(--ease-out) 0.15s, transform 1.6s var(--ease-out) 0.15s;
}
body.is-ready .ring { opacity: 1; transform: none; }

.ring__ticks {
  stroke: var(--tick);
  stroke-width: 1.3;
  stroke-linecap: round;
  transform-origin: 500px 500px;
  animation: spin 150s linear infinite;
}
.ring__ticks .major { stroke-width: 2; stroke: rgba(255,255,255,0.6); }
@keyframes spin { to { transform: rotate(360deg); } }

.ring__dots { fill: rgba(255,255,255,0.45); }

.ring__labels text {
  font: 600 13.5px/1 var(--font-ui);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  fill: var(--ink-2);
  pointer-events: auto;
  cursor: default;
  transition: fill 0.4s var(--ease-out);
}
.ring__labels text.is-on { fill: var(--color-primary-on-dark); }

.ring__marker {
  transform-origin: 500px 500px;
  transition: transform 0.9s var(--ease-out);
}
.ring__marker-dot { fill: var(--color-primary-on-dark); }
.ring__marker-glow { fill: var(--color-primary-on-dark); opacity: 0.22; }

.ring__kicker {
  font: 600 11.5px/1 var(--font-ui);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  fill: var(--color-primary-on-dark);
}

/* ---- The face ---- */
.face {
  position: relative;
  z-index: 1;
  width: var(--dial);
  height: var(--dial);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 0 120px rgba(var(--bg-rgb), 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 calc(var(--dial) * 0.13);
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.9s var(--ease-out), transform 1.3s var(--ease-out);
}
body.is-ready .face { opacity: 1; transform: none; }

.face__mark { height: 30px; width: auto; margin-bottom: 22px; }

.face__title {
  font: 500 clamp(30px, calc(var(--dial) * 0.062), 48px)/1.08 var(--font-display);
  letter-spacing: -0.015em;
  max-width: 13ch;
  margin-bottom: 14px;
}
.face__title em { font-style: italic; color: var(--color-primary-on-dark); }

.face__sub {
  color: var(--ink-3);
  font-size: 15px;
  line-height: 22px;
  max-width: 36ch;
  margin-bottom: 26px;
}

/* ---- Form ---- */
.waitlist { width: 100%; max-width: 440px; }

.waitlist__row {
  display: flex;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-pill);
  padding: 4px;
  transition: border-color 0.3s, background 0.3s;
}
.waitlist__row:focus-within {
  border-color: rgba(127,212,234,0.6);
  background: rgba(255,255,255,0.08);
}

.waitlist__row input {
  flex: 1;
  min-width: 0;
  height: var(--size-input);
  padding: 0 18px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 500 16px/24px var(--font-ui);
  outline: none;
}
.waitlist__row input::placeholder { color: var(--ink-3); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--size-cta);
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #FFF;
  font: 600 15px/20px var(--font-ui);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s, transform 0.25s var(--ease-out);
}
.btn:hover { background: var(--color-primary-hover); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.7; cursor: progress; }

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

.waitlist__note {
  margin-top: 14px;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 18px;
}
.waitlist__error {
  margin-top: 10px;
  color: #FFB4A8;
  font-size: 13px;
  line-height: 18px;
}
.waitlist__error[hidden] { display: none; }
.waitlist.is-invalid .waitlist__row { border-color: rgba(255,180,168,0.7); }

.waitlist .turnstile { margin-top: 12px; }
.waitlist .turnstile:empty { display: none; }

/* ---- Success ---- */
.face.is-done .face__title,
.face.is-done .face__sub { display: none; }
.ok {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: rise 0.6s var(--ease-out);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.ok__check {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(127,212,234,0.14);
  color: var(--color-primary-on-dark);
  margin-bottom: 16px;
}
.ok__head {
  font: 500 clamp(26px, calc(var(--dial) * 0.05), 36px)/1.1 var(--font-display);
  margin-bottom: 10px;
}
.ok__text { color: var(--ink-2); font-size: 15px; line-height: 22px; max-width: 32ch; }
.ok__next { margin-top: 18px; color: var(--ink-3); font-size: 13px; line-height: 18px; }
.ok__bar {
  width: 160px; height: 2px;
  margin: 10px auto 0;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  overflow: hidden;
}
.ok__bar i {
  display: block; height: 100%;
  background: var(--color-primary-on-dark);
  transform-origin: 0 50%;
  animation: fill var(--delay, 3.5s) linear forwards;
}
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ============ FOOTER ============ */
.foot {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 10px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 16px;
  opacity: 0;
  transition: opacity 1s ease 0.8s;
}
body.is-ready .foot { opacity: 1; }
.foot a:hover { color: var(--ink); }

/* ============ SMALL SCREENS ============ */
@media (max-width: 640px), (max-height: 560px) {
  :root { --dial: clamp(280px, min(86vw, 62vh), 420px); }

  .ring__labels text { font-size: 20px; letter-spacing: 0.13em; }
  .ring__kicker { font-size: 19px; letter-spacing: 0.26em; }
  .ring__ticks { stroke-width: 2.2; }
  .ring__ticks .major { stroke-width: 3; }
  .ring__marker-dot { r: 11; }
  .ring__marker-glow { r: 24; }

  .face { padding: 0 calc(var(--dial) * 0.12); }
  .face__mark { height: 24px; margin-bottom: 8px; }
  .face__title { font-size: clamp(24px, calc(var(--dial) * 0.08), 30px); margin-bottom: 10px; }
  .face__sub { display: none; }

  .waitlist { max-width: 240px; }
  .waitlist__row {
    flex-direction: column;
    gap: 6px;
    background: transparent;
    border: 0;
    padding: 0;
  }
  .waitlist__row input {
    flex: none;             /* the row's flex:1 would collapse it when stacked */
    height: 48px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: var(--radius-pill);
    text-align: center;
    font-size: 15px;
  }
  .waitlist__row input:focus { border-color: rgba(127,212,234,0.6); }
  .btn { height: 48px; width: 100%; }
  .waitlist__note { margin-top: 8px; font-size: 11px; line-height: 14px; white-space: nowrap; }

  .ok__text { font-size: 14px; line-height: 20px; }
  .foot { font-size: 11px; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .ring__ticks { animation: none; }
  .wedge__img { animation: none; }
  .wedges { transition: none; }
  .wedge, .ring, .face, .spokes, .foot { transition-duration: 0.01s; }
  .ok { animation: none; }
}
