/* Anunad Studio: a naturalist's notebook set as a science book.
   One deliberate light look (paper and ink), so no dark theme. */

@font-face { font-family: "EB Garamond"; src: url("/fonts/garamond.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/garamond-italic.woff2") format("woff2"); font-weight: 400 600; font-style: italic; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("/fonts/dmmono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("/fonts/dmmono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("/fonts/caveat.woff2") format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Tiro Devanagari"; src: url("/fonts/tiro-deva.woff2") format("woff2"); font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }

:root {
  color-scheme: light;
  --paper: #f3eee2;
  --print: #fbf8f0;
  --ink: #1d2326;
  --ink-2: #474c4e;
  --pencil: #6e6a60;
  --rule: #cdc2ab;
  --blue: #2b4766;      /* blue-black writing ink */
  --madder: #a3402a;    /* red pencil: section marks, figure numbers */
  --grid: rgba(64, 104, 112, .075);
  --serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --mono: "DM Mono", ui-monospace, Consolas, monospace;
  --hand: "Caveat", "Segoe Print", cursive;
  --deva: "Tiro Devanagari", "Nirmala UI", serif;
  --gutter: clamp(16px, 4vw, 56px);
  --margin-col: 228px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  /* paper fibre: very low-contrast noise */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .18 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  font: 400 clamp(18px, .55vw + 14.5px, 21px)/1.55 var(--serif);
  font-feature-settings: "onum", "kern", "liga";
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--madder); outline-offset: 3px; }
.mono { font-family: var(--mono); font-size: .66em; letter-spacing: .04em; font-feature-settings: normal; }
.sc { font-variant-caps: all-small-caps; letter-spacing: .07em; font-feature-settings: "lnum"; }
.deva { font-family: var(--deva); }
.hand { font-family: var(--hand); font-weight: 500; color: var(--blue); line-height: 1.12; }
.red { color: var(--madder); }
.mark .num, .figno, .refs li::before, sup, .plate-key li > span:first-child { font-variant-numeric: lining-nums; }

.page { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- running head ---------- */
.running-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 22px 0 12px; border-bottom: 1px solid var(--rule);
}
.wordmark { color: var(--ink); text-decoration: none; font-size: 1.02rem; font-weight: 500; }
.wordmark .sc { font-size: 1.12em; }
.running-head nav { display: flex; gap: clamp(14px, 2.4vw, 34px); }
.running-head nav a { color: var(--ink-2); text-decoration: none; font-size: .95rem; white-space: nowrap; }
.running-head nav a .red { font-size: .82em; margin-right: .2em; }
.running-head nav a:hover { color: var(--ink); text-decoration: underline; }
.folio { color: var(--pencil); }

/* ---------- section scaffold: margin column + text block ---------- */
.leaf {
  display: grid;
  grid-template-columns: var(--margin-col) minmax(0, 1fr);
  column-gap: clamp(28px, 4vw, 64px);
  padding: clamp(56px, 7vw, 104px) 0;
  border-top: 1px solid var(--rule);
}
.leaf > .margin { grid-column: 1; }
.leaf > .body { grid-column: 2; min-width: 0; }
.leaf > .span { grid-column: 1 / -1; min-width: 0; }
.mark { margin: 0 0 22px; line-height: 1; }
.mark .num { font-size: 2.6rem; color: var(--madder); font-weight: 400; display: block; margin-bottom: 6px; }
.mark .name { font-size: 1.05rem; }
.mark-mobile { display: none; }
.margin-note { margin: 4px 0 0; font-size: 1.15rem; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(32px, 4.5vw, 72px);
  align-items: start;
  padding: clamp(48px, 6vw, 88px) 0 clamp(56px, 6vw, 88px);
}
.hero::before { /* faint graph ruling, fading out */
  content: ""; position: absolute; inset: 0 calc(-1 * var(--gutter)); z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.55) 70%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.55) 70%, transparent 100%);
}
.hero-text { padding-top: clamp(8px, 2.4vw, 36px); }
.entry-kicker { margin: 0 0 18px; color: var(--pencil); }
h1 { margin: 0; font-weight: 400; line-height: .92; letter-spacing: -.012em; font-size: clamp(3.3rem, 6.4vw, 6.4rem); }
.entry { margin: 26px 0 0; padding: 14px 0 0; border-top: 1px solid var(--ink); font-size: 1.12rem; line-height: 1.45; }
.entry .deva { font-size: 1.32em; line-height: 1; margin-right: .3em; }
.entry .pos { color: var(--pencil); font-style: italic; }
.lede { margin: 26px 0 0; font-size: clamp(1.15rem, .6vw + 1rem, 1.42rem); line-height: 1.5; max-width: 30em; }
.first-up { margin: 26px 0 0; font-size: 1.02rem; color: var(--ink-2); max-width: 30em; }
.first-up a { white-space: nowrap; }

/* ---------- Plate I: synchrony ---------- */
.sync { margin: clamp(8px, 2vw, 28px) 0 0; }
.sync-sheet { position: relative; background: var(--print); padding: clamp(12px, 1.6vw, 22px); box-shadow: 0 1px 1px rgba(60, 45, 20, .10), 0 14px 30px -18px rgba(60, 45, 20, .42); }
.sync canvas { display: block; width: 100%; height: 360px; }
.sync-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin: 10px 0 0; font-size: clamp(1.02rem, .45vw + .82rem, 1.22rem); }
.sync-notes p { margin: 0; }
.sync-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 14px; padding-top: 12px; border-top: 1px dotted var(--rule); }
.slider { position: relative; flex: 1 1 220px; min-width: 0; }
.slider label { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 12px; color: var(--pencil); margin-bottom: 4px; }
.slider label b { font-weight: 500; color: var(--ink); }
.slider input { width: 100%; margin: 6px 0 0; accent-color: var(--blue); }
.kc { position: absolute; left: var(--kc, 37%); bottom: -16px; transform: translateX(-50%); font-family: var(--mono); font-size: 10.5px; color: var(--madder); white-space: nowrap; }
.kc::before { content: ""; position: absolute; left: 50%; top: -9px; width: 1px; height: 7px; background: var(--madder); }
.scatter { font: 500 12px/1 var(--mono); letter-spacing: .04em; color: var(--ink); background: transparent; border: 1px solid var(--ink-2); border-radius: 2px; padding: 8px 12px; cursor: pointer; }
.scatter:hover { background: var(--ink); color: var(--print); }
.readout { font-family: var(--mono); font-size: 12px; color: var(--pencil); }
.readout b { font-weight: 500; color: var(--ink); }
.plate-caption { margin: 26px 0 0; font-size: .92rem; line-height: 1.45; color: var(--ink-2); max-width: 40em; }
.plate-caption .red { font-weight: 500; }

/* ---------- §1 statement ---------- */
.statement { font-size: clamp(1.16rem, .5vw + 1.02rem, 1.38rem); line-height: 1.55; max-width: 31em; }
.statement p { margin: 0 0 1.05em; }
.statement p:first-child::first-letter { float: left; font-size: 3.6em; line-height: .8; padding: .06em .08em 0 0; color: var(--madder); }
.statement p:last-child { margin-bottom: 0; }

/* ---------- taped prints ---------- */
.print { position: relative; margin: 0; background: var(--print); padding: clamp(7px, .8vw, 11px); box-shadow: 0 1px 1px rgba(60, 45, 20, .10), 0 14px 30px -18px rgba(60, 45, 20, .42); }
.print::before, .print::after { /* tape */
  content: ""; position: absolute; width: clamp(54px, 7vw, 92px); height: 22px; z-index: 2;
  background: rgba(232, 223, 196, .72); box-shadow: 0 1px 1px rgba(80, 60, 20, .08);
  clip-path: polygon(3% 8%, 97% 0, 100% 46%, 96% 92%, 2% 100%, 0 52%);
}
.print::before { top: -10px; left: -14px; transform: rotate(-34deg); }
.print::after  { top: -10px; right: -14px; transform: rotate(31deg); }
.shot { position: relative; }
.shot img { width: 100%; }

/* ---------- §2 work ---------- */
h2 { margin: 0; font-weight: 400; font-size: clamp(2.6rem, 4.4vw, 4.1rem); line-height: 1; letter-spacing: -.01em; }
.status { margin: 14px 0 0; color: var(--pencil); }
.prose { max-width: 34em; }
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }
.work-intro { margin-top: 30px; }
.work-intro .prose { columns: 2 17em; column-gap: clamp(28px, 3.5vw, 52px); max-width: none; }
.work-intro .prose p { break-inside: avoid-column; }

/* dedication to Leeuwenhoek */
.dedication { margin: clamp(64px, 7vw, 104px) auto 0; max-width: 46rem; text-align: center; }
.dedication blockquote { margin: 0; }
.dedication blockquote p { margin: 0; font-style: italic; font-size: clamp(1.5rem, 1.6vw + 1rem, 2.25rem); line-height: 1.3; text-wrap: balance; }
.dedication figcaption { margin-top: 22px; }
.dedication .who { margin: 0; font-size: 1rem; color: var(--ink-2); }
.dedication .who::before { content: ""; display: block; width: 48px; height: 1px; margin: 0 auto 16px; background: var(--madder); }
.dedication .for { margin: 26px auto 0; max-width: 36rem; text-align: left; font-size: 1rem; line-height: 1.55; }
.dedication .for .sc { font-size: 1.08em; margin-right: .2em; }
.dedication .src { margin: 12px auto 0; color: var(--pencil); text-align: left; max-width: 36rem; }

/* annotated plate */
.plate2 { margin: clamp(64px, 7vw, 100px) auto 0; max-width: 900px; }
.plate2 .overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.overlay .lead { fill: none; stroke: var(--blue); stroke-width: 1.15; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.overlay .dot { fill: var(--blue); }
.overlay .ring { fill: none; stroke: var(--blue); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 3 3; opacity: .8; }
.overlay .scale { stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.overlay .key { display: none; }
.overlay .key circle { fill: var(--print); stroke: var(--blue); stroke-width: 1; vector-effect: non-scaling-stroke; }
.overlay .key text { font: 600 40px var(--hand); fill: var(--blue); text-anchor: middle; dominant-baseline: central; }
.scale-label { position: absolute; left: 5%; bottom: 9.5%; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--ink); }
.note { position: absolute; margin: 0; font-size: clamp(1.05rem, .55vw + .8rem, 1.32rem); width: 16em; }
.note b { font-weight: 600; }
.note i { font-family: var(--serif); font-size: .74em; font-style: italic; color: var(--ink-2); }
.note-a { left: 57%; top: calc(100% + 26px); }
.note-b { left: 25%; bottom: calc(100% + 30px); width: 19em; }
.plate2 .plate-caption { margin-top: clamp(96px, 8vw, 116px); }
.plate-key { display: none; }

/* specimen label */
.label-card { margin: 4px 0 0; padding: 14px 16px 12px; background: #fbf8ef; border: 1px solid #b9ad94; outline: 1px solid #b9ad94; outline-offset: -5px; font-size: .82rem; line-height: 1.35; box-shadow: 0 1px 0 rgba(60,45,20,.06); }
.label-card .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--rule); padding: 2px 4px 8px; margin: 0 0 6px; }
.label-card .head span:first-child { font-style: italic; font-size: 1.2em; }
.label-card dl { margin: 0; }
.label-card dl div { padding: 7px 4px; border-bottom: 1px dotted var(--rule); }
.label-card dl div:last-child { border-bottom: 0; }
.label-card dt { font-family: var(--mono); font-size: .76em; letter-spacing: .08em; text-transform: uppercase; color: var(--pencil); }
.label-card dd { margin: 2px 0 0; font-size: 1.08em; }

/* contact sheet */
.sheet { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(20px, 2.6vw, 40px); row-gap: clamp(56px, 6vw, 88px); margin-top: clamp(64px, 7vw, 104px); align-items: start; }
.sheet figure { margin: 0; }
.sheet .print { transform: rotate(var(--tilt, 0deg)); }
.sheet figure:nth-child(1) { grid-column: 1 / span 7; --tilt: -.45deg; }
.sheet figure:nth-child(2) { grid-column: 9 / span 4; --tilt: .6deg; margin-top: clamp(0px, 9vw, 140px); }
.sheet figure:nth-child(3) { grid-column: 2 / span 5; --tilt: .4deg; margin-top: clamp(0px, 3vw, 40px); }
.sheet figure:nth-child(4) { grid-column: 8 / span 5; --tilt: -.35deg; }
.sheet figure:nth-child(1) .print::after, .sheet figure:nth-child(4) .print::before { display: none; }
.sheet figure:nth-child(2) .print::before, .sheet figure:nth-child(2) .print::after,
.sheet figure:nth-child(3) .print::before, .sheet figure:nth-child(3) .print::after {
  width: 26px; height: 26px; background: none; clip-path: none; box-shadow: none; transform: none; border: 0 solid rgba(60, 50, 35, .55);
}
.sheet figure:nth-child(2) .print::before, .sheet figure:nth-child(3) .print::before { top: -4px; left: -4px; border-width: 1.5px 0 0 1.5px; }
.sheet figure:nth-child(2) .print::after, .sheet figure:nth-child(3) .print::after { top: auto; bottom: -4px; right: -4px; border-width: 0 1.5px 1.5px 0; }
.sheet figcaption, .figrow { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; margin-top: 16px; }
.figno { color: var(--madder); font-size: .95rem; white-space: nowrap; padding-top: 1px; }
.figcap { font-size: .95rem; line-height: 1.4; }
.sheet .hand { grid-column: 2; margin: 8px 0 0; font-size: clamp(1.08rem, .5vw + .85rem, 1.3rem); position: relative; }
.sheet .hand::before { content: ""; position: absolute; left: -14px; top: -2px; width: 9px; height: 13px; border-left: 1.2px solid var(--blue); border-bottom: 1.2px solid var(--blue); border-bottom-left-radius: 6px; opacity: .8; }
.fine { margin: clamp(48px, 5vw, 72px) 0 0; font-size: .86rem; color: var(--pencil); font-style: italic; }

/* ---------- §3 method ---------- */
.margin-quote { margin: 0; padding: 0; }
.margin-quote p { margin: 0; font-style: italic; font-size: .98rem; line-height: 1.45; color: var(--ink-2); text-indent: -.4em; }
.margin-quote footer { margin-top: 10px; font-size: .8rem; line-height: 1.4; color: var(--pencil); }
.margin-quote .hand { display: block; margin-top: 8px; font-size: 1.12rem; }
sup a { text-decoration: none; color: var(--madder); font-size: .78em; padding-left: 1px; }
.studies { margin: clamp(52px, 6vw, 80px) 0 0; }
.studies-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 36px); max-width: 760px; }
.studies-row div { text-align: center; }
.studies-row img { width: 100%; aspect-ratio: 1; opacity: .92; }
.studies-row span { display: block; margin-top: 8px; color: var(--pencil); }
.studies figcaption { max-width: 46em; font-size: .95rem; line-height: 1.45; margin-top: 22px; }
.refs { margin: clamp(40px, 5vw, 60px) 0 0; padding: 18px 0 0; border-top: 1px solid var(--rule); max-width: 46em; font-size: .86rem; line-height: 1.45; color: var(--ink-2); list-style: none; counter-reset: r; }
.refs li { counter-increment: r; display: grid; grid-template-columns: 1.6em 1fr; margin-bottom: 6px; }
.refs li::before { content: counter(r); color: var(--madder); }

/* ---------- §4 contact ---------- */
.mail-big { display: inline-block; font-size: clamp(2rem, 4.2vw, 3.6rem); font-style: italic; line-height: 1.1; text-decoration-thickness: 1px; text-underline-offset: .14em; word-break: break-word; }
.contact .prose { margin-top: 20px; }

/* ---------- foot ---------- */
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 0 36px; border-top: 1px solid var(--ink); font-size: .88rem; color: var(--ink-2); }
.foot p { margin: 0; }
.foot a { color: var(--ink-2); }

/* ---------- document pages (privacy, 404) ---------- */
.doc { max-width: 40rem; padding: clamp(48px, 7vw, 88px) 0 clamp(64px, 8vw, 104px); }
.doc h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.02; margin: 0 0 10px; }
.doc .meta { margin: 0 0 40px; color: var(--pencil); }
.doc h2 { font-size: 1.25rem; font-weight: 500; line-height: 1.3; margin: 2em 0 .4em; }
.doc p, .doc li { margin: 0 0 .9em; }

/* ---------- narrower screens ---------- */
@media (max-width: 1080px) {
  :root { --margin-col: 180px; }
  .hero { grid-template-columns: 1fr; }
  .sync { max-width: 820px; margin-top: 44px; }
}
@media (max-width: 760px) {
  .leaf { grid-template-columns: minmax(0, 1fr); }
  .leaf > .margin, .leaf > .body, .leaf > .span { grid-column: 1; }
  .leaf > .margin { order: 2; margin-top: 34px; }
  .leaf > .margin .mark { display: none; }
  .leaf > .body { order: 1; }
  .leaf > .span { order: 3; }
  .mark-mobile { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
  .mark-mobile .num { font-size: 1.7rem; margin: 0; display: inline; }
  .work .label-card { margin: 0; }
  .contact > .margin { display: none; }
  .sheet { grid-template-columns: minmax(0, 1fr); row-gap: 48px; }
  .sheet figure:nth-child(n) { grid-column: 1; margin-top: 0; }
  .studies-row { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 360px; gap: 22px 28px; }
  .running-head { flex-wrap: wrap; row-gap: 6px; }
  .running-head .folio { display: none; }
  .sync-notes { grid-template-columns: 1fr; }
  /* plate leaders become numbered keys */
  .plate2 { margin-top: 44px; }
  .note { display: none; }
  .overlay .lead, .overlay .dot { display: none; }
  .overlay .key { display: inline; }
  .plate2 .plate-caption { margin-top: 18px; }
  .plate-key { display: block; margin: 16px 0 0; padding: 0; list-style: none; }
  .plate-key li { display: grid; grid-template-columns: 1.5em 1fr; font-size: 1.12rem; margin-bottom: 8px; }
  .plate-key li > span:first-child { font-weight: 600; }
  .print::before, .print::after { width: 52px; height: 18px; }
}
@media (max-width: 420px) {
  .running-head nav a .red { display: none; }
  .mono { font-size: .7em; }
}
