:root {
  --ink: #100e0b;
  --ink-soft: #1b1712;
  --parchment: #f7f1e6;
  --paper: #fffbf3;
  --gold: #c8a96a;
  --gold-deep: #9b793b;
  --cinnabar: #a74836;
  --sage: #879278;
  --line: rgba(255, 255, 255, 0.14);
  --muted: rgba(255, 255, 255, 0.64);
  --faint: rgba(255, 255, 255, 0.42);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
  animation: pageFadeIn 520ms ease both;
}

body.viewer-open {
  overflow: hidden;
}

.cursor-stars {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0.9;
}

a {
  color: inherit;
}

button,
a.button {
  min-height: 44px;
}

button {
  font: inherit;
}

.page-shell {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 78% 18%, rgba(200, 169, 106, 0.14), transparent 28rem),
    linear-gradient(180deg, #17130f 0%, #100e0b 52%, #211a13 100%);
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
  filter: saturate(0.72) sepia(0.12);
  transform: scale(1.02);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(7, 6, 5, 0.95) 0%, rgba(13, 11, 8, 0.84) 34%, rgba(18, 14, 10, 0.48) 68%, rgba(18, 14, 10, 0.22) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0.38) 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1400px, calc(100% - 60px));
  margin: 0 auto;
  padding: 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(200, 169, 106, 0.5);
  border-radius: 50%;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1;
}

.hero-content {
  width: min(1400px, calc(100% - 60px));
  margin: 0 auto;
  padding: clamp(32px, 4vw, 60px) 0;
}

.site-credit {
  position: absolute;
  left: clamp(18px, 3vw, 34px);
  bottom: clamp(16px, 2.4vw, 28px);
  margin: 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  letter-spacing: 0.04em;
  z-index: 1;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(480px, 1.1fr);
  gap: clamp(24px, 3vw, 50px);
  align-items: center;
  min-height: 560px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: rgba(200, 169, 106, 0.88);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.hero-copy {
  max-width: 600px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 500;
  letter-spacing: 0;
}

h1 {
  max-width: 600px;
  color: rgba(200, 169, 106, 0.96);
  font-size: clamp(40px, 5vw, 72px);
  line-height: 0.92;
  text-wrap: balance;
}

.subtitle {
  max-width: 520px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.75);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(17px, 1.8vw, 24px);
  line-height: 1.22;
}

.subtitle a {
  color: rgba(200, 169, 106, 0.96);
  text-decoration: none;
  transition: color 180ms ease;
}

.subtitle a:hover,
.subtitle a:focus-visible {
  color: #d3b577;
  text-decoration: none;
}

.description {
  max-width: 520px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: clamp(13px, 1.1vw, 15px);
  text-align: justify;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button.primary,
.button.secondary {
  border-color: rgba(200, 169, 106, 0.46);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
}

.button.primary:hover,
.button.primary:focus-visible,
.button.secondary:hover,
.button.secondary:focus-visible {
  border-color: rgba(200, 169, 106, 0.54);
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.button.is-active {
  border-color: rgba(200, 169, 106, 0.72);
  background: var(--gold);
  color: #fffaf0;
  box-shadow: 0 10px 24px rgba(112, 78, 24, 0.3);
}

.card-grid-wrap {
  display: grid;
  align-content: start;
  align-self: center;
  min-height: 480px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 520ms ease, transform 520ms ease, visibility 0s 520ms;
}

.card-grid-wrap.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 520ms ease, transform 520ms ease, visibility 0s 0s;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.gallery-grid.scroll-mode {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.gallery-grid.scroll-mode .gallery-image {
  aspect-ratio: 2.15 / 1;
}

.gallery-grid.scroll-mode .gallery-body {
  padding: 10px 12px 11px;
}

.gallery-grid.scroll-mode .gallery-title {
  font-size: clamp(14px, 1.1vw, 17px);
}

.gallery-grid.scroll-mode .gallery-desc {
  min-height: 32px;
  margin-top: 5px;
  -webkit-line-clamp: 2;
}

.gallery-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(32, 27, 21, 0.85);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(51, 35, 18, 0.16);
  transition: transform 240ms ease, border-color 240ms ease, background 240ms ease, box-shadow 240ms ease;
  backdrop-filter: blur(12px);
  cursor: pointer;
  animation: cardFadeIn 420ms ease both;
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: rgba(200, 169, 106, 0.6);
  background: rgba(38, 31, 24, 0.9);
  box-shadow: 0 18px 48px rgba(51, 35, 18, 0.3);
}

.gallery-card:focus-visible,
.gallery-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(200, 169, 106, 0.6);
  background: rgba(38, 31, 24, 0.9);
  box-shadow: 0 18px 48px rgba(51, 35, 18, 0.3);
}

.gallery-card:focus-visible .gallery-image img,
.gallery-card:hover .gallery-image img,
.gallery-card:focus-within .gallery-image img {
  transform: scale(1.04);
}

.gallery-image {
  position: relative;
  aspect-ratio: 1.4 / 1;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.gallery-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.tag {
  position: absolute;
  top: 10px;
  left: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(16, 14, 11, 0.68);
  color: rgba(255, 255, 255, 0.82);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.gallery-body {
  padding: 11px;
}

.gallery-title {
  margin: 0;
  color: rgba(200, 169, 106, 0.92);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(13px, 1.2vw, 16px);
  line-height: 1.15;
}

.gallery-desc {
  display: -webkit-box;
  min-height: 48px;
  margin: 6px 0 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  text-align: left;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.96);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: opacity 320ms ease, visibility 0s 320ms;
}

.image-viewer.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 320ms ease, visibility 0s 0s;
}

.viewer-shell {
  display: grid;
  grid-template-columns: minmax(0, 640px) minmax(340px, 410px);
  gap: clamp(14px, 1.6vw, 22px);
  align-items: center;
  justify-content: center;
  width: min(1040px, calc(100vw - 72px));
  max-height: calc(100dvh - 56px);
  padding: clamp(14px, 2.2vw, 24px) 0;
}

.viewer-close {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.viewer-close span {
  display: block;
  transform: translateY(-2px);
}

.viewer-close:hover,
.viewer-close:focus-visible {
  border-color: rgba(200, 169, 106, 0.72);
  background: rgba(200, 169, 106, 0.18);
  transform: scale(1.03);
}

.viewer-figure {
  min-width: 0;
  margin: 0;
}

.viewer-image-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  cursor: zoom-in;
}

.viewer-image-wrap img {
  display: block;
  width: 100%;
  max-height: min(78dvh, 760px);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.6);
}

.viewer-title {
  margin-top: 14px;
  color: rgba(200, 169, 106, 0.96);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(22px, 2.2vw, 34px);
  line-height: 1.1;
}

.viewer-lens {
  position: absolute;
  width: 154px;
  height: 154px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  background-repeat: no-repeat;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.48),
    inset 0 0 0 1px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.viewer-text {
  display: grid;
  gap: 16px;
  align-self: center;
  min-height: 0;
  max-height: min(72dvh, 680px);
  overflow: auto;
  padding: 2px 6px 8px 0;
}

.viewer-label {
  margin: 0 0 9px;
  color: rgba(200, 169, 106, 0.88);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: none;
}

.viewer-copy {
  border: 1px solid rgba(200, 169, 106, 0.48);
  border-radius: 10px;
  padding: 15px 17px;
  background: rgba(16, 14, 11, 0.28);
  color: rgba(255, 255, 255, 0.82);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(16px, 1.18vw, 19px);
  line-height: 1.72;
  text-align: justify;
  text-justify: inter-ideograph;
  white-space: pre-wrap;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.viewer-copy:hover {
  border-color: rgba(200, 169, 106, 0.74);
  background: rgba(34, 27, 18, 0.46);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  transform: translateY(-2px);
}

.viewer-note {
  justify-self: end;
  max-width: 320px;
  margin: -2px 0 0;
  color: rgba(255, 255, 255, 0.54);
  font-size: 11px;
  line-height: 1.45;
  text-align: right;
}

.viewer-note a {
  color: rgba(200, 169, 106, 0.92);
  text-decoration: none;
  transition: color 180ms ease;
}

.viewer-note a:hover,
.viewer-note a:focus-visible {
  color: #d8bd7d;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 1024px) {
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 36px;
    min-height: auto;
  }

  .hero-copy {
    max-width: 100%;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(36px, 7vw, 56px);
  }

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

  .viewer-shell {
    grid-template-columns: 1fr;
    align-content: start;
    overflow: auto;
    max-height: calc(100dvh - 48px);
    padding-top: 54px;
  }

  .viewer-text {
    max-height: none;
    padding-bottom: 28px;
  }
}

@media (max-width: 768px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    min-height: auto;
  }

  .card-grid-wrap {
    min-height: auto;
  }

  .hero-content {
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .viewer-shell {
    width: min(100% - 28px, 1480px);
  }

  .viewer-image-wrap img {
    max-height: 52dvh;
  }

  .viewer-lens {
    display: none;
  }
}

@media (max-width: 520px) {
  .topbar,
  .hero-content {
    width: min(100% - 28px, 1400px);
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-body {
    padding: 14px;
  }
}

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

@keyframes pageFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
