/* Homeward v05, "At Their Height" (Astra direction A, approved 2026-11-02).
   Documentary photographs carry the feeling; the interface stays quiet, exact and fast: Archivo for everything you act on,
   a little Newsreader italic for the human voice. One view at a time; the narration dock is the phone's main control. */
:root {
  --page: #FAF8F1;
  --surface: #FFFFFF;
  --ink: #202821;
  --muted: #59665E;
  --action: #2449C4;
  --on-action: #FFFFFF;
  --rule: #87988B;
  --line: #E4E1D6;
  --positive: #28633C;
  --caution: #805400;
  --caution-bg: #F6EEDC;
  --urgent: #A3312B;
  --focus: #2449C4;
  --tick: #2449C4;

  --f-sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Newsreader", Georgia, serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --gut: 20px;
  --dock-h: 72px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #151C18; --surface: #202B24; --ink: #F5F6F0; --muted: #B8C3B9; --action: #ACBAFF; --on-action: #16233D;
    --rule: #53645A; --line: #2C3A31; --positive: #A9D8B0; --caution: #F0CA79; --caution-bg: #2A2618; --urgent: #FFAEA0;
    --focus: #FFD46A; --tick: #ACBAFF;
    color-scheme: dark;
  }
}

/* Base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 1.125rem/1.56 var(--f-sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
a { color: var(--action); text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 60; background: var(--surface); padding: 10px 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@supports (text-wrap: pretty) { p, li { text-wrap: pretty; } }
.lede { font-size: 1.125rem; line-height: 1.56; color: var(--muted); max-width: 60ch; }
.ai-note { font-size: .875rem; line-height: 1.43; color: var(--muted); }

/* Buttons and links: 48px targets */
.btn, .btn-quiet { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 6px; font: 600 1rem/1.2 var(--f-sans); text-decoration: none; transition: transform 80ms ease-out, background-color 150ms ease-out; }
.btn { background: var(--action); color: var(--on-action); border: 0; }
.btn-quiet { background: transparent; color: var(--ink); border: 1.5px solid var(--rule); }
.btn:active, .btn-quiet:active, .dock button:active { transform: scale(.98); }
.btn-quiet:disabled { opacity: .4; cursor: default; }
.inline-link { display: inline-flex; align-items: center; min-height: 48px; font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: color-mix(in srgb, var(--action) 85%, var(--ink)); }
  .btn-quiet:hover { border-color: var(--ink); }
}

/* Header */
.top { position: sticky; top: 0; z-index: 40; background: var(--page); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1280px; margin: 0 auto; padding: 0 var(--gut); min-height: 64px; display: flex; align-items: center; gap: 24px; }
.brand { font: 700 1.25rem/1 var(--f-sans); letter-spacing: -0.02em; color: var(--ink); text-decoration: none; padding: 12px 0; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 12px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1rem; border-bottom: 2px solid transparent; }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }
.count { font-size: .8rem; font-weight: 700; color: var(--action); }
.count:empty { display: none; }
.top-help, .menu-btn { display: none; }

main { max-width: 1280px; margin: 0 auto; padding: 0 var(--gut); }
.view { padding-block: 48px 96px; }

/* Home: opening */
.opening { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: center; }
.opening-copy { grid-column: 1 / span 5; display: grid; gap: 20px; }
h1 { font: 700 clamp(2.75rem, 5.4vw, 5.25rem)/1.0 var(--f-sans); letter-spacing: -0.035em; }
.tagline { font: italic 400 clamp(1.375rem, 2.2vw, 1.875rem)/1.25 var(--f-serif); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 8px; }
.facts { font-size: 1rem; color: var(--muted); }
.viewpoint { grid-column: 6 / span 7; margin: 0; }
.vp-frame { position: relative; aspect-ratio: 1600 / 904; overflow: hidden; background: var(--line); }
.vp-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 280ms var(--ease); }
.vp-low { opacity: 0; }
.viewpoint.low .vp-low { opacity: 1; }
.viewpoint.low .vp-high { opacity: 0; }
.viewpoint figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.vp-toggle { min-height: 48px; padding: 0; background: none; border: 0; font-weight: 600; font-size: 1rem; color: var(--action); text-decoration: underline; text-underline-offset: 4px; }

.journey { margin-top: 96px; }
.journey h2, .more { }
h2 { font: 600 clamp(2rem, 4.2vw, 3.75rem)/1.05 var(--f-sans); letter-spacing: -0.025em; }
.journey-list { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.journey-list a { display: grid; gap: 4px; padding: 16px 12px 16px 0; min-height: 48px; color: var(--ink); text-decoration: none; }
.journey-list .n { font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.journey-list strong { font-size: 1.125rem; line-height: 1.25; }
.journey-list .when { font-size: .875rem; color: var(--muted); }
.journey-list .done { font-size: .875rem; color: var(--positive); font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .journey-list a:hover strong, .more-row:hover strong { color: var(--action); } }
.more { margin-top: 64px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.more-row { display: grid; gap: 4px; padding-top: 16px; border-top: 1px solid var(--rule); color: var(--ink); text-decoration: none; min-height: 48px; }
.more-row strong { font-size: 1.25rem; }
.more-row span { color: var(--muted); font-size: 1rem; }

/* Guide */
.phase-bar { display: grid; gap: 8px; margin-bottom: 40px; }
.phase-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.phase-list button { width: 100%; min-height: 48px; padding: 12px 8px 4px 0; background: none; border: 0; border-top: 3px solid transparent; margin-top: -2px; text-align: left; font-size: .95rem; font-weight: 600; color: var(--muted); line-height: 1.25; }
.phase-list button[aria-current] { color: var(--ink); border-top-color: var(--ink); }
.phase-list button.complete::after { content: " ✓"; color: var(--positive); }
.phase-select { display: none; }
.phase-meta { font-size: 1rem; color: var(--muted); }

.step { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 24px; }
.step-head { grid-column: 1 / span 7; display: grid; gap: 12px; margin-bottom: 32px; }
.step-no { font-weight: 600; font-size: 1rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.step-title { font: 600 clamp(1.875rem, 3vw, 2.75rem)/1.1 var(--f-sans); letter-spacing: -0.02em; }
.summary { font-size: 1.25rem; line-height: 1.5; max-width: 52ch; }
.step-photo { grid-column: 1 / span 7; grid-row: 2 / span 3; margin: 0 0 24px; }
.step-photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--line); }
.step-photo figcaption { margin-top: 8px; }
.step-body { grid-column: 8 / span 5; grid-row: 2; display: grid; gap: 32px; align-content: start; }
.step:not(.has-photo) .step-body { grid-column: 1 / span 7; }
.step h2 { font: 600 1rem/1.375 var(--f-sans); }
.checks { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.checks li { border-bottom: 1px solid var(--line); }
.check { display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: start; min-height: 48px; padding: 12px 0; cursor: pointer; font-size: 1.0625rem; line-height: 1.53; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.box { width: 24px; height: 24px; margin-top: 2px; border: 2px solid var(--rule); border-radius: 4px; display: grid; place-items: center; transition: background-color 140ms ease-out, border-color 140ms ease-out; }
.box svg { width: 14px; height: 14px; stroke: var(--on-action); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset 140ms ease-out; }
.check input:checked + .box { background: var(--tick); border-color: var(--tick); }
.check input:checked + .box svg { stroke-dashoffset: 0; }
.check input:checked ~ span { color: var(--muted); }
.check input:focus-visible + .box { outline: 3px solid var(--focus); outline-offset: 2px; }
.check small { display: block; color: var(--muted); font-size: .9375rem; margin-top: 2px; }
.watch { background: var(--caution-bg); padding: 16px 20px; border-left: 4px solid var(--caution); }
.watch h2 { color: var(--caution); }
.watch ul { margin: 8px 0 0; padding-left: 1.1em; display: grid; gap: 8px; font-size: 1.0625rem; }
.going-well { font: italic 400 1.375rem/1.35 var(--f-serif); }
.going-well:empty { display: none; }
.going-well b { font: 600 1rem var(--f-sans); font-style: normal; display: block; margin-bottom: 4px; color: var(--positive); }
.transcript summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.transcript p { font: italic 400 1.25rem/1.5 var(--f-serif); color: var(--ink); }
.step-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 8px; }
.step.changing > * { opacity: 0; transform: translateY(6px); }
.step > * { transition: opacity 180ms var(--ease), transform 180ms var(--ease); }

/* Pages */
.page-head { display: grid; gap: 20px; max-width: 760px; margin-bottom: 56px; }
.kit-left { font-size: 1.25rem; font-weight: 600; }
.kit-left b { font-size: 2.5rem; letter-spacing: -0.02em; margin-right: 8px; color: var(--action); }
.group-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.group-links a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 600; }
.kit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 48px; }
.kit-group { scroll-margin-top: 88px; }
.kit-group header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.kit-group h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.kit-group .when { font-size: 1rem; color: var(--muted); }
.kit-group.must .when { color: var(--action); font-weight: 600; }

.levels { display: grid; gap: 64px; }
.level { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; padding-top: 20px; border-top: 4px solid var(--tone); }
.level.ok { --tone: var(--positive); } .level.caution { --tone: var(--caution); } .level.stop { --tone: var(--urgent); }
.level-head { grid-column: 1 / span 4; display: grid; gap: 8px; align-content: start; }
.level-head h2 { color: var(--tone); font-size: clamp(1.75rem, 3vw, 2.5rem); }
.level-head p { color: var(--muted); font-size: 1rem; }
.signals { grid-column: 5 / span 8; display: grid; gap: 32px; }
.signal { display: grid; gap: 8px; }
.signal h3 { font: 600 1.375rem/1.25 var(--f-sans); }
.signal dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 1.0625rem; }
.signal dt { font-weight: 600; color: var(--muted); }
.signal dd { margin: 0; }
.signal dd.todo { font-weight: 600; color: var(--tone); }

.help-list { list-style: none; margin: 0; padding: 0; max-width: 820px; border-top: 1px solid var(--rule); }
.help-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 4px 32px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.help-list strong { font-size: 1.1875rem; line-height: 1.35; }
.help-list span { color: var(--ink); }

.source-list { margin: 0; padding: 0 0 0 1.4em; columns: 2 420px; column-gap: 48px; font-size: 1rem; }
.source-list li { break-inside: avoid; padding: 0 0 16px 4px; }
.source-list a { font-weight: 600; overflow-wrap: anywhere; }
.source-list small { display: block; color: var(--muted); font-size: .875rem; }

.foot { max-width: 1280px; margin: 0 auto; padding: 48px var(--gut) 64px; border-top: 1px solid var(--line); display: grid; gap: 12px; color: var(--muted); font-size: .9375rem; }
.foot-line { font: italic 400 2rem/1.1 var(--f-serif); color: var(--ink); }

/* Narration dock */
.dock { position: fixed; z-index: 45; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(720px, calc(100% - 32px)); display: flex; align-items: center; gap: 12px; padding: 8px; background: var(--ink); color: var(--page); border-radius: 10px; }
.dock button { min-height: 48px; min-width: 48px; border: 0; border-radius: 6px; font-weight: 600; font-size: 1rem; transition: transform 80ms ease-out; }
.dock-play { display: inline-flex; align-items: center; gap: 8px; padding: 0 18px 0 14px; background: var(--page); color: var(--ink); }
.dock-play svg { width: 20px; height: 20px; fill: currentColor; }
.dock-meta { flex: 1; min-width: 0; display: grid; font-size: .875rem; line-height: 1.3; }
.dock-meta strong { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-meta span { opacity: .75; font-variant-numeric: tabular-nums; }
.dock-voice, .dock-close { background: transparent; color: var(--page); padding: 0 12px; text-decoration: underline; text-underline-offset: 4px; }
.dock-next { background: var(--action); color: var(--on-action); padding: 0 18px; }
.dock.compact .dock-next, .dock.compact .dock-voice { display: none; }
.voice-panel { position: fixed; z-index: 46; left: 50%; bottom: calc(16px + var(--dock-h) + 8px); transform: translateX(-50%); width: min(720px, calc(100% - 32px)); display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; align-items: center; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; }
.voice-panel > label { font-weight: 600; }
.voice-panel select { font: inherit; min-height: 44px; padding: 0 10px; border-radius: 6px; border: 1.5px solid var(--rule); background: var(--page); color: var(--ink); width: 100%; min-width: 0; }
.voice-panel input[type=range] { accent-color: var(--action); width: 100%; min-height: 44px; }
.toggle { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; min-height: 48px; font-weight: 400 !important; }
.toggle input { width: 22px; height: 22px; accent-color: var(--action); }
.voice-panel .note { grid-column: 1 / -1; color: var(--muted); font-size: .875rem; }
.voice-panel { transition: opacity 200ms ease-out, transform 200ms ease-out; }
@starting-style { .voice-panel { opacity: 0; transform: translate(-50%, 12px); } }
body.has-dock { padding-bottom: calc(var(--dock-h) + 40px); }

/* Tablet */
@media (max-width: 1023px) {
  .opening-copy { grid-column: 1 / -1; }
  .viewpoint { grid-column: 1 / -1; }
  .journey-list { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 8px; }
  .step-head, .step-photo, .step-body, .step:not(.has-photo) .step-body { grid-column: 1 / -1; grid-row: auto; }
  .step-photo { margin-bottom: 32px; }
  .kit { grid-template-columns: minmax(0, 1fr); }
  .level-head, .signals { grid-column: 1 / -1; }
}

/* Phone */
@media (max-width: 760px) {
  :root { --gut: 20px; --dock-h: 64px; }
  body { font-size: 1.0625rem; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px var(--gut) 16px; background: var(--page); border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .nav a { border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"] { border-bottom-color: var(--line); text-decoration: underline; text-underline-offset: 4px; }
  .top-help { display: inline-flex; align-items: center; min-height: 48px; margin-left: auto; font-weight: 600; }
  .menu-btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 12px; background: none; border: 1.5px solid var(--rule); border-radius: 6px; font-weight: 600; }
  .view { padding-block: 24px 56px; }
  .opening { gap: 20px; }
  .viewpoint { order: -1; margin: 0 calc(-1 * var(--gut)); }
  .viewpoint figcaption { padding: 0 var(--gut); }
  .journey { margin-top: 56px; }
  .journey-list { grid-template-columns: minmax(0, 1fr); border-top-width: 1px; }
  .journey-list li { border-bottom: 1px solid var(--line); }
  .journey-list a { grid-template-columns: 28px 1fr auto; align-items: baseline; padding: 14px 0; }
  .journey-list .when, .journey-list .done { grid-column: 2; }
  .more { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 40px; }
  .phase-list { display: none; }
  .phase-select { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; font-weight: 600; }
  .phase-select select { font: inherit; min-height: 48px; padding: 0 10px; border-radius: 6px; border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink); width: 100%; min-width: 0; }
  .phase-bar { margin-bottom: 24px; }
  .step-head { margin-bottom: 20px; }
  .summary { font-size: 1.125rem; }
  .step-photo { margin: 0 calc(-1 * var(--gut)) 28px; }
  .step-photo img { aspect-ratio: auto; height: 180px; }
  .step-photo figcaption { padding: 0 var(--gut); }
  .step-nav { display: none; }
  .dock { left: 0; right: 0; bottom: 0; transform: none; width: auto; border-radius: 0; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  .dock-play { padding: 0 14px 0 10px; }
  .dock-voice { padding: 0 8px; }
  .dock-next { padding: 0 14px; }
  .voice-panel { left: 12px; right: 12px; width: auto; transform: none; bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px) + 12px); }
  @starting-style { .voice-panel { opacity: 0; transform: translateY(12px); } }
  .help-list li { grid-template-columns: minmax(0, 1fr); }
  .signal dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .signal dd { margin-bottom: 8px; }
}
@media (max-width: 340px) { :root { --gut: 16px; } .dock-voice { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
  .step.changing > * { transform: none; }
}
