/* ==========================================================================
   STEP Wellbeing, site layer
   Sits on top of _ds tokens. The design system defines colour, type families
   and shape. This file adds the web type scale, layout primitives and the
   components the site needs. Nothing here overrides a token value.
   ========================================================================== */

:root {
  /* Fluid web type scale, the DS ships deck (1920x1080) and A4 scales only */
  --w-display-1: clamp(2.15rem, 1.4rem + 3.0vw, 3.75rem);
  --w-display-2: clamp(1.72rem, 1.3rem + 1.85vw, 2.65rem);
  --w-display-3: clamp(1.24rem, 1.05rem + 0.8vw, 1.62rem);
  --w-display-4: clamp(1.12rem, 1.03rem + 0.4vw, 1.35rem);
  --w-lead:      clamp(1.04rem, 0.98rem + 0.3vw, 1.2rem);
  --w-body:      1.0625rem;
  --w-small:     0.9375rem;
  --w-micro:     0.8125rem;
  --w-kicker:    0.75rem;

  /* Layout */
  --wrap: 1240px;
  --wrap-narrow: 780px;
  --gutter: clamp(20px, 5vw, 40px);
  --section-y: clamp(52px, 6vw, 88px);
  --section-y-tight: clamp(38px, 4.2vw, 58px);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.68, 0.28, 1);
  --lift: 1100ms;
}

/* ---------- base ---------- */

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--w-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--navy); }

b, strong { font-weight: 700; color: var(--navy); }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--green);
  color: var(--on-green-deep);
  font-weight: 800;
  padding: 12px 20px;
  border-radius: 0 0 10px 0;
  z-index: 999;
}
.skip:focus { left: 0; }

/* ---------- layout primitives ---------- */

.band { padding: var(--section-y) var(--gutter); }
.band--tight { padding: var(--section-y-tight) var(--gutter); }
.band--white { background: #fff; }
.band--mist  { background: var(--mist); }
.band--navy  { background: var(--navy); }
.band--deep  { background: var(--navy-deep); }

.wrap { max-width: var(--wrap); margin: 0 auto; }
.wrap--narrow { max-width: var(--wrap-narrow); margin: 0 auto; }

.stack > * + * { margin-top: var(--gap, 20px); }

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
@media (min-width: 900px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

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

.kicker {
  font-size: var(--w-kicker);
  font-weight: 700;
  letter-spacing: var(--kicker-tracking);
  text-transform: uppercase;
  color: var(--teal);
  margin: 0;
}
.kicker--green { color: var(--green); }
.kicker--bright { color: var(--teal-bright); }
.kicker--amber { color: var(--amber-deep); }

.h1 { font-size: var(--w-display-1); font-weight: 700; line-height: 1.02; letter-spacing: -0.015em; }
.h2 { font-size: var(--w-display-2); font-weight: 700; line-height: 1.06; letter-spacing: -0.01em; }
.h3 { font-size: var(--w-display-3); font-weight: 700; line-height: 1.12; }
.h4 { font-size: var(--w-display-4); font-weight: 700; line-height: 1.2; }

.lead { font-size: var(--w-lead); line-height: 1.52; color: var(--ink); }
.small { font-size: var(--w-small); }
.micro { font-size: var(--w-micro); }
.muted { color: var(--ink-soft); }

.on-dark { color: #fff; }
.on-dark .h1, .on-dark .h2, .on-dark .h3, .on-dark .h4 { color: #fff; }
.on-dark .lead { color: var(--ondark-soft); }
.on-dark .muted { color: var(--ondark-muted); }
.on-dark b, .on-dark strong,
.door--two b, .door--two strong,
.card-dark b, .card-dark strong,
.band--navy b, .band--navy strong,
.band--deep b, .band--deep strong { color: #fff; }
/* Exclude buttons: .on-dark a (0,1,1) would otherwise outrank .btn--primary (0,1,0)
   and paint green text onto a green button. */
.on-dark a:not(.btn) { color: var(--green); }
.on-dark a:not(.btn):hover { color: #fff; }

.measure { max-width: 62ch; }
.measure-tight { max-width: 52ch; }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--r-pill);
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: var(--w-body);
  font-weight: 800;
  line-height: 1.2;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
  min-height: 48px;
  text-align: center;
}
.btn--primary { background: var(--green); color: var(--on-green-deep); }
.btn--primary:hover { background: var(--emerald); color: #fff; }

.btn--ghost { border: 1.5px solid var(--line-strong); color: var(--navy); background: transparent; }
.btn--ghost:hover { border-color: var(--navy); background: var(--mist); }
.btn--ghost-dark { border-color: rgba(255,255,255,.38); color: #fff; }
.btn--ghost-dark:hover { border-color: var(--green); color: var(--green); }

.btn--ghost-light { border-color: var(--line-strong); color: var(--navy); }
.btn--ghost-light:hover { border-color: var(--navy); background: var(--mist); color: var(--navy); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

.arrow-link {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.arrow-link::after { content: "→"; transition: transform 160ms var(--ease); }
.arrow-link:hover::after { transform: translateX(4px); }

/* ---------- cards ---------- */

.card {
  background: var(--mist);
  border-radius: var(--r-card);
  padding: 26px 26px 30px;
}
.band--mist .card { background: #fff; }
.card--accent { border-top: var(--bar-top) solid var(--green); }
.card--teal   { border-top: var(--bar-top) solid var(--teal); }
.card--emerald{ border-top: var(--bar-top) solid var(--emerald); }
.card--amber  { border-top: var(--bar-top) solid var(--amber); }
.card--bright { border-top: var(--bar-top) solid var(--teal-bright); }

.card-dark {
  background: var(--surface-card-on-dark);
  border-radius: var(--r-card);
  padding: 26px 26px 30px;
  border: 1px solid var(--line-on-dark);
}

.pill {
  display: inline-block;
  border-radius: var(--r-pill);
  padding: 6px 15px;
  font-size: var(--w-micro);
  font-weight: 800;
  letter-spacing: .04em;
  background: var(--mist-2);
  color: var(--navy);
}
.pill--green { background: var(--green); color: var(--on-green-deep); }
.pill--outline-dark { background: none; border: 1.5px solid var(--border-pill-on-dark); color: #fff; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.on-dark .rule, .rule--dark { background: var(--line-on-dark); }

/* dot list, the DS bullet language */
.dotlist { list-style: none; margin: 0; padding: 0; }
.dotlist li {
  position: relative;
  padding-left: 24px;
  margin-top: 12px;
  line-height: 1.5;
}
.dotlist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .52em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}
.dotlist li:nth-child(3n+2)::before { background: var(--emerald); }
.dotlist li:nth-child(3n+3)::before { background: var(--teal); }

/* ==========================================================================
   SIGNATURE, the capacity ceiling
   A bottom-anchored stack. Structure bands build in beneath, prevention grows
   into the space they create, and the ceiling rises. Demand never changes
   size, because STEP does not reduce demand.
   ========================================================================== */

.ceiling { display: grid; grid-template-columns: 1fr; gap: 34px; }
@media (min-width: 900px) {
  .ceiling { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
}

.ceiling__stage {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  height: 470px;
  padding: 0;
  border-radius: var(--r-panel);
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line-on-dark);
  overflow: hidden;
}

/* stack members, bottom to top in source order */
.ceiling__structure {
  display: flex;
  flex-direction: column-reverse;
  height: 0;
  overflow: hidden;
  transition: height var(--lift) var(--ease);
}
.is-lifted .ceiling__structure { height: 156px; }

.ceiling__slab {
  height: 52px;
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  color: var(--on-teal);
  font-weight: 800;
  font-size: var(--w-small);
  letter-spacing: .01em;
  border-top: 1px solid rgba(255,255,255,.28);
}
.ceiling__slab span {
  font-weight: 600;
  font-size: var(--w-micro);
  letter-spacing: 0;
  opacity: .78;
}
.ceiling__slab--systems     { background: var(--teal-bright); color: var(--on-teal-bright); }
.ceiling__slab--supervision { background: var(--teal); color: var(--on-teal); }
.ceiling__slab--workforce   { background: var(--emerald); color: var(--on-green); }

.ceiling__demand {
  height: 120px;
  flex: 0 0 120px;
  background: rgba(255,255,255,.09);
  border-top: 2px solid var(--amber);
  display: flex;
  align-items: flex-start;
  padding: 12px 18px;
  gap: 10px;
  color: var(--ondark-body);
}

.ceiling__prevention {
  height: 26px;
  flex: 0 0 26px;
  background: var(--green);
  color: var(--on-green-deep);
  display: flex;
  align-items: center;
  padding: 0 18px;
  overflow: hidden;
  transition: height var(--lift) var(--ease), flex-basis var(--lift) var(--ease);
}
.is-lifted .ceiling__prevention { height: 100px; flex-basis: 100px; }

.ceiling__bar {
  flex: 0 0 auto;
  position: relative;
  padding: 0 18px 9px;
  border-bottom: 3px solid rgba(255,255,255,.55);
  transition: border-color var(--lift) var(--ease);
}
.is-lifted .ceiling__bar { border-bottom-color: var(--green); }

.ceiling__label {
  font-size: var(--w-kicker);
  font-weight: 800;
  letter-spacing: var(--kicker-tracking);
  text-transform: uppercase;
  line-height: 1.3;
}
.ceiling__demand .ceiling__label { color: var(--amber); }
.ceiling__bar .ceiling__label { color: #fff; }

.ceiling__sub {
  display: block;
  font-size: var(--w-micro);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ondark-muted);
  margin-top: 3px;
}

/* prevention label swaps as it grows */
.ceiling__prevention .ceiling__label { color: var(--on-green-deep); white-space: nowrap; }
.ceiling__prevention .ceiling__sub { color: rgba(6,40,15,.72); opacity: 0; transition: opacity 420ms var(--ease) 520ms; }
.is-lifted .ceiling__prevention .ceiling__sub { opacity: 1; }

/* headroom hint above the bar */
.ceiling__head {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 14px 18px 8px;
  min-height: 0;
}
.ceiling__head span {
  font-size: var(--w-micro);
  color: var(--ondark-muted);
  opacity: 0;
  transition: opacity 400ms var(--ease) 700ms;
}
.is-lifted .ceiling__head span { opacity: 1; }

/* toggle */
.ceiling__switch {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line-on-dark);
  gap: 3px;
}
.ceiling__switch button {
  appearance: none;
  border: 0;
  background: none;
  border-radius: var(--r-pill);
  padding: 9px 18px;
  font-family: var(--font-body);
  font-size: var(--w-micro);
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ondark-muted);
  cursor: pointer;
  min-height: 40px;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.ceiling__switch button:hover { color: #fff; }
.ceiling__switch button[aria-pressed="true"] { background: var(--green); color: var(--on-green-deep); }

/* ---------- two doors ---------- */

.doors { display: grid; gap: 18px; }
@media (min-width: 880px) { .doors { grid-template-columns: 1fr 1fr; gap: 22px; } }

.door {
  border-radius: var(--r-panel);
  padding: 30px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.door--one { background: var(--mist); border-top: 6px solid var(--teal); }
.door--two { background: var(--navy); border-top: 6px solid var(--green); color: #fff; }
.door--two .h3, .door--two .h4 { color: #fff; }

.door__index {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 60px;
  line-height: .85;
  color: var(--teal);
  opacity: .28;
}
.door--two .door__index { color: var(--green); opacity: .42; }

/* the connector that encodes Stage One */
.stage-one {
  margin-top: 18px;
  border-radius: var(--r-card);
  background: var(--green);
  color: var(--on-green-deep);
  padding: 18px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
}
.stage-one b { color: var(--on-green-deep); }

/* ---------- domain scorecard strip ---------- */

.domains { display: grid; gap: 2px; border-radius: var(--r-doc); overflow: hidden; }
.domain-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  background: var(--mist);
  padding: 13px 18px;
  font-size: var(--w-small);
  font-weight: 600;
  color: var(--navy);
}
.band--mist .domain-row { background: #fff; }
.domain-row .pill { font-size: 11px; padding: 4px 12px; }
.domain-row--index { background: var(--mist-2); }
.band--mist .domain-row--index { background: var(--mist-2); }

/* ---------- tiers of support ---------- */

.tiers { display: grid; gap: 2px; border-radius: var(--r-doc); overflow: hidden; }
.tier {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 6px 18px;
  padding: 22px;
  background: var(--mist);
  align-items: start;
}
.band--mist .tier { background: #fff; }
.tier__n {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.3rem;
  line-height: .82;
  letter-spacing: -0.02em;
}
.tier--1 .tier__n { color: var(--tier-1); }
.tier--2 .tier__n { color: var(--tier-2); }
.tier--3 .tier__n { color: var(--tier-3); }
.tier__body h3 { font-size: var(--w-display-4); font-weight: 700; }
.tier__body p { margin-top: 8px; font-size: var(--w-small); line-height: 1.5; }
.tier__wps {
  grid-column: 2;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: var(--w-micro);
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.tier__wps i {
  font-style: normal;
  width: 9px; height: 9px;
  border-radius: 50%;
  flex: 0 0 9px;
  transform: translateY(1px);
}
.tier--1 .tier__wps i, .tier--2 .tier__wps i { background: var(--green); }
.tier--3 .tier__wps i { background: var(--amber); }
.tier__wps span { font-weight: 600; color: var(--ink-soft); }
@media (max-width: 520px) {
  .tier { grid-template-columns: 1fr; }
  .tier__wps { grid-column: 1; }
}

/* first-use gloss link */
.gloss {
  color: inherit;
  border-bottom: 1.5px dotted var(--teal);
  font-weight: inherit;
}
.gloss:hover { color: var(--teal); border-bottom-style: solid; }
.on-dark .gloss { color: inherit; border-bottom-color: var(--teal-bright); }
.on-dark .gloss:hover { color: var(--teal-bright); }

/* ---------- spec / price rows ---------- */

.rows { display: grid; gap: 2px; border-radius: var(--r-doc); overflow: hidden; }
.row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 10px 20px;
  background: var(--mist);
  padding: 15px 18px;
  font-size: var(--w-small);
  line-height: 1.45;
}
.band--mist .row { background: #fff; }
.row--head { background: var(--mist-2); }
.band--mist .row--head { background: var(--mist-2); }
.row__amt {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--navy);
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.row__amt--green { color: var(--emerald); }
.row span:first-child b { color: var(--navy); }
@media (max-width: 480px) {
  .row { grid-template-columns: 1fr; }
}

/* ---------- stats ---------- */

.stat__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 2rem + 2.4vw, 3.6rem);
  line-height: .9;
  color: var(--green);
  letter-spacing: -0.02em;
}
.stat__label { margin-top: 12px; font-size: var(--w-small); line-height: 1.45; color: var(--ondark-soft); }

/* ---------- callout ---------- */

.callout {
  border-left: var(--bar-left) solid var(--teal);
  background: var(--mist);
  border-radius: 0 var(--r-doc) var(--r-doc) 0;
  padding: 20px 24px;
}
.band--mist .callout { background: #fff; }
.callout--green { border-left-color: var(--green); }
.callout--amber { border-left-color: var(--amber); }

/* ---------- price line ---------- */

.price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--w-display-3);
  color: var(--navy);
  letter-spacing: -0.01em;
}
.door--two .price, .on-dark .price { color: var(--green); }
.price small { font-family: var(--font-body); font-size: var(--w-small); font-weight: 600; color: var(--ink-soft); }
.on-dark .price small { color: var(--ondark-muted); }

@media (max-width: 620px) {
  .ceiling__stage { height: 418px; }
  .is-lifted .ceiling__structure { height: 138px; }
  .ceiling__slab { height: 46px; flex-basis: 46px; padding: 0 14px; }
  .ceiling__slab span { display: none; }
  .ceiling__demand { height: 104px; flex-basis: 104px; padding: 10px 14px; }
  .is-lifted .ceiling__prevention { height: 88px; flex-basis: 88px; }
  .ceiling__prevention, .ceiling__bar, .ceiling__head { padding-left: 14px; padding-right: 14px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .ceiling__head span, .ceiling__prevention .ceiling__sub { transition-delay: 0ms; }
}
