:root {
  --ink: #26312b;
  --graphite: #3b403b;
  --paper: #e9dec2;
  --paper-light: #f7f1df;
  --moss: #244b38;
  --lichen: #78956b;
  --bark: #6d4932;
  --rust: #b65531;
  --twilight: #40566d;
  --orange: #f08a3c;
  --rule: rgba(38, 49, 43, .23);
  --max: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(65, 75, 66, .045) 31px 32px),
    radial-gradient(circle at 20% 10%, rgba(120, 149, 107, .12), transparent 28%),
    var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.65;
}

img { display: block; width: 100%; height: auto; object-fit: cover; }
a { color: inherit; }
button { font: inherit; }
p, h1, h2, h3 { margin-top: 0; }
h1, h2, h3 { font-family: "Avenir Next Condensed", "Arial Narrow", "Segoe UI", sans-serif; line-height: .98; text-wrap: balance; }
h1 { font-size: clamp(3.3rem, 7.5vw, 8.5rem); letter-spacing: -.055em; text-transform: uppercase; }
h2 { font-size: clamp(2.5rem, 5vw, 5.8rem); letter-spacing: -.045em; text-transform: uppercase; }
h3 { font-size: clamp(1.55rem, 2.5vw, 2.5rem); letter-spacing: -.025em; }

.skip-link { position: fixed; z-index: 100; top: .7rem; left: .7rem; padding: .75rem 1rem; color: #fff; background: var(--moss); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.field-width { width: min(var(--max), calc(100% - 3rem)); margin-inline: auto; }
.field-code, .entry-id { margin-bottom: .8rem; color: var(--rust); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.field-link { display: inline-flex; gap: .75rem; align-items: center; padding: .65rem 0; color: var(--moss); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; text-decoration: none; border-bottom: 3px solid var(--rust); }

.folio-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
  min-height: 78px;
  padding: .75rem max(1.5rem, calc((100vw - var(--max)) / 2));
  color: var(--paper-light);
  background: var(--moss);
  border-bottom: 9px solid var(--graphite);
}
.folio-strip p { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .76; }
.folio-mark { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.folio-mark span { display: grid; place-items: center; width: 2.55rem; aspect-ratio: 1; color: var(--moss); background: var(--paper); border: 3px solid var(--orange); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; font-weight: 900; clip-path: polygon(0 0, 83% 0, 100% 17%, 100% 100%, 17% 100%, 0 83%); }
.folio-mark strong { font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif; font-size: 1.25rem; letter-spacing: .03em; text-transform: uppercase; }
.folio-strip nav, .field-footer nav { display: flex; flex-wrap: wrap; gap: .7rem 1.3rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; text-transform: uppercase; }
.folio-strip nav a { text-underline-offset: .35rem; }
.folio-strip nav a:hover, .folio-strip nav a:focus-visible { color: #ffb276; }

.specimen-cover { display: grid; grid-template-columns: 1.08fr .92fr; min-height: calc(100vh - 78px); align-items: center; gap: clamp(2rem, 7vw, 8rem); padding-block: clamp(4rem, 8vw, 8rem); }
.cover-plate { position: relative; padding: clamp(.8rem, 2vw, 1.5rem); background: var(--paper-light); box-shadow: 18px 22px 0 rgba(59, 64, 59, .17); transform: rotate(-1deg); clip-path: polygon(0 0, 94% 0, 100% 6%, 100% 100%, 7% 100%, 0 93%); }
.cover-plate img { aspect-ratio: .93; filter: saturate(.9) contrast(1.03); }
.corner-tick { position: absolute; width: 3.5rem; height: 3.5rem; border-color: var(--rust); }
.tick-a { top: .35rem; left: .35rem; border-top: 3px solid; border-left: 3px solid; }
.tick-b { right: .35rem; bottom: .35rem; border-right: 3px solid; border-bottom: 3px solid; }
.cover-copy { padding-right: clamp(0rem, 4vw, 4rem); }
.cover-copy h1 { margin-bottom: 1.5rem; color: var(--moss); }
.lead { max-width: 42rem; font-size: clamp(1.18rem, 2vw, 1.55rem); }

.common-ground { display: grid; grid-template-columns: .65fr 1.35fr; gap: clamp(2rem, 8vw, 10rem); align-items: start; padding-block: clamp(5rem, 9vw, 9rem); border-top: 1px solid var(--rule); }
.margin-note { position: relative; padding: 2rem 2rem 2rem 4rem; background: rgba(247, 241, 223, .7); border-block: 2px solid var(--graphite); }
.margin-note::before { content: ""; position: absolute; inset: 0 auto 0 1.4rem; border-left: 2px solid var(--rust); }
.margin-note span { font-family: ui-monospace, monospace; font-size: .7rem; letter-spacing: .18em; }
.margin-note p { margin: 1rem 0 0; font-style: italic; }

.transect { padding-block: clamp(4rem, 8vw, 8rem); background: rgba(247, 241, 223, .52); border-block: 12px double var(--moss); }
.transect-heading { padding-bottom: 4rem; }
.transect-row { display: grid; grid-template-columns: minmax(7rem, .22fr) minmax(18rem, .78fr) minmax(20rem, 1fr); align-items: stretch; width: min(var(--max), calc(100% - 3rem)); margin: 0 auto 2px; background: var(--paper-light); border-top: 1px solid var(--graphite); }
.transect-label { display: flex; flex-direction: column; justify-content: space-between; min-height: 100%; padding: 1.2rem; color: var(--paper-light); background: var(--graphite); font-family: ui-monospace, monospace; text-transform: uppercase; }
.transect-label span { color: var(--orange); font-size: 2.5rem; font-weight: 900; }
.transect-label small { opacity: .68; writing-mode: vertical-rl; transform: rotate(180deg); }
.transect-row figure { margin: 0; padding: 1rem; background: #d4c7a7; }
.transect-row img { height: 100%; min-height: 360px; }
.observation-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 5vw, 5rem); border-left: 1px dashed var(--rule); }
.observation-copy h3 { color: var(--moss); }
.row-light .transect-label { background: var(--twilight); }
.row-context .transect-label { background: var(--bark); }

.lens-bench { padding-block: clamp(6rem, 10vw, 10rem); }
.lens-bench > header { max-width: 67rem; }
.lens-layout { display: grid; grid-template-columns: 1.4fr .6fr; gap: 2rem; align-items: start; margin-top: 3rem; }
.lens-plates { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--graphite); }
.lens-tab { position: relative; min-width: 0; padding: .8rem; text-align: left; color: var(--ink); background: var(--paper-light); border: 0; border-right: 1px solid var(--graphite); border-bottom: 1px solid var(--graphite); cursor: pointer; }
.lens-tab:nth-child(even) { border-right: 0; }
.lens-tab:nth-child(n + 3) { border-bottom: 0; }
.lens-tab img { aspect-ratio: 4 / 3; filter: saturate(.72); transition: filter .2s ease; }
.lens-tab span { display: inline-block; margin-top: .75rem; color: var(--moss); font-family: ui-monospace, monospace; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.lens-tab::after { content: ""; position: absolute; inset: .3rem; border: 0 solid var(--orange); pointer-events: none; }
.lens-tab:hover img, .lens-tab:focus-visible img, .lens-tab.is-active img { filter: saturate(1); }
.lens-tab:focus-visible { outline: 4px solid var(--orange); outline-offset: -4px; }
.lens-tab.is-active::after { border-width: 4px; }
.lens-note { position: sticky; top: 2rem; min-height: 350px; padding: clamp(2rem, 4vw, 4rem); color: var(--paper-light); background: var(--moss); border-bottom: 13px solid var(--orange); clip-path: polygon(0 0, 91% 0, 100% 9%, 100% 100%, 0 100%); }
.lens-note .field-code { color: #ffb276; }

.yard-study { padding-block: clamp(5rem, 9vw, 9rem); color: var(--paper-light); background: var(--twilight); }
.yard-heading { max-width: var(--max); }
.yard-heading .field-code { color: #ffc494; }
.yard-heading p:last-child { max-width: 52rem; }
.plate-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(320px, 1fr); gap: 1px; margin-top: 3rem; padding-inline: max(1.5rem, calc((100vw - var(--max)) / 2)); overflow-x: auto; scroll-snap-type: x mandatory; background: rgba(255, 255, 255, .25); }
.yard-plate { position: relative; scroll-snap-align: start; padding: 1rem 1rem 2.2rem; color: var(--ink); background: var(--paper-light); }
.yard-plate img { aspect-ratio: 4 / 5; }
.yard-plate h3, .yard-plate p { margin-inline: 1rem; }
.yard-plate h3 { margin-top: 1.4rem; color: var(--moss); }
.plate-number { position: absolute; z-index: 2; top: 1.7rem; left: 1.7rem; padding: .4rem .6rem; color: var(--paper-light); background: var(--rust); font-family: ui-monospace, monospace; font-weight: 900; }

.decision-key { padding-block: clamp(6rem, 10vw, 10rem); }
.decision-heading { max-width: 78rem; margin-bottom: 4rem; }
.decision-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--graphite); }
.decision-grid figure { margin: 0; padding: 1rem; background: rgba(247, 241, 223, .7); border-right: 1px solid var(--graphite); border-bottom: 1px solid var(--graphite); }
.decision-grid figure:nth-child(even) { border-right: 0; }
.decision-grid img { aspect-ratio: 4 / 3; }
.decision-grid figcaption { padding: 1.2rem .5rem .5rem; }
.decision-grid figcaption strong { display: block; color: var(--moss); font-family: ui-monospace, monospace; text-transform: uppercase; }
.app-pocket { grid-column: 1 / -1; display: grid; grid-template-columns: .72fr 1.28fr; gap: clamp(2rem, 7vw, 7rem); align-items: center; padding: clamp(1rem, 3vw, 3rem); color: var(--paper-light); background: var(--moss); border-top: 10px solid var(--orange); }
.app-pocket img { aspect-ratio: 1; }
.app-pocket .field-code { color: #ffc494; }

.field-footer { display: flex; justify-content: space-between; gap: 2rem; padding: 2.5rem max(1.5rem, calc((100vw - var(--max)) / 2)); color: var(--paper-light); background: #1c251f; border-top: 8px solid var(--rust); }
.field-footer p { margin: .35rem 0 0; opacity: .76; }

.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(1.8rem); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Privacy field notebook */
.notebook-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); width: min(1500px, calc(100% - 3rem)); margin: 0 auto; padding-block: clamp(4rem, 8vw, 8rem); align-items: start; }
.notebook-index { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; color: var(--paper-light); background: var(--graphite); border-right: 7px solid var(--rust); }
.index-heading { padding: 1.3rem; border-bottom: 1px solid rgba(255,255,255,.25); }
.index-heading span, .index-heading strong { display: block; }
.index-heading span { color: #ffc494; font-family: ui-monospace, monospace; font-size: .7rem; letter-spacing: .18em; }
.index-heading strong { margin-top: .35rem; font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif; font-size: 1.35rem; text-transform: uppercase; }
.notebook-index ol { margin: 0; padding: 0; list-style: none; }
.notebook-index li { border-bottom: 1px solid rgba(255,255,255,.1); }
.notebook-index a { display: grid; grid-template-columns: 2.3rem 1fr; gap: .4rem; padding: .72rem 1rem; text-decoration: none; font-size: .88rem; }
.notebook-index a span { color: #ffc494; font-family: ui-monospace, monospace; }
.notebook-index a:hover, .notebook-index a:focus-visible, .notebook-index a.is-current { color: var(--ink); background: var(--paper); outline: 0; }
.notebook-index a.is-current span { color: var(--rust); }
.notebook-pages { min-width: 0; background: rgba(247, 241, 223, .6); border-right: 1px solid var(--graphite); }
.notebook-cover { min-height: 70vh; padding: clamp(3rem, 8vw, 8rem); color: var(--paper-light); background: var(--moss); border-bottom: 16px double var(--paper); }
.notebook-cover .field-code { color: #ffc494; }
.notebook-cover p:last-child { max-width: 55rem; font-size: 1.15rem; }
.notebook-entry { scroll-margin-top: 1rem; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 7vw, 7rem); align-items: center; min-height: 520px; padding: clamp(2rem, 6vw, 6rem); border-bottom: 1px solid var(--graphite); background:
  linear-gradient(90deg, transparent 0 5rem, rgba(182, 85, 49, .24) 5rem calc(5rem + 2px), transparent calc(5rem + 2px)),
  repeating-linear-gradient(0deg, transparent 0 31px, rgba(59, 64, 59, .085) 31px 32px),
  var(--paper-light);
.notebook-entry:nth-of-type(even) { grid-template-columns: .85fr 1.15fr; }
.notebook-entry:nth-of-type(even) .entry-copy { order: 2; }
.notebook-entry figure { position: relative; margin: 0; padding: .7rem; background: var(--paper); box-shadow: 12px 14px 0 rgba(59, 64, 59, .14); transform: rotate(-1deg); }
.notebook-entry:nth-of-type(even) figure { transform: rotate(1deg); }
.notebook-entry figure::before, .notebook-entry figure::after { content: ""; position: absolute; width: 2rem; height: 2rem; border-color: var(--rust); }
.notebook-entry figure::before { top: .25rem; left: .25rem; border-top: 2px solid; border-left: 2px solid; }
.notebook-entry figure::after { right: .25rem; bottom: .25rem; border-right: 2px solid; border-bottom: 2px solid; }
.notebook-entry img { aspect-ratio: 1; }
.notebook-entry h2 { color: var(--moss); font-size: clamp(2rem, 4vw, 4.5rem); }
.text-entry { grid-template-columns: 1fr; min-height: 420px; }
.text-entry:nth-of-type(even) { grid-template-columns: 1fr; }
.text-entry .entry-copy { max-width: 58rem; margin-inline: auto; }
.final-entry { color: var(--paper-light); background: var(--twilight); }
.final-entry h2 { color: var(--paper-light); }
.final-entry .entry-id { color: #ffc494; }
.final-entry .field-link { color: var(--paper-light); border-color: #ffc494; }

@media (max-width: 980px) {
  .folio-strip { grid-template-columns: 1fr auto; }
  .folio-strip > p { display: none; }
  .specimen-cover, .common-ground, .lens-layout, .app-pocket { grid-template-columns: 1fr; }
  .transect-row { grid-template-columns: 6rem 1fr; }
  .transect-row .observation-copy { grid-column: 1 / -1; }
  .lens-note { position: relative; top: auto; }
  .notebook-layout { grid-template-columns: 1fr; width: min(100% - 2rem, 1100px); }
  .notebook-index { position: sticky; z-index: 10; top: 0; max-height: none; overflow: hidden; border-right: 0; border-bottom: 7px solid var(--rust); }
  .index-heading { display: none; }
  .notebook-index ol { display: flex; overflow-x: auto; }
  .notebook-index li { flex: 0 0 auto; border-bottom: 0; border-right: 1px solid rgba(255,255,255,.1); }
  .notebook-index a { display: flex; white-space: nowrap; }
  .notebook-entry { scroll-margin-top: 64px; }
}

@media (max-width: 680px) {
  .field-width { width: min(100% - 1.4rem, var(--max)); }
  .folio-strip { grid-template-columns: 1fr; gap: .7rem; }
  .folio-strip nav { font-size: .68rem; }
  .specimen-cover { padding-top: 2rem; }
  .transect-row { grid-template-columns: 1fr; width: min(100% - 1.2rem, var(--max)); }
  .transect-label { min-height: auto; flex-direction: row; align-items: center; }
  .transect-label span { font-size: 1.6rem; }
  .transect-label small { writing-mode: initial; transform: none; }
  .transect-row .observation-copy { grid-column: auto; }
  .lens-plates, .decision-grid { grid-template-columns: 1fr; }
  .lens-tab:nth-child(n) { border-right: 0; border-bottom: 1px solid var(--graphite); }
  .lens-tab:last-child { border-bottom: 0; }
  .decision-grid figure:nth-child(n) { border-right: 0; }
  .app-pocket { grid-column: auto; }
  .field-footer { flex-direction: column; }
  .notebook-layout { width: 100%; }
  .notebook-entry, .notebook-entry:nth-of-type(even) { grid-template-columns: 1fr; gap: 1.5rem; padding: 2rem 1.2rem 3rem; background:
    linear-gradient(90deg, transparent 0 1rem, rgba(182, 85, 49, .24) 1rem calc(1rem + 2px), transparent calc(1rem + 2px)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(59, 64, 59, .085) 31px 32px),
    var(--paper-light);
  }
  .notebook-entry:nth-of-type(even) .entry-copy { order: initial; }
  .notebook-cover { min-height: auto; padding: 3rem 1.2rem; }
}

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