/* ─────────────────────────────────────────────────────────────────────
   open note labs  |  styles.css  |  "ink-green on paper"

   warm cream ground, deep ink-green, editorial lowercase. Newsreader
   (serif, optical) for display + body, Space Grotesk for labels. two
   living elements only: the mesh (background) and the rail filament
   (left margin nav spine). everything else is quiet type and
   whitespace. no cards, no shadows, no rounded corners, no buttons.
   ───────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-italic-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #e9e7d8;        /* warm cream, matched to the reference ground */
  --paper-deep: #e1dfcf;
  --green: #4a6b5c;        /* sage-ink accent (reference sage, darkened for AA) */
  --green-deep: #3a574a;
  --green-faint: rgba(114, 140, 128, 0.4);
  --sage: #a2b7b0;         /* reference stroke sage */
  --sage-soft: #c1cdc2;
  --ink: #2b332a;          /* green-cast near-black for body */
  --ink-soft: #4a5344;     /* AA on paper */
  --ink-faint: #636c58;

  --rule: rgba(114, 140, 128, 0.22);
  --measure: 33rem;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Space Grotesk", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18.5px;
  line-height: 1.6;
  font-weight: 380;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 0.6rem 1rem;
  z-index: 100;
  font-family: var(--sans);
  font-size: 0.8rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ══ the mesh canvas: fixed, full viewport, under everything ══ */
.mesh {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ══ the left rail: the filament canvas + the index links ══ */
:root {
  --rail: clamp(6.5rem, 11vw, 10rem);
  --page-pad: clamp(1.4rem, 5vw, 5.5rem);
}
.rail-thread {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--rail);
  height: 100vh;
  z-index: 3;
  pointer-events: none;
}
.index-rail {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--rail);
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.6rem;
  padding-left: clamp(1.6rem, 2.6vw, 2.6rem);
  z-index: 4;
  font-family: var(--sans);
  pointer-events: none;
}
.index-rail a {
  pointer-events: auto;
  text-decoration: none;
  color: var(--ink-faint);
  font-size: 0.78rem;
  font-weight: 480;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  line-height: 1.1;
  transition: color 200ms ease, transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}
.index-rail a:hover,
.index-rail a:focus { color: var(--green); }
.index-rail a.active {
  color: var(--green);
  transform: translateX(0.35rem);
}
.index-rail a:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

/* mobile progress filament (hidden on desktop) */
.progress {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  z-index: 6;
  background: var(--green);
  transform-origin: 0 0;
  transform: scaleX(0);
  opacity: 0.55;
  pointer-events: none;
}

/* ══ document: content sits to the right of the rail ══ */
main {
  position: relative;
  z-index: 2;
  margin-left: var(--rail);
  padding: 0 var(--page-pad) 0 clamp(1rem, 3vw, 3.5rem);
  max-width: 74rem;
}

/* ── masthead ── */
.masthead {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vh, 4rem) 0;
}
.kicker {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: var(--ink-soft);
  margin: 0 0 1.2rem;
}
.kicker .kd { color: var(--green); padding: 0 0.35em; }

.wordmark {
  font-family: var(--serif);
  font-weight: 300;
  font-size: min(clamp(3.8rem, 12.5vw, 11.5rem), 24vh);
  line-height: 0.92;
  letter-spacing: -0.025em;
  margin: 0 0 0.4em;
  color: var(--green);
}
.wordmark .wm-line { display: block; }
.wordmark .wm-labs {
  font-style: italic;
  font-weight: 260;
  color: var(--ink);
  margin-left: 0.06em; /* optical align of the italic l */
}

.definition {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.12rem, 2.4vw, 1.7rem);
  line-height: 1.35;
  font-weight: 340;
  max-width: 32rem;
  margin: 0 0 2rem;
  color: var(--ink);
}
.definition .def-word { font-style: normal; font-weight: 480; }
.definition .def-pos {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.68em;
  color: var(--green);
  letter-spacing: 0.05em;
}
.masthead-sub {
  max-width: var(--measure);
  font-size: 1.02rem;
  color: var(--ink-soft);
  margin: 0;
}

/* ══ entries ══ */
.entry {
  position: relative;
  padding: clamp(4rem, 11vh, 8rem) 0;
  border-top: 1px solid var(--rule);
}
.entry-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  color: var(--green);
  margin: 0 0 1.1rem;
}
.entry-title {
  font-family: var(--serif);
  font-weight: 330;
  font-size: clamp(1.9rem, 5vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0 0 clamp(1.8rem, 4.5vh, 3.2rem);
  color: var(--ink);
  max-width: 24ch;
}
.entry-body { max-width: var(--measure); }
.entry-body p { margin: 0 0 1.2rem; }
.entry-body p:last-child { margin-bottom: 0; }
.entry-intro {
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 0 0 clamp(2rem, 5vh, 3.4rem);
}
.lead {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.8vw, 1.9rem);
  line-height: 1.3;
  font-weight: 360;
  color: var(--ink);
  margin: 0 0 1.4rem;
}
.thesis {
  border-left: 2px solid var(--green);
  padding-left: 1.2rem;
  color: var(--ink-soft);
}

/* the premise body steps in from the title, one quiet indent */
#premise .entry-body { margin-left: clamp(0rem, 6vw, 6rem); }

/* ══ the pillars section: a strict four-column colonnade. each pillar
   opens with its own vertical stroke drawn as a top rule + roman
   numeral, reading as fluting, not as a feature grid. ══ */
.pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 clamp(1.4rem, 3vw, 3rem);
}
.pillar {
  padding-top: 1.4rem;
  border-top: 1px solid var(--green-faint);
  position: relative;
}
.pillar::before {
  /* the stroke: a short vertical rule dropping from the top border */
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 2.6rem;
  background: var(--green);
}
.pillar-n {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--green);
  margin: 0 0 1.6rem;
  padding-left: 0.9rem;
}
.pillar-name {
  font-family: var(--serif);
  font-weight: 360;
  font-size: clamp(1.4rem, 2.4vw, 2.1rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 0.7rem;
  color: var(--ink);
}
.pillar-desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
  max-width: 17rem;
}

/* ══ the gallery: empty frames, honest and quiet. one hairline border,
   the live mesh visible through each aperture. asymmetric editorial
   layout on a 6-col grid. real photos drop in without a redesign. ══ */
.gallery {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(1rem, 2.4vw, 2rem);
}
.frame {
  margin: 0;
  position: relative;
  border: 1px solid rgba(35, 84, 59, 0.22);
  display: flex;
  align-items: flex-end;
  padding: 0.9rem 1rem;
}
.frame figcaption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--ink-soft);
}
/* when a real photo drops in: <img> fills the frame, caption overlays */
.frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.frame figcaption { position: relative; z-index: 1; }

/* asymmetric spans + aspect ratios */
.f-a { grid-column: 1 / span 4; aspect-ratio: 16 / 9; }
.f-b { grid-column: 5 / span 2; aspect-ratio: 3 / 4; }
.f-c { grid-column: 1 / span 2; aspect-ratio: 4 / 5; }
.f-d { grid-column: 3 / span 2; aspect-ratio: 4 / 5; }
.f-e { grid-column: 5 / span 2; aspect-ratio: 4 / 5; }

/* ══ find us ══ */
.find-body { max-width: 42rem; }
.find-line { margin: 0 0 0.9rem; }
.go-link {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.6vw, 2.5rem);
  font-weight: 340;
  color: var(--green);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  text-decoration-color: var(--green-faint);
  line-height: 1.25;
  display: inline-block;
}
.go-link::before {
  content: "\2192\00a0";
  display: inline-block;
}
.go-link:hover, .go-link:focus {
  color: var(--green-deep);
  text-decoration-color: var(--green);
}
.find-line-sub { margin-top: 2rem; }
.addr {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

/* ══ colophon ══ */
.colophon {
  position: relative;
  z-index: 2;
  max-width: 74rem;
  margin: 0 0 0 var(--rail);
  padding: clamp(2.4rem, 6vh, 4rem) var(--page-pad) clamp(3rem, 8vh, 5rem) clamp(1rem, 3vw, 3.5rem);
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem clamp(1.5rem, 4vw, 3rem);
  align-items: baseline;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
}
.colophon-brand {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 340;
  letter-spacing: -0.01em;
  color: var(--green);
}
.colophon-note { justify-self: end; color: var(--ink-faint); }

/* ══ responsive ══ */
@media (max-width: 900px) {
  body { font-size: 17px; }
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.6rem clamp(1.4rem, 4vw, 2.4rem); }
  /* the rail collapses: filament + index hide, a thin top progress
     line takes over. no hamburger. */
  .rail-thread, .index-rail { display: none; }
  .progress { display: block; }
  main { margin-left: 0; padding: 0 var(--page-pad); }
  #premise .entry-body { margin-left: 0; }
  .colophon { grid-template-columns: 1fr; margin-left: 0; padding-left: var(--page-pad); }
  .colophon-note { justify-self: start; }
}

@media (max-width: 560px) {
  .masthead { padding-top: 4rem; }
  .wordmark { font-size: min(19vw, 16vh); }
  .pillars { grid-template-columns: 1fr; gap: 2.4rem 0; }
  .pillar-desc { max-width: none; }
  .gallery { grid-template-columns: 1fr 1fr; gap: 0.9rem; }
  .f-a { grid-column: 1 / -1; }
  .f-b { grid-column: 1 / span 1; aspect-ratio: 4 / 5; }
  .f-c { grid-column: 2 / span 1; }
  .f-d { grid-column: 1 / span 1; }
  .f-e { grid-column: 2 / span 1; }
}

/* ══ motion gate: initial hidden states ONLY under [data-motion] ══ */
html[data-motion] .kicker,
html[data-motion] .wordmark,
html[data-motion] .definition,
html[data-motion] .masthead-sub,
html[data-motion] .entry-label,
html[data-motion] .entry-title,
html[data-motion] .entry-intro,
html[data-motion] .entry-body > p,
html[data-motion] .pillar,
html[data-motion] .frame,
html[data-motion] .find-line {
  opacity: 0;
}
html[data-motion] .wordmark .split-char,
html[data-motion] .entry-title .split-word {
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* belt and braces: nothing hides even if the gate leaked */
  html[data-motion] .kicker,
  html[data-motion] .wordmark,
  html[data-motion] .definition,
  html[data-motion] .masthead-sub,
  html[data-motion] .entry-label,
  html[data-motion] .entry-title,
  html[data-motion] .entry-intro,
  html[data-motion] .entry-body > p,
  html[data-motion] .pillar,
  html[data-motion] .frame,
  html[data-motion] .find-line { opacity: 1; }
}
