/* Homepage only. Native scrolling; readable without JS. */
.home-scroll { --scene-gap: clamp(4rem, 9vw, 9rem); }
.home-scroll section[id] { scroll-margin-top: 6rem; }
.home-scroll .sh-home { position: relative; top: auto; height: auto; min-height: calc(100svh - 64px); padding: clamp(4rem, 7vw, 7rem) 0 2rem; }
.home-scroll .sh-wrap { max-width: 1280px; width: min(88%, 1280px); min-height: 0; height: auto; display: block; }
.home-scroll .sh-grid { grid-template-columns: 1.15fr 1fr; align-items: center; gap: 5%; padding: 0; }
.home-scroll .sh-title { font-size: clamp(4rem, 8vw, 7.2rem); max-width: none; line-height: .96; }
.home-scroll .sh-sub { max-width: 37ch; margin-top: 1.75rem; }
.home-scroll .sh-readout { margin-top: 4rem; }
.home-scroll .sh-kicker { font-size: .8rem; }
.home-scroll .sh-ctas { flex-wrap: wrap; }
.home-scroll .sh-b1 { padding: 1rem 1.35rem; background: var(--brass-light); color: var(--channel); border-color: var(--brass-light); }
.home-scroll .sh-b1:focus-visible { outline-color: var(--channel); outline-offset: -6px; box-shadow: 0 0 0 3px var(--ink-on-dark); }
.home-scroll .sh-b1:hover { background: var(--ink-on-dark); border-color: var(--ink-on-dark); }
.home-scroll .scene-cue { display: flex; justify-content: space-between; gap: 1rem; align-items: center; border-top: 1px solid rgba(233,237,241,.2); padding-top: 1rem; margin-top: 2rem; color: var(--ink-on-dark); text-decoration: none; min-height: 44px; font-size: .875rem; }
.scene-cue span:last-child { color: var(--brass-light); }
.scene-preview { position: relative; padding: 2rem; border: 1px solid rgba(196,164,106,.4); background: var(--channel); border-radius: 1rem; box-shadow: 0 32px 100px rgba(0,0,0,.3); transform: rotate(-3deg); }
.scene-preview > p { color: var(--brass-light); font: .75rem var(--mono); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 1rem; }
.scene-preview h2 { font-size: clamp(2rem, 3vw, 3rem); color: var(--ink-on-dark); margin-bottom: 2rem; }
.preview-line { display: flex; gap: 1rem; padding: 1.15rem 0; border-top: 1px solid rgba(233,237,241,.2); color: var(--ink-on-dark); }
.preview-line > span { font: .8rem var(--mono); color: var(--brass-light); padding-top: .3rem; }
.preview-line strong { display: block; font-weight: 500; }
.preview-line small { color: #B6C1D0; font-size: .875rem; }
.preview-caption { display: block; margin-top: 1rem; color: #B6C1D0; font-size: .875rem; }
.story-scene { padding: var(--scene-gap) 0; }
.story-scene .wrap { max-width: 1280px; width: 88%; }
.story-scene h2 { font-size: clamp(2.8rem, 5.5vw, 5.4rem); line-height: 1.02; }
.story-scene h2 em { color: var(--accent); font-weight: 400; }
.story-scene p { max-width: 44ch; }
.story-scene .kicker { display: block; margin-bottom: 1.5rem; font-size: .8rem; }
.home-scroll .story-dark { color: var(--ink-on-dark); background: var(--channel); }
.story-dark h2, .story-dark h3 { color: var(--ink-on-dark); }
.story-dark p { color: #B6C1D0; }
.story-dark .kicker, .story-dark h2 em { color: var(--brass-light); }
.story-dark :focus-visible { outline-color: var(--brass-light); }
.story-dark a { color: var(--ink-on-dark); }
.story-intro { padding-bottom: 2.5rem; border-bottom: 1px solid rgba(233,237,241,.2); }
.story-intro p { margin-top: 1.5rem; }
.story-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 10%; align-items: start; }
.story-step { min-height: 34vh; display: flex; flex-direction: column; justify-content: center; padding: 2.5rem 0; }
.story-step .step-number { font: .85rem var(--mono); color: var(--brass-light); margin-bottom: 1.5rem; }
.story-step h3 { font: 400 clamp(2.3rem, 4vw, 3.8rem)/1.05 var(--serif); margin-bottom: 1.5rem; }
.story-step p { font-size: 1.1rem; }
.story-step a { margin-top: 1.5rem; padding: .75rem 0; width: fit-content; text-underline-offset: .35em; }
.story-demo { position: sticky; top: calc(64px + 13vh); padding: 3rem 0; margin: 0; }
.message-window { border: 1px solid #59616A; border-radius: 1rem; padding: 1.8rem; background: #111F33; box-shadow: 0 24px 70px rgba(0,0,0,.2); }
.message-top { display: flex; justify-content: space-between; gap: 1rem; color: #B6C1D0; font-size: .8rem; padding-bottom: 1.5rem; border-bottom: 1px solid #59616A; }
.message-top strong { color: var(--ink-on-dark); font-weight: 500; }
.message { margin-top: 1.5rem; padding: 1rem 1.2rem; border-radius: .75rem; color: var(--ink-on-dark); background: #26364B; font-size: 1rem; transition: transform var(--m-hover) var(--e-settle), border-color var(--m-hover); border: 1px solid transparent; }
.message span { display: block; font-size: .75rem; color: #CBD5E1; margin-bottom: .4rem; }
.message.reply { background: #C4A46A; color: var(--channel); margin-left: 2rem; }
.message.reply span { color: var(--channel); }
.story-demo figcaption { margin-top: 1.5rem; color: #B6C1D0; font-size: .875rem; max-width: 42ch; }
.story-demo[data-active="0"] .message:nth-child(2), .story-demo[data-active="1"] .message:nth-child(3), .story-demo[data-active="2"] .message:nth-child(4) { border-color: var(--brass-light); transform: translateX(-.6rem); }
.example-picker { padding: 3rem 0; }
.example-links, .capture-grid, .resource-grid { display: grid; gap: 2rem; grid-template-columns: repeat(2,minmax(0,1fr)); }
.example-links { grid-template-columns: repeat(3,minmax(0,1fr)); margin: 1.5rem 0; gap: 1rem; }
.example-links a { padding: 1rem; border: 1px solid var(--line-strong); border-radius: .5rem; color: var(--ink); }
.example-links strong, .example-links span { display: block; }
.example-links span { margin-top: .5rem; font-size: .875rem; color: var(--ink-soft); }
.home-scroll :is(article,details)[id] { scroll-margin-top: 6rem; }
.capture-grid { margin-top: 2rem; align-items: start; }
.sample-sheet, .sample-record { margin: 0; padding: clamp(1.2rem,3vw,2.5rem); border: 1px solid var(--line-strong); border-radius: .5rem; }
.sample-sheet { background: #fffdf6; color: var(--channel); box-shadow: 0 12px 30px #0a162812; transform: rotate(-1deg); }
.sample-sheet figcaption { font: .8rem var(--mono); margin-bottom: 1.5rem; }
.sample-sheet h3, .sample-record h3 { font-size: 1.8rem; }
#sample-source { white-space: pre-line; line-height: 2.4; margin: 1.5rem 0; border-block: 1px solid var(--line); }
.sample-record { background: var(--card); }
.sample-record dl { margin: 1.5rem 0; }
.sample-record dl > div { display: grid; grid-template-columns: 1fr 1.5fr; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.sample-record dt { font-weight: 600; }
.sample-record dd { margin: 0; }
.review-field { color: var(--accent-dark); }
.sample-status { font-weight: 600; margin: 1rem 0; }
.story-scene .sample-note { font-size: .875rem; max-width: 80ch; margin: 1.5rem 0; }
.sample-tabs { margin-top: 1rem; }
.sample-tabs:not([hidden]) { display: flex; flex-wrap: wrap; gap: .75rem; }
.sample-tabs [aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.sample-record label { display: block; font-weight: 600; margin: 1.5rem 0 .5rem; }
.sample-record select { width: 100%; padding: .8rem; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: .3rem; }
.sample-record button:disabled { opacity: .6; cursor: default; }
.sample-record .cta-row { gap: .75rem; }
.resource-grid { margin-top: 2rem; }
.resource-grid article { border-top: 1px solid var(--line-strong); padding-top: 1.5rem; }
.resource-grid h2 { font-size: 1.8rem; }
.resource-grid p { margin-top: 1rem; }
.resource-grid figure { margin: 1.5rem 0; }
.resource-grid img { height: 150px; width: auto; max-width: 100%; object-fit: contain; border-radius: .3rem; }
.chapter-nav { position: fixed; z-index: 25; right: 1rem; top: 40%; display: none; flex-direction: column; }
.chapter-nav a { display: grid; place-items: center; width: 44px; height: 44px; text-decoration: none; }
.chapter-nav a::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #846630; border: 1px solid #E9EDF1; box-shadow: 0 0 0 1px #846630; transition: transform var(--m-ui); }
.chapter-nav a[aria-current="location"]::before { transform: scale(1.8); background: #C4A46A; }
.home-scroll .close { padding: var(--scene-gap) 0; }
.home-scroll .close h2 { max-width: 13ch; font-size: clamp(3.5rem, 7vw, 7rem); }
.home-scroll .close p { max-width: 40ch; }
@media (min-width: 1440px) { .chapter-nav { display: flex; } }
@media (prefers-reduced-motion: no-preference) {
  .scroll-ready [data-reveal] { transition: opacity var(--m-settle) var(--e-settle), transform var(--m-settle) var(--e-settle); }
  .scroll-ready [data-reveal].awaiting { opacity: 0; transform: translateY(2rem); }
  .scroll-ready [data-reveal]:focus-within { opacity: 1; transform: none; }
}
@media (max-width: 900px) {
  .home-scroll .sh-grid, .capture-grid { grid-template-columns: 1fr; gap: 3rem; }
  .home-scroll .sh-title { max-width: 10ch; font-size: clamp(4rem, 13vw, 6rem); }
  .scene-preview { max-width: 540px; width: 100%; margin: 1rem auto 0; transform: none; }
  .home-scroll .sh-readout { margin-top: 3rem; }
  .story-layout { gap: 5%; }
  .message-window { padding: 1.2rem; }
}
@media (max-width: 600px), (max-height: 600px) {
  .example-links, .resource-grid { grid-template-columns: 1fr; }
  .story-layout { display: flex; flex-direction: column; }
  .story-demo { position: static; order: -1; width: 100%; padding: 2rem 0 0; }
  .story-step { min-height: auto; padding: 3rem 0; border-bottom: 1px solid rgba(233,237,241,.2); }
  .story-intro { padding-bottom: 2rem; }
  .home-scroll .sh-home { padding-top: 3rem; }
  .home-scroll .sh-title { font-size: clamp(3.6rem, 17vw, 5.5rem); }
  .home-scroll .sh-kicker { letter-spacing: .06em; }
  .home-scroll .sh-ctas { align-items: flex-start; }
  .home-scroll .sh-readout { gap: 1rem; }
  .home-scroll .sh-readout dd { font-size: 1.8rem; }
  .home-scroll .sh-readout dt { font-size: .75rem; }
  .scene-preview { padding: 1.5rem; }
  .home-scroll .scene-cue { font-size: .8rem; }
  .story-scene .cta-row { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .story-demo { position: static; }
  .story-step { min-height: auto; padding: 3rem 0; }
  .home-scroll [data-reveal] { opacity: 1; transform: none; transition: none; }
  .home-scroll .message { transform: none !important; transition: none; }
}

.home-scroll .consult-short { display: none; }
@media (max-width: 360px) {
  .home-scroll .nav { gap: 8px; padding-inline: 14px; }
  .home-scroll .consult-wide { display: none; }
  .home-scroll .consult-short { display: inline; }
}

/* Exit prompt (homepage only) — see assets/exit-prompt.js.
   Lives here rather than in styles.css because 38 other pages never render it;
   tests/budget.test.js counts this file as homepage-only for that reason. */
.xp {
  max-width: 420px; width: calc(100% - 32px);
  padding: 28px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
}
.xp::backdrop { background: rgba(10, 22, 40, .55); }
.xp h2 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; margin: 0 0 10px; }
.xp p { margin: 0 0 18px; font-size: .95rem; line-height: 1.55; }
.xp .btn { display: inline-block; }
.xp-alt { margin: 16px 0 0; font-size: .85rem; color: var(--ink-mute); }
/* 44px of hit area on a control that sits at the corner of a modal — the rule
   targets.test.js enforces everywhere else on the site. */
.xp-x {
  position: absolute; top: 4px; right: 4px;
  min-width: 44px; min-height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer;
  font-size: 1.5rem; line-height: 1; color: var(--ink-mute);
}
.xp-x:hover { color: var(--ink); }
