/* HUMAN CONTEXT - progression component, refined integration.
   All classes namespaced hcp-. Compact landscape stage; the scrubber
   belongs to the centre column, close under the visual. Sized to sit as
   one editorial homepage section, not a full-screen application. */

.hcp {
  --hcp-forest: var(--forest, #2A342D);
  --hcp-ink: var(--ink-green, #203329);
  --hcp-olive: var(--olive, #62634B);
  --hcp-sage: var(--sage, #8A8D73);
  --hcp-rust: var(--rust, #A55736);
  --hcp-border: var(--border, #D8D3C7);
  --hcp-paper: var(--paper, #F5F1E8);
  --hcp-paper-light: var(--paper-light, #FAF7F0);
  --hcp-text-2: var(--text-2, #686B61);
  --hcp-display: var(--display, "Cormorant Garamond", Georgia, serif);
  --hcp-sans: var(--sans, "Inter", system-ui, -apple-system, sans-serif);
  --hcp-mono: var(--mono, "IBM Plex Mono", ui-monospace, monospace);
  --hcp-ease: var(--ease, cubic-bezier(0.22, 0.61, 0.36, 1));
  --hcp-chalk: #F3EEE3;
  --hcp-label: var(--fs-label, 0.6875rem);
}

/* section wrapper: this section shares the site's standard --shell (see
   styles.css :root and .hero, which the same variable drives), so its
   left/right boundary lines up with the Hero and every other homepage
   section instead of running on its own wider cap. */
.hcp-section {
  padding-top: clamp(1.375rem, 2.4vw, 2rem);
  padding-bottom: clamp(1.5rem, 2.6vw, 2.25rem);
}

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

.hcp-layout {
  display: grid;
  gap: clamp(0.875rem, 1.8vw, 1.375rem);
  grid-template-areas:
    "intro"
    "center"
    "rail"
    "detail";
}

@media (min-width: 48rem) and (max-width: 63.99rem) {
  .hcp-layout {
    grid-template-columns: 1fr 1fr;
    column-gap: var(--col-gap, 2rem);
    grid-template-areas:
      "intro detail"
      "center center"
      "rail rail";
  }
}

@media (min-width: 64rem) {
  .hcp-layout {
    grid-template-columns: 22fr 40fr 15fr 23fr;
    column-gap: clamp(1.25rem, 2vw, 1.75rem);
    grid-template-areas: "intro center rail detail";
    align-items: start;
  }
}

.hcp-intro { grid-area: intro; }
.hcp-center { grid-area: center; }
.hcp-rail { grid-area: rail; }
.hcp-detail { grid-area: detail; }

/* left intro ------------------------------------------------------------- */

.hcp-intro > * + * { margin-top: 0.55rem; }
.hcp-intro h2 { margin: 0; }
.hcp-intro p {
  margin: 0;
  margin-top: 1.35rem;
  font-size: clamp(0.78rem, 0.75rem + 0.12vw, 0.8125rem);
  line-height: 1.5;
}

/* The handwritten slider-note asset. It is art, not a reserved box: no
   fixed empty slot, just natural width sitting low in the intro column,
   right-aligned against the column's own right edge. */
.hcp-note-slot { margin-top: clamp(0.6rem, 1.4vw, 1rem); }
.hcp-note-slot img {
  display: block;
  width: clamp(120px, 13vw, 155px);
  height: auto;
  margin-left: auto;
  opacity: 0.92;
}

/* centre column: landscape stage with its own scrubber underneath -------- */

.hcp-center { min-width: 0; }
/* Capped only up through the tablet range, where .hcp-center spans both
   inner columns (see the 48-64rem grid above) and would otherwise balloon
   far taller than the content at low t. At desktop it's a single 40fr
   column and gets real room to grow as the section itself widens. */
.hcp-stage { width: 100%; max-width: 28rem; margin-inline: auto; }
@media (min-width: 64rem) {
  .hcp-stage { max-width: 46rem; }
}
.hcp-svg { display: block; width: 100%; height: auto; overflow: visible; }

.hcp-tone-forest { --hcp-c: var(--hcp-forest); }
.hcp-tone-olive { --hcp-c: var(--hcp-olive); }
.hcp-tone-sage { --hcp-c: var(--hcp-sage); }
.hcp-tone-chalk { --hcp-c: var(--hcp-chalk, #F3EEE3); }

/* watermark rings: a faint echo of the orbital mark, present mainly at
   Stages 1-2 and handed off to the watercolor field from Stage 3 on */
.hcp-ring {
  fill: none;
  stroke: var(--hcp-c, var(--hcp-sage));
  stroke-width: 0.75;
  vector-effect: non-scaling-stroke;
}

/* watercolor field washes. Opacity is set per frame in JS; the image
   elements themselves never show a hard square edge since the source PNGs
   are transparent outside the painted mark. */
.hcp-wash { pointer-events: none; }

/* Stroke rendering, Stroke C refined.
   JS writes two custom properties per path: --hcp-w (width in screen px from
   the keyframes) and --hcp-o (opacity from the keyframes). The role classes
   below rescale those so hierarchy is a real difference in weight. */
.hcp {
  --hcp-w-primary: 1.05;   --hcp-o-primary: 1;
  --hcp-w-secondary: 0.8;  --hcp-o-secondary: 0.85;
  --hcp-w-dashed: 0.8;     --hcp-o-dashed: 1;
  --hcp-w-ghost: 0.6;      --hcp-o-ghost: 0.15;
  --hcp-link-solid-w: 1.5; --hcp-link-dashed-w: 0.95;
  --hcp-link-dash: 3 4.5;
  --hcp-dot-stroke: 0.85;
}

.hcp-orbit {
  fill: none;
  stroke: var(--hcp-c, var(--hcp-olive));
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-width: calc(var(--hcp-w, 1) * var(--hcp-role-w, 1));
  opacity: calc(var(--hcp-o, 1) * var(--hcp-role-o, 1));
}
.hcp-orbit-ghost { stroke-dasharray: none; }

.hcp-role-primary   { --hcp-role-w: var(--hcp-w-primary);   --hcp-role-o: var(--hcp-o-primary); }
.hcp-role-secondary { --hcp-role-w: var(--hcp-w-secondary); --hcp-role-o: var(--hcp-o-secondary); }
.hcp-role-dashed    { --hcp-role-w: var(--hcp-w-dashed);    --hcp-role-o: var(--hcp-o-dashed); }
.hcp-role-ghost     { --hcp-role-w: var(--hcp-w-ghost);     --hcp-role-o: var(--hcp-o-ghost); }

.hcp-planet-fill { fill: var(--hcp-forest); stroke: none; }

.hcp-link { fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.hcp-link-solid { stroke: var(--hcp-forest); stroke-width: var(--hcp-link-solid-w, 1.7); }
.hcp-link-dashed { stroke: var(--hcp-olive); stroke-width: var(--hcp-link-dashed-w, 1.05); stroke-dasharray: var(--hcp-link-dash, 2.5 4); }

.hcp-node-dot {
  fill: var(--hcp-c, var(--hcp-sage));
  stroke: var(--hcp-forest);
  stroke-width: 1;
  stroke-opacity: var(--hcp-dot-stroke, 0.85);
}
.hcp-node-wash { fill: var(--hcp-c, var(--hcp-sage)); opacity: 0.12; }
.hcp-node-hi { fill: var(--hcp-paper); pointer-events: none; }

/* the orange subject: fixed centre, fixed size, fixed identity across every
   stage. Never scaled by the t-driven SCALE array. */
.hcp-subject { fill: var(--hcp-rust); }
.hcp-subject-ring { fill: none; stroke: var(--hcp-rust); stroke-width: 1; opacity: 0.35; }
.hcp-subject-halo { fill: var(--hcp-rust); opacity: 0.08; }
.hcp-subject-hi { fill: var(--hcp-paper); opacity: 0.2; pointer-events: none; }

/* scrubber ----------------------------------------------------------------
   pulled close under the visual, editorial-timeline feel rather than a
   browser-default range control. */

/* Purely navigational now: the rail carries stage names, so the slider is
   just a line, six stops, and a thumb. No labels above or below it. */
.hcp-scrub { margin-top: 0.7rem; }

.hcp-track { position: relative; height: 26px; }

/* the rail and the filled portion. The filled (selected) side reads
   noticeably stronger than the plain unselected line. */
.hcp-track::before,
.hcp-range-fill {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 3px;
  pointer-events: none;
}
.hcp-track::before { background: var(--hcp-border); }
.hcp-range-fill {
  background: var(--hcp-forest);
  opacity: 0.85;
  transform: scaleX(0);
  transform-origin: left center;
}

/* six stops: quiet dots that are also real click targets to jump straight
   to a stage, cleanly aligned on the line. */
.hcp-stop {
  position: absolute;
  top: 50%; left: 0;
  z-index: 2;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.hcp-stop::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #D8D3C7;
  border: none;
  opacity: 1;
  transition: background 160ms var(--hcp-ease), transform 160ms var(--hcp-ease);
}
.hcp-stop:hover::before { background: var(--hcp-olive); }
.hcp-stop:focus-visible::before { outline: 1.5px solid var(--hcp-olive); outline-offset: 3px; }
/* The thumb itself communicates the current stage; a stop that happens to
   sit under it should not double up as a second dark dot. */
.hcp-stop[aria-pressed="true"] { opacity: 0; pointer-events: none; }

.hcp-range {
  position: relative;
  z-index: 1;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 26px;
  margin: 0; padding: 0;
  background: transparent;
  cursor: pointer;
}
.hcp-range::-webkit-slider-runnable-track { height: 26px; background: transparent; }
.hcp-range::-moz-range-track { height: 26px; background: transparent; }

/* Editorial thumb: rust outer ring, then a single paper-light inset
   band, then the dark forest fill shows through for the centre - just
   three flat layers, no redundant middle ring. */
.hcp-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: 2px;
  border-radius: 50%;
  background: var(--hcp-forest);
  border: 2.25px solid var(--hcp-rust);
  box-shadow: inset 0 0 0 5.25px var(--hcp-paper-light);
  cursor: grab;
  transition: box-shadow 160ms var(--hcp-ease);
}
.hcp-range::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--hcp-forest);
  border: 2.25px solid var(--hcp-rust);
  box-shadow: inset 0 0 0 5.25px var(--hcp-paper-light);
  cursor: grab;
}
.hcp-range:active::-webkit-slider-thumb { cursor: grabbing; }
.hcp-range:focus-visible { outline: 1.5px solid var(--hcp-olive); outline-offset: 6px; border-radius: 20px; }

/* stage rail --------------------------------------------------------------
   six finalized icons, used as supplied. An unselected icon has a
   transparent background and renders in its native dark line-art; a
   selected icon sits on a dark forest circular badge and is flipped to
   off-white with a CSS filter, so no second asset is needed. */

.hcp-rail { display: flex; flex-direction: column; gap: 3px; }

.hcp-layer {
  display: grid;
  grid-template-columns: clamp(2.5rem, 3.2vw, 2.9rem) 1fr;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  min-height: 44px;
  text-align: left;
  cursor: pointer;
  color: var(--hcp-text-2);
  transition: background 200ms var(--hcp-ease), color 200ms var(--hcp-ease), box-shadow 200ms var(--hcp-ease);
}
.hcp-layer-name {
  font-family: var(--hcp-sans);
  font-size: clamp(0.8125rem, 0.77rem + 0.25vw, 0.9375rem);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: inherit;
}

/* The mark is just the icon frame - transparent at rest, sized ~1.7x the
   original small rail treatment for real visual presence. */
.hcp-layer-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(2.5rem, 3.2vw, 2.9rem); height: clamp(2.5rem, 3.2vw, 2.9rem);
  border-radius: 50%;
  background: transparent;
  flex: none;
  transition: background 200ms var(--hcp-ease);
}
.hcp-layer-mark img {
  width: 68%; height: 68%;
  object-fit: contain;
  display: block;
  transition: filter 200ms var(--hcp-ease);
}
.hcp-layer:hover { color: var(--hcp-ink); background: rgba(0, 0, 0, 0.018); }
.hcp-layer[aria-pressed="true"] {
  color: var(--hcp-ink);
  background: var(--hcp-paper-light);
  box-shadow: 0 1px 2px rgba(32, 51, 41, 0.06), 0 0 0 1px rgba(32, 51, 41, 0.05);
}
.hcp-layer[aria-pressed="true"] .hcp-layer-mark { background: var(--hcp-forest); }
.hcp-layer[aria-pressed="true"] .hcp-layer-mark img { filter: brightness(0) invert(1); }
.hcp-layer:focus-visible { outline: 1.5px solid var(--hcp-olive); outline-offset: -1px; }

/* active detail -------------------------------------------------------- */

.hcp-detail { border-left: 1px solid var(--hcp-border); padding-left: var(--s3, 1rem); max-width: 34rem; }

.hcp-panel h3 {
  font-family: var(--hcp-sans);
  font-size: clamp(0.6875rem, 0.66rem + 0.15vw, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hcp-forest);
  margin: 0 0 0.5rem;
}
.hcp-q {
  font-family: var(--hcp-sans);
  font-weight: 400;
  font-size: clamp(0.8375rem, 0.79rem + 0.3vw, 0.9375rem);
  line-height: 1.42;
  color: var(--hcp-ink);
  margin: 0 0 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--hcp-border);
}
.hcp-includes {
  margin: 0 0 0.35rem;
  font-family: var(--hcp-sans);
  font-size: clamp(0.8125rem, 0.78rem + 0.2vw, 0.875rem);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--hcp-text-2);
}
.hcp-list {
  margin: 0 0 0.6rem;
  padding-left: 1rem;
  list-style: disc;
  font-family: var(--hcp-sans);
  color: var(--hcp-text-2);
  font-size: clamp(0.8125rem, 0.78rem + 0.2vw, 0.875rem);
  line-height: 1.38;
}
.hcp-list li { margin-bottom: 0.14rem; }
.hcp-list li::marker { color: var(--hcp-sage); }

.hcp-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  font-family: var(--hcp-sans);
  font-size: clamp(0.8125rem, 0.78rem + 0.2vw, 0.875rem);
  font-weight: 500;
  color: var(--hcp-forest);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 180ms var(--hcp-ease);
}
.hcp-cta:hover { border-bottom-color: var(--hcp-forest); }
.hcp-cta-arrow { display: inline-block; transition: transform 180ms var(--hcp-ease); }
.hcp-cta:hover .hcp-cta-arrow { transform: translateX(3px); }

/* small screens ---------------------------------------------------------- */

@media (max-width: 47.99rem) {
  .hcp-section { padding-top: 1.75rem; padding-bottom: 1.75rem; }
  .hcp-detail { border-left: 0; border-top: 1px solid var(--hcp-border); padding-left: 0; padding-top: var(--s3, 1rem); }
  .hcp-note-slot { margin-top: var(--s3, 1rem); }
  .hcp-note-slot img { width: clamp(110px, 34vw, 140px); }
  .hcp-rail { flex-direction: row; flex-wrap: wrap; column-gap: 0.75rem; }
  .hcp-layer { width: auto; border-left: 0; border-bottom: 2px solid transparent; padding: 0.45rem 0.2rem 0.4rem 0; }
  .hcp-layer[aria-pressed="true"] { background: transparent; box-shadow: none; border-bottom-color: var(--hcp-forest); }
}

@media (prefers-reduced-motion: reduce) {
  .hcp-layer, .hcp-stop::before, .hcp-range-fill, .hcp-cta, .hcp-cta-arrow, .hcp-layer-mark, .hcp-layer-mark img { transition: none; }
}
