/* How it works: page-only layout. Shared components come from site.css. Prefix: .hw- */

/* Header: serif title left, grey lede right. */
@media (min-width: 900px) {
  .hw-head__inner { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--space-2xl); align-items: end; }
  .hw-head .page-head__lede { margin-top: 0; padding-bottom: 0.45em; }
}

/* =========================================================================
   The flow: four steps down a line. Each step has a square node on the line,
   the words, and a small card that plays itself the first time it is seen
   (page.js adds .is-on). The line under each node fills as the step scrolls
   up the screen (site.js writes --p on each [data-progress] step).
   With no script or reduced motion, every card shows its finished state.
   ========================================================================= */
/* The "Yours." stamp starts large; clip it so it never widens the page on phones. */
.hw-flow-sec { overflow-x: clip; }
.hw-flow { display: grid; }
.hw-step {
  --gap: var(--space-3xl);
  display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: var(--space-m);
  padding-bottom: var(--gap);
}
.hw-step__rail { position: relative; grid-row: span 2; }
.hw-step__node {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  background: var(--stage); box-shadow: inset 0 0 0 1.5px var(--ink); border-radius: var(--radius-s);
  font-weight: var(--weight-medium); font-size: 18px; font-variant-numeric: tabular-nums;
}
/* The line runs on through the step's bottom space to just above the next node. */
.hw-step__line { position: absolute; left: calc(50% - 1px); top: 48px; bottom: calc(8px - var(--gap)); width: 2px; background: var(--rule); }
.hw-step__line::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform-origin: 50% 0; transform: scaleY(var(--p, 1)); }
.hw-step:last-child { padding-bottom: 0; }
.hw-step:last-child .hw-step__line { display: none; }

.hw-step__text { padding-top: 2px; }
.hw-step__title { font-size: var(--text-xl); letter-spacing: var(--track-heading); line-height: 1.15; }
.hw-step__lead { margin-top: var(--space-s); font-size: 21px; line-height: 1.5; max-width: 34ch; }

.hw-step__card { margin-top: var(--space-xl); min-width: 0; }
.hw-step__card .stage__field { min-height: 0; padding: var(--space-xl); }
.hw-step__card .stage__panel { padding: var(--space-l); }
.hw-flow__note { margin-top: var(--space-xl); }

@media (min-width: 1000px) {
  .hw-step { grid-template-columns: 48px minmax(0, 5fr) minmax(0, 6fr); column-gap: var(--space-xl); }
  .hw-step__node { width: 48px; height: 48px; font-size: 20px; }
  .hw-step__line { top: 56px; }
  .hw-step__text { padding-top: 6px; }
  .hw-step__card { margin-top: 0; grid-column: 3; grid-row: 1 / span 2; }
}
@media (max-width: 600px) {
  .hw-step { --gap: var(--space-2xl); grid-template-columns: 32px minmax(0, 1fr); column-gap: var(--space-s); }
  .hw-step__node { width: 32px; height: 32px; font-size: 16px; }
  .hw-step__line { top: 40px; }
  .hw-step__lead { font-size: 18px; }
  .hw-step__card { margin-top: var(--space-l); }
  .hw-step__card .stage__field { margin-inline: 0; padding: var(--space-m) var(--space-xs); }
  .hw-step__card .stage__panel { padding: var(--space-m); }
  .hw-find { flex-direction: column; gap: var(--space-2xs); }
  .hw-find .hw-tag { order: -1; }
}

/* ---------- The cards ---------- */
.hw-card { display: grid; gap: var(--space-m); }
.hw-card > .start-again { justify-self: start; margin-top: calc(-1 * var(--space-2xs)); }
.hw-card__title { font-size: var(--text-s); font-weight: var(--weight-medium); color: var(--ink-2); }
.hw-tag {
  flex: none; display: inline-flex; align-items: center; min-height: 30px; padding: 2px 12px;
  background: var(--stage); box-shadow: inset 0 0 0 1.5px var(--ink); border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: var(--weight-medium); white-space: nowrap;
}
.hw-tick { flex: none; position: relative; width: 24px; height: 24px; background: var(--ink); border-radius: 4px; }
.hw-tick::after {
  content: ""; position: absolute; left: 8px; top: 3px; width: 6px; height: 12px;
  border: solid var(--white); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}

/* 1. We talk: a short interview. */
.hw-chat { display: grid; gap: 10px; }
.hw-bubble { max-width: 85%; padding: 10px 16px; border-radius: 18px; font-size: 17px; line-height: 1.35; }
.hw-bubble--me { justify-self: end; background: var(--ink); color: var(--on-ink); border-bottom-right-radius: 4px; }
.hw-bubble--them { justify-self: start; background: var(--pale); border-bottom-left-radius: 4px; }
.hw-noted { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); padding-top: var(--space-s); border-top: var(--rule-w) solid var(--rule); font-weight: var(--weight-medium); }

/* 2. I find what's slow: findings, each stamped. */
.hw-finds { display: grid; gap: var(--space-xs); }
.hw-find {
  display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-s);
  padding: var(--space-s); border: var(--rule-w) solid var(--rule); border-radius: var(--radius-s);
}
.hw-find__text { font-size: 17px; line-height: 1.4; }

/* 3. We fix it: four kinds of fix, one picked. */
.hw-options { display: grid; gap: var(--space-2xs); }
.hw-option {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-s); min-height: 48px; padding: 8px var(--space-s);
  border: var(--line-w) solid var(--line); border-radius: var(--radius-s); font-size: 17px; line-height: 1.3;
}
/* The options not picked stay readable (grey, 7.9:1) and get struck through. */
.hw-option[data-a="dim"] { color: var(--ink-2); border-color: var(--rule); text-decoration: line-through; text-decoration-color: var(--ink-2); }
.hw-option--picked { background: var(--stage); border-color: var(--ink); font-weight: var(--weight-medium); }
.hw-result { font-size: var(--text-l); font-weight: var(--weight-medium); letter-spacing: -0.015em; line-height: 1.25; }
.hw-result-sub { margin-top: calc(-1 * var(--space-s)); color: var(--ink-2); font-size: 17px; }

/* 4. You keep it: the handover list, then a stamp. */
.hw-checks { display: grid; gap: var(--space-s); }
.hw-check { display: flex; align-items: center; gap: var(--space-s); font-size: 19px; line-height: 1.3; }
.hw-yours {
  justify-self: end; rotate: -4deg; padding: 6px 20px 12px;
  background: var(--stage); box-shadow: inset 0 0 0 2px var(--ink); border-radius: var(--radius-panel);
  font-family: var(--serif); font-weight: var(--weight-regular); font-variation-settings: "opsz" 72;
  font-size: clamp(40px, 4vw, 56px); line-height: 1; letter-spacing: var(--track-display);
}

/* ---------- Motion: hidden until the card plays, then each part arrives on its own delay (--d, ms). ---------- */
html.motion .hw-card:not(.is-on) [data-a] { opacity: 0; }
html.motion .hw-card.is-on [data-a] { animation: hw-pop 520ms var(--ease-out) calc(var(--d, 0) * 1ms) backwards; }
html.motion .hw-card.is-on [data-a="stamp"] { animation-name: hw-stamp; animation-duration: 420ms; }
html.motion .hw-card.is-on [data-a="dim"] { animation: hw-dim 500ms var(--ease) calc(var(--d, 0) * 1ms) backwards; }
html.motion .hw-card.is-on [data-a="pick"] { animation: hw-pick 450ms var(--ease-out) calc(var(--d, 0) * 1ms) backwards; }
@keyframes hw-pop { from { opacity: 0; translate: 0 14px; } }
@keyframes hw-stamp { 0% { opacity: 0; scale: 1.8; } 70% { opacity: 1; } }
@keyframes hw-dim { from { color: var(--ink); border-color: var(--line); text-decoration-color: transparent; } }
@keyframes hw-pick { from { background-color: var(--white); border-color: var(--line); } }
html.motion .hw-step__node { transition: background-color 400ms var(--ease); }
html.motion .hw-step:not(.is-reached) .hw-step__node { background: var(--white); }
html:not(.motion) .hw-again { display: none; }

/* =========================================================================
   What you won't need.
   ========================================================================= */
.hw-wont__list { display: grid; gap: var(--space-xl); }
.hw-wont__item { padding-top: var(--space-m); border-top: var(--rule-w) solid var(--ink); }
.hw-wont__title { font-size: var(--text-l); letter-spacing: -0.02em; line-height: 1.25; }
.hw-wont__text { margin-top: var(--space-xs); color: var(--ink-2); font-size: 20px; line-height: 1.5; max-width: 30ch; }
@media (min-width: 900px) {
  .hw-wont__list { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--space-xl); }
}

@media (max-width: 600px) {
  .hw-wont__text { font-size: 18px; }
}
