/* ==========================================================
   Hayden Miew — style.css
   Paper, ink, one accent. Hairlines instead of boxes.
   ========================================================== */

/* ---------- Tokens ---------- */

:root {
  --paper: #f2efe8;
  --paper-2: #e8e4d9;
  --ink: #17171a;
  --muted: #625f57;
  --rule: #d6d0c3;
  --accent: #b23c12;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --gutter: clamp(20px, 4vw, 56px);
  --max: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131312;
    --paper-2: #1d1c1a;
    --ink: #ebe7de;
    --muted: #9d988c;
    --rule: #302e2a;
    --accent: #ec7446;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #131312;
  --paper-2: #1d1c1a;
  --ink: #ebe7de;
  --muted: #9d988c;
  --rule: #302e2a;
  --accent: #ec7446;
  color-scheme: dark;
}

/* Page-to-page cross-fade in browsers that support it */
@view-transition { navigation: auto; }

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

::selection { background: var(--accent); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

a {
  color: inherit;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .35s var(--ease), color .2s;
}
a:hover { background-size: 100% 1px; color: var(--accent); }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left));
}

.meta {
  font: 400 12.5px/1.5 var(--mono);
  letter-spacing: .02em;
  color: var(--muted);
}
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: var(--gutter); top: 12px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 14px;
}

.btn-line {
  appearance: none;
  border: 1px solid var(--rule);
  background: none;
  color: var(--muted);
  font: 400 12px/1 var(--mono);
  padding: 8px 12px;
  min-height: 36px;
  border-radius: 2px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.btn-line:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Top bar ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: transform .4s var(--ease), border-color .3s;
}
.top.is-scrolled { border-bottom-color: var(--rule); }
.top.is-hidden { transform: translateY(-100%); }

.top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.top__name { font: 500 15px/1 var(--sans); letter-spacing: -.01em; }

.top__nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14px;
}
.top__nav a[aria-current="page"] { color: var(--accent); }
.top__nav a[aria-current="page"]::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 7px;
  vertical-align: middle;
  transform: translateY(-1px);
}

.menu-btn { display: none; }

/* Full-screen menu (phones) */
.menu {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
}
.menu[open] { display: flex; flex-direction: column; }
.menu::backdrop { background: var(--paper); }
.menu__bar {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 64px;
}
.menu__list {
  list-style: none;
  margin-top: 24px;
  border-top: 1px solid var(--ink);
}
.menu__list li { border-bottom: 1px solid var(--rule); }
.menu__list a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  font: 300 44px/1.1 var(--serif);
  letter-spacing: -.02em;
  background: none;
}
.menu__list a[aria-current="page"] { color: var(--accent); }
.menu__list .meta { width: 22px; }
.menu__foot {
  margin-top: auto;
  padding-top: 32px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
}

/* ---------- Page header ---------- */

.phead {
  padding-top: clamp(48px, 8vw, 112px);
  padding-bottom: clamp(48px, 7vw, 96px);
}
.phead__crumb { display: flex; gap: 20px; margin-bottom: 20px; }
.phead__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(56px, 11vw, 160px);
  line-height: .92;
  letter-spacing: -.035em;
  margin-left: -.03em;
}
.phead__title em { font-style: italic; font-weight: 300; }
.phead__lede {
  margin-top: clamp(24px, 3vw, 40px);
  max-width: 30em;
  font: 400 clamp(21px, 2.2vw, 28px)/1.3 var(--serif);
  letter-spacing: -.005em;
}

.phead__note {
  margin-top: 18px;
  max-width: 40em;
  font-size: 15px;
  color: var(--muted);
}
.phead__note .linkish {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.phead__note .linkish:hover { color: var(--accent); }

/* ---------- Home hero ---------- */

.hero {
  padding-top: clamp(48px, 9vw, 132px);
  padding-bottom: clamp(64px, 9vw, 120px);
}
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-bottom: clamp(14px, 2vw, 26px); }
.clock { color: var(--ink); font-variant-numeric: tabular-nums; }

.hero__name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(64px, 14.5vw, 212px);
  line-height: .9;
  letter-spacing: -.035em;
  margin-left: -.04em;
}
.hero__name span { display: inline; }
.hero__name em { font-style: italic; font-weight: 300; }

.hero__body {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  column-gap: 32px;
  margin-top: clamp(36px, 5vw, 72px);
}
.hero__body > * { grid-column: 2; }
.hero__lede {
  max-width: 21em;
  font: 400 clamp(23px, 2.6vw, 34px)/1.25 var(--serif);
  letter-spacing: -.01em;
}
.hero__sub { margin-top: 20px; max-width: 34em; color: var(--muted); }
.hero__links { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 15px; }

/* ---------- Sections ---------- */

.section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  column-gap: 32px;
  padding-top: 28px;
  padding-bottom: clamp(72px, 9vw, 136px);
}
.section::before {
  content: "";
  position: absolute;
  top: 0; left: var(--gutter); right: var(--gutter);
  border-top: 1px solid var(--ink);
}
.section > * { grid-column: 2; min-width: 0; }

.section__head {
  grid-column: 1;
  grid-row: 1 / span 30;
  align-self: start;
  position: sticky;
  top: 92px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.section__head h2 { font: 400 15px/1.3 var(--sans); }
.section__intro { color: var(--muted); max-width: 54ch; margin-bottom: 32px; }
.section__more { margin-top: 28px; font-size: 15px; }

/* ---------- Work list ---------- */

.work { list-style: none; }
.work__row + .work__row { border-top: 1px solid var(--rule); }

.work__link {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  grid-template-areas:
    "year title arrow"
    ".    note  arrow"
    ".    tags  arrow";
  column-gap: 24px;
  row-gap: 10px;
  padding: 28px 0 32px;
  background: none;
}
.work__row:first-child .work__link { padding-top: 0; }
.work__link:hover { color: inherit; }

.work__year { grid-area: year; padding-top: .9em; }
.work__title {
  grid-area: title;
  font: 300 clamp(40px, 6.2vw, 88px)/1 var(--serif);
  letter-spacing: -.025em;
  transition: color .25s, transform .45s var(--ease);
}
.work__link:hover .work__title { color: var(--accent); transform: translateX(10px); }
.work__note { grid-area: note; max-width: 48ch; color: var(--muted); }
.work__tags { grid-area: tags; }
.work__thumb { grid-area: thumb; display: none; }
.work__arrow {
  grid-area: arrow;
  align-self: start;
  font: 300 clamp(28px, 3vw, 40px)/1 var(--serif);
  padding-top: .35em;
  transition: transform .45s var(--ease), color .25s;
}
.work__link:hover .work__arrow { transform: translateX(6px); color: var(--accent); }

/* Work index page: thumbnails always visible */
.work--index .work__link {
  grid-template-columns: 88px minmax(0, 5fr) minmax(0, 4fr);
  grid-template-areas:
    "year title thumb"
    ".    note  thumb"
    ".    tags  thumb";
  padding: 40px 0 44px;
}
.work--index .work__thumb { display: block; align-self: start; }
.work--index .work__arrow { display: none; }

.thumb img, .thumb .ph { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border: 1px solid var(--rule); }

/* Floating preview */
.peek {
  position: fixed; left: 0; top: 0;
  width: 380px;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  transform: translate3d(-9999px, 0, 0);
  transition: opacity .25s ease;
}
.peek.is-on { opacity: 1; }
.peek img, .peek .ph {
  width: 100%;
  border: 1px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}

/* Placeholder block (swap for a real image later) */
.ph {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, var(--rule) 14px 15px),
    var(--paper-2);
  color: var(--muted);
  font: 400 12px/1.4 var(--mono);
  text-align: center;
  padding: 16px;
}
.ph span { background: var(--paper-2); padding: 6px 10px; }

/* ---------- Ledger ---------- */

.ledger__row {
  display: grid;
  grid-template-columns: 150px minmax(0, 4fr) minmax(0, 6fr);
  column-gap: 24px;
  row-gap: 8px;
  padding: 22px 0 28px;
}
.ledger__row:first-child { padding-top: 0; }
.ledger__row + .ledger__row { border-top: 1px solid var(--rule); }
.ledger__date { padding-top: 4px; font-variant-numeric: tabular-nums; }
.ledger__main h3 { font: 400 22px/1.25 var(--serif); }
.ledger__where { color: var(--muted); margin-top: 4px; font-size: 15px; }
.ledger__text { font-size: 16px; }
.ledger__text p + p { margin-top: .8em; }
.ledger__text strong { font: 400 26px/1 var(--serif); margin: 0 2px; }

/* ---------- Prose ---------- */

.prose { font: 400 21px/1.55 var(--serif); max-width: 32em; }
.prose p + p { margin-top: .9em; }
.prose a { background-size: 100% 1px; }
.prose h3 {
  font: 500 12.5px/1.5 var(--mono);
  letter-spacing: .02em;
  color: var(--muted);
  margin: 2.4em 0 .7em;
}
.prose h3:first-child { margin-top: 0; }

sup.fn { font: 500 11px/0 var(--mono); margin-left: 2px; }
sup.fn a { color: var(--accent); background: none; padding: 0 1px; }
sup.fn a:hover { text-decoration: underline; }

.notes {
  margin-top: 36px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  list-style: none;
  display: grid;
  gap: 6px;
}
.notes li { display: grid; grid-template-columns: 24px 1fr; }
.notes a { background-size: 100% 1px; }

/* ---------- About ---------- */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 6fr);
  column-gap: 40px;
  row-gap: 40px;
}
.portrait img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 20%;
  filter: grayscale(1) contrast(1.05);
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] .portrait img { mix-blend-mode: normal; filter: grayscale(1) brightness(.9); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .portrait img { mix-blend-mode: normal; filter: grayscale(1) brightness(.9); }
}
.portrait figcaption { margin-top: 10px; }

.principles {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  border-top: 1px solid var(--rule);
}
.principles li { padding: 20px 0 24px; border-bottom: 1px solid var(--rule); }
.principles h3 { font: 400 22px/1.25 var(--serif); margin: 6px 0 8px; }
.principles p { font-size: 16px; color: var(--muted); }

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 32px;
  border-top: 1px solid var(--rule);
}
.facts > div { padding: 16px 0 18px; border-bottom: 1px solid var(--rule); }
.facts dt { margin-bottom: 4px; }
.facts dd { margin: 0; font-size: 16px; }

.refs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 32px;
}
.ref h3 { font: 400 24px/1.2 var(--serif); }
.ref__role { margin-top: 6px; color: var(--muted); font-size: 15px; }
.ref__contact { margin-top: 14px; line-height: 2; }
.ref--note { grid-column: 1 / -1; color: var(--muted); font-size: 15px; border-top: 1px solid var(--rule); padding-top: 16px; }

/* ---------- Plates (photos) ---------- */

.plates {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 24px;
  margin-top: 48px;
}
.plate { margin: 0; }
.plate--wide { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; }
.plate--wide button { flex: 1; }
.plate--wide img { height: 100%; aspect-ratio: auto; }
.plate button {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
}
.plate img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(.75) contrast(1.02);
  transition: filter .4s ease;
}
.plate:hover img { filter: none; }
.plate figcaption { margin-top: 10px; }

/* ---------- Journal ---------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
}
.tab {
  appearance: none;
  border: 1px solid var(--rule);
  background: none;
  color: var(--muted);
  font: 400 13px/1 var(--mono);
  padding: 10px 14px;
  min-height: 40px;
  border-radius: 2px;
  cursor: pointer;
  transition: color .2s, border-color .2s, background-color .2s;
}
.tab:hover { color: var(--ink); border-color: var(--ink); }
.tab[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.journal {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px 28px;
}
.entry[hidden] { display: none; }
.entry__img { margin-bottom: 14px; }
.entry__img img, .entry__img .ph {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(.8);
  transition: filter .4s ease;
}
.entry:hover .entry__img img { filter: none; }
.entry__meta { display: flex; gap: 14px; align-items: center; }
.entry__meta .tag::before {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); margin-right: 6px; vertical-align: middle; transform: translateY(-1px);
}
.entry h3 { font: 400 24px/1.2 var(--serif); margin: 8px 0 8px; letter-spacing: -.01em; }
.entry p { font-size: 15.5px; color: var(--muted); }
.entry--text { border-top: 1px solid var(--ink); padding-top: 16px; align-self: start; }
.entry--text h3 { font-size: 30px; }

.journal--home { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Two photos side by side, spanning two columns (heights match single entries) */
.journal { grid-auto-flow: row dense; }
.entry--duo { grid-column: span 2; }
.entry__img--duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }

/* ---------- Photos fade in slowly once they have loaded ---------- */

img.fade {
  opacity: 0;
  transition: opacity .9s cubic-bezier(.22, .61, .36, 1), filter .4s ease;
}
img.fade.is-in { opacity: 1; }
.duo-dots { display: none; }

/* ---------- Archive ---------- */

.archive { border-top: 1px solid var(--ink); }
.archive__row {
  display: grid;
  grid-template-columns: 52px minmax(0, 5fr) minmax(0, 3fr) 90px;
  column-gap: 20px;
  align-items: baseline;
  width: 100%;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  scroll-margin-top: 100px;
  transition: background-color .2s, padding .3s var(--ease);
}
.archive__row[hidden] { display: none; }
.archive__head { cursor: default; padding: 10px 0; font: 400 12.5px/1.5 var(--mono); color: var(--muted); }
button.archive__row:hover { background: var(--paper-2); padding-left: 10px; }
button.archive__row:hover .archive__title { color: var(--accent); }
.archive__row:target { background: var(--paper-2); padding-left: 10px; }
.archive__no, .archive__date { font: 400 12.5px/1.5 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.archive__title { font-size: 16px; transition: color .2s; }
.archive__from { font-size: 14px; color: var(--muted); }

/* ---------- Dialogs: PDF viewer + photo lightbox ---------- */

.viewer {
  width: min(1000px, 94vw);
  height: min(88vh, 1100px);
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop, .lightbox::backdrop { background: rgba(20, 20, 18, .6); }
.viewer__bar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 8px 20px; padding: 12px 16px; border-bottom: 1px solid var(--ink);
}
.viewer__title { color: var(--ink); }
.viewer__actions { display: flex; gap: 20px; align-items: center; color: var(--ink); }
.x {
  appearance: none; border: 0; background: none; color: inherit;
  font: 400 12.5px/1 var(--mono); cursor: pointer; min-height: 36px; padding: 0 4px;
}
.x:hover { color: var(--accent); }
.viewer iframe { flex: 1; width: 100%; border: 0; background: #fff; }

.lightbox {
  padding: 0; border: 0; background: none; max-width: 94vw; max-height: 92vh; overflow: visible;
}
.lightbox[open] { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.lightbox img { max-width: 94vw; max-height: 82vh; width: auto; border: 1px solid var(--ink); }
.lightbox__bar { display: flex; justify-content: space-between; width: 100%; gap: 20px; color: #ebe7de; }
.lightbox .meta { color: #ebe7de; }

/* ---------- Image zoom ---------- */

.zoomable { cursor: zoom-in; }
.zoomable:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.zoom {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #10100f;
  color: #ebe7de;
}
.zoom[open] { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; animation: card-in .3s var(--ease) both; }
.zoom::backdrop { background: #10100f; }
.zoom .meta { color: #b9b4aa; }

.zoom__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(242, 239, 232, .14);
}
.zoom__cap { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }
.zoom__tools { display: flex; align-items: center; gap: 6px; }
.zoom__tools button {
  appearance: none;
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(242, 239, 232, .22);
  border-radius: 2px;
  background: none;
  color: #ebe7de;
  font: 400 14px/1 var(--mono);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.zoom__tools button:hover { border-color: #f2efe8; color: #fff; }
.zoom__tools button[hidden] { display: none; }
.zoom__sep { width: 1px; height: 22px; background: rgba(242, 239, 232, .18); margin: 0 4px; }

.zoom__stage {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  touch-action: none;
  user-select: none;
  cursor: zoom-in;
}
.zoom__stage.is-zoomed { cursor: grab; }
.zoom__stage.is-zoomed.is-dragging { cursor: grabbing; }
.zoom__stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  transform-origin: center;
  transition: transform .28s var(--ease);
  -webkit-user-drag: none;
  user-select: none;
  will-change: transform;
}
.zoom__hint { text-align: center; padding: 10px 16px max(12px, env(safe-area-inset-bottom)); }

@media (max-width: 760px) {
  .zoom__cap { flex: 1 1 100%; }
  .zoom__tools { width: 100%; justify-content: flex-end; }
  .zoom__tools [data-z="close"] { margin-left: auto; order: 9; }
  .zoom__sep { display: none; }
  .zoom__tools [data-z="reset"] { display: none; }
}

/* ---------- Case study ---------- */

.back { display: inline-block; margin-bottom: 36px; }

.spec {
  margin: 48px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  border-top: 1px solid var(--ink);
}
.spec > div { padding: 14px 20px 18px 0; }
.spec dt { margin-bottom: 4px; }
.spec dd { margin: 0; font-size: 15.5px; }
.spec a { background-size: 100% 1px; }

.shots { display: grid; gap: 24px; grid-template-columns: repeat(12, minmax(0, 1fr)); margin-bottom: clamp(64px, 8vw, 112px); }
.shot { margin: 0; grid-column: span 12; }
.shot--desk { grid-column: span 9; }
.shot--phone { grid-column: span 3; }
.shot--half { grid-column: span 6; }
.shot img { width: 100%; border: 1px solid var(--rule); }
.shot--phone .ph, .shot--phone img { aspect-ratio: 9 / 19; object-fit: cover; object-position: top; }
.shot figcaption { margin-top: 10px; }

.next {
  position: relative;
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px;
  padding-top: 24px; padding-bottom: clamp(64px, 8vw, 104px);
}
.next::before {
  content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter);
  border-top: 1px solid var(--ink);
}
.next__link { font: 300 clamp(32px, 5vw, 64px)/1 var(--serif); letter-spacing: -.02em; }

/* ---------- Project pager (previous / next) ---------- */

.pager {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 24px 40px;
  padding-top: 24px;
  padding-bottom: clamp(64px, 8vw, 104px);
}
.pager::before {
  content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter);
  border-top: 1px solid var(--ink);
}
.pager a { display: flex; flex-direction: column; gap: 10px; background: none; }
.pager a:hover { color: var(--accent); }
.pager__next { text-align: right; align-items: flex-end; }
.pager__name { letter-spacing: -.02em; transition: transform .45s var(--ease); }
.pager__prev .pager__name { font: 300 clamp(22px, 2.6vw, 34px)/1.1 var(--serif); }
.pager__next .pager__name { font: 300 clamp(32px, 5vw, 64px)/1 var(--serif); }
.pager__prev:hover .pager__name { transform: translateX(-6px); }
.pager__next:hover .pager__name { transform: translateX(6px); }
.pager a:hover .meta { color: var(--accent); }

@media (max-width: 760px) {
  .pager { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .pager__next { order: -1; }
  .pager__prev { padding-top: 20px; border-top: 1px solid var(--rule); }
}

/* ---------- Footer / contact ---------- */

.foot { background: var(--ink); color: var(--paper); --line: color-mix(in srgb, var(--paper) 18%, var(--ink)); }
.foot ::selection { background: var(--accent); color: var(--ink); }
.foot .meta { color: color-mix(in srgb, var(--paper) 62%, var(--ink)); }
.foot .clock { color: var(--paper); }

.foot__main { padding-top: clamp(56px, 7vw, 96px); padding-bottom: clamp(48px, 6vw, 80px); }

.foot__mail { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 20px; margin-top: 14px; }
.foot__mail a {
  font: 300 clamp(30px, 6.4vw, 96px)/1.05 var(--serif);
  letter-spacing: -.03em;
  word-break: break-word;
  background-size: 100% 1px;
}
.foot__mail a:hover { color: var(--accent); }
.foot .btn-line { border-color: var(--line); color: color-mix(in srgb, var(--paper) 70%, var(--ink)); }
.foot .btn-line:hover { border-color: var(--paper); color: var(--paper); }

.foot__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px 64px;
  align-items: start;
}
.foot__lead {
  margin-top: 14px;
  max-width: 14em;
  font: 300 clamp(30px, 3.6vw, 48px)/1.12 var(--serif);
  letter-spacing: -.02em;
  color: var(--paper);
}

.minicard {
  appearance: none; border: 0; font: inherit; text-align: left; cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: min(300px, 100%);
  aspect-ratio: 85 / 55;
  margin-top: 36px;
  padding: 18px 20px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 6px 6px 0 var(--accent);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.minicard:hover { color: var(--ink); transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--accent); }
.minicard__name { font: 300 32px/1 var(--serif); letter-spacing: -.02em; }
.minicard__name em { font-style: italic; }
.foot .minicard .meta { color: var(--muted); }
.minicard__foot { display: flex; justify-content: space-between; gap: 12px; }

.channels { list-style: none; border-top: 1px solid var(--line); }
.channels a, .channels button {
  appearance: none; border: 0; border-bottom: 1px solid var(--line);
  width: 100%; color: inherit; font: inherit; text-align: left; cursor: pointer;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding: 15px 0;
  min-height: 52px;
  background: none;
  font-size: 16px;
}
.channels a:hover, .channels button:hover { color: var(--accent); }
.ch__go { font: 400 15px/1 var(--mono); transition: transform .35s var(--ease); }
.channels a:hover .ch__go, .channels button:hover .ch__go { transform: translateX(4px); }

.linkish {
  appearance: none; border: 0; padding: 0; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.linkish:hover { color: var(--accent); }

/* Business card popup */
.cardmodal {
  width: min(560px, 92vw);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper);
  overflow: visible;
}
.cardmodal[open] { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.cardmodal::backdrop { background: #10100f; }
.cardmodal[open] .bcard { animation: card-in .55s var(--ease) both; }
.cardmodal[open] .cardpage__actions { animation: card-in .55s .08s var(--ease) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.cardmodal__bar { width: 100%; display: flex; justify-content: space-between; align-items: center; color: #d9d5cc; }
.cardmodal__bar .x { color: #ebe7de; }
.cardmodal .bcard__front { background: #17171a; color: #f2efe8; }
.cardmodal .bcard__back { background: #f2efe8; color: #17171a; border-color: #f2efe8; box-shadow: 10px 10px 0 var(--accent); }
.cardpage__actions--dark .btn-line { border-color: rgba(242, 239, 232, .3); color: #ebe7de; }
.cardpage__actions--dark .btn-line:hover { border-color: #f2efe8; color: #fff; }
.cardpage__actions--dark .btn-solid { background: #f2efe8; color: #17171a; border-color: #f2efe8; }
.cardpage__actions--dark .btn-solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Email chooser */
.sheet {
  width: min(400px, 92vw);
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}
.sheet::backdrop { background: rgba(16, 16, 15, .6); }
.sheet[open] { animation: card-in .35s var(--ease) both; }
.sheet__bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--ink); }
.sheet__list { list-style: none; }
.sheet__list li + li { border-top: 1px solid var(--rule); }
.sheet__list a, .sheet__list button {
  appearance: none; border: 0; width: 100%; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 16px; min-height: 56px; font-size: 17px;
}
.sheet__list a:hover, .sheet__list button:hover { background: var(--paper-2); color: var(--accent); }

.foot__base {
  position: relative;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding-top: 18px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}
.foot__base::before {
  content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter);
  border-top: 1px solid var(--line);
}

/* ---------- Business card page ---------- */

.cardpage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding-top: clamp(40px, 7vw, 96px);
  padding-bottom: clamp(80px, 10vw, 140px);
}
.cardpage__hint, .cardpage__note { text-align: center; }

.bcard {
  appearance: none; border: 0; padding: 0; margin: 0;
  background: none; color: inherit; font: inherit; text-align: left;
  width: min(560px, 100%);
  aspect-ratio: 85 / 55;
  perspective: 1600px;
  cursor: pointer;
}
.bcard__inner {
  position: relative;
  display: block;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .8s var(--ease);
}
.bcard.is-flipped .bcard__inner { transform: rotateY(180deg); }
.bcard:hover .bcard__inner { transform: rotateY(-4deg); }
.bcard.is-flipped:hover .bcard__inner { transform: rotateY(184deg); }

.bcard__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(18px, 4.4vw, 32px);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.bcard__front { background: var(--ink); color: var(--paper); box-shadow: 10px 10px 0 var(--accent); }
.bcard__back {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
  transform: rotateY(180deg);
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(16px, 4vw, 28px);
}
.bcard .meta { color: inherit; opacity: .7; }
.bcard__row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bcard__name { display: block; font: 300 clamp(38px, 9vw, 66px)/.95 var(--serif); letter-spacing: -.03em; }
.bcard__name em { font-style: italic; }
.bcard__role { display: block; margin-top: 12px; font-size: clamp(13px, 2.6vw, 16px); line-height: 1.4; opacity: .82; }

.bcard__qr {
  height: 100%;
  aspect-ratio: 1;
  flex: none;
  padding: 0;
  background: #fff;
  color: #111;
}
.qr { display: block; width: 100%; height: 100%; }
.bcard__info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bcard__lines { font: 400 clamp(12px, 2.4vw, 15px)/1.6 var(--mono); word-break: break-word; }

.cardpage__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.cardpage__actions .btn-line,
.btn-solid {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  font: 400 13px/1 var(--mono);
  border-radius: 2px;
  background: none;
}
.btn-solid { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); transition: background-color .2s, border-color .2s; }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .journal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journal--home .entry:nth-child(3) { display: none; }
}

@media (max-width: 960px) {
  .section, .hero__body { grid-template-columns: minmax(0, 1fr); }
  .section > *, .hero__body > * { grid-column: 1; }
  .section__head { grid-row: auto; position: static; margin-bottom: 28px; }
  .ledger__row { grid-template-columns: minmax(0, 1fr); }
  .ledger__date { padding-top: 0; }
  .intro { grid-template-columns: minmax(0, 1fr); }
  .portrait { max-width: 280px; }
  .plates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shot--desk { grid-column: span 12; }
  .shot--phone { grid-column: span 6; }
  .work--index .work__link {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "thumb" "year" "title" "note" "tags";
  }
  .work--index .work__thumb { margin-bottom: 8px; }
  .work--index .work__year { padding-top: 0; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; box-shadow: none; border-width: 1px 0 0; }
  .sheet__list li:last-child a, .sheet__list li:last-child button { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .cardmodal__bar { padding-inline: 4px; }
  .foot__grid { grid-template-columns: minmax(0, 1fr); }
  .channels a { grid-template-columns: 92px minmax(0, 1fr) auto; font-size: 15px; }
  .bcard__back { flex-direction: row; }
  .top__nav { display: none; }
  .menu-btn { display: inline-flex; align-items: center; }

  .hero__name span { display: block; }
  .hero__name { font-size: clamp(64px, 25vw, 140px); line-height: .88; }

  .work__link {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb thumb"
      "year  arrow"
      "title arrow"
      "note  note"
      "tags  tags";
  }
  .work__thumb { display: block; margin-bottom: 10px; }
  .work__year { padding-top: 0; }

  .principles, .facts, .refs { grid-template-columns: minmax(0, 1fr); }
  .plates { grid-template-columns: minmax(0, 1fr); }
  .plate--wide { grid-column: auto; grid-row: auto; }
  .plate--wide img { height: auto; aspect-ratio: 4 / 3; }

  .journal, .journal--home { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .entry--duo { grid-column: auto; }
  /* Phones: two photos become a swipeable pair, same height as a single entry */
  .entry__img--duo {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .entry__img--duo::-webkit-scrollbar { display: none; }
  .entry__img--duo img { flex: 0 0 100%; scroll-snap-align: start; }
  .duo-dots { display: flex; justify-content: center; gap: 7px; margin: -4px 0 12px; }
  .duo-dots span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--rule);
    transition: background-color .5s ease, transform .5s ease;
  }
  .duo-dots span.is-on { background: var(--ink); transform: scale(1.15); }
  .journal--home .entry:nth-child(3) { display: block; }

  .archive__row { grid-template-columns: 34px minmax(0, 1fr); row-gap: 2px; }
  .archive__from, .archive__date { grid-column: 2; }
  .archive__head span:nth-child(n+3) { display: none; }

  .prose { font-size: 19px; }
  .spec { grid-template-columns: minmax(0, 1fr); }
  .spec > div { border-bottom: 1px solid var(--rule); }
  .shot--half { grid-column: span 12; }
}

@media (hover: none) { .peek { display: none; } }

@media (prefers-reduced-motion: reduce) {
  img.fade { opacity: 1; }
  .bcard:hover .bcard__inner { transform: none; }
  .bcard.is-flipped:hover .bcard__inner { transform: rotateY(180deg); }
  html { scroll-behavior: auto; }
  @view-transition { navigation: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .top, .peek, .viewer, .lightbox, .menu, .btn-line, .tabs { display: none !important; }
  .foot { background: none; color: #000; }
  .section__head { position: static; }
}

/* ===== Update: business card back (aligned text) ===== */
.bcard { container-type: inline-size; }
.bcard__back { padding: 5cqw; gap: 4cqw; }
.bcard__qr { height: auto; width: 42cqw; aspect-ratio: 1; flex: none; }
.bcard__info { gap: 2.4cqw; min-width: 0; }
.bcard__info .meta { font-size: clamp(10px, 2.5cqw, 13px); white-space: nowrap; }
.bcard__lines {
  font: 400 clamp(10px, 3cqw, 15px)/1.7 var(--mono);
  white-space: nowrap;
  word-break: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zoom__pdf {
  display: inline-flex; align-items: center;
  min-height: 40px; padding: 0 10px;
  border: 1px solid rgba(242, 239, 232, .22); border-radius: 2px;
  color: #ebe7de; font: 400 13px/1 var(--mono); background: none;
}
.zoom__pdf:hover { border-color: #f2efe8; color: #fff; }
.zoom__pdf[hidden] { display: none; }
.zoom__stage::after {
  content: attr(data-status);
  position: absolute; inset: 0;
  display: none; place-items: center;
  padding: 24px; text-align: center;
  font: 400 13px/1.5 var(--mono); color: #b9b4aa;
}
.zoom.is-loading .zoom__stage::after,
.zoom.is-error .zoom__stage::after { display: grid; }
.zoom.is-loading .zoom__stage img,
.zoom.is-error .zoom__stage img { visibility: hidden; }
@media (max-width: 760px) {
  .zoom__pdf { order: 8; }
}