/* Intern onboarding — a MenuFit-style, one-question-per-screen slide-through.
   Reuses tokens, font, background shell and corners from /styles.css.
   CSP-safe: no inline styles; dynamic transforms are set via the CSSOM in intern.js. */

:root {
  --onb-vh: 100dvh;
  --green-deep: #04160b;
  --green-btn: #7cff8b;
  --green-btn-hi: #9dffab;
}

.onb-shell {
  min-height: 100dvh;
}

.onb {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: var(--onb-vh);
  min-height: var(--onb-vh);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 22px max(18px, env(safe-area-inset-bottom));
  /* Residual corrections outside a tracking burst glide briefly; during a
     burst (.onb-kbd-track) the height is applied every frame with NO easing —
     that's what lets the footer ride the keyboard 1:1 instead of trailing it. */
  transition: height 150ms ease-out, min-height 150ms ease-out;
}

.onb.onb-kbd-track {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .onb {
    transition: none;
  }
}

/* ---------- Header: back + progress ---------- */
.onb-header {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(560px, 100%);
  margin: 6px auto 0;
  min-height: 44px;
}

.onb-back {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.onb-back:hover {
  transform: translateX(-2px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.onb-back:disabled {
  opacity: 0.28;
  cursor: default;
  transform: none;
}

.onb-progress {
  display: flex;
  flex: 1 1 auto;
  gap: 6px;
}

.onb-seg {
  flex: 1 1 0;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transition: background 200ms ease;
}

.onb-seg.is-done {
  background: linear-gradient(90deg, var(--blue), var(--green));
  box-shadow: 0 0 14px rgba(124, 255, 139, 0.32);
}

.onb-seg.is-active {
  background: linear-gradient(90deg, var(--blue), var(--green));
  box-shadow: 0 0 16px rgba(77, 170, 255, 0.4);
}

.onb-step-count {
  flex: 0 0 auto;
  min-width: 40px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  letter-spacing: 0.02em;
}

/* ---------- Form + sliding track ---------- */
.onb-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  margin: 0;
}

.onb-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.onb-track {
  display: flex;
  height: 100%;
  will-change: transform;
  transition: transform 460ms cubic-bezier(0.16, 1, 0.3, 1);
}

.onb-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* No side padding: the content column must sit flush with the header's
     back-arrow and the footer button (they all share the .onb gutter). */
  padding: 16px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.onb-slide-inner {
  width: min(560px, 100%);
  margin: 0 auto;
}

/* Only the on-screen slide animates its contents in. */
.onb-slide.is-current .onb-anim {
  animation: fade-rise 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.onb-slide.is-current .onb-anim.d1 { animation-delay: 60ms; }
.onb-slide.is-current .onb-anim.d2 { animation-delay: 130ms; }
.onb-slide.is-current .onb-anim.d3 { animation-delay: 210ms; }

.onb-eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.onb-q {
  /* 16px below the headline so the input doesn't hug it on help-less steps
     (name/age/phone) — the help line adds its own spacing when present. */
  margin: 0 0 16px;
  font-size: 34px;
  line-height: 1.08;
  font-weight: 600;
}

.onb-help {
  margin: 0 0 22px;
  max-width: 460px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 15px;
  line-height: 1.55;
}

/* ---------- Text + email inputs ---------- */
.onb-input,
.onb-textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.onb-input {
  min-height: 58px;
  padding: 0 16px;
  font-size: 17px;
}

.onb-textarea {
  min-height: 168px;
  padding: 14px 16px;
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
}

.onb-input::placeholder,
.onb-textarea::placeholder {
  color: rgba(255, 255, 255, 0.34);
}

.onb-input:focus,
.onb-textarea:focus {
  border-color: rgba(77, 170, 255, 0.82);
  background: rgba(77, 170, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(77, 170, 255, 0.14);
}

/* ---------- Choice cards ---------- */
.onb-choices {
  display: grid;
  gap: 12px;
}

.onb-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 62px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: rgba(124, 255, 139, 0.16);
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  cursor: pointer;
  text-align: left;
  font-size: 16px;
  font-weight: 750;
  transition: transform 140ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.onb-choice-key {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.onb-choice:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 255, 139, 0.5);
  background: rgba(124, 255, 139, 0.08);
  color: var(--text);
}

.onb-choice.is-selected {
  border-color: rgba(124, 255, 139, 0.72);
  color: var(--text);
  background: rgba(124, 255, 139, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 12px 30px rgba(124, 255, 139, 0.12);
}

.onb-choice.is-selected .onb-choice-key {
  border-color: rgba(124, 255, 139, 0.6);
  color: var(--green-deep);
  background: var(--green-btn);
}

.onb-choice:focus-visible {
  outline: none;
  border-color: rgba(77, 170, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(77, 170, 255, 0.16);
}

/* ---------- Voice recorder ---------- */
.onb-voice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px 0 4px;
  text-align: center;
}

.onb-mic {
  position: relative;
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  border: 1px solid rgba(124, 255, 139, 0.42);
  border-radius: 50%;
  color: var(--green-deep);
  background: var(--green-btn);
  box-shadow:
    0 2px 2px 0 rgba(210, 255, 218, 0.6) inset,
    0 18px 44px rgba(124, 255, 139, 0.26);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms ease, background 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.onb-mic:hover {
  transform: translateY(-2px) scale(1.02);
  background: var(--green-btn-hi);
}

.onb-mic:active {
  transform: scale(0.98);
}

.onb-mic:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(77, 170, 255, 0.34), 0 18px 44px rgba(124, 255, 139, 0.26);
}

.onb-mic-icon {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  line-height: 0;
}

/* Pulsing halo while recording. */
.onb-mic-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  opacity: 0;
  border: 2px solid rgba(255, 106, 106, 0.72);
  pointer-events: none;
}

.onb-mic.is-recording {
  border-color: rgba(255, 106, 106, 0.6);
  color: #fff;
  background: #ff5f5f;
  box-shadow:
    0 2px 2px 0 rgba(255, 200, 200, 0.5) inset,
    0 18px 44px rgba(255, 95, 95, 0.3);
}

.onb-mic.is-recording .onb-mic-ring {
  opacity: 1;
  animation: mic-pulse 1.4s ease-out infinite;
}

@keyframes mic-pulse {
  0% {
    transform: scale(1);
    opacity: 0.75;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.onb-voice-status {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  font-weight: 750;
  max-width: 420px;
  line-height: 1.45;
}

.onb-voice-timer {
  margin: 0;
  min-height: 22px;
  color: var(--green-soft);
  font-size: 18px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.onb-voice[data-state="recording"] .onb-voice-timer {
  color: #ffb3b3;
}

.onb-voice-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(420px, 100%);
  margin-top: 2px;
}

.onb-voice-audio {
  width: 100%;
  height: 40px;
}

.onb-voice-redo {
  min-height: 40px;
}

/* ---------- Intro (landing) slide ---------- */
.onb-slide.onb-intro {
  text-align: center;
}

.onb-intro .onb-slide-inner {
  width: min(600px, 100%);
}

.onb-lede {
  margin: 0 auto 10px;
  max-width: 620px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 17px;
  line-height: 1.45;
  font-weight: 600;
}

.onb-intro-title {
  margin: 0 0 26px;
  font-size: 48px;
  line-height: 1.02;
  font-weight: 500;
  text-wrap: balance;
}

/* Stat cards — neon tokens, same language as the careers page comp badges. */
.onb-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 26px;
}

.onb-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.015);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 14px 40px rgba(0, 0, 0, 0.18);
}

.onb-stat-value {
  font-size: 26px;
  font-weight: 850;
  line-height: 1.05;
  white-space: nowrap;
}

.onb-stat-value.tone-gold {
  color: var(--gold-soft);
  text-shadow: 0 0 8px rgba(255, 191, 65, 0.8), 0 0 26px rgba(255, 142, 23, 0.44);
}

.onb-stat-value.tone-blue {
  color: var(--blue-soft);
  text-shadow: 0 0 8px rgba(77, 170, 255, 0.8), 0 0 24px rgba(0, 123, 255, 0.42);
}

.onb-stat-value.tone-green {
  color: var(--green-soft);
  text-shadow: 0 0 8px rgba(124, 255, 139, 0.72), 0 0 24px rgba(124, 255, 139, 0.36);
}

.onb-stat-label {
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.onb-intro-copy {
  margin: 0 auto 28px;
  max-width: 540px;
}

.onb-intro-copy p {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 16px;
  line-height: 1.6;
}

.onb-intro-copy p:last-child {
  margin-bottom: 0;
}

.onb-cta-note {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.onb-intro-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

/* ---------- Intro narrative reveal ----------
   The landing screen unfolds beat by beat. `visibility` lives inside the
   keyframes so pre-delay content is truly gone (not just transparent):
   the CTA cannot be clicked, tabbed to, or read until its beat lands.
   Beats only run on the current slide; hidden tabs pause them; the global
   prefers-reduced-motion override collapses everything to instant. */
@keyframes intro-beat {
  0% {
    opacity: 0;
    visibility: hidden;
    transform: translateY(18px);
    filter: blur(6px);
  }
  1% {
    visibility: visible;
  }
  100% {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes intro-stat-pop {
  0% {
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.9);
  }
  1% {
    visibility: visible;
  }
  70% {
    transform: translateY(-2px) scale(1.03);
  }
  100% {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }
}

/* Everything starts hidden; the beat reveals it. `visibility` lives inside
   the keyframes so pre-delay content is truly gone: the CTA cannot be
   clicked, tabbed to, or read until its beat lands. */
.onb-intro .seq-1, .onb-intro .seq-2, .onb-intro .seq-3,
.onb-intro .seq-7, .onb-intro .seq-8, .onb-intro .seq-9, .onb-intro .seq-10,
.onb-intro .seq-stat-1, .onb-intro .seq-stat-2, .onb-intro .seq-stat-3 {
  opacity: 0;
  visibility: hidden;
}

/* No CSS delay timeline any more: the JS conductor (runIntroType) reveals
   each element by adding .seq-go exactly when the previous line finishes
   typing — the reveals and the wall-clock typing can never drift apart. */
.onb-intro .seq-go {
  animation: intro-beat 600ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.onb-intro .onb-stat.seq-go {
  animation: intro-stat-pop 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* The untyped remainder of a typing line: laid out (so wrapping never
   shifts) but invisible. The failsafe reveals it whole. */
.onb-type-rest {
  visibility: hidden;
}

.onb-intro.reveal-done .onb-type-rest {
  visibility: visible;
}

/* ChatGPT-style caret while each line types itself out. */
.onb-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--green);
  box-shadow: 0 0 8px rgba(124, 255, 139, 0.7);
  animation: caret-blink 0.9s steps(1) infinite;
}

@keyframes caret-blink {
  0%, 60% { opacity: 1; }
  61%, 100% { opacity: 0; }
}

/* Failsafe (set by intern.js after ~8s of visible time): everything shown,
   no animation dependence. Also what back-nav re-entry sees. */
.onb-intro.reveal-done .seq-1, .onb-intro.reveal-done .seq-2,
.onb-intro.reveal-done .seq-3, .onb-intro.reveal-done .seq-7,
.onb-intro.reveal-done .seq-8, .onb-intro.reveal-done .seq-9,
.onb-intro.reveal-done .seq-10, .onb-intro.reveal-done .seq-stat-1,
.onb-intro.reveal-done .seq-stat-2, .onb-intro.reveal-done .seq-stat-3 {
  animation: none;
  opacity: 1;
  visibility: visible;
  transform: none;
  filter: none;
}

.onb-intro-para {
  margin: 0 0 12px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  color: rgba(255, 255, 255, 0.68);
  font-size: 16px;
  line-height: 1.6;
}

/* ---------- Buttons ---------- */
.onb-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: rgba(124, 255, 139, 0.2);
  padding: 0 26px;
  border: 0;
  border-radius: 12px;
  color: var(--green-deep);
  background: var(--green-btn);
  box-shadow:
    2px -2px 3px 0 rgba(25, 140, 60, 0.42) inset,
    0 2px 2px 0 rgba(210, 255, 218, 0.6) inset,
    0 14px 30px rgba(124, 255, 139, 0.24);
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.onb-primary::after {
  content: "\2192";
  font-weight: 900;
}

.onb-primary.no-arrow::after {
  content: "";
}

.onb-primary:hover {
  transform: translateY(-2px);
  background: var(--green-btn-hi);
  box-shadow:
    2px -2px 3px 0 rgba(25, 140, 60, 0.5) inset,
    0 2px 2px 0 rgba(210, 255, 218, 0.7) inset,
    0 20px 40px rgba(124, 255, 139, 0.32);
}

.onb-primary:active {
  transform: translateY(0);
}

.onb-primary:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.onb-intro-cta {
  min-height: 60px;
  padding: 0 46px;
  font-size: 18px;
}

.onb-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  -webkit-user-select: none;
  user-select: none;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.onb-secondary:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.onb-secondary:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ---------- Footer ---------- */
.onb-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(560px, 100%);
  margin: 10px auto 0;
  padding-top: 12px;
}

.onb-footer .onb-primary {
  margin-left: auto;
}

.onb-error {
  flex: 1 1 auto;
  margin: 0;
  color: #ffc9c9;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

/* ---------- Success ---------- */
.onb-done {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 40px 22px;
  min-height: var(--onb-vh);
  text-align: center;
  animation: fade-rise 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.onb-done h2 {
  margin: 4px 0 12px;
  font-size: 42px;
  line-height: 1.02;
  font-weight: 600;
}

.onb-done-copy {
  max-width: 420px;
  margin: 0 0 26px;
  color: var(--soft);
  font-size: 16px;
  line-height: 1.55;
}

.onb-done-home {
  text-decoration: none;
}

/* ---------- Honeypot + noscript ---------- */
.onb-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.onb-noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
  color: var(--text);
}

.onb-noscript a {
  color: var(--green-soft);
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .onb {
    padding: max(14px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom));
  }

  /* Decorative corner marks collide with the back arrow and the Continue
     button once the flow goes full-width — drop them on small screens. */
  .onb-shell .corner {
    display: none;
  }

  /* Questions read better near the top on a phone than floating mid-screen. */
  .onb-slide {
    justify-content: flex-start;
    padding-top: 28px;
  }

  /* The intro is a full story — keep it centered. */
  .onb-slide.onb-intro {
    justify-content: center;
    padding-top: 8px;
  }

  .onb-q {
    font-size: 28px;
  }

  .onb-intro-title {
    font-size: 32px;
  }

  .onb-lede {
    font-size: 15px;
  }

  .onb-stats {
    gap: 8px;
    margin-bottom: 22px;
  }

  .onb-stat {
    padding: 13px 6px 11px;
  }

  .onb-stat-value {
    font-size: 20px;
  }

  .onb-stat-label {
    font-size: 10px;
    letter-spacing: 0.05em;
  }

  .onb-intro-copy p {
    font-size: 15px;
  }

  .onb-input,
  .onb-textarea {
    font-size: 16px;
  }

  .onb-footer .onb-secondary {
    padding: 0 14px;
  }
}

@media (max-width: 380px) {
  .onb-intro-title {
    font-size: 28px;
  }

  .onb-stat-value {
    font-size: 18px;
  }

  .onb-q {
    font-size: 25px;
  }
}
