:root {
  --paper:   #f3efe6;
  --paper-2: #eae4d6;
  --ink:     #1c1a17;
  --ink-2:   #4a463f;
  --ink-3:   #807a6e;
  --line:    #d8d1c2;
  --frame:   #2a2722;
  --mat:     #faf7ec;   /* plate mat: warm, a touch above the wall */
  --bevel:   rgba(42,39,34,0.55);   /* hairline at the mat's aperture */
  --accent:  #8a6d3b;
  --serif:   "Cormorant Garamond", Georgia, "Times New Roman", "Noto Serif JP", "Noto Serif KR", serif;
  --body:    "EB Garamond", Georgia, serif;
  --gutter:  clamp(20px, 5vw, 72px);
  --shadow:  40,33,20;   /* rgb of plate drop-shadow */
}

/* Dark "gallery at night": dark walls, artwork stays on a light mat. */
html[data-theme="dark"] {
  --paper:   #17150f;
  --paper-2: #211e16;
  --ink:     #f0ece1;
  --ink-2:   #cbc4b4;
  --ink-3:   #938b7c;
  --line:    #322d24;
  --frame:   #0b0a07;
  --mat:     #262119;
  --bevel:   rgba(240,236,225,0.18);
  --accent:  #c9a86a;
  --shadow:  0,0,0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
}

/* ── Theme toggle ─────────────────────────────────────────── */
.theme-toggle {
  position: fixed;
  top: clamp(14px, 2.5vw, 28px);
  right: clamp(14px, 2.5vw, 28px);
  z-index: 50;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: var(--paper-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-3); }
/* Show the icon for the theme you'd switch TO. */
.theme-toggle .theme-sun { display: none; }
.theme-toggle .theme-moon { display: block; }
html[data-theme="dark"] .theme-toggle .theme-sun { display: block; }
html[data-theme="dark"] .theme-toggle .theme-moon { display: none; }

a { color: var(--accent); text-decoration: none; }
em { font-style: italic; }

/* ── Masthead ─────────────────────────────────────────────── */
.masthead {
  text-align: center;
  padding: clamp(48px, 9vw, 120px) var(--gutter) clamp(24px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
}
.kicker {
  font-family: var(--body);
  font-size: 13px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 24px;
}
.masthead h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 8.5vw, 88px);
  line-height: 1.02;
  letter-spacing: 0.005em;
  color: var(--ink);
}
.byline {
  margin-top: 28px;
  font-family: var(--serif);
  font-size: clamp(17px, 2.4vw, 22px);
  color: var(--ink-2);
  letter-spacing: 0.02em;
}
.byline .author { white-space: nowrap; }
.byline .author:not(:last-child)::after {
  content: "\00B7";
  margin: 0 0.5em;
  color: var(--ink-3);
}
.byline a { color: inherit; text-decoration: none; transition: color 0.15s; }
.byline a:hover { color: var(--accent); }
.affil {
  margin-top: 4px;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.venue {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  letter-spacing: 0.04em;
  color: var(--accent);
}

/* ── Site nav ───────────────────────────────────────── */
.sitenav {
  text-align: center;
  padding: 26px var(--gutter) 0;
  font-family: var(--body);
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.sitenav a { color: var(--ink-3); text-decoration: none; transition: color 0.15s; }
.sitenav a:hover { color: var(--accent); }
.sitenav .here { color: var(--ink-2); }

/* ── High-quality downloads ─────────────────────────────────────── */
.downloads {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px) var(--gutter) clamp(56px, 8vw, 96px);
}
.dl-list { list-style: none; }
.dl-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.dl-list a {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s;
}
.dl-list a:hover { color: var(--accent); }
.dl-meta {
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  white-space: nowrap;
}


/* ── About ────────────────────────────────────────────────── */
.about {
  max-width: 64ch;
  margin: clamp(36px, 6vw, 72px) auto;
  padding: 0 var(--gutter);
  text-align: center;
}
.about p {
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.72;
  color: var(--ink-2);
}
.about em, .about i { color: var(--ink); font-style: italic; }
.about a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.about a:hover { color: var(--ink); }

/* ── "Coming soon" placard (paper.html) ───────────────────── */
.placard {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: var(--gutter);
}
.placard .ps-eyebrow {
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.placard h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(52px, 12vw, 120px);
  line-height: 1;
  color: var(--ink);
}
.placard .ps-note {
  font-size: clamp(17px, 2.4vw, 21px);
  color: var(--ink-2);
  max-width: 44ch;
}
.placard .ps-back { margin-top: 18px; font-size: 16px; }
.placard .ps-back a { color: var(--accent); }
.placard .ps-back a:hover { color: var(--ink); }

/* ── Gallery ──────────────────────────────────────────────── */
.gallery {
  display: grid;
  /* 300px lands on exactly 4 columns at the 1800px cap (a 5th would need
     the tracks under 280px) and steps down to 3/2 as the viewport narrows. */
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(36px, 5vw, 64px);
  padding: clamp(24px, 4vw, 56px) var(--gutter) clamp(56px, 8vw, 96px);
  max-width: 1800px;
  margin: 0 auto;
}

.plate {
  cursor: pointer;
  outline: none;
  display: flex;
  flex-direction: column;
}
.plate .frame {
  position: relative;
  width: 100%;
  background: var(--mat);
  padding: 18px;
  border: 1px solid var(--line);
  box-shadow:
    0 1px 1px rgba(0,0,0,0.04),
    0 10px 28px rgba(var(--shadow),0.16);
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), box-shadow 0.35s;
}
.plate .frame::after {
  content: "";
  position: absolute;
  inset: 18px;
  box-shadow: inset 0 0 0 1px var(--bevel);
  pointer-events: none;
}
.plate .frame img {
  display: block;
  width: 100%;
  aspect-ratio: 1;       /* square driven by the image's own definite width */
  height: auto;
  object-fit: cover;
}
.plate:hover .frame,
.plate:focus-visible .frame {
  transform: translateY(-4px);
  box-shadow:
    0 2px 2px rgba(0,0,0,0.05),
    0 22px 48px rgba(var(--shadow),0.26);
}
.plate:focus-visible .frame { outline: 2px solid var(--accent); outline-offset: 4px; }

.plate figcaption {
  margin-top: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.plate .artist {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.plate .artist a { color: inherit; text-decoration: none; transition: color 0.15s; }
.plate .artist a:hover { color: var(--accent); }

/* ── Colophon ─────────────────────────────────────────────── */
.colophon {
  border-top: 1px solid var(--line);
  padding: 32px var(--gutter) 56px;
  text-align: center;
}
.colophon p {
  max-width: 70ch;
  margin: 0 auto;
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.6;
}
.colophon em { font-style: italic; color: var(--ink-2); }

/* ── Lightbox ─────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  max-width: none; max-height: none;
  border: none; padding: 0; margin: 0;
  background: rgba(20,18,15,0.94);
  color: var(--paper);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.lightbox::backdrop { background: rgba(20,18,15,0.94); }
.lightbox[open] { display: flex; animation: fade 0.2s ease both; }
.lb-stage {
  display: flex; align-items: center; justify-content: center;
  max-width: 92vw; max-height: 88vh;
}
.lb-stage img {
  /* Sized from the viewport, not from the file's intrinsic pixels: the 700px
     stand-in and the 2048px original then occupy exactly the same box, so the
     swap sharpens in place instead of resizing. */
  width: min(92vw, 88vh);
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--mat);
  padding: clamp(8px, 1.4vw, 18px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.lb-caption {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.02em;
  color: rgba(243,239,230,0.82);
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden; text-overflow: ellipsis;
}
.lightbox button {
  position: absolute;
  background: none; border: none;
  color: rgba(243,239,230,0.7);
  font-family: var(--serif);
  cursor: pointer;
  padding: 12px;
  line-height: 1;
  transition: color 0.15s;
}
.lightbox button:hover { color: var(--paper); }
.lb-close { top: 14px; right: 22px; font-size: 40px; }
.lb-prev { left: 14px;  top: 50%; transform: translateY(-50%); font-size: 56px; }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); font-size: 56px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

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

@media (max-width: 600px) {
  body { font-size: 17px; }
  .sitenav { padding-top: 62px; font-size: 11px; letter-spacing: 0.14em; }
  .masthead { padding: clamp(40px, 12vw, 64px) var(--gutter) 28px; }
  .masthead h1 { font-size: clamp(34px, 11vw, 56px); letter-spacing: 0; }
  .byline { font-size: 16px; }
  .about { margin: 40px auto; }
  .about p { font-size: 17px; line-height: 1.65; }
  .gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 28px var(--gutter) 56px;
  }
  .plate { width: 100%; max-width: 300px; }
  .plate .frame { padding: 14px; }
  .plate .frame::after { inset: 14px; }
  .plate .artist { font-size: 22px; }
  .lb-prev, .lb-next { font-size: 40px; }
}
