/* Journey Journals — quiz + results
   Brand lane: minimalist, sans-serif, clean, calm, gender-neutral.
   Warm whites, soft grays, muted teal. Nothing floral, nothing clinical. */

:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #23312e;
  --muted: #6d7a76;
  --faint: #9aa5a1;
  --teal: #2e5a55;
  --teal-deep: #234742;
  --mist: #e9f0ee;
  --line: #e5e1d8;
  --line-strong: #d4cfc3;
  --radius: 14px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

.wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 24px 20px 96px;
}

/* ---------- header ---------- */

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 28px;
}
.brand-mark {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-deep);
  text-decoration: none;
}
.progress {
  font-size: 13px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 40px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--teal);
  border-radius: 2px;
  transition: width 300ms var(--ease);
}

/* ---------- quiz steps ---------- */

.step { display: none; }
.step.active {
  display: block;
  animation: step-in 260ms var(--ease);
}
@keyframes step-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 14px;
}

h1 {
  font-size: clamp(26px, 5.5vw, 34px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}

.sub {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 32px;
  max-width: 46ch;
}

textarea, input[type="text"] {
  width: 100%;
  display: block; /* removes the inline-block baseline gap so .field hugs the textarea */
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 16px 18px;
  outline: none;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
  resize: none;
}
textarea { min-height: 140px; }
textarea:focus, input[type="text"]:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--mist);
}
textarea::placeholder, input[type="text"]::placeholder {
  color: var(--faint);
}

.hint {
  font-size: 13px;
  color: var(--faint);
  margin-top: 10px;
}

/* mic — desktop-only, added by mic.js when Web Speech is supported.
   On phones/tablets the OS keyboard's own dictation key sits right here,
   so we render nothing and let it do the work. */
.field { position: relative; }
.mic-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 150ms ease-out, border-color 150ms ease-out, background-color 150ms ease-out, transform 100ms ease-out;
}
.mic-btn[hidden] { display: none; }
.mic-btn:hover { color: var(--teal); border-color: var(--teal); }
.mic-btn:active { transform: scale(0.94); }
.mic-btn.listening {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  animation: mic-pulse 1.4s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 90, 85, 0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(46, 90, 85, 0); }
}
.mic-note {
  font-size: 13px;
  color: #a06b3f;
  margin-top: 10px;
}

/* pills */

.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  font: inherit;
  font-size: 15.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  transition: border-color 150ms ease-out, background-color 150ms ease-out, transform 100ms ease-out;
  text-align: left;
}
.pill:active { transform: scale(0.97); }
.pill[aria-pressed="true"] {
  background: var(--mist);
  border-color: var(--teal);
  color: var(--teal-deep);
}

.pills-stack { flex-direction: column; align-items: stretch; }
.pills-stack .pill { padding: 15px 18px; }

.optional-line { margin-top: 22px; }
.optional-line label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}

/* nav buttons */

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
}
.btn {
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 15px 34px;
  cursor: pointer;
  background: var(--teal);
  color: #fff;
  transition: background-color 150ms ease-out, transform 100ms ease-out, opacity 150ms ease-out;
}
.btn:hover { background: var(--teal-deep); }
.btn:active { transform: scale(0.97); }
.btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.btn-ghost {
  background: none;
  color: var(--muted);
  font-weight: 500;
  padding: 15px 10px;
}
.btn-ghost:hover { background: none; color: var(--ink); }

/* loading */

.loading { text-align: center; padding: 96px 0; }
.loading .dot-row { display: inline-flex; gap: 7px; margin-bottom: 26px; }
.loading .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--teal);
  animation: breathe 1.2s ease-in-out infinite;
}
.loading .dot:nth-child(2) { animation-delay: 0.15s; }
.loading .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes breathe {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50%      { opacity: 1; transform: scale(1); }
}
.loading p { color: var(--muted); font-size: 16px; }

/* error note */

.error-note {
  background: #fbf3ee;
  border: 1px solid #ecd9cc;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 15px;
  color: #7a5540;
  margin-bottom: 24px;
  display: none;
}
.error-note.show { display: block; }

/* ---------- results ---------- */

.distress {
  background: var(--mist);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 15px;
  color: var(--teal-deep);
  margin-bottom: 28px;
}

.tier { margin-bottom: 36px; }
.tier-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.tier h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.tier .tier-sub {
  font-size: 14.5px;
  color: var(--muted);
  margin-bottom: 16px;
}

.card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  font: inherit;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 150ms ease-out, background-color 150ms ease-out;
}
.card:active { transform: scale(0.995); }
.card.selected {
  border-color: var(--teal);
  background: #f4f8f7;
}
.card .check {
  flex: none;
  width: 22px; height: 22px;
  margin-top: 1px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: border-color 150ms ease-out, background-color 150ms ease-out;
}
.card.selected .check {
  background: var(--teal);
  border-color: var(--teal);
}
.card .check svg { opacity: 0; transition: opacity 120ms ease-out; }
.card.selected .check svg { opacity: 1; }
.card .body { flex: 1; }
.card .prompt-text { font-size: 16.5px; font-weight: 500; line-height: 1.4; }
.card .meta {
  font-size: 13px;
  color: var(--faint);
  margin-top: 5px;
}
.card .why {
  font-size: 14px;
  color: var(--muted);
  margin-top: 7px;
  padding-left: 10px;
  border-left: 2px solid var(--mist);
}

/* see all 42 */

details.all-pool { border-top: 1px solid var(--line); padding-top: 8px; }
details.all-pool > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 2px;
  font-size: 16px;
  font-weight: 600;
  color: var(--teal-deep);
}
details.all-pool > summary::-webkit-details-marker { display: none; }
details.all-pool > summary .chev { transition: transform 200ms var(--ease); color: var(--faint); }
details.all-pool[open] > summary .chev { transform: rotate(180deg); }

.approach-group { margin: 8px 0 26px; }
.approach-group h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.approach-group .desc {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
  max-width: 52ch;
}

/* sticky footer bar */

.bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
}
.bar-inner {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.bar .count {
  font-size: 14.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.bar .count strong { color: var(--ink); }
.bar .btn { padding: 13px 28px; }

.cap-note {
  font-size: 13px;
  color: #a06b3f;
  margin-left: 8px;
  opacity: 0;
  transition: opacity 200ms ease-out;
}
.cap-note.show { opacity: 1; }

/* done panel */

.done-panel {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
}
.done-panel h2 { font-size: 22px; margin-bottom: 10px; }
.done-panel p { color: var(--muted); font-size: 15.5px; max-width: 44ch; margin: 0 auto 6px; }

@media (max-width: 480px) {
  .wrap { padding: 18px 16px 108px; }
  .nav { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
