:root {
  --kh-ink: #121212;
  --kh-paper: #e4e2dd;
  --kh-card: #f3f2ee;
  --kh-signal: #c92516;
  --kh-muted: #5c5a55;
  --kh-line: #2a2925;
  --kh-soft: #9a968c;
  --kh-on-ink: #f3f2ee;
  --kh-rule: #c9c6bf;
  --kh-step: 120ms;
  --kh-ease: cubic-bezier(.2, 0, 0, 1);
  /* The room the hero keeps for the cookie bar: the bar is 77px tall at 768 and up, 92px at 600, 148px on a phone. */
  --kh-cookie-reserve: 92px;
  --kh-display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --kh-sans: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
}
html { scroll-padding-top: 72px; }
/* The body takes the darkest band so no light canvas shows past the footer; every light band sets its own ground. */
body { font-family: var(--kh-sans); color: var(--kh-ink); line-height: 1.5; font-size: 17px; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--kh-ink); outline-offset: 3px; }
.kh-nav :focus-visible, .kh-hero :focus-visible, .kh-detail :focus-visible, .kh-sched :focus-visible, .kh-footer :focus-visible, .kh-cookie :focus-visible { outline-color: #fff; }

/* Nav: the same ink bar as the home page. */

/* Hero: the finished cover photo and the scrim, a plain photo with no depth or reveal; the tag, the headline and the button rise in order. */
.kh-hero { position: relative; min-height: calc(100vh - 69px); min-height: calc(100svh - 69px); display: grid; align-content: end; isolation: isolate; color: #fff; }
.kh-hero-pic { position: absolute; inset: 0; z-index: -2; margin: 0; }
.kh-hero-pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; display: block; }
.kh-hero-scrim { position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(10,10,10,.82) 0%, rgba(10,10,10,.45) 32%, rgba(10,10,10,0) 62%); }
.kh-hero-in { padding: 56px 24px 48px; max-width: 1280px; width: 100%; margin: 0 auto; display: grid; gap: 18px; }
.kh-tag { display: inline-grid; gap: 2px; justify-self: start; margin: 0; background: var(--kh-card); color: var(--kh-ink); padding: 10px 14px 10px 16px; border-left: 4px solid var(--kh-signal); font-size: 14px; line-height: 1.35; }
.kh-tag b { font-family: var(--kh-display); font-size: 20px; text-transform: uppercase; letter-spacing: .02em; font-weight: 800; }
.kh-tag span { color: var(--kh-muted); }
.kh-tag b, .kh-tag span { text-wrap: pretty; }
.kh-hero h1 { font-size: clamp(3rem, 9vw, 7.6rem); max-width: 14ch; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.kh-sub { font-size: clamp(1.05rem, 1.6vw, 1.3rem); max-width: 52ch; margin: 0; color: #ece9e2; }
.kh-hero-cta { margin: 6px 0 0; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.kh-hero-cta .kh-call { color: #fff; }
/* The text sits on the foot of the photo, so a line parsed late pushes the lines above it up. On a slow connection the browser
   paints before the button row arrives; the block stays hidden until it has, so nothing in it moves once seen. */
.kh-hero-in:not(:has(> .kh-hero-cta)) { visibility: hidden; }
/* About hero: the barn photo is upright, and the text on its foot would cover Ben's face, so from 768 up the photo takes the
   right half and the text sits on the ink half beside it, on the page's left content edge. Phones stack the photo over the text. */
.kh-hero { background: var(--kh-ink); }
.kh-hero-pic { left: 50%; }
.kh-hero-pic img { object-position: 50% 60%; }
.kh-hero-in { width: 50%; max-width: none; margin: 0; padding: 56px 48px 56px max(24px, calc(50vw - 616px)); }
.kh-hero h1 { font-size: clamp(3rem, 6.4vw, 4.75rem); max-width: none; text-shadow: none; }

/* Load sequence. The photo starts at .01, not 0, so the browser counts it as painted on the first frame. */
@keyframes kh-fade-in { from { opacity: .01; } to { opacity: 1; } }
@keyframes kh-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.kh-hero-pic { animation: kh-fade-in 900ms ease-out both; }
.kh-seq > * { opacity: 0; animation: kh-rise 520ms var(--kh-ease) forwards; animation-delay: calc(300ms + var(--i, 0) * var(--kh-step)); }

/* Scroll reveals: hidden only once the head script marks the page kh-js, so the content shows with JavaScript off. */
.kh-js .kh-reveal { opacity: 0; transform: translateY(18px); transition: opacity 560ms var(--kh-ease), transform 560ms var(--kh-ease); }
.kh-js .kh-fade { opacity: 0; transition: opacity 560ms ease-out; }
.kh-js .kh-reveal.kh-in, .kh-js .kh-fade.kh-in { opacity: 1; transform: none; }
/* With JavaScript off, photos held back by the loader show their noscript copy and the placeholder hides. */
html:not(.kh-js) img[data-srcset] { display: none !important; }

/* Shared band parts. */
.kh-link { font-weight: 600; color: inherit; text-decoration: underline; text-decoration-color: var(--kh-signal); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.kh-head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px 64px; align-items: end; margin-bottom: 48px; }
.kh-head h2 { font-size: clamp(2.6rem, 6vw, 5.4rem); }
.kh-head p { margin: 0; max-width: 46ch; font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.4; }

/* Photos: each frame holds its box; the loader drops the picture in when it nears the screen. */
.kh-pic { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; margin: 0 0 8px; background: #cfccc5; }
.kh-pic picture { display: contents; }
.kh-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* The story: home's About split (photo left, text right), copied from home.html's "Ben and the crew" rules. */
.kh-about { background: var(--kh-paper); padding: 104px 0; }
.kh-about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px 72px; align-items: center; }
.kh-about-pic { display: block; aspect-ratio: 3 / 4; overflow: hidden; background: #cfccc5; }
.kh-about-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kh-about h2 { font-size: clamp(2.3rem, 4.6vw, 4.2rem); margin-bottom: 28px; }
.kh-about-text p { margin: 0 0 16px; max-width: 60ch; }
/* End of home's About rules. */

/* The finish work: Ben's line from post 022 on the ink band, beside the riser detail from the TimberTech build. */
.kh-detail { background: var(--kh-ink); color: var(--kh-on-ink); padding: 88px 0 96px; }
.kh-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px 72px; align-items: center; }
.kh-detail-line { margin: 0; max-width: 26ch; font-size: clamp(1.5rem, 2.5vw, 2.15rem); line-height: 1.3; font-weight: 600; text-wrap: balance; }
.kh-detail-fig { margin: 0; }
.kh-detail-pic { display: block; aspect-ratio: 4 / 3; overflow: hidden; margin: 0 0 12px; background: #1a1916; }
.kh-detail-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kh-detail figcaption { font-size: 15px; line-height: 1.45; max-width: 52ch; color: #bdbbb3; }
.kh-detail figcaption b { display: block; margin-bottom: 4px; font-family: var(--kh-display); font-size: 22px; line-height: 1; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: var(--kh-signal); }
.kh-detail figcaption a { color: var(--kh-on-ink); }

/* The job grid: a deck, an addition and a roof from the projects page, the whole card the link. */
.kh-more { background: var(--kh-paper); padding: 88px 0 96px; }
.kh-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 28px; }
.kh-card { position: relative; display: grid; gap: 6px; align-content: start; transition: transform .18s var(--kh-ease); }
.kh-card h3 { font-family: var(--kh-sans); text-transform: none; letter-spacing: 0; font-weight: 600; line-height: 1.2; font-size: clamp(1.15rem, 1.4vw, 1.3rem); }
.kh-card p { margin: 0; color: var(--kh-muted); font-size: 16px; }
.kh-card h3 a { color: inherit; text-decoration: none; }
.kh-card h3 a::after { content: ''; position: absolute; inset: 0; }
.kh-pic-tag { position: absolute; left: 0; bottom: 0; display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 7px 12px 6px; background: var(--kh-ink); color: #f3f2ee; font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.kh-pic-tag b { font-family: var(--kh-display); font-size: 20px; line-height: 1; font-weight: 800; color: var(--kh-signal); }
.kh-go { justify-self: start; margin-top: 4px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--kh-signal); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.kh-card:has(a:hover) { transform: translateY(-2px); }
.kh-card:has(a:hover) .kh-go { text-decoration-thickness: 3px; }
.kh-card:has(a:active) { transform: translateY(0); transition-duration: 80ms; }
.kh-all { margin: 48px 0 0; }
.kh-all a { display: inline-flex; align-items: center; min-height: 44px; font-size: 18px; }

/* The schedule on the ink band, signed by Ben. */
.kh-sched { background: var(--kh-ink); color: var(--kh-on-ink); padding: 88px 0 96px; border-bottom: 1px solid var(--kh-line); }
.kh-sched-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px 64px; align-items: end; }
.kh-sched h2 { font-size: clamp(2.6rem, 6vw, 5.4rem); }
.kh-sched-text p { margin: 0 0 14px; max-width: 46ch; }
.kh-sched-text .kh-lead { font-size: clamp(1.15rem, 1.6vw, 1.35rem); line-height: 1.4; }
.kh-sched-text p + p { color: #c9c6be; }
.kh-sched-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; margin-top: 28px !important; }
.kh-sched-cta .kh-call { color: var(--kh-on-ink); text-decoration: underline; text-decoration-color: var(--kh-signal); text-decoration-thickness: 2px; text-underline-offset: 4px; min-height: 44px; display: inline-flex; align-items: center; }
.kh-sign { display: grid; gap: 2px; margin: 32px 0 0 !important; padding-top: 20px; border-top: 1px solid var(--kh-line); }
.kh-sign b { font-family: var(--kh-display); font-size: 1.7rem; line-height: 1; font-weight: 800; text-transform: uppercase; letter-spacing: .01em; color: var(--kh-on-ink); }
.kh-sign span { color: var(--kh-soft); font-weight: 600; }
.kh-foot-grid p, .kh-foot-grid ul { margin: 0; }
.kh-foot-list a { display: inline-flex; align-items: center; min-height: 32px; color: #e4e1da; text-decoration: none; }
.kh-foot-bottom a, .kh-foot-bottom button { color: var(--kh-soft); text-decoration: none; font: inherit; display: inline-flex; align-items: center; min-height: 28px; }
.kh-cookie p { margin: 0; flex: 1; min-width: 220px; font-size: 14px; color: #c9c6be; }
/* While the bar is up on a first visit, the hero lifts its button clear of it (Codex, 2026-10-25: at 390 the bar covered the button). */
html.kh-cookie-open .kh-hero-in { padding-bottom: calc(48px + var(--kh-cookie-reserve)); }
@media (max-width: 1023px) {
  .kh-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .kh-head, .kh-sched-grid, .kh-detail-grid { grid-template-columns: minmax(0, 1fr); }
  /* home.html's About rules at 900: one column, a 4:3 frame. The coop sits low in its photo, so its crop holds 50% 62%, not home's 50% 30%. */
  .kh-about-grid { grid-template-columns: minmax(0, 1fr); }
  .kh-about-pic { aspect-ratio: 4 / 3; max-width: 640px; }
  .kh-about-pic img { object-position: 50% 62%; }
  .kh-detail-pic { max-width: 640px; }
  .kh-foot-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  :root { --kh-cookie-reserve: 148px; }
  .kh-js .kh-nav-links a { min-height: 52px; padding: 0; border-top: 1px solid var(--kh-line); font-size: 17px; }
  .kh-hero { min-height: calc(100svh - 65px); }
  .kh-hero-in { padding: 40px 16px 32px; gap: 14px; }
  html.kh-cookie-open .kh-hero-in { padding-bottom: calc(32px + var(--kh-cookie-reserve)); }
  .kh-hero h1 { font-size: clamp(2.4rem, 11.5vw, 3.6rem); max-width: none; }
  .kh-tag { font-size: 13px; }
  .kh-about, .kh-detail, .kh-more, .kh-sched { padding: 64px 0; }
  .kh-head { margin-bottom: 32px; }
  /* Cards turn into ledger rows, as on the projects page: the photo left, the job right. */
  .kh-cards { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .kh-card { grid-template-columns: 42% minmax(0, 1fr); column-gap: 14px; }
  .kh-card .kh-pic { grid-row: 1 / span 4; margin: 0; }
  .kh-card > :not(.kh-pic) { grid-column: 2; }
  .kh-card p { font-size: 15px; }
  .kh-pic-tag { padding: 5px 8px 4px; font-size: 12px; }
  .kh-pic-tag b { font-size: 19px; }
}

/* Under 768 the about hero stacks: the barn photo across the top, cropped to the three faces and the horse, then the text on ink. */
@media (max-width: 767px) {
  .kh-hero { display: block; min-height: 0; }
  .kh-hero-pic { position: relative; inset: auto; left: auto; display: block; height: 32vh; height: 32svh; min-height: 200px; }
  .kh-hero-pic img { object-position: 50% 52%; }
  .kh-hero-in { width: 100%; padding: 24px 24px 40px; }
  html.kh-cookie-open .kh-hero-in { padding-bottom: calc(40px + var(--kh-cookie-reserve)); }
}
@media (max-width: 600px) {
  .kh-hero-in { padding-left: 16px; padding-right: 16px; }
}
/* Short phones (740px tall and under): the cookie bar takes 148px or more, so the photo band shrinks, the text moves up and the h1 floor drops, keeping the hero button above the bar with the fallback font too. */
@media (max-width: 767px) and (max-height: 760px) {
  .kh-hero-pic { height: 26vh; height: 26svh; min-height: 120px; }
  .kh-hero-pic img { object-position: 50% 47%; }
  .kh-hero-in { padding-top: 16px; gap: 10px; }
  .kh-hero h1 { font-size: clamp(2rem, 9vw, 3.1rem); }
}
/* Phones show no hero photo (Adam, 2026-12-02): the coop stays on wider screens alone. */
@media (max-width: 767px) {
  .kh-hero-pic { display: none; }
  .kh-hero-in { padding-top: 40px; }
}
/* Between the phone menu and the full bar, the nav drops its quote button; the hero and the closing band carry it. */

/* Reduced motion stays last so it wins every cascade. */
@media (prefers-reduced-motion: reduce) {
  .kh-nav-links a { transition: none; }
  .kh-hero-pic { animation: none; }
  .kh-seq > * { animation: none; opacity: 1; }
  .kh-btn, .kh-card { transition: none; }
  .kh-btn:hover, .kh-card:has(a:hover) { transform: none; }
}
