/* ---------- Join the studio — Typeform-style survey ----------
   Full-height page: thin progress bar + logo pinned top, one step centered,
   up/down arrows bottom-right, a one-line footer at the bottom.
   Steps stack in the same grid cell; only .is-active is visible, sliding up
   when moving forward and down when moving back. */
.tf-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Top: progress + logo ---- */
.tf-top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding-top: env(safe-area-inset-top, 0px);
}
.tf-progress {
  height: 4px;
  background: var(--rule);
}
.tf-progress__fill {
  height: 100%;
  width: 0;
  background: var(--ink);
  border-radius: 0 999px 999px 0;
  transition: width 500ms var(--ease-editorial);
}
.tf-top__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad);
}
.tf-home { display: block; }
/* logo.svg stretches to its box (preserveAspectRatio=none), so size both sides at 489:113. */
.tf-home img { width: 104px; height: 24px; }
.tf-count {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---- Steps ---- */
.tf {
  flex: 1;
  display: grid;
  align-items: center;
  padding: 0 var(--pad);
  position: relative;
}
.tf-step {
  grid-area: 1 / 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 0 96px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(40px);
  transition: opacity 180ms var(--ease-ios), transform 520ms var(--ease-editorial), visibility 0s linear 520ms;
}
/* Hidden steps leave the flow so the page is only as tall as the current one. */
.tf-step:not(.is-active) {
  position: absolute;
  top: 0;
  left: var(--pad);
  right: var(--pad);
  width: auto;
}
.tf-step.is-before { transform: translateY(-40px); }
.tf-step.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 420ms var(--ease-ios) 80ms, transform 620ms var(--ease-editorial) 40ms, visibility 0s;
}

.tf-num {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  opacity: 0.7;
}
.tf-q {
  margin: 0;
  font-weight: 700;
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.tf-q--hero { font-size: clamp(32px, 5vw, 56px); }
.tf-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 20px);
}

/* ---- Text fields: underline only, like Typeform ---- */
.tf-fields { display: flex; flex-direction: column; gap: 28px; margin-top: 32px; }
.tf-step > .tf-field { margin-top: 28px; }
.tf-field { display: flex; flex-direction: column; gap: 6px; }
.tf-label { font-size: 15px; font-weight: 600; opacity: 0.7; }
.tf-field input,
.tf-field textarea {
  width: 100%;
  font: inherit;
  font-size: clamp(20px, 2.4vw, 28px);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--rule);
  border-radius: 0;
  padding: 8px 0;
  outline: none;
  transition: border-color 200ms var(--ease-ios);
}
.tf-field textarea { resize: none; line-height: 1.35; }
.tf-field input::placeholder,
.tf-field textarea::placeholder { color: var(--ink); opacity: 0.3; }
.tf-field input:focus,
.tf-field textarea:focus { border-bottom-color: var(--ink); }

/* ---- Choice options: stacked, lettered ---- */
.tf-options {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 28px;
}
.tf-opt { position: relative; cursor: pointer; max-width: 100%; }
.tf-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tf-opt span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: min(320px, 100%);
  padding: 10px 16px 10px 10px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.25;
  transition: background 160ms var(--ease-ios), color 160ms var(--ease-ios), opacity 160ms var(--ease-ios), transform 120ms var(--ease-ios);
}
.tf-opt kbd {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  background: var(--bg);
  color: var(--ink);
}
.tf-opt:hover span { background: color-mix(in srgb, var(--ink) 14%, transparent); }
.tf-opt input:checked + span { background: var(--ink); color: var(--bg); }
.tf-opt input:checked + span kbd { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.tf-opt input:checked + span::after { content: "✓"; margin-left: auto; padding-left: 12px; font-weight: 700; }
.tf-opt input:focus-visible + span { box-shadow: 0 0 0 3px var(--rule); }
.tf-opt input:disabled + span { opacity: 0.35; cursor: not-allowed; }
.tf-opt.is-flash span { transform: scale(0.98); }

/* ---- Actions ---- */
.tf-actions { display: flex; align-items: center; gap: 16px; margin-top: 32px; }
.tf-btn {
  font: inherit;
  font-weight: 700;
  font-size: 18px;
  color: var(--bg);
  background: var(--ink);
  border: 0;
  border-radius: 10px;
  padding: 12px 26px;
  cursor: pointer;
  transition: opacity 160ms var(--ease-ios);
}
.tf-btn:hover { opacity: 0.88; }
.tf-btn:disabled { opacity: 0.5; cursor: progress; }
.tf-btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.tf-hint { font-size: 14px; opacity: 0.6; }
.tf-hint b { font-weight: 700; }
.tf-error { margin: 14px 0 0; min-height: 1.4em; color: #D93A2B; font-size: 15px; }
.tf-error:empty { min-height: 0; margin: 0; }
.tf-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---- Up / down arrows ---- */
.tf-nav {
  position: fixed;
  right: max(var(--pad), env(safe-area-inset-right, 0px));
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 1px;
  border-radius: 8px;
  overflow: hidden;
  z-index: 4;
}
.tf-nav__btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 36px;
  border: 0;
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
}
.tf-nav__btn:disabled { opacity: 0.35; cursor: default; }
.tf.is-finished .tf-nav { display: none; }

/* ---- Simple footer ---- */
.tf-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--pad) calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--rule);
  font-size: 14px;
  font-weight: 600;
}
.tf-footer a:hover { opacity: 0.7; }

@media (max-width: 600px) {
  .tf { align-items: start; }
  .tf-step { padding-top: 6vh; }
  /* Arrows become a bottom bar so they never sit on top of answers. */
  .tf-nav {
    left: 0; right: 0; bottom: 0;
    justify-content: flex-end;
    gap: 8px;
    border-radius: 0;
    padding: 10px max(var(--pad), env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--bg);
    border-top: 1px solid var(--rule);
  }
  .tf-nav__btn { border-radius: 8px; }
  .tf-footer { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .tf-hint { display: none; }
  .tf-opt span { min-width: 100%; }
  .tf-options { align-items: stretch; }
  .tf-step { padding-bottom: 120px; }
  /* 16px+ stops iOS Safari zooming into the field on focus. */
  .tf-field input, .tf-field textarea { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .tf-step, .tf-step.is-active, .tf-progress__fill { transition: none; }
}
