/* ============================================================
   Celita Summa — "Field notebook"
   Editorial structure · technical/handmade texture · cyanotype blue
   Newsreader (display) · Inter (body) · JetBrains Mono (labels) · Caveat (notes)
   ============================================================ */

:root {
  /* Palette */
  --paper:      #f4efe6;  /* warm paper cream */
  --paper-deep: #ece5d7;  /* shifted panels (loom/photo) */
  --ink:        #1a1a1a;  /* deep ink, not pure black */
  --ink-soft:   #43403b;  /* secondary text */
  --blue:       #2b4c7e;  /* cyanotype / blueprint accent */
  --blue-deep:  #20395f;  /* hover */
  --pencil:     #a8a29a;  /* grid lines, dividers, schematic strokes, labels */
  --brown:      #6b5544;  /* handwritten margin notes */
  --rule:       #d8cfbf;  /* hairline rules on paper */
  --blue-line:      var(--blue);                                       /* the "ink" dividers — full strength */
  --blue-line-soft: color-mix(in srgb, var(--blue) 45%, transparent);  /* sub-dividers within a case */
  --blue-tint:      color-mix(in srgb, var(--blue) 12%, var(--paper)); /* highlighted node fill */

  /* Type */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --hand:  "Kalam", "Segoe Script", cursive;

  /* Layout */
  --aside:   12rem;   /* left margin column for notes + coordinates */
  --main:    46rem;   /* primary reading/content column */
  --gap:     clamp(1.5rem, 4vw, 4rem);
  --pad:     clamp(1.25rem, 5vw, 3.5rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { 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(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 0;
}

p { margin: 0 0 1.2rem; }
p:last-child { margin-bottom: 0; }
em { font-style: italic; }
a { color: inherit; }
img { max-width: 100%; display: block; }

::selection { background: var(--blue); color: var(--paper); }

/* faint graph-paper dot grid behind everything */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(var(--blue) 1px, transparent 1.5px);
  background-size: 24px 24px;
  opacity: 0.18;
}

/* ============================================================
   The "spread" — left margin column + main content, centered
   ============================================================ */
.spread {
  display: grid;
  grid-template-columns: var(--aside) minmax(0, var(--main));
  column-gap: var(--gap);
  justify-content: center;
  padding-inline: var(--pad);
}
.spread__aside { grid-column: 1; }
.spread__main  { grid-column: 2; min-width: 0; }
/* asides that hold no note still reserve the left margin track on desktop,
   but shouldn't leave an empty gap when the columns collapse on mobile */
.spread__aside:empty { display: none; }

/* ============================================================
   Monospace labels / coordinates
   ============================================================ */
.sec-label,
.fig-label,
.coord,
.dateline,
.nav__links a,
.legend li,
.field-notes dt,
.facts dt,
.video-embed__hint,
.photo-frame__hint,
.schematic__step,
.cluster__sat,
.cluster__node,
.schematic-fig figcaption,
.bio__photo figcaption,
.colophon,
.contact__lines {
  font-family: var(--mono);
}

.sec-label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 0.8rem;
}

/* ============================================================
   Header / nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--blue-line);
  transition: border-color 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--blue); }

.nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  max-width: 76rem;
  margin-inline: auto;
  padding: 1.05rem var(--pad);
}
.nav__mark {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.nav__mark-sym {
  color: var(--blue);
  font-weight: 600;
  margin-right: 0.1em;
}
.nav__links {
  display: flex;
  align-items: baseline;
  gap: clamp(0.9rem, 2.5vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  text-decoration: none;
  color: var(--blue);
  transition: color 0.2s var(--ease);
}
.nav__links a:hover { color: var(--blue-deep); }
.nav__num { color: var(--blue); font-weight: 600; }

@media (max-width: 40rem) {
  .nav__links li:nth-child(1),
  .nav__links li:nth-child(3) { display: none; } /* keep work + write-to-me on small */
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  max-width: calc(var(--aside) + var(--main) + var(--gap));
  margin-inline: auto;
  padding: clamp(4.5rem, 13vh, 10rem) var(--pad) clamp(3.5rem, 9vw, 7rem);
}
.hero__inner { max-width: var(--main); }

.dateline {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 1.75rem;
}

.hero__heading {
  font-size: clamp(2.6rem, 1.1rem + 7vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 18ch;
  margin-bottom: 2rem;
  text-wrap: balance;
}

/* italic "write" + hand-drawn underline, in cyanotype blue */
.hand-blue {
  position: relative;
  color: var(--blue);
  font-style: italic;
  white-space: nowrap;
}
.underline-draw {
  position: absolute;
  left: -0.03em;
  right: -0.03em;
  bottom: -0.16em;
  width: calc(100% + 0.06em);
  height: 0.42em;
  overflow: visible;
  pointer-events: none;
}
.underline-draw path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.hero__lede {
  max-width: 40rem;
  font-size: clamp(1.08rem, 1rem + 0.4vw, 1.28rem);
  color: var(--ink-soft);
  margin-bottom: 2.25rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
    color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn--primary { background: var(--blue); color: var(--paper); border-color: var(--blue); }
.btn--primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); transform: translateY(-2px); }
.btn--ghost { border: 1.5px solid var(--blue); color: var(--blue); }
.btn--ghost:hover { background: var(--blue-tint); transform: translateY(-2px); }

/* handwritten "or just scroll →" */
.scroll-note {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--hand);
  font-size: 1.32rem;
  color: var(--brown);
  transform: rotate(-2deg);
  transform-origin: left center;
  margin: 0;
}
.scroll-note__arrow {
  width: 0.85rem;
  height: 1.6rem;
  overflow: visible;
}
.scroll-note__arrow path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding-block: clamp(4rem, 9vw, 8rem);
  position: relative;
}

/* keep anchor jumps clear of the sticky header */
.section, .case { scroll-margin-top: 4.5rem; }
.section::before {
  /* architectural cyanotype transition rule */
  content: "";
  position: absolute;
  top: 0;
  left: var(--pad);
  right: var(--pad);
  height: 2px;
  background: var(--blue-line);
}
/* ruler tick marks at each section transition (left margin) */
.section::after {
  content: "";
  position: absolute;
  top: 0;
  left: var(--pad);
  width: 15px;
  height: 41px;
  background: repeating-linear-gradient(
    to bottom,
    var(--blue) 0 1.5px,
    transparent 1.5px 8px
  );
  opacity: 1;
  pointer-events: none;
}

/* per-section page coordinate, top corner */
.page-coord {
  position: absolute;
  top: 1.15rem;
  right: var(--pad);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  color: var(--blue);
}

/* section header — roman numeral sits directly above the headline */
.section-head { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head .sec-label { margin-bottom: 0.7rem; }

.section-title {
  font-size: clamp(1.5rem, 1.05rem + 1.7vw, 2.1rem);
  margin-bottom: 0;
}

/* ============================================================
   Margin notes (handwritten) + coordinate arrows
   ============================================================ */
/* small documentary photo pinned in the margin (placeholder for now),
   sitting just below the handwritten note + its down-arrow */
.margin-photo { margin: 0.3rem 0 0; }
.margin-photo .photo-frame--margin {
  aspect-ratio: 4 / 3;
  border: 1.5px solid var(--blue);
}
.margin-photo figcaption {
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--blue);
}

.margin-note {
  font-family: var(--hand);
  font-size: 1.04rem;
  line-height: 1.42;
  color: var(--brown);
  margin: 0.4rem 0 0;
  position: relative;
}
.margin-note__arrow {
  display: block;
  width: 3.2rem;
  height: 2.4rem;
  margin-top: 0.4rem;
  overflow: visible;
}
.margin-note__arrow path {
  fill: none;
  stroke: var(--brown);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================
   I · Approach — three principles
   ============================================================ */
.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.principle { padding-top: 1rem; border-top: 2px solid var(--blue); }
.coord {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--blue);
  margin-bottom: 0.6rem;
}
.principle h3 {
  font-size: 1.4rem;
  line-height: 1.12;
  margin-bottom: 0.7rem;
  min-height: 2.24em; /* reserve 2 lines so one-line headings still align their body copy */
}
.principle p {
  font-size: 0.96rem;
  color: var(--ink-soft);
}

/* ============================================================
   II · Work — cases
   ============================================================ */
.case { padding-block: clamp(2.5rem, 5vw, 4rem); }
.case .spread { row-gap: 1.25rem; }

.fig-label {
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 1rem;
}

/* map-legend tags */
.legend {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.legend li {
  font-size: 0.72rem;
  color: var(--ink-soft);
  line-height: 1.9;
}
.legend li::before {
  content: "◦ ";
  color: var(--blue);
}

.case__title {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  line-height: 1.12;
  margin-bottom: 1.75rem;
  max-width: 22ch;
}

/* ---- schematic diagrams (blueprint) ---- */
.schematic-fig {
  position: relative;
  margin: 0 0 2rem;
  padding-top: 1.4rem;
}
/* tiny coordinate label, top-left of each diagram */
.fig-coord {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--blue);
}
.schematic {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 0.3rem;
}
.schematic__step {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1.3;
  color: var(--blue);
  background: var(--paper);
  border: 1.5px solid var(--blue);
  border-radius: 2px;
  padding: 0.5rem 0.4rem;
}
.schematic__step--alt { border-style: dashed; }
.schematic__arrow {
  flex: 0 0 auto;
  align-self: center;
  width: 26px;
  height: 16px;
  color: var(--blue);
}
.schematic__arrow line,
.schematic__arrow path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.schematic-fig figcaption {
  margin-top: 0.85rem;
  font-size: 0.7rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--blue);
}

/* ---- cluster diagram (case 3): hub-and-spoke system map ---- */
.cluster {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
/* dashed blue spokes radiating from the central node to each satellite */
.cluster__links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.cluster__links line {
  stroke: var(--blue);
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
  opacity: 0.65;
}
.cluster__sat,
.cluster__node {
  position: relative;
  z-index: 1;                 /* sit above the spokes */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.64rem;
  line-height: 1.25;
  background: var(--paper);   /* cream fill hides spokes behind boxes */
  border: 1.5px solid var(--blue);
  border-radius: 2px;
  padding: 0.7rem 0.45rem;
  min-height: 3.2rem;
}
.cluster__sat { color: var(--blue); }
.cluster__node {
  background: var(--blue-tint);
  color: var(--blue);
  border-width: 2px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ---- field notes (Situation / What I built / What happened) ---- */
.field-notes { margin: 0; }
.field-notes__row {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.25rem;
  padding-block: 1.1rem;
  border-top: 1px solid var(--blue-line-soft);
}
.field-notes__row:first-child { border-top: none; padding-top: 0; }
.field-notes dt {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pencil);
  padding-top: 0.25rem;
}
.field-notes dd { margin: 0; color: var(--ink-soft); }
.field-notes dd code {
  font-family: var(--mono);
  font-size: 0.84em;
  color: var(--blue);
  background: var(--paper-deep);
  padding: 0.08em 0.4em;
  border-radius: 3px;
  white-space: nowrap;
}

/* ---- video placeholder, framed as a catalogued plate ---- */
/* sits first in the panel now, so space below it (above the field notes) */
.video-fig { margin: 0 0 2.75rem; }
/* blue frame + cream mat + crop marks, matching the bio photo plate */
.video-plate {
  position: relative;
  padding: 0.45rem;                 /* cream mat between video and frame */
  background: var(--paper);
  border: 1.5px solid var(--blue);
}
.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--paper-deep);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.video-embed iframe,
.video-embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
/* in native fullscreen, letterbox instead of cropping the sides on non-16:9 screens */
.video-embed video:fullscreen { object-fit: contain; }
.video-embed video:-webkit-full-screen { object-fit: contain; }
.video-embed__hint {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--pencil);
}

/* ---- collapsible case details (title + schematic stay visible) ---- */
.case__more { margin-top: 1.6rem; }
.case__toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--blue);
  border-radius: 2px;
  background: var(--blue-tint);
  list-style: none;
  user-select: none;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.case__toggle::-webkit-details-marker { display: none; }
.case__toggle:hover,
.case__toggle:focus-visible {
  background: var(--blue);
  color: var(--paper);
  outline: none;
}
/* boxed +/- mark — reads as a control */
.case__toggle-mark {
  font-weight: 600;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  padding: 0.05rem 0.3rem;
  line-height: 1;
}
.case__toggle-mark::before { content: "+"; }
details[open] > .case__toggle .case__toggle-mark::before { content: "\2212"; }
/* explicit action hint, pushed to the right */
.case__toggle::after {
  content: "expand \2193";
  margin-left: auto;
  letter-spacing: 0.06em;
  opacity: 0.85;
}
details[open] > .case__toggle::after { content: "collapse \2191"; }
.case__more-inner { padding-top: 1.6rem; }

/* ============================================================
   III · Bio
   ============================================================ */

/* organic counterpoint — a faint paper grain over the About section only.
   feColorMatrix maps the noise luminance to a low alpha, so it reads as soft
   black speckle over the cream (the grid + divider underneath stay intact). */
.section--about {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.42 0 0 0 0 0.33 0 0 0 0 0.27 0.065 0.065 0.065 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

.bio {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: start;
}
.bio__photo { margin: 0; }

/* portrait treated as a catalogued plate: blue frame, cream mat, crop marks */
.photo-plate {
  position: relative;
  padding: 0.45rem;                 /* cream mat between photo and frame */
  background: var(--paper);
  border: 1.5px solid var(--blue);
}
.photo-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--paper-deep);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 26%;         /* keep the face in frame after the 4:5 crop */
}
.photo-frame__hint {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--pencil);
}

/* corner registration / crop marks, just outside the frame */
.crop {
  position: absolute;
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--blue);
  z-index: 1;
}
.crop--tl { top: -6px;    left: -6px;  border-right: 0; border-bottom: 0; }
.crop--tr { top: -6px;    right: -6px; border-left: 0;  border-bottom: 0; }
.crop--bl { bottom: -6px; left: -6px;  border-right: 0; border-top: 0; }
.crop--br { bottom: -6px; right: -6px; border-left: 0;  border-top: 0; }

.bio__photo figcaption {
  margin-top: 0.7rem;
  font-size: 0.7rem;
  font-style: italic;
  color: var(--blue);
}

.bio__lead {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1rem + 1.1vw, 1.7rem);
  line-height: 1.32;
  color: var(--ink);
}
.bio__text p:not(.bio__lead) { color: var(--ink-soft); font-size: 0.98rem; }

/* condensed tool stack, set as blueprint chips under the headshot */
.bio__stack { margin: 1.1rem 0 0; }
.bio__stack-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pencil);
  margin: 0 0 0.55rem;
}
.bio__stack-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
}
.bio__stack-tags li {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--blue);
  background: var(--blue-tint);
  border: 1px solid var(--blue-line-soft);
  border-radius: 2px;
  padding: 0.18rem 0.5rem;
  line-height: 1.3;
}

/* ============================================================
   IV · Write to me
   ============================================================ */
.contact__prose {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 1rem + 1.4vw, 1.9rem);
  line-height: 1.35;
  max-width: 32ch;
  margin-bottom: 2.25rem;
}
.contact__lines { list-style: none; margin: 0; padding: 0; }
.contact__lines li { margin-bottom: 0.6rem; }
.contact__lines a {
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.2s var(--ease);
}
.contact__lines a:hover { color: var(--blue); }
.contact__sym { color: var(--blue); margin-right: 0.5rem; }

/* ============================================================
   Colophon / footer
   ============================================================ */
.colophon {
  padding-block: 2.75rem;
  position: relative;
}
.colophon::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--pad);
  right: var(--pad);
  height: 2px;
  background: var(--blue-line);
}
.colophon__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
}
.colophon p {
  font-size: 0.7rem;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--pencil);
  margin: 0;
  max-width: 46ch;
}
.colophon__top {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease);
  white-space: nowrap;
}
.colophon__top:hover { color: var(--blue); }
.colophon__arrow { color: var(--blue); }

/* ============================================================
   Scroll-reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ============================================================
   Responsive
   ============================================================ */

/* tablet: collapse the left margin column; notes/labels flow inline above */
@media (max-width: 60rem) {
  .spread {
    grid-template-columns: minmax(0, var(--main));
    justify-content: start;
    max-width: var(--main);
    margin-inline: auto;
  }
  .spread__aside, .spread__main { grid-column: 1; }
  .spread__aside {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1.25rem;
  }
  .sec-label, .fig-label { margin-bottom: 0; }
  .legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-bottom: 0; }
  .legend li { line-height: 1.4; }
  /* margin notes become inline blocks above the section content */
  .margin-photo {
    flex-basis: 100%;
    max-width: 15rem;
    margin-bottom: 0.6rem;
  }
  .margin-note {
    flex-basis: 100%;
    margin-top: 0.5rem;
    font-size: 1.08rem;
  }
  .margin-note__arrow { display: none; }
}

@media (max-width: 48rem) {
  .principles { grid-template-columns: 1fr; gap: 2rem; }
  .principle h3 { min-height: 0; } /* stacked column — no need to reserve 2 lines */

  .bio { grid-template-columns: 1fr; }
  .bio__photo { max-width: 18rem; }

  /* schematics stack; arrows point down */
  .schematic { flex-direction: column; align-items: stretch; gap: 0.3rem; }
  .schematic__step { flex: none; }
  .schematic__arrow { transform: rotate(90deg); align-self: center; margin: 0.05rem 0; }

  /* cluster: hub on top, satellites in a 2-col grid below (spokes don't map to this layout) */
  .cluster { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .cluster__node { grid-column: 1 / -1; order: -1; }
  .cluster__links { display: none; }
}

@media (max-width: 34rem) {
  .field-notes__row { grid-template-columns: 1fr; gap: 0.35rem; }
  .field-notes dt { padding-top: 0; }
  .hero__heading br { display: none; }
  .hero__actions .btn { flex: 1 1 100%; min-height: 48px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .scroll-note { transform: none; }
}
