:root {
  color-scheme: dark;
  --bg: #211b17;
  --surface: #2d251f;
  --surface-hover: #382d25;
  --frame: #17120f;
  --text: #f2e9df;
  --muted: #cbb9aa;
  --line: #5a493c;
  --accent: #d1a27b;
  --accent-strong: #e5bb96;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse 85% 40% at 80% -10%, rgba(151, 95, 61, .15), transparent 75%), var(--bg);
  color: var(--text);
  line-height: 1.5;
}
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.shell { width: min(100% - 2.5rem, 1120px); margin-inline: auto; }

.site-header { border-bottom: 1px solid var(--line); }
.site-header .shell { display: flex; align-items: center; min-height: 4.4rem; }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  color: var(--text);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .025em;
  text-decoration: none;
}
.wordmark-mark { width: .25rem; height: 1.5rem; background: var(--accent); }

.home-main { padding-block: clamp(2.5rem, 6vw, 6.5rem) 5rem; }
.intro { max-width: 900px; }
.wire-rule { display: block; width: min(100%, 760px); height: 3.5rem; margin: 2.5rem auto 0; object-fit: contain; opacity: .7; }
.eyebrow {
  margin: 0 0 .8rem;
  color: var(--accent-strong);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1.08;
}
.lead {
  max-width: 39rem;
  margin: 1.3rem 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.station-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: clamp(1.8rem, 4vw, 3rem);
}
.station-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 10rem;
  padding: 1.6rem 1.7rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  transition: background .2s, border-color .2s;
}
.station-card::after {
  content: "";
  position: absolute;
  right: .45rem;
  bottom: .3rem;
  width: clamp(8rem, 34%, 12rem);
  aspect-ratio: 1763 / 892;
  background: url("stone-watermark.png") center / contain no-repeat;
  filter: invert(1) sepia(1) saturate(.55) brightness(.82);
  opacity: .28;
  pointer-events: none;
}
.station-card > * { position: relative; z-index: 1; }
.station-card:hover { border-color: var(--accent); background: var(--surface-hover); }
.station-number {
  align-self: flex-start;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.7rem;
  line-height: 1;
}
.station-info { display: flex; flex-direction: column; gap: .2rem; min-width: 0; margin-left: 1.5rem; }
.station-title { font-size: 1.13rem; font-weight: 700; }
.station-topic { color: var(--muted); font-size: .92rem; }
.station-keyword { margin-top: .45rem; color: var(--accent-strong); font-family: Georgia, "Times New Roman", serif; font-size: 1rem; }
.station-meta { color: var(--muted); font-size: .9rem; }
.arrow { flex: none; width: 1.5rem; height: 1.5rem; margin-left: auto; color: var(--accent); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.site-footer .shell { padding-block: 1.5rem; }

.gallery-main { padding-block: 2rem 5rem; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--muted);
  font-size: .95rem;
  text-decoration: none;
}
.back-link:hover { color: var(--text); }
.back-link svg { width: 1.2rem; height: 1.2rem; }
.page-heading {
  margin: 3.1rem 0 2.2rem;
}
.page-heading h1 { font-size: clamp(2.5rem, 6vw, 4.7rem); }
.page-keyword { margin: .7rem 0 0; color: var(--accent-strong); font-family: Georgia, "Times New Roman", serif; font-size: 1.3rem; }
.detail-wire { width: min(100%, 680px); height: 2.7rem; margin: -1rem 0 2rem; }
.stone-text {
  max-width: 820px;
  margin: 0 0 2.5rem;
  padding: 1.6rem 1.85rem 1.8rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--surface);
}
.gallery-heading {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  line-height: 1.25;
}
.stone-text-body { max-width: 68ch; font-size: 1rem; line-height: 1.7; }
.stone-text-body p { margin: 0; }
.stone-text-body p:first-child { font-size: 1.12rem; font-weight: 700; line-height: 1.6; }
.stone-text-body p + p { margin-top: 1rem; }
.gallery-heading { margin: 0 0 1.2rem; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.gallery-item {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background .2s, border-color .2s;
}
.gallery-item:hover { border-color: var(--accent); background: var(--surface-hover); }
.image-frame { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: var(--frame); }
.image-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.image-frame img[hidden] { display: none; }
.missing-message { display: none; max-width: 13rem; padding: 1rem; color: var(--muted); font-size: .9rem; text-align: center; }
.gallery-item.is-missing .missing-message { display: block; }
.image-caption { display: flex; align-items: center; justify-content: space-between; gap: .8rem; width: 100%; min-height: 3.6rem; padding: .85rem 1rem; font-size: .9rem; }
.image-title { line-height: 1.35; }
.image-caption svg { flex: none; width: 1.15rem; height: 1.15rem; color: var(--accent); }

.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #120e0b;
  color: #fff;
}
.lightbox::backdrop { background: #120e0b; }
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lightbox-top, .lightbox-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.3rem;
  padding: .7rem clamp(1rem, 3vw, 2rem);
}
.lightbox-top { border-bottom: 1px solid var(--line); }
.lightbox-bottom { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.lightbox-actions { display: flex; align-items: center; gap: .65rem; }
.lightbox-hint { flex: none; }
.lightbox-description-toggle { display: none; }
.lightbox-close, .lightbox-nav {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.lightbox-close { width: 2.8rem; height: 2.8rem; }
.lightbox-close svg, .lightbox-nav svg { width: 1.3rem; height: 1.3rem; }
.lightbox-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem); min-height: 0; }
.lightbox-stage { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; overflow: hidden; padding: .8rem 4.5rem; }
.lightbox-image { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.lightbox-info { min-width: 0; overflow: auto; padding: clamp(1.4rem, 3vw, 2.5rem); border-left: 1px solid var(--line); background: #221b17; }
.lightbox-info-label { margin: 0 0 1rem; color: var(--accent-strong); font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.lightbox-title { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.6rem, 2.5vw, 2.2rem); font-weight: 400; line-height: 1.2; }
.lightbox-description { margin: 1.3rem 0 0; color: var(--muted); font-size: 1rem; line-height: 1.7; }
.lightbox-nav { position: absolute; z-index: 1; top: 50%; width: 3rem; height: 3rem; transform: translateY(-50%); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox button:hover { border-color: var(--accent); background: var(--surface-hover); }

@media (max-width: 1099px) {
  .lightbox-main { display: block; position: relative; }
  .lightbox-stage { width: 100%; height: 100%; }
  .lightbox-info { display: none; position: absolute; z-index: 3; top: .75rem; right: .75rem; bottom: .75rem; width: min(21rem, calc(100% - 1.5rem)); padding: 1.5rem; border: 1px solid var(--line); box-shadow: 0 8px 30px #0008; }
  .lightbox.show-description .lightbox-info { display: block; }
  .lightbox-description-toggle { display: inline-flex; align-items: center; min-height: 2.6rem; padding: .35rem .85rem; border: 1px solid var(--line); border-radius: .3rem; background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; }
  .lightbox-description-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-strong); }
}

.station-card:focus-visible, .back-link:focus-visible, .gallery-item:focus-visible, .lightbox button:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 4px;
}

@media (max-width: 760px) {
  .station-list { grid-template-columns: 1fr; }
  .station-card { min-height: 7.5rem; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lightbox[open] { grid-template-rows: auto minmax(0, 1fr); }
  .lightbox-bottom { display: none; }
  .lightbox-stage { padding: .7rem 3rem; }
  .lightbox-info { top: auto; right: .75rem; bottom: .75rem; left: .75rem; width: auto; max-height: min(50vh, 26rem); padding: 1.25rem; }
}

@media (max-width: 520px) {
  .shell { width: min(100% - 2rem, 1120px); }
  .home-main { padding-top: 3rem; }
  .wire-rule { height: 2.7rem; margin-top: 1.5rem; }
  .lead { font-size: 1rem; }
  .station-list { margin-top: 1.4rem; }
  .station-card { min-height: 6.9rem; padding: 1.2rem; }
  .station-number { font-size: 2.4rem; }
  .station-info { margin-left: 1.1rem; }
  .gallery-main { padding-top: 1.4rem; }
  .page-heading { display: block; margin: 2.5rem 0 1.7rem; }
  .detail-wire { margin: -1rem 0 1.5rem; }
  .stone-text { margin-bottom: 2rem; padding: 1.2rem 1.25rem; }
  .gallery-grid { grid-template-columns: 1fr; }
  .lightbox-stage { padding: .5rem .5rem 4.5rem; }
  .lightbox-nav { top: auto; bottom: .8rem; width: 2.8rem; height: 2.8rem; transform: none; }
  .lightbox-prev { left: calc(50% - 3.4rem); }
  .lightbox-next { right: calc(50% - 3.4rem); }
}

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