:root {
  --aquifer: #164d67;
  --aquifer-deep: #0c3348;
  --silt: #c88548;
  --ochre: #b96e34;
  --terracotta: #a84c34;
  --cottonwood: #536d43;
  --limestone: #f0e8d4;
  --chalk: #faf7ee;
  --charcoal: #172c32;
  --mist: #d9e4df;
  --line: color-mix(in srgb, var(--charcoal) 20%, transparent);
  --display: Rockwell, "Roboto Slab", "Iowan Old Style", Georgia, serif;
  --sans: Inter, Avenir, "Avenir Next", ui-sans-serif, system-ui, sans-serif;
  --measure: 68ch;
  --gutter: clamp(1rem, 4vw, 4.5rem);
  color-scheme: light;
  font-family: var(--sans);
  background: var(--limestone);
  color: var(--charcoal);
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { overflow-x: clip; }
img { display: block; width: 100%; height: 100%; object-fit: cover; background: #d5c9ad; }
figure { margin: 0; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .22em; }
p { line-height: 1.65; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.035em; text-wrap: balance; }
h1 { font-size: clamp(3.1rem, 8.8vw, 9rem); line-height: .88; }
h2 { font-size: clamp(2.2rem, 5.2vw, 5.7rem); line-height: .98; margin: .3em 0; }
h3 { font-size: clamp(1.65rem, 3vw, 3rem); line-height: 1.05; margin: .25em 0; }
.skip-link { position: fixed; z-index: 100; left: 1rem; top: 1rem; padding: .8rem 1rem; background: var(--chalk); transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.wordmark { display: inline-flex; gap: .65rem; align-items: center; font-family: var(--display); font-size: 1.08rem; font-weight: 700; text-decoration: none; view-transition-name: flow-wordmark; }
.drop-mark { width: 1.1rem; height: 1.45rem; display: inline-block; background: var(--aquifer); border-radius: 60% 40% 68% 32% / 55% 38% 62% 45%; transform: rotate(28deg); }
.fold-header, .policy-header { position: relative; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1.15rem var(--gutter); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--limestone) 92%, transparent); backdrop-filter: blur(14px); }
.fold-header nav { display: flex; gap: clamp(.8rem, 2vw, 2.2rem); font-size: .86rem; font-weight: 700; }
.fold-header nav a { text-decoration: none; }
.fold-header nav a:hover, .fold-header nav a:focus-visible { color: var(--aquifer); }
.eyebrow, .reach-number, .reach-label, .index-kicker { margin: 0; font-size: .74rem; line-height: 1.25; letter-spacing: .16em; text-transform: uppercase; font-weight: 800; }
.channel-link { display: inline-flex; align-items: center; gap: .65rem; padding-bottom: .3rem; border-bottom: 2px solid currentColor; text-decoration: none; font-weight: 800; }
.channel-link:hover span { transform: translate(.15rem, .15rem); }
.channel-link span { transition: transform .18s ease; }
.media { overflow: hidden; background: #d2c4a7; }
.media img { transition: transform 900ms cubic-bezier(.2,.72,.2,1); }
.media:hover img { transform: scale(1.015); }

/* Landing: a long foldout whose widths and axes change by chapter. */
.landing-body { background: var(--limestone); }
.headwaters { position: relative; min-height: min(88rem, 92svh); display: grid; align-items: end; overflow: hidden; isolation: isolate; }
.media-headwaters { position: absolute; inset: 0; z-index: -2; }
.media-headwaters::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(9,34,45,.82) 0 34%, rgba(9,34,45,.2) 68%, transparent), linear-gradient(0deg, rgba(9,34,45,.65), transparent 48%); }
.headwaters-copy { width: min(66rem, 90vw); padding: 8vh var(--gutter) 10vh; color: #fff8e8; }
.headwaters-copy h1 { margin: .18em 0 .28em; }
.headwaters-copy > p:not(.eyebrow) { max-width: 42rem; font-size: clamp(1.05rem, 2vw, 1.45rem); }

.identity-reach { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(15rem,.65fr); grid-template-rows: auto auto; gap: clamp(1.5rem,4vw,5rem); padding: clamp(5rem,10vw,11rem) var(--gutter); background: var(--chalk); }
.identity-copy { align-self: center; max-width: 58rem; padding-left: clamp(0rem,5vw,6rem); }
.identity-copy .lead { font-family: var(--display); font-size: clamp(1.35rem,2.3vw,2.15rem); line-height: 1.35; }
.mineral-seam { min-height: 42rem; border-radius: 48% 8% 42% 12% / 12% 38% 9% 44%; }
.pueblo-plate { grid-column: 1 / -1; width: min(72rem, 85vw); aspect-ratio: 3 / 2; justify-self: center; clip-path: polygon(3% 8%, 97% 0, 100% 89%, 58% 97%, 0 100%, 0 15%); }

.finite-reach { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(18rem,.85fr); min-height: 75vh; background: var(--aquifer-deep); color: #f7efdc; }
.finite-still { min-height: 36rem; clip-path: polygon(0 0, 92% 0, 100% 42%, 91% 100%, 0 100%); }
.finite-copy { align-self: center; padding: clamp(3rem,7vw,8rem) var(--gutter); max-width: 38rem; }
.finite-copy p { font-size: 1.12rem; }

.domain-braids { position: relative; padding: clamp(5rem,10vw,12rem) var(--gutter); background: linear-gradient(90deg, transparent calc(50% - 1px), rgba(22,77,103,.18) 50%, transparent calc(50% + 1px)), var(--limestone); }
.braids-intro { max-width: 72rem; margin: 0 auto clamp(5rem,9vw,10rem); text-align: center; }
.braids-intro p:last-child { max-width: var(--measure); margin-inline: auto; }
.braid { width: min(75rem, 100%); margin: 0 auto clamp(6rem,11vw,12rem); display: grid; grid-template-columns: minmax(14rem,.85fr) minmax(18rem,1.15fr); gap: clamp(2rem,6vw,7rem); align-items: center; }
.braid:nth-of-type(even) { grid-template-columns: minmax(18rem,1.15fr) minmax(14rem,.85fr); }
.braid > div { max-width: 34rem; }
.portrait-cut { aspect-ratio: 4 / 5; border-radius: 48% 6% 43% 14% / 9% 45% 10% 40%; }
.landscape-cut { aspect-ratio: 3 / 2; clip-path: polygon(0 4%, 91% 0, 100% 19%, 95% 94%, 13% 100%, 0 82%); }
.round-plate { aspect-ratio: 1; border-radius: 50%; box-shadow: 0 2rem 5rem rgba(39,49,42,.16); }
.wide-break { width: min(92rem,100%); aspect-ratio: 16 / 9; margin: 0 auto clamp(3rem,7vw,7rem); clip-path: polygon(0 10%, 18% 0, 100% 5%, 96% 87%, 73% 100%, 0 93%); }
.wide-break figcaption, .app-folds figcaption { padding: 1rem .25rem; max-width: 38rem; font-family: var(--display); font-size: 1.2rem; }
.bead-study { width: min(46rem,85vw); aspect-ratio: 3 / 2; margin-left: auto; margin-right: 6vw; transform: rotate(-2deg); }

.storm-reach { position: relative; min-height: 72vh; display: grid; place-items: center; background: var(--charcoal); color: white; }
.storm-panorama { position: absolute; inset: 0; opacity: .62; }
.storm-panorama::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(23,44,50,.92), rgba(23,44,50,.16)); }
.storm-copy { position: relative; z-index: 1; max-width: 66rem; padding: 15vh var(--gutter) 9vh; align-self: end; }
.storm-copy p:last-child { max-width: 44rem; }

.shared-reach { display: grid; grid-template-columns: repeat(12,1fr); grid-auto-rows: minmax(6rem,auto); gap: clamp(.8rem,2vw,2rem); padding: clamp(5rem,10vw,11rem) var(--gutter); background: #d9d1bc; }
.shared-copy { grid-column: 2 / 9; margin-bottom: 4rem; }
.shared-copy p:last-child { max-width: var(--measure); }
.reserve-basin { grid-column: 1 / 9; aspect-ratio: 16 / 10; clip-path: polygon(0 5%, 76% 0, 100% 21%, 95% 100%, 8% 92%); }
.entity-layers { grid-column: 9 / 13; align-self: end; aspect-ratio: 4 / 5; border-radius: 4rem 1rem 6rem 1.5rem; }
.hydrograph-relief { grid-column: 3 / 10; aspect-ratio: 16 / 9; margin-top: 2rem; }
.observe-kit { grid-column: 10 / 13; aspect-ratio: 3 / 2; align-self: center; transform: translateX(-2rem) rotate(2deg); }

.app-confluence { padding: clamp(5rem,11vw,12rem) var(--gutter); background: var(--chalk); }
.app-confluence > header { display: grid; grid-template-columns: .65fr 1.35fr; column-gap: 5vw; align-items: start; margin-bottom: clamp(3rem,7vw,8rem); }
.app-confluence > header .reach-number { grid-row: 1 / span 2; }
.app-confluence > header h2, .app-confluence > header p:last-child { grid-column: 2; }
.app-confluence > header p:last-child { max-width: 55rem; font-size: 1.15rem; }
.app-overview { width: min(94rem,100%); aspect-ratio: 16 / 10; margin-inline: auto; border-radius: 6rem 1rem 7rem 1rem / 2rem 5rem 2rem 7rem; }
.app-folds { width: min(82rem,100%); margin: clamp(4rem,8vw,9rem) auto 0; display: grid; grid-template-columns: repeat(12,1fr); gap: clamp(1.2rem,3vw,3.5rem); }
.app-folds figure:nth-child(1) { grid-column: 1 / 8; }
.app-folds figure:nth-child(2) { grid-column: 7 / 13; margin-top: 10rem; }
.app-folds figure:nth-child(3) { grid-column: 2 / 6; }
.app-folds figure:nth-child(4) { grid-column: 5 / 13; margin-top: 5rem; }
.app-folds figure:nth-child(1) .media, .app-folds figure:nth-child(2) .media { aspect-ratio: 3 / 2; }

.source-delta { display: grid; grid-template-columns: 1fr .55fr .9fr; gap: clamp(1.5rem,4vw,5rem); padding: clamp(5rem,10vw,11rem) var(--gutter); background: var(--cottonwood); color: #f8f3e5; }
.source-copy { align-self: center; }
.source-copy h2 { font-size: clamp(2.5rem,5vw,5rem); }
.source-list { margin: 2rem 0 0; padding: 0; list-style: none; border-top: 1px solid rgba(255,255,255,.35); }
.source-list li { border-bottom: 1px solid rgba(255,255,255,.35); }
.source-list a { display: block; padding: .9rem 0; }
.source-thread { min-height: 42rem; border-radius: 50% 10% 40% 20%; }
.words-specimens { aspect-ratio: 3 / 2; align-self: end; transform: rotate(2deg); }

.closing-delta { position: relative; min-height: 85vh; display: grid; grid-template-columns: 1fr minmax(13rem,.28fr); align-items: end; color: #fff9e9; background: var(--aquifer-deep); overflow: hidden; }
.closing-panorama { position: absolute; inset: 0; opacity: .48; }
.closing-panorama::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12,51,72,.92), rgba(12,51,72,.18)); }
.closing-copy { position: relative; z-index: 1; padding: 12vh var(--gutter); max-width: 65rem; }
.closing-copy p { max-width: 43rem; }
.return-channel { position: relative; z-index: 1; height: 68vh; margin: 4rem 2rem 0 0; border-radius: 50% 12% 0 0; opacity: .88; }

.site-footer { display: flex; justify-content: space-between; gap: 3rem; padding: 3rem var(--gutter); background: var(--charcoal); color: #f3ebd8; font-size: .9rem; }

/* Privacy: a calmer indexed canal, not a reduced landing page. */
.policy-body { background: #e9e4d8; }
.policy-header { position: sticky; top: 0; background: rgba(233,228,216,.94); }
.policy-header p { margin: 0; font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
.canal-layout { display: grid; grid-template-columns: minmax(15rem,22rem) minmax(0,1fr); align-items: start; }
.policy-index { position: sticky; top: 4.7rem; max-height: calc(100svh - 4.7rem); overflow: auto; padding: 3rem 2rem 4rem var(--gutter); border-right: 1px solid var(--line); }
.policy-index ol { list-style: none; counter-reset: reach; margin: 1.3rem 0 0; padding: 0; }
.policy-index li { counter-increment: reach; }
.policy-index a { display: grid; grid-template-columns: 2.2rem 1fr; gap: .4rem; padding: .62rem 0; text-decoration: none; font-size: .84rem; line-height: 1.25; border-bottom: 1px solid rgba(23,44,50,.12); }
.policy-index a::before { content: counter(reach, decimal-leading-zero); color: var(--aquifer); font-family: var(--display); }
.policy-index a[aria-current="true"] { color: var(--aquifer); font-weight: 800; }
.policy-flow { min-width: 0; }
.policy-intro { padding: clamp(5rem,9vw,10rem) clamp(1.5rem,7vw,8rem); background: linear-gradient(135deg,#f8f3e7,#dbe1d5); }
.policy-intro h1 { max-width: 18ch; margin: .35em 0; font-size: clamp(3rem,6.5vw,7rem); color: var(--aquifer-deep); }
.policy-intro p:last-child { max-width: 65ch; font-size: clamp(1rem,1.5vw,1.25rem); }
.policy-reach { scroll-margin-top: 5rem; position: relative; display: grid; grid-template-columns: minmax(16rem,1fr) minmax(18rem,.85fr); gap: clamp(2rem,6vw,7rem); align-items: center; min-height: 68vh; padding: clamp(4rem,9vw,10rem) clamp(1.5rem,7vw,8rem); border-top: 1px solid var(--line); background: var(--limestone); }
.policy-reach:nth-of-type(4n+2) { background: #dbe1d5; }
.policy-reach:nth-of-type(4n+3) { background: #e4d5bf; }
.policy-reach:nth-of-type(4n) { background: #d7dedc; }
.policy-reach.reverse .policy-copy { order: 2; }
.policy-reach.reverse figure { order: 1; }
.policy-reach.narrow { grid-template-columns: minmax(17rem,.62fr) minmax(14rem,.38fr); }
.policy-copy { max-width: 62ch; }
.policy-copy h2 { font-size: clamp(2.1rem,4.2vw,4.7rem); }
.policy-copy p:not(.reach-label) { font-size: clamp(1rem,1.3vw,1.14rem); }
.policy-reach figure { aspect-ratio: 3 / 2; clip-path: polygon(4% 0, 100% 6%, 95% 94%, 8% 100%, 0 72%); }
.policy-reach figure.portrait { aspect-ratio: 4 / 5; border-radius: 45% 7% 38% 11% / 8% 42% 9% 37%; clip-path: none; }
.policy-reach code { font-size: .84em; overflow-wrap: anywhere; }
.policy-reach:target { box-shadow: inset .35rem 0 0 var(--aquifer); }
.policy-return { padding: 4rem clamp(1.5rem,7vw,8rem) 7rem; background: var(--aquifer-deep); color: white; }
.policy-footer { background: #102a36; }

@media (max-width: 900px) {
  .identity-reach, .finite-reach, .braid, .braid:nth-of-type(even), .source-delta, .closing-delta { grid-template-columns: 1fr; }
  .identity-copy { padding-left: 0; }
  .mineral-seam { min-height: 32rem; }
  .finite-still { min-height: 28rem; clip-path: polygon(0 0,100% 0,94% 92%,15% 100%,0 89%); }
  .shared-copy { grid-column: 1 / 13; }
  .reserve-basin { grid-column: 1 / 10; }
  .entity-layers { grid-column: 8 / 13; }
  .hydrograph-relief { grid-column: 1 / 9; }
  .observe-kit { grid-column: 8 / 13; }
  .app-confluence > header { grid-template-columns: 1fr; }
  .app-confluence > header .reach-number, .app-confluence > header h2, .app-confluence > header p:last-child { grid-column: 1; grid-row: auto; }
  .source-thread { min-height: 28rem; }
  .return-channel { height: 30rem; margin: 0 var(--gutter) 4rem; }
  .canal-layout { grid-template-columns: 1fr; }
  .policy-index { position: relative; top: auto; max-height: none; padding: 2.5rem var(--gutter); border-right: 0; border-bottom: 1px solid var(--line); }
  .policy-index ol { columns: 2; column-gap: 2rem; }
  .policy-index li { break-inside: avoid; }
}

@media (max-width: 640px) {
  .fold-header, .policy-header { align-items: flex-start; }
  .fold-header nav { gap: .8rem; }
  .fold-header nav a:not(:last-child) { display: none; }
  .headwaters { min-height: 84svh; }
  .media-headwaters::after { background: linear-gradient(0deg,rgba(9,34,45,.9),rgba(9,34,45,.08) 80%); }
  .headwaters-copy { padding-top: 12rem; }
  .headwaters-copy h1 { font-size: clamp(3rem,16vw,5.4rem); }
  .identity-reach { grid-template-columns: 1fr; }
  .pueblo-plate { width: 100%; }
  .braid, .braid:nth-of-type(even) { gap: 1.5rem; }
  .braid:nth-of-type(even) > div { order: 2; }
  .braid:nth-of-type(even) figure { order: 1; }
  .shared-reach { display: block; }
  .shared-reach > * { margin-bottom: 1.5rem; transform: none; }
  .app-folds { display: block; }
  .app-folds figure { margin: 0 0 3rem !important; }
  .site-footer { flex-direction: column; gap: .8rem; }
  .policy-header p { max-width: 11rem; text-align: right; }
  .policy-index ol { columns: 1; }
  .policy-reach, .policy-reach.narrow { grid-template-columns: 1fr; min-height: 0; }
  .policy-reach.reverse .policy-copy, .policy-reach.reverse figure { order: initial; }
  .policy-reach figure, .policy-reach figure.portrait { aspect-ratio: 3 / 2; border-radius: 0; clip-path: polygon(3% 0,100% 5%,96% 94%,8% 100%,0 78%); }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .media:hover img { transform: none; }
}

@media print {
  .fold-header, .policy-header, .policy-index, .policy-return, .site-footer { position: static; display: none; }
  .canal-layout { display: block; }
  .policy-reach, .policy-reach.narrow { display: block; min-height: 0; padding: 2rem 0; break-inside: avoid; background: white !important; }
  .policy-reach figure { display: none; }
  body { background: white; color: black; }
}

@view-transition { navigation: auto; }
::view-transition-old(flow-wordmark), ::view-transition-new(flow-wordmark) { animation-duration: 220ms; }
