/* LCL AI Pre-Survey — styles mirror lcl-ui/src/tokens.ts. No raw hex outside :root. */

@font-face {
  font-family: 'Bristone';
  src: url('/assets/bristone-bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* canvas & surfaces */
  --onyx: #000000;
  --carbon: #272727;
  --graphite: #494949;
  --surface: #0f0f10;
  --surface-hi: #1a1a1c;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-hi: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.18);
  --hairline: rgba(255, 255, 255, 0.1);
  --hairline-bronze: rgba(199, 154, 86, 0.28);
  /* ink */
  --bone: #e9e4e1;
  --white: #ffffff;
  --muted: #9c978f;
  --faint: #5a5750;
  --ink-on-accent: #000000;
  /* accents */
  --mint: #43dbbb;
  --teal: #38a495;
  --mint-tint: rgba(67, 219, 187, 0.12);
  --mint-border: rgba(67, 219, 187, 0.35);
  --bronze: #a47c38;
  --bronze-soft: #c79a56;
  --danger: #b5564e;
  --warning: #c98a3c;
  /* type */
  --font-display: 'Bristone', Georgia, serif;
  --font-body: 'Helvetica Neue', Helvetica, Inter, system-ui, sans-serif;
  /* radii */
  --r-s: 10px;
  --r-m: 16px;
  --r-card: 24px;
  --r-pill: 999px;
  /* motion */
  --t-fast: 200ms;
  --t-base: 350ms;
}

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

html { height: 100%; }

body {
  min-height: 100dvh;
  background: var(--onyx);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- ambient washes: mint high, bronze low (lcl.ui.ambient) ---- */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(55% 55% at 85% -5%, rgba(67, 219, 187, 0.14) 0%, rgba(67, 219, 187, 0.05) 55%, transparent 100%),
    radial-gradient(60% 60% at 0% 105%, rgba(199, 154, 86, 0.12) 0%, rgba(199, 154, 86, 0.04) 60%, transparent 100%);
}

/* ---- chrome: logo pinned top + progress hairline ---- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: calc(18px + env(safe-area-inset-top)) 20px 14px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.55) 70%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.topbar .logo { height: 22px; display: block; }

.progress {
  width: min(340px, 68vw);
  height: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 1px;
  background: var(--mint);
  transition: width var(--t-base) ease;
}

/* ---- stage ---- */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(96px + env(safe-area-inset-top)) 20px calc(140px + env(safe-area-inset-bottom));
}

.step {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: rise var(--t-base) ease both;
}

.step.leaving {
  animation: sink var(--t-fast) ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sink {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-14px); }
}

@media (prefers-reduced-motion: reduce) {
  .step, .step.leaving { animation: none; }
}

/* ---- type ---- */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--bronze-soft);
}

.q-head { display: flex; flex-direction: column; gap: 10px; }

.q-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 5.4vw, 38px);
  line-height: 1.12;
  color: var(--bone);
  text-wrap: balance;
}

.q-sub { font-size: 15px; line-height: 1.45; color: var(--muted); max-width: 52ch; }

.optional-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  width: fit-content;
}

/* ---- inputs (lcl.ui.field) ---- */
.field input[type='text'],
.field input[type='email'],
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--bone);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline);
  border-radius: var(--r-m);
  padding: 16px;
  outline: none;
  transition: border-color var(--t-fast) ease, background var(--t-fast) ease;
  caret-color: var(--mint);
}

.field textarea { min-height: 132px; resize: vertical; line-height: 1.5; }

.field input:focus, .field textarea:focus {
  border-color: var(--mint-border);
  background: rgba(255, 255, 255, 0.06);
}

.field ::placeholder { color: var(--faint); }

.field-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 18px;
  font-size: 12px;
  color: var(--faint);
}

.field-meta .error { color: var(--danger); }
.field-meta .counter { color: var(--warning); }

/* ---- option cards (glass) ---- */
.options { display: flex; flex-direction: column; gap: 10px; }

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--bone);
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r-m);
  padding: 15px 16px;
  cursor: pointer;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  transition: border-color var(--t-fast) ease, background var(--t-fast) ease, transform var(--t-fast) ease, opacity var(--t-fast) ease;
}

.option:hover { background: var(--glass-hi); }
.option:active { transform: scale(0.985); }

.option.selected {
  background: var(--mint-tint);
  border-color: var(--mint-border);
}

.option.dimmed { opacity: 0.38; pointer-events: none; }

.option .opt-key {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.04);
}

.option.selected .opt-key {
  color: var(--ink-on-accent);
  background: var(--mint);
  border-color: var(--mint);
}

.option .opt-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.option .opt-label { font-weight: 500; line-height: 1.3; }
.option .opt-detail { font-size: 13px; color: var(--muted); }

.option .opt-check { flex: none; opacity: 0; transition: opacity var(--t-fast) ease; color: var(--mint); }
.option.selected .opt-check { opacity: 1; }

/* scale variant — big number chip */
.option.scale .opt-key {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 19px;
}

.pick-counter { font-size: 13px; color: var(--muted); }
.pick-counter strong { color: var(--mint); font-weight: 600; }

/* grid layout — compact multi-select cards (tools) */
.options.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.options.grid .option {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  min-height: 78px;
}

.options.grid .option .opt-key { width: 22px; height: 22px; border-radius: 7px; font-size: 13px; }
.options.grid .option .opt-label { font-size: 14px; }
.options.grid .option .opt-detail { font-size: 12px; }
.options.grid .option .opt-check { display: none; }

/* ranked multi — drag to reorder */
.option .drag-handle {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}

.option .drag-handle:hover { color: var(--bone); background: rgba(255, 255, 255, 0.06); }
.option.dragging { opacity: 0.45; }
.option.dragging .drag-handle { cursor: grabbing; }

.drop-line {
  height: 2px;
  border-radius: 1px;
  background: var(--mint);
  margin: -6px 4px;
  box-shadow: 0 0 8px rgba(67, 219, 187, 0.6);
}

/* ---- matrix (tools grid) ---- */
.matrix { display: flex; flex-direction: column; gap: 8px; }

.matrix-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--r-m);
  padding: 12px 14px;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}

.matrix-row .opt-body { flex: 1; min-width: 0; }
.matrix-row .opt-label { font-size: 15px; font-weight: 500; }
.matrix-row .opt-detail { font-size: 12px; color: var(--muted); }

.matrix-cells { display: flex; gap: 8px; flex: none; }

.cell {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 8px 12px;
  cursor: pointer;
  transition: all var(--t-fast) ease;
  white-space: nowrap;
}

.cell.on {
  color: var(--ink-on-accent);
  background: var(--mint);
  border-color: var(--mint);
}

.matrix-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }

@media (max-width: 480px) {
  .matrix-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .matrix-cells { justify-content: flex-start; }
}

/* ---- footer / CTA (pinned, house onboarding layout) ---- */
.foot {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.6) 70%, transparent);
}

.pill {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--ink-on-accent);
  background: var(--mint);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 16px 34px;
  min-height: 48px;
  cursor: pointer;
  transition: transform var(--t-fast) ease, opacity var(--t-fast) ease, background var(--t-fast) ease;
}

.pill:hover { background: #4ee7c7; }
.pill:active { transform: scale(0.985); }
.pill:disabled { opacity: 0.35; cursor: default; }

.pill.ghost {
  color: var(--bone);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  padding: 15px 22px;
}

.pill.ghost:hover { background: rgba(255, 255, 255, 0.09); }

.key-hint { font-size: 12px; color: var(--faint); }
.key-hint kbd {
  font-family: var(--font-body);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--muted);
}

@media (max-width: 560px) {
  .key-hint { display: none; }
  .foot .pill:not(.ghost) { flex: 1; }
}

/* ---- intro / outro / terminal screens ---- */
.hero { text-align: center; align-items: center; gap: 18px; }
.hero .q-title { font-size: clamp(32px, 7vw, 46px); }
.hero .q-sub { margin: 0 auto; }

.hero-mark { width: 76px; height: 76px; margin: 0 auto 6px; display: block; }

.done-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto;
  display: grid;
  place-items: center;
  background: var(--mint-tint);
  border: 1px solid var(--mint-border);
  color: var(--mint);
}

.lock-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto;
  display: grid;
  place-items: center;
  background: rgba(199, 154, 86, 0.1);
  border: 1px solid var(--hairline-bronze);
  color: var(--bronze-soft);
}

.resume-note {
  font-size: 13px;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
