:root {
  --photo-reveal-duration: .65s;
  --intro-end: 5.65s;
  --title-delay: 2s;
  color-scheme: dark;
  --background: #290d1a;
  background: var(--background);
  --gold: #eac98f;
  --paper: #f8e8dc;
  font-family: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--paper);
}
main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  overflow: clip;
}
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }

.header {
  background: radial-gradient(ellipse at 50% 0, #49172a, var(--background) 80%);
  border-bottom: 1px solid #af754e;
}
nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .25rem clamp(1.1rem, 3vw, 3rem);
  padding: clamp(.6rem, 2vw, 1.25rem) 1rem;
}
nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--gold);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
nav a:hover { color: #fff7e7; text-decoration: underline; text-underline-offset: .42em; }

.panorama {
  --band-height: clamp(12rem, 20vw, 38rem);
  --photo-anchor: 47%;
  position: relative;
  height: calc(var(--band-height) + 1px);
  container-type: inline-size;
  flex-shrink: 0;
  background: #321c24;
  border-bottom: 1px solid #ae754f;
}
.panorama-image {
  position: absolute;
  inset: 0 0 auto;
  height: 100%;
  overflow: clip;
  z-index: 1;
  pointer-events: none;
}
.panorama-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 62%, #250b173d);
  pointer-events: none;
}
.concert {
  position: absolute;
  top: 50%;
  left: var(--photo-anchor);
  translate: calc(-1 * var(--photo-anchor)) -50%;
  /* At both ends the 5:1 image covers the entire aperture. */
  width: max(100cqw, calc(5 * var(--band-height)));
  height: auto;
}

.anniversary {
  --overlap: clamp(2rem, 3.2vw, 4rem);
  flex: 1 0 auto;
  min-height: 25rem;
  padding: 0 1rem clamp(2.7rem, 5.5vw, 6rem);
  text-align: center;
  background: radial-gradient(ellipse at 50% 0, #541a31, transparent 72%),
    linear-gradient(150deg, #210a16, #340f21 54%, #250c18);
  display: flow-root;
}
.anniversary-title-group {
  position: relative;
  z-index: 2;
  display: flow-root;
}
.anniversary-copy { position: relative; z-index: 2; }
.logo {
  position: relative;
  display: block;
  width: clamp(6rem, 9vw, 10rem);
  margin: calc(-1 * var(--overlap)) auto 0;
  border: 1px solid #dc9c7d80;
  background: #a32048;
  box-shadow: 0 .65rem 2.2rem #16061065;
  filter: drop-shadow(0 .35rem .55rem rgb(18 5 12 / .7));
}
.logo img { display: block; width: 100%; height: auto; }
.years {
  display: flex;
  justify-content: center;
  gap: .65em;
  margin: clamp(1.3rem, 2.7vw, 2.7rem) 0 .45rem;
  color: var(--gold);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .28em;
  font-variant-numeric: lining-nums;
}
h1 {
  margin: 0 auto;
  padding-bottom: .12em;
  width: fit-content;
  color: var(--gold);
  font: 500 clamp(3rem, 7.25vw, 8.6rem)/.94 "Cormorant Garamond", Georgia, serif;
  text-transform: uppercase;
  letter-spacing: -.025em;
}
.years, #anniversary-title {
  filter: drop-shadow(0 .15rem .1rem #0d0309)
    drop-shadow(0 .3rem .38rem rgb(13 3 9 / .95));
}
h1 span { white-space: nowrap; }
h1 sup { font-size: .42em; line-height: 0; vertical-align: .87em; margin-inline-start: .08em; }
@supports (background-clip: text) or (-webkit-background-clip: text) {
  h1 {
    background-image: linear-gradient(108deg, transparent 42%, #fff2b5 48%, #fffdf3 50%, #fff2b5 52%, transparent 58%),
      linear-gradient(100deg, #c69250, #ecca8d 57%, #f1d6a3 74%, #d5a461);
    background-size: 250% 100%, 100% 100%;
    background-position: 100% center, center;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gold-sheen 6s linear infinite;
  }
}
@keyframes gold-sheen {
  from { background-position: 100% center, center; }
  to { background-position: 0% center, center; }
}
.academy {
  margin: clamp(.9rem, 1.8vw, 1.5rem) 0 0;
  font-size: clamp(.86rem, 1.3vw, 1.12rem);
  letter-spacing: .13em;
  text-transform: uppercase;
  line-height: 1.65;
}
.academy span { display: block; color: #e9c8c7; font-size: .92em; text-transform: none; letter-spacing: .06em; }
.visit {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  margin-top: 1.5rem;
  min-height: 46px;
  padding: .5rem 1.1rem;
  border: 1px solid #ad805e;
  color: var(--gold);
  font-size: .85rem;
}
.visit:hover { background: #f4d6a2; color: #290d1a; }
@media (min-width: 601px) and (max-width: 959px) {
  nav { column-gap: clamp(1rem, 3.2vw, 2rem); }
  .panorama { --band-height: clamp(12rem, 27vw, 15rem); }
  .anniversary { --overlap: 2.35rem; }
  h1 { font-size: clamp(2.65rem, 7.1vw, 5rem); }
}

@media (max-width: 600px) {
  nav { gap: 0; padding: .3rem .5rem; }
  nav a {
    flex: 0 0 33.333%;
    justify-content: center;
    font-size: clamp(.61rem, 2.15vw, .74rem);
    letter-spacing: .09em;
  }
  .panorama { --band-height: clamp(8.5rem, 39vw, 12.5rem); --photo-anchor: 46%; }
  .anniversary {
    --overlap: 1.65rem;
    min-height: 0;
    padding: 0 .75rem 2.4rem;
  }
  .logo { width: clamp(4.7rem, 18vw, 6rem); }
  .years { margin-top: 1rem; }
  h1 span { display: block; }
  h1 { font-size: clamp(1.45rem, 9.5vw, 3.55rem); }
  h1 span:first-child { font-size: 1.37em; }
}

@media (min-width: 1600px) {
  .panorama { --band-height: min(20vw, 43vh, 38rem); }
}

@media (min-width: 960px) and (max-height: 1000px) {
  nav { padding-block: clamp(.35rem, 1.25vh, .85rem); }
  .panorama { --band-height: clamp(9rem, 36vh, 24rem); }
  .anniversary {
    --overlap: clamp(1.6rem, 4.5vh, 3rem);
    min-height: 0;
    padding-bottom: clamp(1.15rem, 3.5vh, 2.25rem);
  }
  .logo { width: clamp(5.5rem, 14vh, 8.5rem); }
  .years { margin-top: clamp(.75rem, 2.1vh, 1.4rem); }
  h1 { font-size: clamp(3rem, min(7.25vw, 12vh), 8.6rem); }
  .academy { margin-top: clamp(.6rem, 1.5vh, 1rem); }
  .visit { margin-top: clamp(.75rem, 2vh, 1.25rem); }
}

@supports (grid-template-rows: subgrid) {
  body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr auto auto minmax(1rem, 1fr);
  }
  .header { display: grid; align-content: center; }
  main {
    grid-row: 2 / 5;
    display: grid;
    grid-template-rows: subgrid;
  }
  .panorama { grid-row: 1; }
  .anniversary {
    grid-row: 2 / 4;
    display: grid;
    grid-template-rows: subgrid;
    min-height: 0;
    padding-bottom: 0;
  }
  .anniversary-content {
    grid-row: 1;
    display: flow-root;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .header { animation: menu-fade .55s ease-out var(--intro-end) backwards; }
  .panorama-image {
    animation: photo-settle var(--intro-end) cubic-bezier(.48, .02, .52, .98),
      photo-reveal var(--photo-reveal-duration) ease-in-out;
  }
  .concert { animation: photo-zoom var(--intro-end) cubic-bezier(.48, .02, .52, .98); }
  .academy, .visit { animation: intro-fade .75s ease-out calc(var(--intro-end) - 2s) backwards; }
  .anniversary-title-group {
    animation: title-zoom calc(var(--intro-end) - var(--title-delay)) cubic-bezier(.48, .02, .52, .98) var(--title-delay) backwards;
  }
  .panorama-image, .concert, .anniversary-title-group {
    /* Samples of a normalized Gaussian cumulative distribution. */
    --photo-motion-easing: linear(0, .017, .061, .154, .306, .5, .694, .846, .939, .983, 1);
    animation-timing-function: var(--photo-motion-easing);
  }
  .panorama-image { animation-timing-function: var(--photo-motion-easing), ease-in-out; }
  .anniversary-title-group:focus-within, .visit:focus { animation: none; }
}

.intro-loading body { visibility: hidden; }
.intro-loading :is(.header, .panorama-image, .concert, .anniversary-title-group, h1, .academy, .visit) {
  animation: none;
}

@keyframes menu-fade {
  from { opacity: 0; visibility: hidden; }
  to { opacity: 1; visibility: visible; }
}

@keyframes title-zoom {
  from { opacity: 0; transform: scale(2); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes photo-settle {
  from { height: 100vh; height: 100dvh; }
  to { height: var(--band-height); }
}

@keyframes photo-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes photo-zoom {
  from { width: max(100cqw, 500vh); width: max(100cqw, 500dvh); }
  to { width: max(100cqw, calc(5 * var(--band-height))); }
}

@keyframes intro-fade {
  from { opacity: 0; transform: translateY(.45rem); }
}

@media (prefers-reduced-motion: reduce) { h1 { animation: none; } }
@media (forced-colors: active) { h1 { color: CanvasText; background: none; } }
