/* =============================================================
   RiskIQ — Public UI design system
   Hand-rolled. No framework. Warm-green / financial-trustworthy.
   ============================================================= */

/* ---------- Cross-browser shims (iOS Safari, Android Chrome, etc) ---------- */
@supports (height: 100dvh) {
  html, body { min-height: 100dvh; }
}
@supports (-webkit-touch-callout: none) {
  /* iOS-only: ensure 100% fills the visible area minus toolbar */
  .full-bleed { min-height: -webkit-fill-available; }
}
/* Prevent iOS Safari from zooming when an input is focused. iOS auto-zooms
   any input whose computed font-size is < 16px. */
input, select, textarea, button {
  font-size: max(16px, 1rem);
  font-family: inherit;
}
/* Apple system controls — keep our styling */
input, textarea, select, button {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}
/* iOS / Android tap target minimum (44x44 per Apple HIG, 48dp per Material). */
button, .btn, .tile, [role="button"], a.btn {
  min-height: 44px;
  touch-action: manipulation;
}
/* Don't let iOS bold form labels weirdly */
label, .label { -webkit-text-size-adjust: 100%; }
/* Safe-area inset (iPhone notch / Android cutout) */
body {
  padding-left:   env(safe-area-inset-left, 0);
  padding-right:  env(safe-area-inset-right, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
/* Disable iOS double-tap-to-zoom on interactive elements */
* { -webkit-tap-highlight-color: transparent; }

:root {
  --green-deep:    #1a3518;
  --green-primary: #2d5a27;
  --green-light:   #4a7c42;
  --green-mist:    #f5f8f4;
  --green-edge:    #d8e3d3;

  --accent-amber:  #f39c12;
  --accent-red:    #c0392b;
  --accent-blue:   #3478d6;

  --text-dark:     #1f2937;
  --text-mute:     #6b7280;
  --text-faint:    #9ca3af;

  --card-bg:       #ffffff;
  --card-shadow:   0 10px 30px -10px rgba(45,90,39,0.18);
  --card-shadow-lg:0 20px 50px -20px rgba(45,90,39,0.32);
  --card-radius:   16px;
  --card-radius-sm:10px;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter-page: clamp(20px, 4vw, 48px);
  --content-max: 1280px;
  --reading-max: 720px;

  --ease-out:    cubic-bezier(.16,.84,.32,1);
  --ease-in-out: cubic-bezier(.65,.05,.35,1);
}

/* =============== reset =============== */

*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--sans);
  color: var(--text-dark);
  background: var(--green-mist);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--green-primary); text-decoration: none; }
a:hover { color: var(--green-deep); text-decoration: underline; }

button { font-family: inherit; }

/* =============== layout shell =============== */

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

.rail {
  background: linear-gradient(180deg, var(--green-deep) 0%, var(--green-primary) 100%);
  color: #fff;
  padding: 40px 32px;
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

@media (max-width: 900px) {
  .rail {
    position: relative;
    min-height: auto;
    padding: 24px var(--gutter-page);
  }
}

.rail .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rail .brand .logo-mark {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,0.12);
}

.rail .brand .brand-text {
  display: flex; flex-direction: column; line-height: 1.05;
}
.rail .brand .firm {
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.78;
}
.rail .brand .product {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.rail .firm-block { display: flex; flex-direction: column; gap: 4px; }
.rail .firm-block .firm-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.2;
}
.rail .firm-block .firm-tag {
  font-size: 0.85rem;
  opacity: 0.7;
}

.rail .advisor-card {
  margin-top: auto;
  padding: 18px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  text-align: center;
}
.rail .advisor-card .label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 6px;
}
.rail .advisor-card .name {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin-bottom: 8px;
}
.rail .advisor-card a {
  display: block;
  color: #fff;
  font-size: 0.9rem;
  opacity: 0.88;
  margin-top: 2px;
}
.rail .advisor-card a:hover { opacity: 1; text-decoration: underline; }

.rail .rail-nav {
  display: flex; flex-direction: column; gap: 8px;
  font-size: 0.88rem;
}
.rail .rail-nav a {
  color: rgba(255,255,255,0.78);
  padding: 6px 0;
}
.rail .rail-nav a:hover { color: #fff; text-decoration: none; }

.main {
  padding: 0;
  background: var(--green-mist);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.main-inner {
  flex: 1;
  padding: clamp(28px, 5vw, 64px) var(--gutter-page);
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
}

/* progress bar fixed under the top of the main column */
.progress-rail {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 3px;
  background: rgba(45,90,39,0.10);
  width: 100%;
}
.progress-rail .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-light), var(--green-primary));
  width: 0%;
  transition: width 380ms var(--ease-out);
}

/* footer */
.foot {
  border-top: 1px solid var(--green-edge);
  padding: 28px var(--gutter-page);
  font-size: 0.78rem;
  color: var(--text-mute);
  background: #fff;
}
.foot .foot-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
}
.foot p { margin: 0 0 6px 0; }
.foot .boiler { max-width: 800px; line-height: 1.55; }
.foot .copy { white-space: nowrap; }
@media (max-width: 700px) {
  .foot .foot-inner { grid-template-columns: 1fr; }
}

/* =============== typography =============== */

h1, h2, h3, h4 {
  margin: 0 0 12px 0;
  color: var(--green-deep);
  letter-spacing: -0.01em;
}

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05;
}

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  line-height: 1.15;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

p { margin: 0 0 14px 0; }

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-mute);
  max-width: 60ch;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-light);
  font-weight: 600;
  margin-bottom: 14px;
}

.muted { color: var(--text-mute); }
.tiny  { font-size: 0.82rem; }

/* =============== buttons =============== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 140ms var(--ease-out),
              box-shadow 200ms var(--ease-out),
              background 160ms ease,
              color 160ms ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible {
  outline: 3px solid rgba(52,120,214,0.45);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--green-primary);
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(45,90,39,0.55);
}
.btn-primary:hover { background: var(--green-deep); color: #fff; text-decoration: none;}

.btn-ghost {
  background: transparent;
  color: var(--green-primary);
  border-color: var(--green-edge);
}
.btn-ghost:hover { background: #fff; color: var(--green-deep); text-decoration: none; }

.btn-lg {
  padding: 18px 32px;
  font-size: 1.08rem;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ripple */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255,255,255,0.5);
  pointer-events: none;
  animation: ripple 600ms ease-out forwards;
}
@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 24px;
}

/* =============== cards =============== */

.card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid rgba(45,90,39,0.06);
}

.card-flush { padding: 0; overflow: hidden; }

.card.spacious { padding: clamp(28px, 4vw, 48px); }

/* =============== forms =============== */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}

.field label,
.field .label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-dark);
}

.field .hint {
  font-size: 0.82rem;
  color: var(--text-mute);
}

.input,
.select,
input[type="text"].input,
input[type="email"].input,
input[type="tel"].input,
input[type="number"].input,
input[type="date"].input,
textarea.input {
  font: inherit;
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--green-edge);
  background: #fff;
  color: var(--text-dark);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 120ms ease;
}
.input:hover { border-color: var(--green-light); }
.input:focus,
.input:focus-visible {
  outline: none;
  border-color: var(--green-primary);
  box-shadow: 0 0 0 4px rgba(45,90,39,0.10);
}

textarea.input { resize: vertical; min-height: 110px; }

.input-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 560px) {
  .input-grid-2 { grid-template-columns: 1fr; }
}

/* dollar input */
.dollar-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.dollar-wrap::before {
  content: "$";
  position: absolute;
  left: 24px;
  font-family: var(--serif);
  font-size: 2.2rem;
  color: var(--green-light);
  pointer-events: none;
}
.dollar-input {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 500;
  width: 100%;
  padding: 18px 24px 18px 64px;
  border-radius: 14px;
  border: 1.5px solid var(--green-edge);
  background: #fff;
  color: var(--green-deep);
  letter-spacing: 0.01em;
}
.dollar-input:focus {
  outline: none;
  border-color: var(--green-primary);
  box-shadow: 0 0 0 4px rgba(45,90,39,0.12);
}

/* =============== goal tiles =============== */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.tile {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--green-edge);
  border-radius: 14px;
  padding: 22px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 160ms var(--ease-out),
              border-color 160ms ease,
              box-shadow 200ms ease,
              background 160ms ease;
}
.tile:hover {
  transform: translateY(-2px);
  border-color: var(--green-light);
  box-shadow: 0 10px 24px -16px rgba(45,90,39,0.4);
}
.tile:focus-visible {
  outline: 3px solid rgba(52,120,214,0.45);
  outline-offset: 2px;
}
.tile .tile-icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--green-mist);
  color: var(--green-primary);
}
.tile .tile-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--green-deep);
}
.tile .tile-sub {
  font-size: 0.82rem;
  color: var(--text-mute);
}
.tile[aria-pressed="true"] {
  background: linear-gradient(180deg, #ffffff, #eaf2e7);
  border-color: var(--green-primary);
  box-shadow: 0 12px 26px -16px rgba(45,90,39,0.55);
  animation: tile-pop 240ms var(--ease-out);
}
.tile[aria-pressed="true"] .tile-icon {
  background: var(--green-primary);
  color: #fff;
}
.tile .tile-check {
  position: absolute;
  top: 12px; right: 12px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--green-primary);
  color: #fff;
  display: grid; place-items: center;
  font-size: 0.7rem;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 160ms ease, transform 160ms var(--ease-out);
}
.tile[aria-pressed="true"] .tile-check { opacity: 1; transform: scale(1); }

@keyframes tile-pop {
  0%   { transform: translateY(-2px) scale(1); }
  35%  { transform: translateY(-4px) scale(1.04); }
  100% { transform: translateY(-2px) scale(1); }
}

/* =============== slider step =============== */

.slider-block {
  margin: 28px 0 8px;
}
.slider-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.slider-labels .lbl {
  padding: 18px 20px;
  border-radius: 14px;
  text-align: center;
  border: 1.5px solid;
  display: flex; flex-direction: column; gap: 4px;
}
.slider-labels .lbl-loss {
  border-color: rgba(192,57,43,0.25);
  background: rgba(192,57,43,0.05);
}
.slider-labels .lbl-gain {
  border-color: rgba(45,90,39,0.25);
  background: rgba(45,90,39,0.05);
}
.slider-labels .lbl .pct {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 600;
  line-height: 1;
}
.slider-labels .lbl-loss .pct { color: var(--accent-red); }
.slider-labels .lbl-gain .pct { color: var(--green-primary); }
.slider-labels .lbl .dollars {
  font-size: 0.95rem;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    #c0392b 0%,
    #e58c7e 35%,
    #cfd9cb 50%,
    #9bc191 65%,
    var(--green-primary) 100%);
  outline: none;
  cursor: pointer;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 34px; height: 34px;
  border-radius: 999px;
  background: var(--green-primary);
  border: 3px solid #fff;
  box-shadow: 0 6px 14px -4px rgba(45,90,39,0.55);
  cursor: grab;
  transition: transform 120ms var(--ease-out);
}
.range::-webkit-slider-thumb:hover { transform: scale(1.08); }
.range::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.02); }
.range::-moz-range-thumb {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--green-primary);
  border: 3px solid #fff;
  box-shadow: 0 6px 14px -4px rgba(45,90,39,0.55);
  cursor: grab;
}
.range:focus-visible {
  box-shadow: 0 0 0 4px rgba(52,120,214,0.30);
}

.range-ticks {
  display: flex; justify-content: space-between;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* =============== bracketing cards =============== */

.bracket-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 800px) {
  .bracket-grid { grid-template-columns: 1fr; }
}

.bracket-card {
  background: #fff;
  border: 1.5px solid var(--green-edge);
  border-radius: 14px;
  padding: 22px 18px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 160ms var(--ease-out),
              border-color 160ms ease,
              box-shadow 200ms ease;
  position: relative;
}
.bracket-card:hover {
  transform: translateY(-3px);
  border-color: var(--green-light);
  box-shadow: 0 16px 36px -22px rgba(45,90,39,0.45);
}
.bracket-card[aria-pressed="true"] {
  border-color: var(--green-primary);
  background: linear-gradient(180deg, #ffffff, #eaf2e7);
  box-shadow: 0 18px 38px -22px rgba(45,90,39,0.55);
}
.bracket-card .b-label {
  font-size: 0.78rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--green-light);
  font-weight: 700;
}
.bracket-card .b-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--green-deep);
  line-height: 1.15;
}
.bracket-card .b-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}
.bracket-card .b-bar {
  display: flex; flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  border-radius: 8px;
  padding: 10px;
  min-height: 110px;
  position: relative;
  font-variant-numeric: tabular-nums;
}
.bracket-card .b-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.bracket-card .b-bar.down {
  order: 1;
  background: rgba(192,57,43,0.07);
  color: var(--accent-red);
}
.bracket-card .b-bar.up {
  order: 2;
  background: rgba(45,90,39,0.08);
  color: var(--green-primary);
}
.bracket-card .b-bar .b-amt {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
}
.bracket-card .b-bar .b-cap {
  font-size: 0.72rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.bracket-card .b-bar .b-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: currentColor;
  opacity: 0.18;
  transform-origin: bottom;
  transform: scaleY(var(--bar-scale, 0.6));
  transition: transform 480ms var(--ease-out);
}

/* =============== radio list =============== */

.radio-list {
  display: flex; flex-direction: column; gap: 10px;
}
.radio-tile {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--green-edge);
  background: #fff;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 120ms ease;
}
.radio-tile:hover { border-color: var(--green-light); transform: translateY(-1px); }
.radio-tile input[type="radio"] {
  margin-top: 4px;
  accent-color: var(--green-primary);
  width: 18px; height: 18px;
}
.radio-tile .r-title { font-weight: 600; color: var(--green-deep); }
.radio-tile .r-sub   { font-size: 0.88rem; color: var(--text-mute); }
.radio-tile:has(input:checked) {
  border-color: var(--green-primary);
  background: linear-gradient(180deg, #ffffff, #eaf2e7);
}

/* =============== landing hero =============== */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
  padding: clamp(24px, 5vw, 64px) 0;
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
}

.hero .hero-headline {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.02;
  color: var(--green-deep);
  margin-bottom: 18px;
}
.hero .hero-headline em {
  font-style: normal;
  color: var(--green-light);
  position: relative;
}
.hero .hero-headline em::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.06em;
  height: 0.18em;
  background: rgba(243,156,18,0.35);
  z-index: -1;
}

.hero .hero-sub {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--text-mute);
  max-width: 50ch;
  margin-bottom: 30px;
}

.hero .hero-points {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 28px;
  font-size: 0.92rem;
  color: var(--text-mute);
}
.hero .hero-points .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green-light);
  margin-right: 8px;
  vertical-align: middle;
}

/* badges */
.badges {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 520px;
  margin: 0 auto;
}
.badge {
  position: absolute;
  width: 36%;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 600;
  color: #fff;
  text-align: center;
  box-shadow: var(--card-shadow-lg);
  user-select: none;
}
.badge .b-label {
  font-size: 0.7rem;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  opacity: 0.78;
  display: block;
}
.badge .b-num {
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1;
  margin-top: 6px;
}

.badge-low {
  left: 4%; top: 52%;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  transform: rotate(-6deg);
  animation: float-a 7s ease-in-out infinite;
}
.badge-mid {
  left: 32%; top: 16%;
  width: 40%;
  background: linear-gradient(135deg, var(--green-light), var(--green-primary));
  transform: rotate(2deg);
  z-index: 2;
  box-shadow: 0 30px 60px -20px rgba(45,90,39,0.55);
  animation: float-b 6s ease-in-out infinite;
}
.badge-mid .b-num {
  animation: pulse-q 2.4s ease-in-out infinite;
  font-size: clamp(3rem, 7vw, 4.5rem);
}
.badge-high {
  right: 4%; top: 56%;
  background: linear-gradient(135deg, #2d5a27, #1a3518);
  transform: rotate(7deg);
  animation: float-c 8s ease-in-out infinite;
}

@keyframes float-a {
  0%,100% { transform: translateY(0) rotate(-6deg); }
  50%     { transform: translateY(-12px) rotate(-4deg); }
}
@keyframes float-b {
  0%,100% { transform: translateY(0) rotate(2deg); }
  50%     { transform: translateY(-16px) rotate(4deg); }
}
@keyframes float-c {
  0%,100% { transform: translateY(0) rotate(7deg); }
  50%     { transform: translateY(-10px) rotate(5deg); }
}
@keyframes pulse-q {
  0%,100% { opacity: 1;   text-shadow: 0 0 0 rgba(255,255,255,0); }
  50%     { opacity: 0.85; text-shadow: 0 0 22px rgba(255,255,255,0.55); }
}

/* "?" connector arrows behind badges */
.badge-arrows {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
}

/* =============== step container + transitions =============== */

.step-card {
  background: #fff;
  border-radius: var(--card-radius);
  padding: clamp(24px, 4vw, 44px);
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(45,90,39,0.06);
}

.step-shell {
  max-width: var(--reading-max);
  margin: 0 auto;
}

.step-counter {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-light);
  font-weight: 700;
  margin-bottom: 12px;
}

.step-question {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  color: var(--green-deep);
  line-height: 1.15;
  margin-bottom: 8px;
}

.step-helper {
  color: var(--text-mute);
  margin-bottom: 26px;
}

.step-anim-in {
  animation: step-in 320ms var(--ease-out) both;
}
@keyframes step-in {
  from { opacity: 0; transform: translateX(36px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* =============== reveal page =============== */

.reveal-shell {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  padding: clamp(20px, 4vw, 48px) 0;
}

.reveal-stage {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.reveal-prelude {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--green-primary);
  letter-spacing: 0.01em;
}

.reveal-prelude .dots span {
  display: inline-block;
  width: 6px; height: 6px;
  margin: 0 2px;
  background: var(--green-primary);
  border-radius: 50%;
  opacity: 0.3;
  animation: dot-pulse 1.4s infinite ease-in-out;
}
.reveal-prelude .dots span:nth-child(2) { animation-delay: 0.2s; }
.reveal-prelude .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-pulse {
  0%,100% { opacity: 0.3; transform: translateY(0); }
  50%     { opacity: 1;   transform: translateY(-4px); }
}

.reveal-sign {
  position: relative;
  width: clamp(220px, 36vw, 360px);
  aspect-ratio: 1 / 1.08;
  display: grid;
  place-items: center;
}
.reveal-halo {
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: radial-gradient(closest-side,
              rgba(74,124,66,0.30),
              rgba(74,124,66,0) 70%);
  opacity: 0;
  transition: opacity 800ms ease;
  pointer-events: none;
}
.reveal-stage.act-3 .reveal-halo { opacity: 1; }

.reveal-num {
  position: relative;
  z-index: 2;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(5.5rem, 16vw, 9.5rem);
  line-height: 1;
  color: var(--green-deep);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 14px rgba(45,90,39,0.18);
}

.reveal-band {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3.6vw, 2.1rem);
  color: var(--green-primary);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms ease, transform 600ms var(--ease-out);
}
.reveal-stage.act-3 .reveal-band {
  opacity: 1; transform: translateY(0);
}

.reveal-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  width: 100%;
  max-width: 640px;
  margin-top: 4px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 700ms 200ms ease, transform 700ms 200ms var(--ease-out);
}
.reveal-stage.act-3 .reveal-range {
  opacity: 1; transform: translateY(0);
}
.reveal-range .r-block {
  padding: 18px;
  border-radius: 14px;
  border: 1.5px solid;
  text-align: center;
  background: #fff;
}
.reveal-range .r-loss { border-color: rgba(192,57,43,0.25); }
.reveal-range .r-gain { border-color: rgba(45,90,39,0.25); }
.reveal-range .r-pct {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1;
}
.reveal-range .r-loss .r-pct { color: var(--accent-red); }
.reveal-range .r-gain .r-pct { color: var(--green-primary); }
.reveal-range .r-dollars {
  font-variant-numeric: tabular-nums;
  color: var(--text-mute);
  margin-top: 6px;
}

.reveal-explainer {
  max-width: 580px;
  color: var(--text-mute);
  font-size: 1.02rem;
  margin-top: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 700ms 400ms ease, transform 700ms 400ms var(--ease-out);
}
.reveal-stage.act-3 .reveal-explainer {
  opacity: 1; transform: translateY(0);
}

.reveal-cta {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 700ms 600ms ease, transform 700ms 600ms var(--ease-out);
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.reveal-stage.act-3 .reveal-cta {
  opacity: 1; transform: translateY(0);
}

/* shield/sign SVG container fills */
.sign-svg {
  position: absolute;
  inset: 0;
  z-index: 1;
  filter: drop-shadow(0 18px 30px rgba(45,90,39,0.25));
}

/* =============== upload page =============== */

.dropzone {
  border: 2.5px dashed var(--green-light);
  border-radius: 18px;
  background: #fff;
  padding: 56px 24px;
  text-align: center;
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
  cursor: pointer;
}
.dropzone:hover,
.dropzone.is-drag {
  background: var(--green-mist);
  border-color: var(--green-primary);
  transform: translateY(-1px);
}
.dropzone .dz-icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--green-mist);
  color: var(--green-primary);
}
.dropzone .dz-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--green-deep);
  margin-bottom: 6px;
}
.dropzone .dz-sub {
  color: var(--text-mute);
  font-size: 0.92rem;
}
.dropzone input[type="file"] { display: none; }

.chip-list {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 22px;
}
.chip {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--green-edge);
  border-radius: 12px;
  padding: 12px 16px;
}
.chip .chip-icon {
  width: 36px; height: 36px;
  background: var(--green-mist);
  color: var(--green-primary);
  border-radius: 8px;
  display: grid; place-items: center;
}
.chip .chip-main { min-width: 0; }
.chip .chip-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip .chip-meta {
  font-size: 0.78rem; color: var(--text-mute);
  margin-top: 2px;
}
.chip .chip-bar {
  margin-top: 6px;
  height: 5px;
  background: var(--green-mist);
  border-radius: 999px;
  overflow: hidden;
}
.chip .chip-bar .fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green-light), var(--green-primary));
  transition: width 180ms ease;
}
.chip.is-done .chip-bar .fill { width: 100% !important; }
.chip.is-error { border-color: rgba(192,57,43,0.4); }
.chip.is-error .chip-bar .fill { background: var(--accent-red); }
.chip .chip-state {
  font-size: 0.78rem;
  color: var(--text-mute);
  font-weight: 600;
}
.chip.is-done .chip-state { color: var(--green-primary); }
.chip.is-error .chip-state { color: var(--accent-red); }

/* =============== methodology =============== */

.doc {
  max-width: var(--reading-max);
  margin: 0 auto;
}
.doc h2 { margin-top: 36px; }
.doc h3 { margin-top: 24px; color: var(--green-primary); }
.doc p, .doc li { color: var(--text-dark); }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc .cite {
  font-size: 0.85rem;
  color: var(--text-mute);
  font-style: italic;
}

/* =============== done page =============== */

.done-shell {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: 48px 0;
}
.done-check {
  width: 80px; height: 80px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--green-primary);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 22px 38px -16px rgba(45,90,39,0.55);
  animation: pop-in 600ms var(--ease-out) both;
}
@keyframes pop-in {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

.advisor-callout {
  margin-top: 30px;
  padding: 24px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--green-edge);
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  text-align: left;
  flex-wrap: wrap;
}
.advisor-callout .a-name {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--green-deep);
}
.advisor-callout .a-meta { color: var(--text-mute); font-size: 0.92rem; }
.advisor-callout a { display: block; }

/* =============== accessibility =============== */

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

:focus-visible {
  outline: 3px solid rgba(52,120,214,0.45);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .badge { animation: none !important; }
}

/* =============== utilities =============== */

.stack-sm > * + * { margin-top: 10px; }
.stack    > * + * { margin-top: 18px; }
.stack-lg > * + * { margin-top: 30px; }

.flex { display: flex; gap: 12px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.center { text-align: center; }
.spacer { flex: 1; }
.hidden { display: none !important; }


.rail .advisor-card .advisor-photo {
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  margin: 8px auto 10px auto;
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

.rail .advisor-card .creds { font-size: 11.5px; opacity: 0.82; margin-top: 2px; letter-spacing: 0.1px; }


.signature-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-mute);
  margin-bottom: 14px;
  letter-spacing: 0.005em;
}
.signature-line .sig-name {
  font-style: normal;
  font-weight: 600;
  color: var(--green-light);
  border-bottom: 1px solid rgba(74,124,66,0.35);
  padding-bottom: 1px;
}
.signature-line .sig-firm {
  font-style: normal;
  color: var(--green-light);
  font-weight: 500;
}


.bracket-card .b-arrow {
  display: inline-block;
  vertical-align: -5px;
  opacity: 0.85;
}
.bracket-card .b-arrow-l { margin-right: 4px; }
.bracket-card .b-arrow-r { margin-left:  4px; }

/* ===========================================================================
 * Phone-tight overrides.
 * On screens <=640px the hero badge art was eating the first scroll and the
 * headline+CTA fell below the fold. Shrinks hero padding, headline, sub copy,
 * and rail header so "What's your Risk IQ?" + the "Get my Risk IQ" button
 * land on screen without the user scrolling.
 * =========================================================================== */
@media (max-width: 640px) {
  .rail {
    padding: 14px var(--gutter-page);
    gap: 8px;
  }
  .rail .firm-block .firm-tag {
    display: none;
  }
  .rail .advisor-card {
    padding: 10px 12px;
    gap: 4px;
  }
  .rail .advisor-card .creds { display: none; }
  .rail .advisor-card .advisor-photo {
    width: 48px;
    height: 48px;
  }

  .hero {
    padding: 16px 0 8px;
    gap: 14px;
  }
  .hero .hero-headline {
    font-size: 2.1rem;
    margin-bottom: 10px;
    line-height: 1.05;
  }
  .hero .hero-sub {
    font-size: 1rem;
    margin-bottom: 16px;
  }
  .hero .btn-row {
    margin-bottom: 10px;
  }
  .hero .hero-points {
    margin-top: 14px;
    gap: 12px;
    font-size: 0.85rem;
  }
  .hero-art { display: none; }
  .main-inner { padding-top: 4px; }
}

/* Bracketing card arrow rows.
 * Up = green stacked triangles, down = red stacked triangles.
 * Count is set by Jinja (1-3 for steps 7-8, 2-4 for step 9), so MORE risk
 * = more arrows. We also scale each glyph up slightly for cards with more
 * arrows so the visual weight grows quadratically with risk. */
.b-arrows {
  display: flex;
  gap: 2px;
  align-items: center;
  line-height: 0;
  margin: 4px 0;
}
.b-arrows.up    { justify-content: flex-end; }
.b-arrows.down  { justify-content: flex-end; }
.b-arrow-icon {
  flex: none;
}
.b-arrow-icon.up    { color: #1d7a3a; }   /* green, upside */
.b-arrow-icon.down  { color: #b03038; }   /* red, downside */

/* Bigger arrow icons on cards with more of them. We can't reliably read
 * the rendered child count from CSS, so we use child-count selectors. */
.b-arrows > :nth-child(1):nth-last-child(1)              { width: 14px; height: 14px; }
.b-arrows > :nth-child(1):nth-last-child(2),
.b-arrows > :nth-child(2):nth-last-child(1)              { width: 16px; height: 16px; }
.b-arrows > :nth-child(1):nth-last-child(3),
.b-arrows > :nth-child(2):nth-last-child(2),
.b-arrows > :nth-child(3):nth-last-child(1)              { width: 18px; height: 18px; }
.b-arrows > :nth-child(1):nth-last-child(4),
.b-arrows > :nth-child(2):nth-last-child(3),
.b-arrows > :nth-child(3):nth-last-child(2),
.b-arrows > :nth-child(4):nth-last-child(1)              { width: 22px; height: 22px; }

/* Resume card — shown to returning visitors with an unfinished assessment. */
.resume-card {
  background: rgba(45, 90, 39, 0.06);
  border: 1px solid rgba(45, 90, 39, 0.18);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
  max-width: 520px;
}
.resume-card .resume-eyebrow {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--green-deep);
  margin-bottom: 4px;
}
.resume-card .resume-line {
  color: var(--text-mute);
  font-size: 0.95rem;
  margin-bottom: 10px;
}
.resume-card .btn-row { margin-bottom: 0; }

/* ==========================================================================
 * Bracketing arrows v2 — inside the upside/downside boxes, stacked with
 * negative margin so 1/2/3 arrows read as a single ascending "weight" icon.
 *
 *   c0 (Less Risk / Stay Here)   → blue, single
 *   c1 (Original / More Reward)  → green, double-overlap
 *   c2 (More Reward / Even More) → red-pink, triple-overlap (largest)
 *
 * .step9 shifts the count up by one so even the left card has a stack.
 * ========================================================================== */

/* Hide the old v1 row-of-arrows rendering if any survives the patch. */
.b-arrows.up, .b-arrows.down { display: none !important; }

.b-stack {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  margin-top: 6px;
  /* arrows visually stack via negative margin between siblings */
}
.b-stack .b-arrow-icon {
  flex: none;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.18));
}
.b-stack .b-arrow-icon + .b-arrow-icon {
  margin-left: -8px;          /* overlap the prior triangle */
}

/* ---- colour by card position ------------------------------------------- */
.b-stack.c0 { color: #2563eb; }   /* blue — less risk */
.b-stack.c1 { color: #15803d; }   /* green — original */
.b-stack.c2 { color: #d6336c; }   /* red/pink — more risk */

/* ---- size per arrow grows with the stack so the right-most card visibly
 *      DOMINATES (bigger triangles + more of them).
 *      The CSS selectors below count children at render time. ---------- */
/* 1 child */
.b-stack > :nth-child(1):nth-last-child(1) { width: 22px; height: 22px; }
/* 2 children — first slightly smaller, second medium */
.b-stack > :nth-child(1):nth-last-child(2) { width: 22px; height: 22px; }
.b-stack > :nth-child(2):nth-last-child(1) { width: 28px; height: 28px; }
/* 3 children — small / medium / large ascending */
.b-stack > :nth-child(1):nth-last-child(3) { width: 18px; height: 18px; opacity: 0.55; }
.b-stack > :nth-child(2):nth-last-child(2) { width: 26px; height: 26px; opacity: 0.78; }
.b-stack > :nth-child(3):nth-last-child(1) { width: 34px; height: 34px; }
/* 4 children — for step 9 c2 (Even More) — quadruple stack */
.b-stack > :nth-child(1):nth-last-child(4) { width: 16px; height: 16px; opacity: 0.45; }
.b-stack > :nth-child(2):nth-last-child(3) { width: 22px; height: 22px; opacity: 0.65; }
.b-stack > :nth-child(3):nth-last-child(2) { width: 30px; height: 30px; opacity: 0.85; }
.b-stack > :nth-child(4):nth-last-child(1) { width: 38px; height: 38px; }

/* ---- tint the WHOLE card by colour, not just the arrows ---------------- */
.bracket-card {
  position: relative;
}
.bracket-grid .bracket-card:nth-child(1) {
  border-color: rgba(37, 99, 235, 0.30);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(255,255,255,0));
}
.bracket-grid .bracket-card:nth-child(2) {
  border-color: rgba(21, 128, 61, 0.32);
  background: linear-gradient(180deg, rgba(21, 128, 61, 0.06), rgba(255,255,255,0));
}
.bracket-grid .bracket-card:nth-child(3) {
  border-color: rgba(214, 51, 108, 0.35);
  background: linear-gradient(180deg, rgba(214, 51, 108, 0.07), rgba(255,255,255,0));
}
/* selected state gets a stronger ring in the card's colour */
.bracket-grid .bracket-card:nth-child(1)[aria-pressed="true"] {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.55) inset;
}
.bracket-grid .bracket-card:nth-child(2)[aria-pressed="true"] {
  box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.55) inset;
}
.bracket-grid .bracket-card:nth-child(3)[aria-pressed="true"] {
  box-shadow: 0 0 0 2px rgba(214, 51, 108, 0.60) inset;
}
