/* ==========================================================================
   Outsourced Actuaries — outsourcedactuaries.us
   Palette: ink navy / paper / mist / signal blue / ember orange
   Type:    Archivo (headlines, UI) + Source Serif 4 (body prose)

   Motion system: one device, reused. A section's ember rule draws in, the
   heading wipes in behind it, then supporting content settles. Nothing else
   on the page moves unless a person acts on it.
   ========================================================================== */

:root {
  --ink:        #0E2140;
  --ink-deep:   #081528;
  --ink-soft:   #17304F;
  --paper:      #FFFFFF;
  --mist:       #EDF1F6;
  --rule:       #D3DCE7;
  --rule-navy:  rgba(255, 255, 255, 0.14);
  --blue:       #1F5FA8;
  --blue-lift:  #4C8AD1;
  --ember:      #F07E26;
  --ember-deep: #D2620F;
  --ember-glow: rgba(240, 126, 38, 0.28);
  --slate:      #46536B;
  --slate-mute: #6C7A92;

  --measure:    68ch;
  --gut:        clamp(1.25rem, 4vw, 2.5rem);
  --shell:      1180px;

  --ease:       cubic-bezier(0.22, 0.68, 0.24, 1);
  --ease-out:   cubic-bezier(0.16, 0.84, 0.44, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--slate);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; height: auto; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--ember-deep); }

/* The UA rule for [hidden] is display:none at very low specificity, so any
   class that sets display (.btn is inline-flex) silently beats it and the
   element stays on screen. Everything here is toggled via .hidden in JS, so
   this needs to win. */
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--ember);
  outline-offset: 3px;
  border-radius: 3px;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ember);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 300;
  font-family: "Archivo", system-ui, sans-serif;
}
.skip:focus { left: 0; }

/* ---------- type ---------- */

h1, h2, h3, h4, .ui {
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.15rem, 1.4rem + 3.1vw, 3.55rem); font-weight: 620; }
h2 { font-size: clamp(1.7rem, 1.2rem + 1.9vw, 2.6rem); }
h3 { font-size: clamp(1.12rem, 1.02rem + 0.42vw, 1.3rem); letter-spacing: -0.01em; }

p { margin: 0 0 1.1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: clamp(1.09rem, 1rem + 0.5vw, 1.32rem);
  line-height: 1.55;
}

/* ==========================================================================
   MOTION SYSTEM
   ========================================================================== */

/* the ember rule that opens every section — also the motion trigger */
.tick {
  width: 44px;
  height: 3px;
  background: var(--ember);
  border: 0;
  margin: 0 0 1.6rem;
  transform-origin: left center;
}
.tick--center { margin-inline: auto; transform-origin: center; }

@media (prefers-reduced-motion: no-preference) {
  .reveal-on .tick { transform: scaleX(0); transition: transform 0.55s var(--ease-out); }

  /* headings wipe in from the left, behind the rule */
  .reveal-on [data-wipe] {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.85s var(--ease) 0.18s;
  }

  /* supporting content settles — opacity only, no slide */
  .reveal-on [data-fade] {
    opacity: 0;
    transition: opacity 0.7s var(--ease) var(--d, 0.3s);
  }

  /* list items stagger via an index custom property */
  .reveal-on [data-stagger] > * {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
    transition-delay: calc(0.28s + var(--i, 0) * 0.035s);
  }

  /* Revealed states are declared after, at equal specificity, so they win. */
  .is-in .tick { transform: scaleX(1); }
  .is-in [data-wipe] { clip-path: inset(0 -0.2em 0 0); }
  .is-in [data-fade] { opacity: 1; }
  .is-in [data-stagger] > * { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}

/* ---------- sections ---------- */

.band { padding-block: clamp(3.75rem, 7vw, 7rem); position: relative; }
.band--mist { background: var(--mist); }
.band--navy { background: var(--ink); color: #C9D6E6; }
.band--navy h2, .band--navy h3 { color: #fff; }
.band + .band--mist,
.band--mist + .band { border-top: 1px solid var(--rule); }

.band__head { margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.band__head h2 { max-width: 26ch; }
.band__head .lede { margin-top: 1.25rem; max-width: var(--measure); }
.band__head .lede + .lede { margin-top: 0; }

/* ==========================================================================
   NAV — condenses on scroll, tracks the active section
   ========================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14, 33, 64, 0.82);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav.is-stuck {
  background: rgba(8, 21, 40, 0.95);
  border-bottom-color: var(--rule-navy);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.5rem;
  transition: min-height 0.3s var(--ease);
}
.nav.is-stuck .nav__inner { min-height: 3.85rem; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  margin-right: auto;
}
.brand img { width: 34px; height: 34px; transition: transform 0.4s var(--ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.brand span {
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  color: #fff;
  white-space: nowrap;
}

.nav__links {
  display: flex;
  gap: clamp(1rem, 2.2vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  position: relative;
  display: block;
  font-family: "Archivo", sans-serif;
  font-size: 0.9rem;
  font-weight: 450;
  color: #B7C7DB;
  text-decoration: none;
  padding-block: 0.45rem;
  transition: color 0.2s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--ember);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.32s var(--ease-out);
}
.nav__links a:hover { color: #fff; }
.nav__links a:hover::after,
.nav__links a[aria-current="true"]::after { transform: scaleX(1); }
.nav__links a[aria-current="true"] { color: #fff; }

@media (max-width: 900px) { .nav__links { display: none; } }

/* ---------- buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: "Archivo", sans-serif;
  font-size: 0.95rem;
  font-weight: 560;
  letter-spacing: -0.005em;
  padding: 0.8rem 1.55rem;
  border: 0;
  border-radius: 5px;
  background: var(--ember);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease),
              box-shadow 0.3s var(--ease);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255,255,255,0.3) 50%, transparent 75%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease);
}
.btn:hover {
  background: var(--ember-deep);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px -8px var(--ember-glow);
}
.btn:hover::before { transform: translateX(100%); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:disabled::before { display: none; }

.btn--lg { padding: 1.05rem 2.1rem; font-size: 1.03rem; }
.btn--nav { padding: 0.6rem 1.15rem; font-size: 0.88rem; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  box-shadow: none;
}
.btn--ghost:hover {
  background: transparent;
  color: var(--ink);
  border-color: var(--blue);
  box-shadow: none;
  transform: none;
}
.btn--ghost::before { display: none; }

@media (max-width: 480px) { .btn--lg { width: 100%; } }

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  position: relative;
  background: var(--ink-deep);
  color: #C9D6E6;
  overflow: hidden;
  padding-block: clamp(4.5rem, 11vw, 8.5rem) 0;
  isolation: isolate;
}

.hero__wash {
  position: absolute;
  inset: -20%;
  z-index: -3;
  background:
    radial-gradient(42% 46% at 22% 18%, rgba(31, 95, 168, 0.42), transparent 70%),
    radial-gradient(38% 42% at 82% 72%, rgba(240, 126, 38, 0.16), transparent 70%),
    radial-gradient(60% 60% at 50% 0%, rgba(76, 138, 209, 0.18), transparent 70%);
}
@media (prefers-reduced-motion: no-preference) {
  .hero__wash { animation: drift 26s ease-in-out infinite alternate; }
  @keyframes drift {
    from { transform: translate3d(-2.5%, -1.5%, 0) scale(1); }
    to   { transform: translate3d(2.5%, 2%, 0) scale(1.07); }
  }
}

.hero__grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(78% 68% at 50% 42%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(78% 68% at 50% 42%, #000 30%, transparent 100%);
}

/* follows the pointer; --mx/--my set in JS, defaults keep it centred */
.hero__spot {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    18rem 18rem at var(--mx, 50%) var(--my, 38%),
    rgba(240, 126, 38, 0.13),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  pointer-events: none;
}
.hero:hover .hero__spot { opacity: 1; }
@media (hover: none) { .hero__spot { display: none; } }

.hero__fan {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: clamp(9rem, 26vh, 15rem);
  pointer-events: none;
  /* the glow around the resolved point sits above this box's top edge */
  overflow: visible;
}

.hero__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-bottom: clamp(11rem, 30vh, 17rem);
}

.hero h1 { color: #fff; max-width: 26ch; margin-inline: auto; }
.hero .lede { color: #A9BCD4; margin: 1.6rem auto 2.6rem; max-width: 56ch; }
.hero__cta { display: flex; justify-content: center; }

/* one orchestrated page-load sequence */
@media (prefers-reduced-motion: no-preference) {
  .hero h1,
  .hero .lede,
  .hero__cta,
  .hero__cue {
    opacity: 0;
    animation: rise 0.9s var(--ease) forwards;
  }
  .hero .tick--center {
    opacity: 0;
    transform: scaleX(0);
    animation: tickIn 0.6s var(--ease-out) 0.1s forwards;
  }
  .hero h1    { animation-delay: 0.24s; }
  .hero .lede { animation-delay: 0.42s; }
  .hero__cta  { animation-delay: 0.56s; }
  .hero__cue  { animation-delay: 1.1s; }

  @keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
  }
  @keyframes tickIn {
    from { opacity: 0; transform: scaleX(0); }
    to   { opacity: 1; transform: scaleX(1); }
  }
}

/* scroll cue */
.hero__cue {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  transform: translateX(-50%);
  z-index: 3;
  display: grid;
  place-items: center;
  gap: 0.5rem;
  font-family: "Archivo", sans-serif;
  font-size: 0.74rem;
  font-weight: 450;
  color: #93A8C2;
  text-decoration: none;
  /* the cue sits over the scenario paths — this lifts it off them */
  text-shadow: 0 0 10px var(--ink-deep), 0 0 5px var(--ink-deep),
               0 0 2px var(--ink-deep);
}
.hero__cue:hover { color: #fff; }
.hero__cue i {
  display: block;
  width: 1px;
  height: 2.1rem;
  background: linear-gradient(to bottom, transparent, var(--ember));
}
@media (prefers-reduced-motion: no-preference) {
  .hero__cue i { animation: cue 2.4s var(--ease) 1.6s infinite; transform-origin: top center; }
  @keyframes cue {
    0%, 100% { transform: scaleY(0.4); opacity: 0.35; }
    45%      { transform: scaleY(1);   opacity: 1; }
  }
}
@media (max-height: 620px) { .hero__cue { display: none; } }

/* scenario paths */
.fan-path { fill: none; stroke: var(--blue-lift); stroke-width: 1; opacity: 0.26; }
.fan-path--live { stroke: var(--ember); stroke-width: 2; opacity: 0.95; }
.fan-dot { fill: var(--ember); }
/* fill comes from the radialGradient in the markup, not from here */
.fan-halo { opacity: 0.85; }

@media (prefers-reduced-motion: no-preference) {
  .fan-path {
    stroke-dasharray: 1800;
    stroke-dashoffset: 1800;
    animation: draw 1.9s var(--ease) 0.5s forwards;
  }
  .fan-dot { opacity: 0; animation: pop 0.5s var(--ease-out) 2.1s forwards; }
  /* Animating the SVG geometry property `r` rather than a transform: with
     transform-box: fill-box, Chromium takes the scaled circle's bounding
     box as the paint area and the soft edge gets clipped square. */
  .fan-halo { animation: halo 3.4s ease-in-out 2.4s infinite; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes pop  { to { opacity: 1; } }
  @keyframes halo {
    0%, 100% { r: 18px; opacity: 0.5; }
    50%      { r: 34px; opacity: 1; }
  }
}

/* ==========================================================================
   WHAT WE DO
   ========================================================================== */

.modes { border-top: 1px solid var(--rule); }

.mode {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: clamp(0.5rem, 3vw, 3rem);
  padding: clamp(1.75rem, 3.4vw, 2.5rem) 0;
  border-bottom: 1px solid var(--rule);
}
.mode::before {
  content: "";
  position: absolute;
  left: -1.1rem;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--ember);
  transform: scaleY(0);
  transform-origin: center top;
  transition: transform 0.4s var(--ease-out);
}
.mode:hover::before { transform: scaleY(1); }
.mode:hover h3 { color: var(--ember-deep); }
.mode h3 { transition: color 0.3s var(--ease); }
.mode__body p { max-width: 62ch; }

@media (max-width: 760px) {
  .mode { grid-template-columns: 1fr; gap: 0.65rem; }
  .mode::before { left: -0.85rem; }
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}
.tags li {
  font-family: "Archivo", sans-serif;
  font-size: 0.815rem;
  font-weight: 480;
  line-height: 1.3;
  color: var(--blue);
  background: rgba(31, 95, 168, 0.075);
  border: 1px solid rgba(31, 95, 168, 0.18);
  border-radius: 3px;
  padding: 0.3rem 0.6rem;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease),
              color 0.25s var(--ease);
}
.tags li:hover {
  background: rgba(240, 126, 38, 0.09);
  border-color: rgba(240, 126, 38, 0.4);
  color: var(--ember-deep);
}

/* ==========================================================================
   WHERE WE ADD VALUE
   ========================================================================== */

.domains {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(16rem, 27vw, 21rem), 1fr));
  border-top: 1px solid var(--rule);
}

.domain { padding: clamp(1.5rem, 2.6vw, 2.1rem) 0; border-bottom: 1px solid var(--rule); }
.domain h3 { margin-bottom: 0.9rem; }
.domain .tags { margin-top: 0; }

@media (min-width: 900px) {
  .domain { padding-inline: clamp(1.25rem, 2.4vw, 2rem); }
  .domain:not(:nth-child(3n + 1)) { border-left: 1px solid var(--rule); }
  .domain:nth-child(3n + 1) { padding-left: 0; }
}

/* ==========================================================================
   PROSE BANDS + the outcome-distribution figure
   ========================================================================== */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.28fr);
  gap: clamp(1.75rem, 5vw, 4.5rem);
  align-items: start;
}
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }
.split h2 { max-width: 22ch; }
.split h2 + p,
.split h2 + .lede { margin-top: 1.15rem; }

.figure { margin: 2.25rem 0 0; }
.figure svg { width: 100%; height: auto; overflow: visible; }
.figure figcaption {
  font-family: "Archivo", sans-serif;
  font-size: 0.79rem;
  color: var(--slate-mute);
  margin-top: 0.85rem;
  max-width: 36ch;
  line-height: 1.45;
}

.dist-bar { fill: var(--blue); opacity: 0.2; }
.dist-bar--peak { fill: var(--ember); opacity: 0.85; }
.dist-curve { fill: none; stroke: var(--blue); stroke-width: 1.5; opacity: 0.5; }
.dist-axis { stroke: var(--rule); stroke-width: 1; }
.dist-mean { stroke: var(--ember-deep); stroke-width: 1.5; stroke-dasharray: 3 3; }

@media (prefers-reduced-motion: no-preference) {
  .reveal-on .dist-bar {
    transform: scaleY(0);
    transform-box: fill-box;
    transform-origin: bottom center;
    transition: transform 0.6s var(--ease-out);
    transition-delay: calc(0.2s + var(--i, 0) * 0.045s);
  }
  .reveal-on .dist-curve {
    stroke-dasharray: 700;
    stroke-dashoffset: 700;
    transition: stroke-dashoffset 1.4s var(--ease) 0.5s;
  }
  .reveal-on .dist-mean { opacity: 0; transition: opacity 0.5s var(--ease) 1.2s; }

  .is-in .dist-bar { transform: scaleY(1); }
  .is-in .dist-curve { stroke-dashoffset: 0; }
  .is-in .dist-mean { opacity: 1; }
}

/* the four-step method */
.method { counter-reset: step; list-style: none; margin: 2rem 0 0; padding: 0; }
.method li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.1rem 2.6rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--rule);
  max-width: 62ch;
}
.method li:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.method li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1em;
  font-family: "Archivo", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ember);
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(240, 126, 38, 0.5);
  border-radius: 50%;
  background: var(--mist);
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
              border-color 0.3s var(--ease);
}
.method li:hover::before { background: var(--ember); border-color: var(--ember); color: #fff; }
.method strong {
  font-family: "Archivo", sans-serif;
  font-weight: 580;
  color: var(--ink);
  display: block;
  margin-bottom: 0.2rem;
}

/* ---------- U.S. presence ---------- */

.presence {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
}
@media (max-width: 880px) { .presence { grid-template-columns: 1fr; } }
.presence p { color: #B3C4D8; }

/* trusted partners — a quieter sub-block beneath the presence statement */
.partners {
  margin-top: clamp(2.25rem, 4vw, 3.25rem);
  padding-top: clamp(1.75rem, 3vw, 2.5rem);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.partners h3 { margin-bottom: 0.65rem; }
.partners p { color: #B3C4D8; max-width: 62ch; }
.partners p.partners__list {
  margin-top: 1.1rem;
  font-family: "Archivo", sans-serif;
  font-weight: 580;
  color: #fff;
}
.partners__list a {
  color: #fff;
  text-decoration-color: var(--ember);
  text-underline-offset: 0.25em;
}
.partners__list a:hover { color: var(--ember); }

/* ==========================================================================
   INTAKE — a stepped form on a dark panel
   ========================================================================== */

.intake {
  background: var(--ink-deep);
  color: #C9D6E6;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.intake__wash {
  position: absolute;
  inset: -30%;
  z-index: -1;
  background:
    radial-gradient(40% 44% at 18% 12%, rgba(31, 95, 168, 0.34), transparent 70%),
    radial-gradient(36% 40% at 88% 84%, rgba(240, 126, 38, 0.15), transparent 70%);
}
.intake h2 { color: #fff; }
.intake .lede { color: #A9BCD4; }

.intake__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
@media (max-width: 940px) { .intake__grid { grid-template-columns: 1fr; } }

.intake__aside p { color: #A9BCD4; max-width: 40ch; }
.intake__aside a { color: #fff; }

.reassure { list-style: none; margin: 1.75rem 0 0; padding: 0; }
.reassure li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.85rem;
  font-family: "Archivo", sans-serif;
  font-size: 0.9rem;
  color: #B3C4D8;
}
.reassure li:last-child { margin-bottom: 0; }
.reassure li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 3px rgba(240, 126, 38, 0.18);
}

/* the card */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 30px 70px -30px rgba(4, 12, 26, 0.7);
  overflow: hidden;
}

/* progress */
.steps {
  display: flex;
  border-bottom: 1px solid var(--rule);
  background: #FAFBFD;
}
.steps__item {
  flex: 1;
  padding: 1rem 0.85rem;
  border: 0;
  background: transparent;
  text-align: left;
  font-family: "Archivo", sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--slate-mute);
  cursor: pointer;
  position: relative;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.steps__item:not(:first-child) { border-left: 1px solid var(--rule); }
.steps__item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--ember);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s var(--ease-out);
}
.steps__item[aria-current="step"] { color: var(--ink); background: #fff; }
.steps__item[aria-current="step"]::after { transform: scaleX(1); }
.steps__item.is-done { color: var(--blue); }
.steps__item.is-done::after { transform: scaleX(1); background: var(--blue); opacity: 0.35; }
.steps__item:disabled { cursor: default; }

.steps__num {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: -0.3em;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease),
              color 0.25s var(--ease);
}
.steps__item[aria-current="step"] .steps__num {
  background: var(--ember);
  border-color: var(--ember);
  color: #fff;
}
.steps__item.is-done .steps__num { background: var(--blue); border-color: var(--blue); color: #fff; }

@media (max-width: 560px) {
  .steps__label { position: absolute; left: -9999px; }
  .steps__item { text-align: center; padding: 0.85rem 0; }
  .steps__num { margin-right: 0; }
}

.card__body { padding: clamp(1.5rem, 3.5vw, 2.5rem); }

/* panels */
.panel { display: none; }
.panel.is-active { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .panel.is-active { animation: panelIn 0.42s var(--ease-out); }
  @keyframes panelIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
  }
}
.panel > h3 { margin-bottom: 0.35rem; color: var(--ink); }
.panel__hint {
  font-family: "Archivo", sans-serif;
  font-size: 0.87rem;
  color: var(--slate-mute);
  margin: 0 0 1.5rem;
  max-width: 48ch;
}

/* fields */
.field { margin-bottom: 1.4rem; }
.field:last-child { margin-bottom: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 620px) { .row { grid-template-columns: 1fr; gap: 0; } }

label, legend, .field__label {
  display: block;
  font-family: "Archivo", sans-serif;
  font-size: 0.875rem;
  font-weight: 550;
  color: var(--ink);
  margin-bottom: 0.5rem;
  padding: 0;
}
.req { color: var(--ember-deep); }

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #FAFBFD;
  border: 1px solid #C3CFDD;
  border-radius: 6px;
  padding: 0.78rem 0.9rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease),
              background 0.2s var(--ease);
}
input::placeholder, textarea::placeholder { color: #98A6B9; }
input:hover, textarea:hover { border-color: var(--blue-lift); }
input:focus, textarea:focus {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 95, 168, 0.15);
  outline: none;
}
textarea { min-height: 8.5rem; resize: vertical; line-height: 1.55; }

.counter {
  font-family: "Archivo", sans-serif;
  font-size: 0.76rem;
  color: var(--slate-mute);
  text-align: right;
  margin: 0.35rem 0 0;
}

fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; }
fieldset:last-child { margin-bottom: 0; }

/* ---------- chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "Archivo", sans-serif;
  font-size: 0.875rem;
  font-weight: 460;
  color: var(--slate);
  background: #FAFBFD;
  border: 1px solid #C3CFDD;
  border-radius: 100px;
  padding: 0.5rem 0.95rem;
  margin: 0;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
              color 0.2s var(--ease), transform 0.16s var(--ease);
}
.chip:hover { border-color: var(--blue-lift); color: var(--ink); transform: translateY(-1px); }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }

.chip__tick {
  width: 0;
  height: 0.8rem;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  transition: width 0.22s var(--ease-out);
}
.chip__tick svg { width: 0.8rem; height: 0.8rem; display: block; }
.chip__tick path { stroke: currentColor; stroke-width: 2.6; fill: none; stroke-linecap: round; }

/* JS mirrors checked state onto the label, so this works everywhere */
.chip.is-checked {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.chip.is-checked .chip__tick { width: 0.8rem; }
.chip.is-checked:hover { background: var(--ink-soft); border-color: var(--ink-soft); }
.chip.is-focused { outline: 3px solid var(--ember); outline-offset: 2px; }

/* ---------- segmented control ---------- */

/* Dividers come from a 1px grid gap showing the container colour through,
   so they stay correct whether the control sits on one row or two — a
   border-left on each cell leaves a stray edge on the wrapped row. */
.segment {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: #C3CFDD;
  border: 1px solid #C3CFDD;
  border-radius: 6px;
  overflow: hidden;
}
@media (min-width: 1080px) {
  .segment { grid-template-columns: repeat(4, 1fr); }
}
.seg {
  position: relative;
  margin: 0;
  padding: 0.72rem 0.5rem;
  background: #FAFBFD;
  text-align: center;
  font-family: "Archivo", sans-serif;
  font-size: 0.85rem;
  font-weight: 470;
  color: var(--slate);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.seg:hover { background: #EFF3F8; color: var(--ink); }
.seg.is-checked { background: var(--blue); color: #fff; }
.seg.is-focused { outline: 3px solid var(--ember); outline-offset: -3px; }

.other-field { margin: 0.75rem 0 0; max-width: 24rem; }
.other-field[hidden] { display: none; }

/* ---------- errors, actions, status ---------- */

.err {
  font-family: "Archivo", sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: #B3320F;
  margin: 0.45rem 0 0;
}
.err[hidden] { display: none; }
.invalid input,
.invalid textarea { border-color: #B3320F; background: #FFF8F6; }
.invalid input:focus,
.invalid textarea:focus { box-shadow: 0 0 0 3px rgba(179, 50, 15, 0.16); }

.card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
  padding: 1.15rem clamp(1.5rem, 3.5vw, 2.5rem);
  border-top: 1px solid var(--rule);
  background: #FAFBFD;
}
.card__foot .form__note { margin-left: auto; }
.form__note {
  font-family: "Archivo", sans-serif;
  font-size: 0.8rem;
  color: var(--slate-mute);
  margin: 0;
  max-width: 30ch;
}
@media (max-width: 620px) {
  .card__foot { flex-direction: column; align-items: stretch; }
  .card__foot .btn { width: 100%; }
  .card__foot .form__note { margin-left: 0; max-width: none; text-align: center; }
}

.form-status { padding: clamp(1.75rem, 4vw, 2.75rem); }
.form-status[hidden] { display: none; }
.form-status h3 { margin-bottom: 0.5rem; }
.form-status p { margin: 0; }
.form-status__mark {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 1.1rem;
  background: rgba(240, 126, 38, 0.12);
  color: var(--ember-deep);
  font-family: "Archivo", sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
}
.form-status--bad .form-status__mark { background: rgba(179, 50, 15, 0.1); color: #B3320F; }

/* ---------- footer ---------- */

.foot {
  background: var(--ink);
  color: #93A8C2;
  padding-block: clamp(2.5rem, 5vw, 3.75rem);
  font-family: "Archivo", sans-serif;
  font-size: 0.875rem;
}
.foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2.5rem;
  align-items: center;
  justify-content: space-between;
}
.foot a { color: #CFDDEC; }
.foot a:hover { color: var(--ember); }
.foot__brand { display: inline-flex; align-items: center; gap: 0.65rem; }
.foot__brand img { width: 30px; height: 30px; }
.foot__brand strong { color: #fff; font-weight: 600; }
.foot p { margin: 0; max-width: none; }

/* ---------- narrow-screen nav ---------- */

@media (max-width: 560px) {
  .btn--nav { font-size: 0.82rem; padding: 0.55rem 0.85rem; white-space: nowrap; }
  .nav__inner { gap: 0.75rem; }
}
@media (max-width: 420px) { .brand span { display: none; } }
