:root {
  color-scheme: light;
  --ink: #121827;
  --midnight: #10182b;
  --midnight-soft: #1a2540;
  --paper: #f7f4ed;
  --paper-deep: #eee9de;
  --white: #fffdfa;
  --gold: #a98447;
  --gold-bright: #c7a86b;
  --muted: #667085;
  --line: rgba(16, 24, 43, 0.14);
  --shadow: 0 22px 70px rgba(15, 23, 42, 0.16);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(199, 168, 107, 0.14), transparent 22rem),
    linear-gradient(135deg, var(--paper) 0%, #faf8f3 55%, var(--paper-deep) 100%);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.28;
  background-image: linear-gradient(rgba(16, 24, 43, 0.025) 1px, transparent 1px);
  background-size: 100% 4px;
  pointer-events: none;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  color: white;
  background: var(--midnight);
  border-radius: 0.35rem;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 5.25rem;
  padding: 0.8rem clamp(1.25rem, 5vw, 5rem);
  color: var(--paper);
  background: rgba(16, 24, 43, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.brand img {
  border-radius: 0.75rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.35rem, 1vw, 0.8rem);
}

.main-nav a {
  position: relative;
  padding: 0.55rem 0.75rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 0.4rem;
}

.main-nav a::after {
  position: absolute;
  right: 0.75rem;
  bottom: 0.25rem;
  left: 0.75rem;
  height: 1px;
  content: "";
  background: var(--gold-bright);
  transform: scaleX(0);
  transition: transform 180ms ease;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: white;
}

.main-nav a[aria-current="page"]::after,
.main-nav a:hover::after {
  transform: scaleX(1);
}

main {
  min-height: calc(100vh - 16rem);
}

.page {
  width: min(1180px, calc(100% - 2.5rem));
  margin: 0 auto;
}

.home-page {
  display: grid;
  grid-template-columns: minmax(17rem, 0.86fr) minmax(20rem, 1.14fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: center;
  min-height: calc(100vh - 9rem);
  padding: clamp(3rem, 8vh, 7rem) 0 clamp(6.5rem, 12vh, 9rem);
}

.home-photo {
  width: min(100%, 29rem);
  justify-self: end;
}

.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: hidden;
  background: var(--midnight-soft);
  border: 0.55rem solid var(--white);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
}

.portrait-frame::after {
  position: absolute;
  inset: 0;
  content: "";
  border: 1px solid rgba(199, 168, 107, 0.58);
  border-radius: inherit;
  pointer-events: none;
}

.portrait-frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-placeholder {
  display: grid;
  place-content: center;
  justify-items: center;
  width: 100%;
  height: 100%;
  gap: 1rem;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.74);
  text-align: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(199, 168, 107, 0.22), transparent 45%),
    var(--midnight-soft);
}

.portrait-placeholder img {
  border-radius: 1rem;
  opacity: 0.88;
}

.date {
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-family: var(--serif);
  text-align: center;
  letter-spacing: 0.06em;
}

.home-tribute {
  max-width: 40rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 400;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(2.9rem, 7vw, 6.6rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.tribute-copy {
  position: relative;
  max-width: 38rem;
  margin-top: clamp(2rem, 5vw, 3.25rem);
  padding-left: clamp(1.2rem, 3vw, 2rem);
  color: #343b4a;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.75;
  border-left: 1px solid var(--gold-bright);
}

.tribute-copy p:first-child {
  margin-top: 0;
}

.tribute-copy p:last-child {
  margin-bottom: 0;
}

.signature {
  display: block;
  margin-top: 2rem;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
}

.content-page {
  min-height: calc(100vh - 9rem);
  padding: clamp(3.5rem, 8vw, 7rem) 0 10rem;
}

.page-heading {
  display: grid;
  grid-template-columns: minmax(12rem, 0.8fr) minmax(15rem, 1.2fr);
  column-gap: 3rem;
  align-items: end;
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.page-heading .eyebrow {
  grid-column: 1 / -1;
}

.page-heading h1 {
  max-width: none;
  font-size: clamp(3.2rem, 8vw, 7rem);
}

.page-heading > p:last-child {
  max-width: 34rem;
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.gallery-groups {
  display: grid;
  gap: clamp(3rem, 7vw, 5.5rem);
}

.period-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: -1.75rem;
}

.period-nav button {
  padding: 0.55rem 0.85rem;
  color: var(--midnight);
  cursor: pointer;
  background: rgba(255, 253, 250, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.period-nav button:hover,
.period-nav button:focus-visible {
  color: white;
  background: var(--midnight);
}

.gallery-period {
  scroll-margin-top: 7rem;
}

.period-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.period-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.period-heading span {
  color: var(--muted);
  font-size: 0.9rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 2rem);
}

.photo-card {
  margin: 0;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.photo-open {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
  background: #d9d6cf;
  border: 0;
}

.photo-open img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 350ms ease;
}

.photo-open:hover img {
  transform: scale(1.025);
}

.photo-card figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  padding: 0.9rem 1rem;
}

.photo-card figcaption span {
  overflow: hidden;
  font-family: var(--serif);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-link,
.dialog-caption a {
  flex: none;
  padding: 0.48rem 0.7rem;
  color: var(--midnight);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.download-link:hover,
.dialog-caption a:hover {
  color: white;
  background: var(--midnight);
}

.empty-state {
  display: grid;
  place-items: center;
  max-width: 42rem;
  margin: clamp(3rem, 8vw, 7rem) auto;
  padding: 3.5rem 2rem;
  text-align: center;
  background: rgba(255, 253, 250, 0.55);
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.empty-state img {
  margin-bottom: 1rem;
  border-radius: 1rem;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.11);
}

.empty-state h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.empty-state p {
  margin: 0.65rem 0 0;
  color: var(--muted);
}

.texts-list {
  display: grid;
  gap: 1.25rem;
  max-width: 60rem;
  margin: 0 auto;
}

.text-panel {
  overflow: hidden;
  background: rgba(255, 253, 250, 0.82);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  box-shadow: 0 10px 35px rgba(15, 23, 42, 0.06);
}

.text-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
}

.text-panel summary::-webkit-details-marker {
  display: none;
}

.text-panel summary h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
}

.text-panel summary::after {
  width: 2rem;
  height: 2rem;
  flex: none;
  content: "";
  background:
    linear-gradient(var(--gold), var(--gold)) center / 0.75rem 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) center / 2px 0.75rem no-repeat;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.text-panel[open] summary::after {
  background: linear-gradient(var(--gold), var(--gold)) center / 0.75rem 2px no-repeat;
}

.text-panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.text-body {
  max-width: 48rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  color: #343b4a;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  line-height: 1.8;
}

.text-body > :first-child {
  margin-top: 0;
}

.text-body > :last-child {
  margin-bottom: 0;
}

.text-body h1,
.text-body h2,
.text-body h3 {
  max-width: none;
  margin: 1.8rem 0 0.65rem;
  font-size: 1.45rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.text-pending {
  color: var(--muted);
  font-style: italic;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 8rem;
  padding: 1.5rem 1rem 7rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  background: var(--midnight);
}

.site-footer p {
  margin: 0;
}

.site-footer img {
  border-radius: 0.6rem;
}

.audio-player {
  position: fixed;
  right: clamp(0.75rem, 2vw, 1.5rem);
  bottom: clamp(0.75rem, 2vw, 1.5rem);
  left: clamp(0.75rem, 2vw, 1.5rem);
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) auto minmax(10rem, 1.2fr);
  align-items: center;
  gap: clamp(0.8rem, 2vw, 1.5rem);
  width: min(46rem, calc(100% - 1.5rem));
  min-height: 4.8rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  color: white;
  background: rgba(16, 24, 43, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.8rem;
  box-shadow: 0 18px 60px rgba(9, 14, 26, 0.3);
  backdrop-filter: blur(18px);
}

.track-copy {
  min-width: 0;
}

.player-label {
  display: block;
  color: var(--gold-bright);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.track-copy strong {
  display: block;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.player-controls button {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  color: white;
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.player-controls .play-button {
  width: 2.9rem;
  height: 2.9rem;
  color: var(--midnight);
  background: var(--paper);
}

.player-controls button:disabled {
  cursor: default;
  opacity: 0.35;
}

.progress-wrap {
  min-width: 0;
}

.progress-wrap input {
  width: 100%;
  height: 0.25rem;
  accent-color: var(--gold-bright);
}

.time {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.7rem;
}

.photo-dialog {
  width: min(68rem, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  overflow: hidden;
  color: white;
  background: var(--midnight);
  border: 0;
  border-radius: 0.75rem;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
}

.photo-dialog::backdrop {
  background: rgba(5, 9, 17, 0.82);
  backdrop-filter: blur(6px);
}

.photo-dialog > img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 8rem);
  object-fit: contain;
  background: #080d18;
}

.dialog-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: white;
  font-size: 1.7rem;
  cursor: pointer;
  background: rgba(16, 24, 43, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
}

.dialog-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
}

.dialog-caption p {
  margin: 0;
  font-family: var(--serif);
}

.dialog-caption a {
  color: white;
  border-color: rgba(255, 255, 255, 0.25);
}

.noscript {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 1rem;
  color: white;
  text-align: center;
  background: #8a2633;
}

.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;
}

.reveal {
  animation: reveal 520ms ease both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }

  .brand span {
    display: none;
  }

  .home-page {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-top: 2.5rem;
  }

  .home-photo {
    width: min(100%, 23rem);
    justify-self: center;
  }

  .home-tribute {
    max-width: 42rem;
    justify-self: center;
  }

  .page-heading {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

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

  .audio-player {
    grid-template-columns: minmax(7rem, 1fr) auto;
  }

  .progress-wrap {
    display: none;
  }
}

@media (max-width: 540px) {
  .site-header {
    gap: 0.5rem;
  }

  .brand img {
    width: 36px;
    height: 36px;
  }

  .main-nav a {
    padding: 0.5rem 0.45rem;
    font-size: 0.86rem;
  }

  .main-nav a::after {
    right: 0.45rem;
    left: 0.45rem;
  }

  .page {
    width: min(100% - 1.5rem, 1180px);
  }

  h1 {
    font-size: clamp(2.65rem, 16vw, 4.25rem);
  }

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

  .site-footer {
    flex-direction: column;
    gap: 0.35rem;
  }

  .audio-player {
    min-height: 4.35rem;
    padding: 0.55rem 0.7rem;
  }

  .player-controls button:not(.play-button) {
    display: none;
  }

  .dialog-caption {
    align-items: flex-start;
    flex-direction: column;
  }
}

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