/* =========================================================
   Hayden Fang — Personal Archive
   A warm-paper, editorial, hand-set aesthetic.
   No gradients. No perfect symmetry. Quiet, crafted, a little
   off-grid on purpose.
   ========================================================= */

/* ---- Fonts -------------------------------------------------- */
/* Fraunces  : editorial display serif w/ optical sizing + soft
   Newsreader: literary body serif
   IBM Plex Mono: metadata, labels, page furniture */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900&family=Newsreader:ital,opsz,wght@0,6..72,300..600;1,6..72,300..600&family=IBM+Plex+Mono:ital,wght@0,400;0,500;1,400&display=swap');

/* ---- Tokens ------------------------------------------------- */
:root {
  --paper:      #f1ece1;   /* warm cream */
  --paper-2:    #e9e2d3;   /* slightly deeper panel */
  --paper-edge: #ded5c2;
  --ink:        #1d1a15;   /* warm near-black */
  --ink-soft:   #4a443a;
  --ink-faint:  #8a8275;
  --rule:       #c8bfac;   /* hairline */
  --rust:       #a8432a;   /* primary accent */
  --rust-deep:  #7e3220;
  --ochre:      #9a7b34;   /* secondary accent */
  --teal:       #3f6b63;   /* rare third accent */

  --serif-display: 'Fraunces', Georgia, serif;
  --serif-body:    'Newsreader', Georgia, serif;
  --mono:          'IBM Plex Mono', ui-monospace, monospace;

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
}

/* ---- Reset-ish ---------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 18px;
  line-height: 1.6;
  font-optical-sizing: auto;
  /* faint paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

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

/* ---- Language visibility ------------------------------------ */
[data-lang="en"] .zh { display: none !important; }
[data-lang="zh"] .en { display: none !important; }
/* keep mono labels tight when swapped */
.zh { font-feature-settings: normal; }

/* ---- Layout shell ------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ===========================================================
   MASTHEAD — reads like the cover of a personal periodical
   =========================================================== */
.masthead {
  border-bottom: 1px solid var(--ink);
  padding-top: 18px;
}
.masthead__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 14px;
  flex-wrap: wrap;
}
.masthead__top .dotline { flex: 1; border-bottom: 1px dotted var(--rule); transform: translateY(-3px); }

.masthead__title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 6px 0 16px;
  flex-wrap: wrap;
}
.masthead__title h1,
.masthead__title .wordmark {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: clamp(34px, 7vw, 78px);
  line-height: 0.92;
  letter-spacing: -0.015em;
  margin: 0;
}
.masthead__title .wordmark a { text-decoration: none; }
.masthead__title .wordmark em {
  font-style: italic;
  font-weight: 300;
  color: var(--rust);
}
.masthead__sub {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: right;
  max-width: 220px;
}

/* slim masthead for interior pages */
.masthead--slim .masthead__title { padding: 2px 0 12px; }
.masthead--slim .masthead__title .wordmark { font-size: clamp(26px, 4vw, 40px); }
.masthead--slim .masthead__sub { font-size: 11px; }

/* ---- Nav ---------------------------------------------------- */
.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 11px 0;
  border-top: 1px solid var(--rule);
  flex-wrap: wrap;
}
.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 2px;
  transition: color .18s ease;
}
.nav a .num { color: var(--ink-faint); margin-right: 5px; font-size: 10.5px; }
.nav a:hover { color: var(--rust); }
.nav a.is-active { color: var(--ink); }
.nav a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--rust);
}
.nav__spacer { flex: 1; }

/* language toggle */
.langtoggle {
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 4px;
  cursor: pointer;
  display: inline-flex;
  gap: 2px;
  letter-spacing: 0.02em;
}
.langtoggle span {
  padding: 2px 9px;
  border-radius: 999px;
  color: var(--ink-faint);
  transition: all .18s ease;
}
[data-lang="en"] .langtoggle .l-en,
[data-lang="zh"] .langtoggle .l-zh { background: var(--ink); color: var(--paper); }

/* ===========================================================
   GENERIC EDITORIAL BITS
   =========================================================== */
.kicker {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust);
  display: inline-block;
}
.sec-no {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.rule--ink { border-top: 1px solid var(--ink); }

h2.display, h3.display, .display {
  font-family: var(--serif-display);
  font-weight: 460;
  letter-spacing: -0.012em;
  line-height: 1.04;
}

.lead {
  font-family: var(--serif-body);
  font-size: clamp(20px, 2.6vw, 27px);
  line-height: 1.42;
  font-weight: 320;
  color: var(--ink);
}
.lead em { font-style: italic; color: var(--rust-deep); }

p { margin: 0 0 1.1em; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  padding: 1px 6px;
  border-radius: 4px;
}

/* link style in prose — hand-drawn-ish underline */
.prose a, a.inline {
  color: var(--rust-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--rust);
  transition: background .18s ease;
}
.prose a:hover, a.inline:hover { background: #e6d9c4; }

/* margin note */
.note {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

/* ===========================================================
   HOME — hero
   =========================================================== */
.hero { padding: clamp(40px, 7vw, 86px) 0 36px; }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0, 300px);
  gap: clamp(24px, 5vw, 64px);
  align-items: end;
}
.hero h2 {
  font-family: var(--serif-display);
  font-weight: 420;
  font-size: clamp(40px, 8.5vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0.1em 0 0;
}
.hero h2 .ital { font-style: italic; font-weight: 300; }
.hero h2 .rust { color: var(--rust); }
.hero__bio {
  font-family: var(--serif-body);
  font-size: clamp(17px, 1.9vw, 20px);
  line-height: 1.5;
  color: var(--ink-soft);
  border-left: 2px solid var(--rust);
  padding-left: 18px;
}
.hero__bio strong { font-weight: 600; color: var(--ink); }
.hero__meta {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.hero__meta .dot { color: var(--rust); }

/* ===========================================================
   INDEX / CONTENTS — the archive's table of contents
   =========================================================== */
.contents { padding: 30px 0 20px; }
.contents__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 6px;
}
.entry {
  display: grid;
  grid-template-columns: 56px minmax(0,1fr) auto;
  gap: clamp(14px, 3vw, 40px);
  align-items: baseline;
  text-decoration: none;
  color: var(--ink);
  padding: 26px 4px 24px;
  border-top: 1px solid var(--rule);
  position: relative;
  transition: padding-left .25s cubic-bezier(.2,.7,.2,1), background .2s ease;
}
.entry:last-child { border-bottom: 1px solid var(--rule); }
.entry:hover { padding-left: 18px; background: rgba(168,67,42,0.04); }
.entry__no { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); padding-top: 10px; }
.entry__title {
  font-family: var(--serif-display);
  font-weight: 440;
  font-size: clamp(26px, 4.4vw, 46px);
  line-height: 1.0;
  letter-spacing: -0.014em;
}
.entry__title .sub {
  display: block;
  font-family: var(--serif-body);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(14px, 1.7vw, 17px);
  color: var(--ink-soft);
  letter-spacing: 0;
  margin-top: 8px;
  max-width: 46ch;
}
.entry__meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: right;
  white-space: nowrap;
  padding-top: 10px;
}
.entry__arrow {
  font-family: var(--mono);
  color: var(--rust);
  opacity: 0;
  transform: translateX(-6px);
  transition: all .25s ease;
}
.entry:hover .entry__arrow { opacity: 1; transform: translateX(0); }

/* ===========================================================
   SECTIONS (interior pages)
   =========================================================== */
.section { padding: clamp(40px, 6vw, 74px) 0; }
.section__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: clamp(20px, 4vw, 56px);
  align-items: end;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 40px;
}
.section__head h2 {
  font-family: var(--serif-display);
  font-weight: 430;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.016em;
  margin: 10px 0 0;
}
.section__head h2 em { font-style: italic; font-weight: 300; color: var(--rust); }
.section__intro {
  font-family: var(--serif-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* two-column editorial body */
.cols2 {
  column-count: 2;
  column-gap: clamp(28px, 5vw, 60px);
  column-rule: 1px solid var(--rule);
}
@media (max-width: 720px){ .cols2 { column-count: 1; } }

/* ===========================================================
   PROJECT / BUILD CARDS — irregular, not a grid of boxes
   =========================================================== */
.builds { display: flex; flex-direction: column; }
.build {
  display: grid;
  grid-template-columns: 88px minmax(0,1fr) minmax(0, 240px);
  gap: clamp(16px, 3.5vw, 44px);
  align-items: start;
  padding: 34px 0;
  border-top: 1px solid var(--rule);
}
.build:last-child { border-bottom: 1px solid var(--rule); }
.build__icon {
  width: 72px; height: 72px; border-radius: 17px;
  border: 1px solid var(--paper-edge);
  background: #fff;
  box-shadow: 0 1px 0 var(--paper-edge);
  overflow: hidden;
}
.build__icon img { width: 100%; height: 100%; object-fit: cover; }
.build__icon--ph {
  display: grid; place-items: center;
  background: var(--paper-2);
  font-family: var(--mono); color: var(--ink-faint); font-size: 22px;
}
.build__body h3 {
  font-family: var(--serif-display);
  font-weight: 470;
  font-size: clamp(22px, 3.2vw, 30px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}
.build__role {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--rust);
}
.build__body p { font-size: 16.5px; line-height: 1.5; margin: 12px 0 0; color: var(--ink-soft); max-width: 60ch; }
.build__tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--ink-soft);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 3px 10px; background: rgba(255,255,255,0.35);
}
.build__aside {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.6;
  color: var(--ink-faint); letter-spacing: 0.02em;
}
.build__aside .yr { color: var(--ink); }
.build__aside a { color: var(--rust-deep); text-decoration: none; border-bottom: 1px solid var(--rust); }
.build__aside a:hover { background: #e6d9c4; }

/* ===========================================================
   WRITING — list of notes
   =========================================================== */
.posts { border-top: 1px solid var(--ink); }
.post {
  display: grid;
  grid-template-columns: 120px minmax(0,1fr) auto;
  gap: clamp(16px, 3vw, 40px);
  align-items: baseline;
  padding: 22px 4px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none; color: var(--ink);
  transition: background .2s ease, padding-left .25s ease;
}
.post:hover { background: rgba(168,67,42,0.04); padding-left: 14px; }
.post__date { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); letter-spacing: 0.03em; text-transform: uppercase; }
.post__title {
  font-family: var(--serif-display); font-weight: 440;
  font-size: clamp(20px, 2.8vw, 27px); line-height: 1.15; letter-spacing: -0.01em;
}
.post__title .sub { display:block; font-family: var(--serif-body); font-style: italic; font-weight: 300; font-size: 15px; color: var(--ink-soft); margin-top: 4px; }
.post__tag { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ochre); }

/* ===========================================================
   GALLERY — visual diary, irregular masonry-ish
   =========================================================== */
.gallery {
  columns: 3 240px;
  column-gap: 18px;
}
.plate {
  break-inside: avoid;
  margin-bottom: 18px;
  background: #fff;
  border: 1px solid var(--paper-edge);
  padding: 10px 10px 12px;
  box-shadow: 0 1px 0 var(--paper-edge);
  transform: rotate(var(--tilt, 0deg));
}
.plate:nth-child(3n) { --tilt: -0.6deg; }
.plate:nth-child(4n) { --tilt: 0.5deg; }
/* scroll-reveal: plates fade + rise as they enter view (turned on by JS; keeps the polaroid tilt) */
.gallery.is-reveal .plate { opacity: 0; transform: translateY(20px) rotate(var(--tilt, 0deg)); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.gallery.is-reveal .plate.is-visible { opacity: 1; transform: translateY(0) rotate(var(--tilt, 0deg)); }
.plate__img {
  aspect-ratio: var(--ar, 3/4);
  background: var(--paper-2);
  display: grid; place-items: center;
  color: var(--ink-faint); font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.04em;
  /* button reset (plate is clickable to open the lightbox) */
  width: 100%; padding: 0; border: 0; cursor: zoom-in;
  overflow: hidden;
}
.plate__img img { transition: transform .4s cubic-bezier(.2,.7,.2,1); }
.plate:hover .plate__img img { transform: scale(1.03); }
.plate__img:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; }
.plate__cap {
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  letter-spacing: 0.02em; margin-top: 9px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px;
}
.plate__cap .no { color: var(--rust); white-space: nowrap; }

/* ===========================================================
   WORK (selected professional) — restrained
   =========================================================== */
.work { border-top: 1px solid var(--ink); }
.work__item {
  display: grid;
  grid-template-columns: 72px minmax(0,1fr) minmax(0,200px);
  gap: clamp(16px, 3.5vw, 44px);
  padding: 38px 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.work__icon { width: 60px; height: 60px; border-radius: 14px; overflow:hidden; border: 1px solid var(--paper-edge); background:#fff; }
.work__icon img { width: 100%; height: 100%; object-fit: cover; }
.work__item h3 { font-family: var(--serif-display); font-weight: 470; font-size: clamp(22px, 3vw, 30px); margin: 0 0 2px; letter-spacing: -0.01em; }
.work__sub { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--rust); }
.work__item p { font-size: 16.5px; line-height: 1.55; color: var(--ink-soft); margin: 12px 0 0; max-width: 62ch; }
.work__side { font-family: var(--mono); font-size: 11.5px; line-height: 1.7; color: var(--ink-faint); letter-spacing: 0.02em; }
.work__side .lbl { color: var(--ink); }

/* timeline / earlier roles condensed */
.tl { margin-top: 8px; }
.tl__row {
  display: grid; grid-template-columns: 130px minmax(0,1fr) auto; gap: 18px;
  padding: 12px 0; border-bottom: 1px dotted var(--rule);
  font-size: 16px; align-items: baseline;
}
.tl__yr { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); letter-spacing: 0.03em; }
.tl__role { color: var(--ink); }
.tl__role b { font-weight: 600; }
.tl__place { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em; text-align: right; }

/* ===========================================================
   ABOUT
   =========================================================== */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0,1.4fr) minmax(0,1fr);
  gap: clamp(30px, 6vw, 80px);
}
.about__body p { font-size: 18.5px; line-height: 1.62; margin: 0 0 1.1em; }
.about__body p:first-child::first-letter {
  font-family: var(--serif-display);
  font-size: 3.4em; float: left; line-height: 0.72;
  padding: 8px 10px 0 0; color: var(--rust); font-weight: 500;
}
.factsheet { font-family: var(--mono); font-size: 12.5px; line-height: 1.7; }
.factsheet dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.factsheet dt { color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; padding-top: 2px; }
.factsheet dd { margin: 0; color: var(--ink); }
.factsheet dd a { color: var(--rust-deep); text-decoration: none; border-bottom: 1px solid var(--rust); }

/* ===========================================================
   CONTACT band
   =========================================================== */
.contact {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: clamp(40px, 7vw, 80px) 0;
  margin-top: 30px;
}
.contact h2 {
  font-family: var(--serif-display); font-weight: 420;
  font-size: clamp(32px, 6vw, 62px); letter-spacing: -0.015em; margin: 0 0 18px; line-height: 1.05;
  overflow-wrap: anywhere;
}
.contact h2 a { text-decoration: none; border-bottom: 2px solid var(--rust); }
.contact h2 a:hover { color: var(--rust); }
.contact__links { display: flex; flex-wrap: wrap; gap: 10px 26px; font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 8px; }
.contact__links a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 2px; }
.contact__links a:hover { color: var(--rust); border-color: var(--rust); }

/* ===========================================================
   FOOTER
   =========================================================== */
.foot {
  padding: 26px 0 40px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.foot a { color: var(--ink-soft); text-decoration: none; }
.foot a:hover { color: var(--rust); }

/* back-to-index pager */
.pager {
  display:flex; justify-content: space-between; align-items:center;
  border-top: 1px solid var(--rule); padding: 20px 0;
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
}
.pager a { color: var(--ink-soft); text-decoration: none; }
.pager a:hover { color: var(--rust); }

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 860px){
  .hero__grid { grid-template-columns: 1fr; align-items: start; }
  .section__head { grid-template-columns: 1fr; }
  .about__grid { grid-template-columns: 1fr; }
  .build { grid-template-columns: 64px 1fr; }
  .build__aside { grid-column: 1 / -1; padding-top: 4px; }
  .work__item { grid-template-columns: 56px 1fr; }
  .work__side { grid-column: 1 / -1; }
  .entry { grid-template-columns: 40px 1fr; }
  .entry__meta { grid-column: 2 / -1; text-align: left; padding-top: 12px; }
  .post { grid-template-columns: 1fr; gap: 6px; }
  .post__date { order: -1; }
  .tl__row { grid-template-columns: 90px 1fr; }
  .tl__place { grid-column: 2 / -1; text-align: left; }
}
@media (max-width: 520px){
  body { font-size: 17px; }
  .gallery { columns: 1; }
  .post-body pre { font-size: 12.5px; padding: 14px 14px; }
  .contact h2 { font-size: clamp(22px, 7vw, 30px); }
}

/* ===========================================================
   AVATAR
   =========================================================== */
/* contact-area avatar — a warm, welcoming sign-off portrait */
.contact__avatar {
  width: 92px; height: 92px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1px var(--rule), 0 4px 14px rgba(29,26,21,0.13);
  margin: 0 0 22px;
}

/* ===========================================================
   BLOG POST detail page
   =========================================================== */
.post-hero { padding: clamp(40px, 6vw, 72px) 0 32px; border-bottom: 1px solid var(--ink); margin-bottom: 48px; }
.post-hero .kicker { margin-bottom: 14px; }
.post-hero h1 {
  font-family: var(--serif-display);
  font-weight: 420;
  font-size: clamp(34px, 6.5vw, 72px);
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}
.post-hero h1 em { font-style: italic; font-weight: 280; color: var(--rust); }
.post-hero__meta {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-faint);
}
.post-hero__meta .sep { color: var(--rule); }
.post-body {
  max-width: 64ch;
  min-width: 0;
  font-size: 19px; line-height: 1.68;
}
.post-body p { margin: 0 0 1.3em; }
.post-body h2 {
  font-family: var(--serif-display); font-weight: 440;
  font-size: clamp(24px, 3.5vw, 32px); letter-spacing: -0.012em;
  margin: 2em 0 0.5em; line-height: 1.05;
}
.post-body h2 em { font-style: italic; font-weight: 300; color: var(--rust); }
.post-body blockquote {
  border-left: 3px solid var(--rust);
  margin: 2em 0; padding: 2px 0 2px 22px;
  color: var(--ink-soft); font-style: italic;
  font-size: 1.05em;
}
.post-body code { font-size: 0.83em; }
.post-body pre {
  background: var(--paper-2); border: 1px solid var(--paper-edge);
  border-radius: 6px; padding: 18px 20px;
  max-width: 100%; overflow-x: auto;
  font-family: var(--mono); font-size: 14px; line-height: 1.55;
  margin: 1.6em 0;
}
/* long links / emails must wrap, not push the page wider */
.prose a, .post-aside a, .post-body a { overflow-wrap: anywhere; }
.post-body pre code { background: none; border: none; padding: 0; font-size: inherit; }
.post-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 220px;
  gap: clamp(24px, 5vw, 64px);
  padding-bottom: 60px;
}
.post-aside {
  font-family: var(--mono); font-size: 12px; line-height: 1.7;
  color: var(--ink-faint); letter-spacing: 0.02em;
  padding-top: 4px;
}
.post-aside .lbl { color: var(--rust); text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.1em; display: block; margin-bottom: 4px; }
.post-aside .aside-block { margin-bottom: 28px; }
.post-aside a { color: var(--rust-deep); text-decoration: none; border-bottom: 1px solid var(--rust); }
@media (max-width: 860px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-aside { border-top: 1px solid var(--rule); padding-top: 28px; display: flex; flex-wrap: wrap; gap: 20px 40px; }
  .post-aside .aside-block { flex: 1 1 160px; margin-bottom: 0; }
}

/* gallery plates with real images */
.plate__img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===========================================================
   LIGHTBOX — full-frame photo viewer
   =========================================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: clamp(16px, 4vw, 48px);
  background: rgba(18, 15, 11, 0.94);
  opacity: 0; visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__stage {
  flex: 1 1 auto; min-height: 0; width: 100%;
  display: flex; align-items: center; justify-content: center;
}
.lightbox__img {
  max-width: min(100%, 1100px);
  max-height: 100%;
  object-fit: contain;
  background: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  animation: lbImgIn .44s cubic-bezier(.2,.72,.2,1) both;
}
.lightbox__cap {
  flex: 0 0 auto;
  max-width: min(1100px, 92vw);
  text-align: center;
  font-family: var(--serif-body);
  color: var(--paper);
  animation: lbCapIn .5s cubic-bezier(.2,.72,.2,1) .06s both;
}
.lightbox__title {
  font-family: var(--serif-display);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 460; letter-spacing: -0.01em;
}
.lightbox__note {
  display: block; margin-top: 6px;
  font-style: italic; font-size: clamp(14px, 1.8vw, 17px);
  color: #d8cdb8;
}
.lightbox__no {
  display: block; margin-top: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: #9a8f78;
}
.lightbox__place {
  display: inline-block; margin-top: 12px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.03em;
  color: #d8cdb8; text-decoration: none;
  border-bottom: 1px solid rgba(216,205,184,0.4); padding-bottom: 2px;
  transition: color .18s ease, border-color .18s ease;
}
.lightbox__place:hover { color: #fff; border-color: #fff; }
/* controls */
.lightbox__btn {
  position: absolute; background: rgba(255,255,255,0.08);
  color: var(--paper); border: 1px solid rgba(255,255,255,0.18);
  cursor: pointer; border-radius: 999px;
  display: grid; place-items: center;
  font-family: var(--mono); line-height: 1;
  transition: background .18s ease, transform .18s ease;
}
.lightbox__btn:hover { background: rgba(255,255,255,0.2); }
.lightbox__btn:active { transform: scale(0.94); }
.lightbox__close { top: clamp(12px, 3vw, 24px); right: clamp(12px, 3vw, 24px); width: 44px; height: 44px; font-size: 20px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 26px; }
.lightbox__nav:active { transform: translateY(-50%) scale(0.94); }
.lightbox__prev { left: clamp(8px, 2vw, 24px); }
.lightbox__next { right: clamp(8px, 2vw, 24px); }
.lightbox__count {
  position: absolute; top: clamp(14px, 3vw, 26px); left: clamp(14px, 3vw, 26px);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  color: #9a8f78;
}
body.lb-open { overflow: hidden; }
@media (max-width: 520px){
  /* mobile: navigate by swipe instead of the edge arrows (which can overlap the photo) */
  .lightbox__nav { display: none; }
}

/* lightbox entrance — image zooms/fades in, caption follows (replayed on open + prev/next) */
@keyframes lbImgIn {
  from { opacity: 0; transform: scale(0.97) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes lbCapIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce){
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
