/* Base: reset, type, grid, links, focus, motion primitives */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
  background: var(--paper);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.62;
  letter-spacing: 0.002em;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--green); color: var(--on-night); }
.on-night ::selection, .on-green ::selection { background: var(--on-night); color: var(--night); }
:root { accent-color: var(--green); caret-color: var(--green); scrollbar-color: var(--rule-strong) var(--paper); }
img, picture, svg { display: block; max-width: 100%; height: auto; }
picture img { width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:where(ul[role="list"], ol[role="list"]) { list-style: none; margin: 0; padding: 0; }
[hidden] { display: none !important; }
p { margin: 0 0 1em; text-wrap: pretty; max-width: 66ch; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
  font-feature-settings: "kern", "liga", "lnum";
}
h1 { font-size: var(--fs-xl); hyphens: manual; line-height: 1.04; letter-spacing: -0.018em; }
h2 { font-size: var(--fs-l); line-height: 1.08; letter-spacing: -0.012em; }
h3 { font-size: var(--fs-m); line-height: 1.16; letter-spacing: -0.006em; }
h1 em, h2 em, h3 em { font-style: italic; }

.lead {
  font-family: var(--serif);
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--ink);
  font-feature-settings: "kern", "liga", "onum", "pnum";
  max-width: 38ch;
}
.lead--wide { max-width: 52ch; }
.side-head {
  font-family: var(--serif);
  font-size: var(--fs-side);
  font-weight: 500;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.055em;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
}
.sc { font-variant-caps: all-small-caps; letter-spacing: 0.05em; }
.caption { font-size: var(--fs-caption); line-height: 1.45; color: var(--muted); letter-spacing: 0.01em; }
.figure { font-family: var(--serif); font-feature-settings: "lnum", "tnum"; }
.serif-text { font-family: var(--serif); font-feature-settings: "onum", "pnum"; }
strong { font-weight: 600; color: var(--ink); }

/* Links */
a { color: var(--green-text); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }
.on-night a { color: var(--green-light); }
.on-night a:hover { color: var(--on-night); }

/* Focus */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.on-night :focus-visible { outline-color: var(--focus-on-night); }

/* Grounds */
.ground-paper { background: var(--paper); }
.ground-stone { background: var(--stone); }
.ground-stone-deep { background: var(--stone-deep); }
.on-night { background: var(--night); color: var(--on-night-muted); }
.on-night h1, .on-night h2, .on-night h3, .on-night .lead, .on-night .side-head, .on-night strong { color: var(--on-night); }
.on-night .caption { color: var(--on-night-muted); }
.on-green { background: var(--green); color: var(--on-night-muted); }
.on-green h1, .on-green h2, .on-green h3, .on-green .lead, .on-green .side-head, .on-green strong { color: var(--on-night); }
.on-green a { color: var(--on-night); }
.on-green :focus-visible { outline-color: var(--on-night); }

/* Layout */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--margin);
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
}
.section { padding-block: var(--section); }
.section--tight { padding-block: var(--section-tight); }
.span-all { grid-column: 1 / -1; }
.col-side { grid-column: 1 / span 3; }
.col-text { grid-column: 4 / span 7; }
.col-main { grid-column: 4 / -1; }

@media (max-width: 899px) {
  .col-side, .col-text, .col-main { grid-column: 1 / -1; }
  .col-side { margin-bottom: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--rule-strong); }
  .on-night .col-side { border-top-color: var(--rule-night); }
}

.rule-top { border-top: 1px solid var(--rule); }
.on-night .rule-top { border-top-color: var(--rule-night); }

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--s4);
  top: -100px;
  z-index: var(--z-skip);
  background: var(--ink);
  color: var(--paper);
  padding: var(--s3) var(--s4);
  font-family: var(--sans);
  font-size: var(--fs-ui);
  text-decoration: none;
}
.skip-link:focus { top: var(--s4); color: var(--paper); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Primary action: typographic, one per screen */
.action {
  position: relative;
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  padding-block: var(--s2);
  transition: text-decoration-thickness var(--t-ui) var(--ease-stone), transform var(--t-ui) var(--ease-stone);
}
.action::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 2px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--t-state) var(--ease-stone);
}
.action:hover, .action:focus-visible { color: var(--ink); text-decoration-thickness: 2px; }
.action:hover::after, .action:focus-visible::after { transform: scaleX(1); }
.action:active { transform: translateY(1px); }
.on-night .action, .on-green .action { color: var(--on-night); }
.on-night .action::after { background: var(--green-light); }
.on-green .action::after { background: var(--on-night); }

/* Solid action: form submit only */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: var(--s4) 28px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.005em;
  transition: background-color var(--t-ui) var(--ease-stone), transform var(--t-ui) var(--ease-stone);
}
.button:hover { background: var(--green); }
.button:active { transform: translateY(1px); }
.button[aria-disabled="true"] { background: var(--rule); color: var(--muted); cursor: not-allowed; }

/* Photographs */
.photo { position: relative; overflow: hidden; background: var(--stone-deep); margin: 0; }
.photo > picture { display: block; width: 100%; height: 100%; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo--4x5 { aspect-ratio: 4 / 5; }
.photo--2x3 { aspect-ratio: 2 / 3; }
.photo--3x2 { aspect-ratio: 3 / 2; }
.photo--golden { aspect-ratio: 1.618 / 1; }
.photo--21x9 { aspect-ratio: 21 / 9; }
@media (max-width: 639px) {
  .photo--21x9, .photo--golden { aspect-ratio: 4 / 5; }
}
.credit { margin-top: var(--s2); font-size: var(--fs-caption); color: var(--muted); max-width: none; }
.credit a { color: inherit; }
.on-night .credit { color: var(--on-night-muted); }

/* Motion primitives. Content is visible by default; html.motion is set only when JS confirms it can animate. */
.line-mask { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.line-mask > span { display: block; }

@media (prefers-reduced-motion: no-preference) {
  html.motion [data-reveal="lines"] .line-mask > span {
    transform: translateY(105%);
    transition: transform var(--t-reveal) var(--ease-settle);
    transition-delay: calc(var(--i, 0) * var(--stagger) + var(--delay, 0ms));
  }
  html.motion [data-reveal="lines"].is-in .line-mask > span { transform: none; }

  html.motion [data-reveal="wipe"] {
    clip-path: inset(0 0 100% 0);
    transition: clip-path var(--t-wipe) var(--ease-weight);
  }
  html.motion [data-reveal="wipe"] img {
    transform: scale(1.08);
    transition: transform calc(var(--t-wipe) + 400ms) var(--ease-stone);
  }
  html.motion [data-reveal="wipe"].is-in { clip-path: inset(0 0 0 0); }
  html.motion [data-reveal="wipe"].is-in img { transform: none; }

  html.motion [data-reveal="fade"] {
    opacity: 0;
    transition: opacity var(--t-reveal) var(--ease-stone);
    transition-delay: var(--delay, 0ms);
  }
  html.motion [data-reveal="fade"].is-in { opacity: 1; }

  @supports (animation-timeline: view()) {
    .parallax img {
      height: 112%;
      max-height: none;
      animation: parallax linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }
    @keyframes parallax {
      from { transform: translateY(0); }
      to { transform: translateY(-10%); }
    }
  }
}
