/* ============================================================
   TimelyNodes — university research pages
   Extends styles.css. Same palette, same type, quieter execution.

   The landing page earns its gradients and its animated factor graph: it is trying to
   make you feel something in four seconds. These pages are trying to hold someone's
   attention through twenty-eight questions, so the gradient is demoted to an accent —
   the progress bar, the focus ring, the selected state, one rule under the headline —
   and the background stays still. Nothing here moves unless the reader moved it.
   ============================================================ */

:root {
  /* Reading measure. Prose narrow enough to scan, option grids wider. */
  --q-measure: 62ch;
  --q-wide: 940px;
  --q-ease: cubic-bezier(.22,.61,.36,1);
}

.q-page {
  /* No animated canvas on these pages, so the ambient wash is much softer than the
     landing page's — enough to avoid flatness, not enough to compete with text. */
  background:
    radial-gradient(900px 600px at 85% -15%, #16132a 0%, transparent 60%),
    radial-gradient(700px 500px at -5% 5%, #0c1725 0%, transparent 55%),
    var(--bg);
}

/* styles.css gives .btn `display: inline-flex`, which outranks the user-agent's
   `[hidden] { display: none }` — so without this the Back and Skip buttons stay visible
   on steps where the controller has hidden them. */
[hidden] { display: none !important; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  background: var(--violet);
  color: #fff;
  border-radius: 0 0 12px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* Focus is visible everywhere and uses the brand accent rather than the UA default. */
:where(a, button, input, textarea, select, label.opt, label.wish, label.scale-pip):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 10px;
}
.opt-input:focus-visible + .opt-mark { box-shadow: 0 0 0 3px rgba(52,227,208,.45); }
.opt:has(.opt-input:focus-visible),
.wish:has(.opt-input:focus-visible),
.scale-pip:has(.opt-input:focus-visible) {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.nav-quiet { backdrop-filter: blur(14px); }

/* ---------- Invitation ---------- */

.q-hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 120px 22px 80px;
}
.q-hero h1 {
  font-size: clamp(34px, 5.4vw, 60px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 14px 0 0;
}
.q-hero .lede {
  max-width: var(--q-measure);
  margin-top: 22px;
  font-size: clamp(16px, 1.9vw, 19px);
  color: var(--muted);
}

.q-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 34px 0 30px;
  padding: 18px 0 0;
  border-top: 1px solid var(--border);
}
.q-meta > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
  padding-right: 26px;
}
.q-meta b { font-size: 16px; font-weight: 700; }
.q-meta span { font-size: 13px; color: var(--faint); }

.q-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.q-resume {
  margin-top: 28px;
  padding: 18px 20px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  max-width: 520px;
}
.q-resume p { margin-bottom: 14px; }
.q-resume-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.q-why {
  margin-top: 84px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  max-width: var(--q-measure);
}
.q-why h2 { font-size: 20px; margin: 0 0 12px; }
.q-why h2 + p { margin-bottom: 16px; }
.q-why p { color: var(--muted); margin-bottom: 16px; }
.q-why-list { margin: 0 0 12px; padding-left: 20px; color: var(--muted); }
.q-why-list li { margin-bottom: 10px; }
.q-why a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Runner ---------- */

.q-runner {
  max-width: var(--q-wide);
  margin: 0 auto;
  padding: 104px 22px 40px;
}
.q-runner.is-busy { cursor: progress; }

.q-progress { margin-bottom: 26px; }
.q-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 10px;
}
.q-section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cyan);
}
.q-step-count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--faint);
}
.q-bar-track {
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.q-bar {
  height: 100%;
  width: 0;
  background: var(--grad);
  border-radius: 999px;
  transition: width 420ms var(--q-ease);
}

.q-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(22px, 3.4vw, 40px);
}

/* Visually hidden, not removed. The section name is already on screen in the progress
   bar, so showing it again inside the card is noise — but it still has to exist as the
   heading that focus moves to on each step, or a screen reader gets no announcement that
   the question changed. */
.q-heading {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.q-heading:focus { outline: none; }

.q-banner {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: var(--radius-s);
  border: 1px solid rgba(255,107,169,.4);
  background: rgba(255,107,169,.1);
  color: #ffc9de;
  font-size: 14px;
}

/* ---------- Questions ---------- */

.q + .q { margin-top: 38px; padding-top: 38px; border-top: 1px solid var(--border); }

.q-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q-legend { display: block; padding: 0; margin-bottom: 20px; }

.q-prompt {
  display: block;
  font-size: clamp(20px, 2.6vw, 27px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  max-width: var(--q-measure);
}
.q-help {
  display: block;
  margin-top: 10px;
  font-size: 15px;
  color: var(--muted);
  max-width: var(--q-measure);
}

.q-group + .q-group { margin-top: 22px; }
.q-group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 10px;
}

.q-options { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .q-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-options-dense { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* The choice card. A real input is inside, visually hidden but fully focusable — the
   card is a <label>, so a click anywhere on it selects, and a screen reader still hears
   a radio or a checkbox. */
.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 160ms var(--q-ease), background 160ms var(--q-ease), transform 160ms var(--q-ease);
}
.opt:hover { border-color: var(--border-2); background: var(--surface-2); }
.opt:active { transform: scale(.995); }
.opt.is-selected {
  border-color: rgba(124,92,255,.75);
  background: linear-gradient(100deg, rgba(124,92,255,.14), rgba(52,227,208,.08));
}
.opt-button { width: 100%; }

.opt-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.opt-mark {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1.5px solid var(--border-2);
  background: rgba(255,255,255,.02);
  transition: border-color 160ms var(--q-ease), background 160ms var(--q-ease);
  position: relative;
}
input[type="radio"] + .opt-mark { border-radius: 50%; }
.opt.is-selected .opt-mark,
.wish.is-selected .opt-mark {
  border-color: transparent;
  background: var(--grad);
}
.opt.is-selected .opt-mark::after,
.wish.is-selected .opt-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: no-repeat center/11px 11px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%230a0a12' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5'/%3E%3C/svg%3E");
}

.opt-label { font-size: 15px; line-height: 1.35; }

.opt-other {
  grid-column: 1 / -1;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-s);
  background: rgba(0,0,0,.25);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.opt-other::placeholder { color: var(--faint); }

.q-counter {
  margin-top: 12px;
  font-size: 13px;
  color: var(--faint);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.q-error {
  margin-top: 14px;
  font-size: 14px;
  color: #ffc9de;
}

/* ---------- Scale ---------- */

.q-scale { max-width: 520px; }
.q-scale-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale-pip {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 160ms var(--q-ease), background 160ms var(--q-ease);
}
.scale-pip:hover { border-color: var(--border-2); background: var(--surface-2); }
.scale-pip.is-selected {
  border-color: transparent;
  background: var(--grad);
}
.scale-pip.is-selected .scale-pip-value { color: #0a0a12; }
.scale-pip-value { font-size: 19px; font-weight: 700; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.q-scale-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 13px;
  color: var(--faint);
}

/* ---------- Wishlist choices ---------- */

.q-wishlist { display: grid; gap: 10px; }
.wish {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 160ms var(--q-ease), background 160ms var(--q-ease);
}
.wish:hover { border-color: var(--border-2); background: var(--surface-2); }
.wish.is-selected {
  border-color: rgba(124,92,255,.75);
  background: linear-gradient(100deg, rgba(124,92,255,.14), rgba(52,227,208,.08));
}
.wish-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wish-title { font-size: 15px; font-weight: 600; }
.wish-summary { font-size: 14px; color: var(--muted); line-height: 1.5; }
.wish-count {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 46px;
  padding: 7px 6px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
}
.wish-count-n { font-size: 16px; font-weight: 700; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.wish-count-label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }

/* ---------- Ranking ---------- */

.rank-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.rank-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(124,92,255,.5);
  border-radius: var(--radius-s);
  background: linear-gradient(100deg, rgba(124,92,255,.12), rgba(52,227,208,.06));
}
.rank-badge {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grad);
  color: #0a0a12;
  font-weight: 800;
  font-size: 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.rank-label { font-size: 15px; }
.rank-controls { display: flex; gap: 6px; }
.rank-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border-2);
  background: rgba(0,0,0,.25);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  transition: background 160ms var(--q-ease), opacity 160ms var(--q-ease);
}
.rank-btn:hover:not(:disabled) { background: rgba(255,255,255,.08); }
.rank-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ---------- Free text ---------- */

.q-text { display: block; }
.q-textarea {
  width: 100%;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-s);
  background: rgba(0,0,0,.28);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1.6;
  resize: vertical;
}
.q-textarea::placeholder { color: var(--faint); }
.q-textarea:focus { border-color: rgba(52,227,208,.5); }

/* ---------- Contact ---------- */

.contact-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.contact-field { display: flex; flex-direction: column; gap: 7px; }
.contact-field-wide { margin-top: 20px; }
.contact-label { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.contact-optional {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}
.contact-input {
  padding: 13px 15px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-s);
  background: rgba(0,0,0,.28);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px stops iOS Safari zooming the viewport on focus. */
}
.contact-input:focus { border-color: rgba(52,227,208,.5); }

.q-privacy {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.6;
  color: var(--faint);
  max-width: var(--q-measure);
}

/* ---------- Step navigation ---------- */

.q-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}
.q-remaining {
  margin-left: auto;
  font-size: 12px;
  color: var(--faint);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.q-nav .btn-primary { min-width: 132px; justify-content: center; }

@media (max-width: 620px) {
  .q-nav { flex-wrap: wrap; }
  .q-remaining { order: -1; margin-left: 0; width: 100%; }
  .q-nav .btn-primary { flex: 1; }
}

/* ---------- Closing ---------- */

.q-done {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 120px 22px 80px;
}
.q-done h1 {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 14px 0 0;
}
.q-done .lede { max-width: var(--q-measure); margin-top: 20px; color: var(--muted); }

.echo {
  margin: 34px 0 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.echo-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 18px 20px;
}
.echo-row + .echo-row { border-top: 1px solid var(--border); }
@media (min-width: 720px) {
  /* `start`, not `baseline`: if a label ever wraps to two lines, baseline leaves the
     value floating against the first of them. */
  .echo-row { grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
}
.echo-key {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}
.echo-value { font-size: 17px; font-weight: 600; }

.done-list { margin: 0 0 30px; padding-left: 20px; color: var(--muted); max-width: var(--q-measure); }
.done-list li { margin-bottom: 10px; }

.q-done-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Public wishlist ---------- */

.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;
}

.wl-hero { padding-bottom: 40px; }

.wl, .wl-suggest, .wl-cta {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}
.wl-status { color: var(--muted); padding: 20px 0; }
.wl-status.is-error { color: #ffc9de; }

.wl-list { display: grid; gap: 10px; padding-bottom: 20px; }

.wl-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 160ms var(--q-ease);
}
.wl-item:hover { border-color: var(--border-2); }

.wl-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 56px;
  padding: 10px 8px;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 160ms var(--q-ease), background 160ms var(--q-ease), transform 160ms var(--q-ease);
}
.wl-vote:hover { border-color: rgba(124,92,255,.6); background: rgba(124,92,255,.1); }
.wl-vote:active { transform: scale(.96); }
.wl-vote.is-voted {
  border-color: transparent;
  background: var(--grad);
  color: #0a0a12;
}
.wl-vote-arrow { font-size: 11px; line-height: 1; opacity: .8; }
.wl-vote-n { font-size: 17px; font-weight: 700; font-family: 'JetBrains Mono', ui-monospace, monospace; }

.wl-body { min-width: 0; }
.wl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wl-title { font-size: 16px; font-weight: 600; margin: 0; }
.wl-summary { margin: 7px 0 0; font-size: 15px; line-height: 1.6; color: var(--muted); max-width: var(--q-measure); }
.wl-category {
  display: inline-block;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.wl-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  color: var(--muted);
}
.wl-badge-planned  { border-color: rgba(91,140,255,.5); color: #a9c2ff; }
.wl-badge-building { border-color: rgba(52,227,208,.5); color: var(--cyan); }
.wl-badge-shipped  { border-color: rgba(52,227,208,.7); background: rgba(52,227,208,.12); color: var(--cyan); }

.wl-suggest, .wl-cta {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.wl-suggest h2, .wl-cta h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 12px; }
.wl-suggest > p, .wl-cta > p { max-width: var(--q-measure); margin-bottom: 24px; }
.wl-suggest form { display: grid; gap: 16px; max-width: 640px; }
.wl-suggest .btn { justify-self: start; }
.wl-cta { padding-bottom: 90px; }

/* Off-screen rather than display:none — some bots skip hidden fields, fewer skip these. */
.wl-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .q-bar, .opt, .wish, .scale-pip, .rank-btn, .wl-item, .wl-vote { transition: none; }
}
