:root {
  --paper: #e9dfcf;
  --card: #f3ecdf;
  --ink: #111;
  --muted: #4a443b;
  --red: #c8342b;
  --serif-display: "Playfair Display", "Bodoni MT", Didot, Georgia, serif;
  --serif-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --side: 76px;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1; }

a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--ink); color: var(--paper);
  padding: .5rem 1rem; font-family: var(--sans); font-size: .8rem;
}
.skip:focus { top: 1rem; }

/* ---------- Page frame: logo rail + content, links column on the right ---------- */
.page {
  flex: 1;
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  column-gap: clamp(1.5rem, 3.5vw, 3rem);
  padding: 1.5rem calc(var(--side) + var(--pad)) 0 var(--pad);
}
.content { position: relative; display: flex; flex-direction: column; min-width: 0; }

.stamp {
  align-self: start;
  display: flex; flex-direction: column; align-items: center; gap: .8rem;
  text-decoration: none;
}
.dot { width: 34px; height: 34px; border-radius: 50%; background: var(--red); }
.vertical {
  writing-mode: vertical-rl;
  font-family: var(--serif-display); font-weight: 700;
  font-size: .8rem; letter-spacing: .32em; text-transform: uppercase;
}

/* ---------- Links column (same as home) ---------- */
.links {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--side);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.5rem;
}
.links a {
  writing-mode: vertical-rl;
  font-family: var(--sans); font-size: .72rem; font-weight: 500;
  letter-spacing: .28em; text-transform: uppercase; text-decoration: none;
  padding: .4rem;
  transition: color .2s;
}
.links a:hover { color: var(--red); }
.links a[aria-current="page"] { color: var(--red); }
.links a:first-child::before {
  content: ""; display: block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); margin: 0 auto .9rem;
}

/* ---------- Back to home ---------- */
.back {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: .8rem;
  text-decoration: none;
}
.back-icon {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--ink); border-radius: 50%;
  transition: background .2s, color .2s, transform .2s;
}
.back:hover .back-icon, .back:focus-visible .back-icon {
  background: var(--ink); color: var(--paper); transform: translateX(-3px);
}
.back-text {
  font-family: var(--sans); font-size: .7rem; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
}

/* ---------- Intro ---------- */
.intro {
  position: relative;
  max-width: 40rem;
  margin: clamp(1.25rem, 2.5vw, 1.75rem) 0 clamp(2rem, 4.5vw, 3.5rem);
}
.lede {
  margin: 0; font-size: 1.15rem; line-height: 1.7;
}
.cap {
  float: left;
  display: grid; place-items: center;
  width: 3.6rem; height: 3.6rem; margin: .35rem .9rem 0 0;
  background: var(--ink); color: var(--paper);
  font-family: var(--serif-display); font-weight: 900; font-size: 2.4rem; line-height: 1;
}
.figure {
  position: absolute; top: 0; right: 0;
  width: 28px; height: 70px; overflow: visible; pointer-events: none;
  view-transition-name: human;
}
.figure .body { fill: var(--ink); }
.figure .shadow { fill: var(--ink); opacity: .16; }

/* ---------- Section title ---------- */
.news { flex: 1; padding: clamp(1.5rem, 3vw, 2.25rem) 0 clamp(1.5rem, 3vw, 2.5rem); }
.section-title {
  display: flex; align-items: center; gap: .8rem;
  margin: 0 0 clamp(1rem, 2.2vw, 1.5rem);
  font-family: var(--serif-display); font-weight: 700;
  font-size: clamp(.95rem, 1.4vw, 1.15rem);
  letter-spacing: .2em; text-transform: uppercase;
}
.hand { fill: var(--ink); flex: none; shape-rendering: crispEdges; }

/* ---------- Cards ---------- */
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.4vw, 2.25rem);
  align-items: start;
}
.cards li:nth-child(1) { margin-top: 0; }
.cards li:nth-child(2) { margin-top: 2.25rem; }
.cards li:nth-child(3) { margin-top: .75rem; }
.cards li:nth-child(4) { margin-top: 3rem; }

.card {
  display: block; width: 100%;
  margin: 0; padding: .75rem .75rem 1rem;
  text-align: left; font: inherit; color: inherit;
  background: var(--card);
  border: 1px solid rgba(17,17,17,.14);
  box-shadow: 0 1px 0 rgba(17,17,17,.06), 0 14px 26px -18px rgba(17,17,17,.45);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 1px 0 rgba(17,17,17,.06), 0 22px 30px -18px rgba(17,17,17,.5);
}
.card > span { display: block; }
.card > .full[hidden] { display: none; }

.thumb { aspect-ratio: 4 / 3; overflow: hidden; background: #cfc6b6; }
.thumb svg, .viewer-img svg { display: block; width: 100%; height: 100%; }
.thumb .bg, .viewer-img .bg { fill: #d3cabb; }
.thumb svg { transition: transform .5s ease; }
.card:hover .thumb svg { transform: scale(1.04); }

.meta {
  display: flex !important; justify-content: space-between; gap: .5rem;
  margin: .85rem 0 .35rem;
  font-family: var(--sans); font-size: .64rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.title {
  font-family: var(--serif-display); font-weight: 700;
  font-size: 1.25rem; line-height: 1.2;
}
.excerpt { margin-top: .5rem; font-size: .92rem; line-height: 1.5; color: var(--muted); }
.open {
  display: inline-flex !important; align-items: center; gap: .5rem;
  margin-top: .9rem;
  font-family: var(--sans); font-size: .66rem; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
}
.open i {
  display: inline-grid; place-items: center; width: 22px; height: 22px;
  border: 1px solid var(--ink); border-radius: 50%;
  font-style: normal; font-size: .9rem; line-height: 1;
  transition: background .2s, color .2s;
}
.card:hover .open i, .card:focus-visible .open i { background: var(--ink); color: var(--paper); }

/* ---------- Footer ---------- */
.foot {
  padding: 1rem 0 1.25rem;
  border-top: 1px solid rgba(17,17,17,.25);
}
.foot p {
  margin: 0; font-family: var(--sans); font-size: .66rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}

/* ---------- Enlarged view ---------- */
#viewer {
  padding: 0; border: 0; color: inherit;
  width: min(980px, calc(100% - 2rem)); max-height: calc(100vh - 2rem);
  background: var(--card);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.55);
  overflow: auto;
}
#viewer[open] { display: grid; grid-template-columns: 1.1fr 1fr; animation: rise .25s ease; }
#viewer::backdrop { background: rgba(17,17,17,.55); animation: fade .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.viewer-img { background: #cfc6b6; min-height: 280px; }
.viewer-img svg { height: 100%; min-height: 280px; }
.viewer-body { padding: clamp(1.5rem, 3vw, 2.75rem); display: flex; flex-direction: column; }
.viewer-body .tag {
  margin: 0 0 .75rem; font-family: var(--sans); font-size: .68rem; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
}
.viewer-body h2 {
  margin: 0 0 1.25rem; font-family: var(--serif-display); font-weight: 900;
  font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.05; text-transform: uppercase;
}
.viewer-text p { margin: 0 0 1rem; }
.viewer-text p:first-child::first-letter {
  float: left; font-family: var(--serif-display); font-weight: 900;
  font-size: 3.4em; line-height: .8; padding: .08em .1em 0 0;
}
.links-line { font-family: var(--sans); font-size: .72rem; letter-spacing: .08em; }
.links-line a { text-underline-offset: 3px; }

.pager {
  margin-top: auto; padding-top: 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  font-family: var(--sans); font-size: .7rem; letter-spacing: .18em;
}
.step {
  width: 40px; height: 40px; border: 1px solid var(--ink); border-radius: 50%;
  background: transparent; color: var(--ink); font-size: 1rem; cursor: pointer;
  transition: background .2s, color .2s;
}
.step:hover { background: var(--ink); color: var(--paper); }

.close {
  position: absolute; top: .75rem; right: .75rem; z-index: 2;
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--ink); border-radius: 50%;
  background: var(--card); color: var(--ink); cursor: pointer;
  transition: background .2s, color .2s;
}
.close:hover { background: var(--ink); color: var(--paper); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards li:nth-child(1), .cards li:nth-child(3) { margin-top: 0; }
  .cards li:nth-child(2), .cards li:nth-child(4) { margin-top: 2.25rem; }
}

@media (max-width: 720px) {
  :root { --side: 0px; }
  .figure { width: 18px; height: 45px; }
  .page {
    grid-template-columns: 1fr; row-gap: 1rem;
    padding: 1.1rem var(--pad) 3.5rem;
  }
  /* logo becomes a horizontal lockup, like the home bottom bar becomes a row */
  .stamp { flex-direction: row; gap: .7rem; }
  .vertical { writing-mode: horizontal-tb; font-size: .72rem; letter-spacing: .24em; }
  .dot { width: 24px; height: 24px; }

  .links {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 3.5rem;
    flex-direction: row; justify-content: center; gap: .5rem; padding: 0 .25rem;
    background: var(--paper); z-index: 5;
  }
  .links a { writing-mode: horizontal-tb; padding: .5rem .2rem; letter-spacing: .1em; font-size: .6rem; white-space: nowrap; }
  .links a:first-child::before { display: none; }

  .cards { grid-template-columns: 1fr; }
  .cards li:nth-child(n) { margin-top: 0; }
  .cards li:nth-child(even) { margin-left: 1.5rem; }
  .cards li:nth-child(odd) { margin-right: 1.5rem; }

  #viewer {
    width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0;
  }
  #viewer[open] { grid-template-columns: 1fr; grid-auto-rows: min-content; align-content: start; }
  .viewer-img { min-height: 0; aspect-ratio: 4 / 3; }
  .viewer-img svg { min-height: 0; }
}

@media (max-width: 420px) {
  .links { gap: .3rem; padding: 0 .15rem; }
  .links a { letter-spacing: .06em; font-size: .56rem; padding: .5rem .15rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
