/* THE LINE: the shared motion layer (11-17-26; first built for /physicians/, promoted to /assets/ the same night on
   David's rule "all pages get motion layers"). Linked by any page that wants it; pair with /assets/line.js.
   Written for /physicians/ and its children. Set in the site's long-form grammar: /about/assets/about.css (record ledger,
   document links, closing), /assets/article.css (head, contents rail, reading column, "At Acrylic" pane) and
   /scottsdale/assets/scottsdale.css (breadcrumb, h3, source line). This file adds the one instrument these pages own:
   THE LINE. A single trace of light that starts as a heartbeat and settles into a steady climb. It is the hero art
   (drawn once, then a bead of light travels it), the rail the four steps hang on (drawn by scroll), and the figures on
   the child pages (each page has its own line). Spectrum appears only as light; text stays graphite. No new colours.
   Everything is complete with JS off and with reduced motion: the lines are simply already drawn. */

/* ---------- hero: the head keeps its words; the line runs behind and below them ---------- */
/* the foot pad tracks the window with no cap, because the line's height does too (a capped pad let the line climb into the
   words on very wide and on tablet-wide windows) */
.ph-head { position: relative; overflow: hidden; padding-bottom: max(150px, 19vw); isolation: isolate; }
/* .is-low: a shorter foot for pages where what follows the head must stay near the fold (ad landing pages). The page's
   line has to stay low to match: run the line-versus-text sweep. */
.ph-head.is-low { padding-bottom: max(100px, 12vw); }
.ph-head > .wrap { position: relative; z-index: 2; }
.ph-head .art-rule { display: none; }
/* the head's foot is a hairline on every page, so the pool of light ends on a line and not in mid-air; the hub's steps
   section would draw the same line again as its own top border */
.ph-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); z-index: 2; pointer-events: none; }
.ph .ph-steps { border-top: 0; }
.ph-scene { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.ph-scene::before {   /* a soft pool of light under the climb, the way the /clients/ prism throws colour on pearl */
  content: ""; position: absolute; right: -8%; bottom: -30%; width: 70%; height: 95%;
  background: radial-gradient(closest-side, rgba(156, 124, 244, .16), rgba(224, 122, 176, .10) 45%, rgba(242, 199, 126, .06) 70%, transparent);
  filter: blur(8px);
}
.ph-line { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; display: block; overflow: visible; }
.ph-line.is-tall { display: none; }
.ph-line path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ph-grid { stroke: rgba(29, 33, 38, .055); stroke-width: 1; }
.ph-glow { stroke-width: 14; opacity: .28; filter: blur(9px); }
.ph-trace { stroke-width: 2.6; stroke-dasharray: 1; stroke-dashoffset: 0; }
.ph-line.is-tall .ph-trace { stroke-width: 4.2; }
.ph-line.is-tall .ph-glow { stroke-width: 22; }
.ph-bead { fill: #fff; stroke: none; opacity: 0; filter: drop-shadow(0 0 6px rgba(156, 124, 244, .95)) drop-shadow(0 0 16px rgba(224, 122, 176, .7)); }
.ph-bead-halo { fill: rgba(255, 255, 255, .5); opacity: 0; }
html.ph-live .ph-bead, html.ph-live .ph-bead-halo { opacity: 1; }
/* Veo (11-17-26): /assets/veo.js sizes .veo on the line and fades the clip in once it plays; until then, and for good
   without it, .veo is an empty box and the SVG line is the hero. The clip carries its own point of light, so the bead rests. */
.ph-head .veo { position: absolute; z-index: 1; left: 0; top: 0; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.ph-head .veo video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s var(--ease); }
.ph-head .veo.is-on video { opacity: 1; }
.ph-head.veo-on .ph-bead, .ph-head.veo-on .ph-bead-halo { opacity: 0 !important; transition: opacity .6s var(--ease); }

@media (prefers-reduced-motion: no-preference) {
  html.js .ph-trace { animation: ph-draw 2.6s cubic-bezier(.45, .05, .2, 1) .15s both; }
  html.js .ph-glow { animation: ph-fade 2.2s ease 1s both; }
  @keyframes ph-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes ph-fade { from { opacity: 0; } to { opacity: .28; } }
}

/* ---------- the four steps: a record section whose rail is the same line, drawn by scroll ---------- */
.ph-steps { border-top: 1px solid var(--line); padding: clamp(56px, 7vw, 96px) 0; }
.ph-steps-lede { margin: 0 0 clamp(28px, 3vw, 40px); font: 400 clamp(19px, 1.6vw, 22px)/1.5 var(--serif); color: var(--ink-2); max-width: 34em; text-wrap: pretty; }
.ph-path { list-style: none; margin: 0; padding: 0; position: relative; counter-reset: ph; }
.ph-path::before, .ph-path::after {   /* the rail: a quiet graphite hairline, and light laid over it as far as --p */
  content: ""; position: absolute; left: 15px; top: 14px; bottom: 14px; width: 2px; border-radius: 2px;
}
.ph-path::before { background: rgba(29, 33, 38, .12); }
.ph-path::after {
  background: linear-gradient(180deg, var(--cyan), var(--violet) 38%, var(--rose) 70%, var(--amber));
  transform-origin: 50% 0; transform: scaleY(var(--p, 1));
  box-shadow: 0 0 14px rgba(156, 124, 244, .45);
}
.ph-step { position: relative; counter-increment: ph; padding: 0 0 clamp(30px, 3.4vw, 46px) 64px; }
.ph-step:last-child { padding-bottom: 0; }
.ph-step::before {   /* the node */
  content: counter(ph); position: absolute; z-index: 1; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font: 500 15px/1 var(--sans); color: var(--ink);
  background: var(--pearl, #fbfaf7); box-shadow: inset 0 0 0 1.5px rgba(29, 33, 38, .55);
  transition: box-shadow .5s var(--ease), background .5s var(--ease);
}
.ph-step h3 { font: 400 clamp(26px, 2.5vw, 34px)/1.12 var(--serif); letter-spacing: -.008em; margin: 0 0 10px; text-wrap: balance; }
.ph-step p { margin: 0 0 10px; font-size: 18px; line-height: 1.65; max-width: 36em; text-wrap: pretty; }
.ph-step p:last-child { margin-bottom: 0; }
.ph-step .ph-where { font: 500 14px/1.5 var(--sans); letter-spacing: .01em; color: var(--ink-3); }
.ph-step .ph-where a { color: var(--ink-2); text-underline-offset: 4px; }
.ph-step a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
/* live: steps wait below the rail's light, then settle as it reaches them */
html.ph-live .ph-step > * { opacity: .28; transform: translateY(10px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
html.ph-live .ph-step.is-on > * { opacity: 1; transform: none; }
html.ph-live .ph-step.is-on::before { background: #fff; box-shadow: inset 0 0 0 1.5px rgba(29, 33, 38, .8), 0 0 0 5px rgba(156, 124, 244, .14), 0 0 18px rgba(224, 122, 176, .4); }

/* ---------- figures on the child pages: a framed SVG whose line is drawn as it crosses the window ---------- */
.ph-fig { margin: clamp(28px, 3vw, 40px) 0; padding: 0; }
.ph-fig-frame {
  position: relative; border-radius: var(--r); padding: clamp(16px, 2vw, 26px);
  background: linear-gradient(150deg, rgba(255, 255, 255, .9), rgba(251, 250, 247, .6));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .95), 0 0 0 1px rgba(29, 33, 38, .07), 0 30px 60px -36px rgba(50, 60, 100, .35);
}
.ph-fig-frame::before { content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), var(--rose), var(--amber), transparent); opacity: .8; }
.ph-fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.ph-fig svg text { font: 500 13px/1 var(--sans); fill: var(--ink-2); letter-spacing: .02em; }
.ph-fig svg .ph-fig-strong { font-weight: 600; fill: var(--ink); }
.ph-fig svg .ph-axis { stroke: rgba(29, 33, 38, .28); stroke-width: 1; fill: none; }
.ph-fig svg .ph-quiet { stroke: rgba(29, 33, 38, .5); stroke-width: 1.6; fill: none; stroke-dasharray: 3 5; stroke-linecap: round; }
.ph-fig svg .ph-ink { stroke: var(--ink); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ph-fig svg [data-draw] { stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--d, 1)); }
.ph-fig svg .ph-wash { opacity: calc(var(--d, 1) * .9); }
.ph-fig svg .ph-dot { fill: #fff; stroke: var(--ink); stroke-width: 1.5; }
.ph-fig figcaption { margin: 12px 4px 0; font: 400 14px/1.55 var(--sans); color: var(--ink-3); max-width: 44em; }

/* ---------- small things these pages add to the reading column ---------- */
.ph-facts { margin: 0 0 22px; border-top: 1px solid rgba(29, 33, 38, .7); }
.ph-facts > div { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 6px 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ph-facts dt { font: 500 16px/1.45 var(--sans); color: var(--ink); }
.ph-facts dd { margin: 0; font-size: 17px; line-height: 1.55; }
.ph-facts dd small { display: block; margin-top: 4px; font: 400 14px/1.5 var(--sans); color: var(--ink-3); }
.ph-kids { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.art-prose .ph-kids > li { padding: 0; margin: 0; }
.art-prose .ph-kids > li::before { content: none; }
.ph-kid {
  position: relative; display: block; height: 100%; padding: 20px 22px 22px; border-radius: var(--r); text-decoration: none !important; color: var(--ink);
  background: linear-gradient(150deg, rgba(255, 255, 255, .9), rgba(251, 250, 247, .55));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .95), 0 0 0 1px rgba(29, 33, 38, .08);
  transition: box-shadow .35s var(--ease), transform .35s var(--ease);
}
.ph-kid:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px #fff, 0 0 0 1px rgba(29, 33, 38, .14), 0 24px 44px -30px rgba(50, 60, 100, .5); }
.ph-kid b { display: block; font: 400 24px/1.15 var(--serif); margin: 0 0 8px; }
.ph-kid span { display: block; font: 400 15.5px/1.5 var(--sans); color: var(--ink-2); }
.ph-kid:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

@media (max-width: 900px) {
  .ph-line.is-wide { display: none; }
  .ph-line.is-tall { display: block; }
  .ph-head { padding-bottom: max(170px, 41vw); }
  .ph-head.is-low { padding-bottom: max(104px, 27vw); }
  .ph-scene::before { right: -30%; width: 120%; height: 60%; bottom: -18%; }
}
@media (max-width: 760px) {
  .ph-step { padding-left: 52px; }
  .ph-step p { font-size: 17px; }
  .ph-facts > div { grid-template-columns: 1fr; }
  .ph-fig svg:not([style*="max-width"]) text { font-size: 14.5px; }   /* full-width figures scale to about 0.78 on a phone */
  .ph-kids { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html.ph-live .ph-step > * { opacity: 1; transform: none; transition: none; }
}
