:root {
  --bg: #0e0e0e;
  --bg-soft: #171717;
  --text: #e5e5e5;
  --accent: #ffcc33;
  --accent-soft: rgba(255, 204, 51, 0.45);
  --accent-glow: rgba(255, 204, 51, 0.14);
  --control-bg: #151515;
  --control-border: #2f2f2f;
  --border: #363435;
  --muted: #b8b8b8;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  padding-top: 24px;
  color: var(--text);
  font-family: "Raleway", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255, 204, 51, 0.05), transparent 38%),
    radial-gradient(circle at 80% 0%, rgba(255, 204, 51, 0.04), transparent 33%);
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -50px;
  left: 1rem;
  background: var(--accent);
  color: #141414;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  border-radius: 0.25rem;
  z-index: 10;
}

.skip-link:focus {
  top: 0.5rem;
}

.site-header {
  margin-block-end: 1.25rem;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.brand {
  color: var(--accent);
  text-decoration: none;
  font-family: "URW Chancery L", "Brush Script MT", "Segoe Script", cursive;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1;
}

.nav-list {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-list a {
  color: var(--accent);
  text-decoration: none;
  padding: 0.5rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: #141414;
  background: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

.nav-list a[aria-current="page"] {
  color: var(--accent);
  background: rgba(255, 204, 51, 0.08);
  border-color: rgba(255, 204, 51, 0.22);
  text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--accent);
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-weight: 500;
  letter-spacing: 0.03em;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  margin: 0.5rem 0 1rem;
}

h2 {
  font-size: clamp(1.4rem, 4vw, 1.85rem);
}

a {
  color: var(--accent);
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

.hero-panel,
.text-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 60%);
  /* border: 1px solid var(--border); */
  padding: 1rem;
}

article.text-panel {
  max-width: 52rem;
}

article.text-panel p,
.hero-panel p:not(.action-row) {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.hero-panel p:not(.action-row) {
  max-width: 52rem;
}

article.text-panel h3 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.memorial-quote {
  margin: 0.4rem 0 1.5rem;
  padding: 1.1rem 1.25rem 1rem;
  border-left: 1px solid rgba(255, 204, 51, 0.28);
  background: linear-gradient(90deg, rgba(255, 204, 51, 0.04), transparent);
}

.memorial-quote blockquote {
  margin: 0;
}

.memorial-quote p {
  margin: 0;
  color: #ddc98a;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: clamp(1rem, 2.1vw, 1.18rem);
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.memorial-quote figcaption {
  margin-top: 0.45rem;
  color: #b8a980;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.memorial-cover {
  max-width: 850px;
  margin: 1.5rem auto 1.25rem;
  padding: 0.7rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

.memorial-cover img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
}

.memorial-cover figcaption {
  margin-top: 0.5rem;
  color: #9a9080;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.hero-figure {
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
  background: rgba(0, 0, 0, 0.25);
}

.hero-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.action-row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.text-panel .action-row .button {
  padding: 0.48rem 0.78rem;
  font-size: 0.95rem;
  border-color: rgba(255, 204, 51, 0.35);
}

.text-panel .action-row .button-primary {
  background: rgba(255, 204, 51, 0.9);
}

.button {
  border: 1px solid var(--accent-soft);
  color: var(--accent);
  background: transparent;
  text-decoration: none;
  padding: 0.55rem 0.85rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font: inherit;
}

.button:hover,
.button:focus-visible {
  background: var(--accent);
  color: #141414;
  text-decoration: none;
}

.button-primary {
  background: var(--accent);
  color: #141414;
}

.button-primary:hover,
.button-primary:focus-visible {
  background: #f1bc1f;
  border-color: #f1bc1f;
}

.muted {
  color: var(--muted);
}

#gallery-summary {
  font-size: 0.94rem;
  color: #a7a7a7;
  margin: 0.15rem 0 0.35rem;
}

.collection-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.collection-head h2 {
  margin: 0;
}

.collection-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.collection-actions .button {
  padding: 0.3rem 0.55rem;
  font-size: 0.85rem;
  border-color: transparent;
  color: #606060;
  background: transparent;
}

.collection-actions .button:hover,
.collection-actions .button:focus-visible {
  border-color: var(--control-border);
  background: var(--control-bg);
  color: var(--muted);
}

.gallery-grid {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
}

.gallery-card {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.gallery-card:hover,
.gallery-card:focus-within {
  transform: translateY(-2px);
  border-color: var(--accent-soft);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}

.gallery-button {
  width: 100%;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.gallery-button img {
  width: 100%;
  height: 212px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
  transition: transform 260ms ease, filter 260ms ease;
}

.gallery-button:hover img,
.gallery-button:focus-visible img {
  transform: scale(1.015);
  filter: saturate(1.04);
}

.card-text {
  padding: 0.8rem 0.8rem 0.9rem;
}

.card-text h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  color: #d7c58f;
}

.gallery-button:hover .card-text h3,
.gallery-button:focus-visible .card-text h3 {
  color: #e6ce88;
}

.card-text p {
  margin: 0.35rem 0 0;
  line-height: 1.45;
}

.gallery-more {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.gallery-more .button {
  min-width: 11rem;
  border-color: transparent;
  color: #606060;
  background: transparent;
}

.gallery-more .button:hover,
.gallery-more .button:focus-visible {
  border-color: var(--control-border);
  background: var(--control-bg);
  color: var(--muted);
}

.viewer[hidden] {
  display: none;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 8, 0.97);
}

.viewer-backdrop {
  position: absolute;
  inset: 0;
  cursor: default;
}

.viewer-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(calc(100vw - 7rem), 1200px);
  max-height: 100vh;
  padding: 3rem 0 1.5rem;
  outline: none;
}

.viewer-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.viewer-figure img {
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.viewer-caption {
  text-align: center;
  margin-top: 0.9rem;
  padding: 0 0.5rem;
}

.viewer-caption h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 400;
  color: #d7c58f;
  letter-spacing: 0.04em;
}

.viewer-caption p {
  margin: 0.15rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.viewer-close {
  position: fixed;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.55);
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background 160ms, color 160ms, border-color 160ms;
}

.viewer-close:hover,
.viewer-close:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.viewer-prev,
.viewer-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.45);
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background 160ms, color 160ms, border-color 160ms;
}

.viewer-prev {
  left: 0.75rem;
}

.viewer-next {
  right: 0.75rem;
}

.viewer-prev:hover,
.viewer-prev:focus-visible,
.viewer-next:hover,
.viewer-next:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.viewer-fullscreen {
  position: fixed;
  bottom: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.3);
  padding: 0;
  border-radius: 0.2rem;
  cursor: pointer;
  transition: color 160ms, background 160ms;
}

.viewer-fullscreen:hover,
.viewer-fullscreen:focus-visible {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.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;
}

.site-footer {
  margin-top: 2.2rem;
  border-top: 1px solid var(--border);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 1rem 0;
}

.monogram {
  color: var(--accent);
  letter-spacing: 0.3em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-button img {
    height: 185px;
  }
}

@media (max-width: 479px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-button img {
    height: 220px;
  }
}

@media (max-width: 640px) {
  body {
    padding-top: 16px;
    letter-spacing: 0.01em;
  }

  .viewer-stage {
    width: calc(100vw - 5rem);
    padding: 2.5rem 0 1.25rem;
  }

  .viewer-figure img {
    max-height: calc(100vh - 8rem);
  }

  .viewer-prev,
  .viewer-next {
    width: 2.4rem;
    height: 2.4rem;
  }

  .viewer-prev {
    left: 0.4rem;
  }

  .viewer-next {
    right: 0.4rem;
  }

  .memorial-quote {
    padding: 0.75rem 0.8rem 0.65rem;
  }

  .memorial-quote p {
    letter-spacing: 0.01em;
  }

  .memorial-cover {
    padding: 0.5rem;
  }
}
