:root {
  --color-canvas: #f1f5f8;
  --color-surface: #f8fafc;
  --color-ink: #172431;
  --color-muted: #526372;
  --color-line: #cbd7e1;
  --color-primary: #24577f;
  --color-primary-deep: #153b5a;
  --color-on-primary: #f7fbff;
  --color-accent: #7298b8;
  --font-display: Arial, Helvetica, sans-serif;
  --font-body: Arial, Helvetica, sans-serif;
  --space-page: clamp(1.25rem, 4vw, 4rem);
  --container: 76rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-photo: 0 1.5rem 4rem rgba(32, 66, 94, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--color-ink);
  background: var(--color-canvas);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

body:has(dialog[open]) {
  overflow: hidden;
}

.scroll-progress {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(36, 87, 127, 0.1);
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--color-primary);
  will-change: transform;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
a {
  touch-action: manipulation;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  transform: translateY(-150%);
  background: var(--color-primary-deep);
  color: var(--color-on-primary);
  text-decoration: none;
}

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

.container {
  width: min(calc(100% - (2 * var(--space-page))), var(--container));
  margin-inline: auto;
}

.site-header {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--space-page);
}

.brand {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.75rem;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--color-primary);
  border-radius: 50%;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
}

.brand-date,
.site-nav a,
.eyebrow,
.section-kicker,
.lightbox-count {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-date {
  color: var(--color-muted);
}

.site-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.5rem);
}

.site-nav a {
  position: relative;
  min-height: 2.75rem;
  align-content: center;
  text-decoration: none;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: 0.45rem;
  left: 0;
  height: 1px;
  transform: scaleX(0);
  transform-origin: right;
  background: currentColor;
  content: "";
  transition: transform 220ms var(--ease-out);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  grid-template-columns: minmax(0, 1.05fr) minmax(18rem, 0.95fr);
  align-items: center;
  gap: clamp(3rem, 7vw, 8rem);
  padding: 8.5rem var(--space-page) 5rem;
}

.hero::before {
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  width: 29%;
  height: 100%;
  background: #e1eaf1;
  content: "";
}

.hero-copy {
  width: min(100%, 43rem);
  justify-self: end;
}

.eyebrow,
.section-kicker {
  margin: 0 0 1.5rem;
  color: var(--color-primary);
}

.hero h1,
.opening h2,
.timeline h2,
.letter h2,
.lightbox h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
}

.hero h1 {
  max-width: 12ch;
  font-size: clamp(4rem, 8.3vw, 8.8rem);
}

.hero h1 em {
  color: var(--color-primary);
  font-weight: 500;
  font-style: normal;
}

.hero-intro {
  max-width: 35rem;
  margin: 2rem 0 2.25rem;
  color: var(--color-muted);
  font-size: clamp(1rem, 1.25vw, 1.15rem);
}

.text-link {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  gap: 0.9rem;
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.text-link svg,
.icon-button svg {
  width: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.text-link svg {
  transition: transform 220ms var(--ease-out);
}

.text-link:hover svg,
.text-link:focus-visible svg {
  transform: translateX(0.35rem);
}

.hero-visual {
  position: relative;
  width: min(100%, 31rem);
}

.hero-photo-button {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-on-primary);
  cursor: pointer;
  text-align: left;
}

.hero-photo-button:focus-visible {
  outline-offset: -0.45rem;
}

.hero-frame {
  position: relative;
  z-index: 2;
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow-photo);
  transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out);
}

.hero-frame:hover,
.hero-frame:focus-within {
  transform: translateY(-0.3rem);
  box-shadow: 0 2rem 4.5rem rgba(32, 66, 94, 0.2);
}

.photo-action {
  position: absolute;
  z-index: 4;
  right: 1rem;
  bottom: 1rem;
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(247, 251, 255, 0.45);
  background: rgba(21, 59, 90, 0.82);
  backdrop-filter: blur(8px);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.photo-action svg,
.back-to-top svg {
  width: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.hero-accent {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  right: -2rem;
  bottom: -2rem;
  width: 68%;
  height: 61%;
  background: var(--color-primary);
}

.vertical-note {
  position: absolute;
  z-index: 3;
  top: 2rem;
  right: -4.2rem;
  margin: 0;
  color: var(--color-on-primary);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.hero-index {
  position: absolute;
  bottom: 1.5rem;
  left: var(--space-page);
  margin: 0;
  color: #8495a3;
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.photo-shell {
  overflow: hidden;
  background: #d7e2ea;
}

.photo-shell img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  object-fit: cover;
  transition: opacity 350ms ease;
}

.photo-shell.is-loaded img {
  opacity: 1;
}

.photo-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  place-items: center;
  padding: 2rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.5), transparent 46%),
    linear-gradient(145deg, #dbe6ed, #b9cad6);
  color: #435c70;
  text-align: center;
}

.photo-placeholder::before,
.photo-placeholder::after {
  position: absolute;
  border: 1px solid rgba(42, 78, 105, 0.24);
  border-radius: 50%;
  content: "";
}

.photo-placeholder::before {
  width: 58%;
  aspect-ratio: 1;
}

.photo-placeholder::after {
  width: 42%;
  aspect-ratio: 1;
}

.photo-placeholder span,
.photo-placeholder small {
  position: relative;
  z-index: 1;
}

.photo-placeholder span {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 1;
}

.photo-placeholder small {
  margin-top: 1rem;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  line-height: 1.6;
  text-transform: uppercase;
}

.opening {
  padding-block: clamp(6rem, 12vw, 11rem);
}

.opening-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(17rem, 0.6fr);
  gap: clamp(2rem, 8vw, 8rem);
  align-items: end;
}

.opening h2,
.timeline h2 {
  font-size: clamp(3rem, 6vw, 6rem);
}

.opening-grid > p {
  max-width: 34rem;
  margin: 0;
  color: var(--color-muted);
}

.timeline {
  padding-block: clamp(5rem, 10vw, 9rem);
  background: var(--color-surface);
}

.timeline-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(4rem, 8vw, 8rem);
}

.timeline-hint {
  max-width: 19rem;
  margin: 0 0 0.65rem;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.year-nav {
  position: sticky;
  z-index: 20;
  top: 0;
  margin-bottom: clamp(3rem, 6vw, 5rem);
  padding-block: 0.65rem;
  border-block: 1px solid rgba(203, 215, 225, 0.75);
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(12px);
}

.year-nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.year-nav-list::-webkit-scrollbar {
  display: none;
}

.year-nav-button {
  position: relative;
  min-width: 4.5rem;
  min-height: 3rem;
  flex: 0 0 auto;
  padding: 0.6rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.year-nav-button:hover {
  border-color: var(--color-line);
  color: var(--color-primary);
}

.year-nav-button[aria-current="true"] {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-on-primary);
}

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

.year-card:nth-child(even) {
  margin-top: clamp(5rem, 12vw, 11rem);
}

.year-card {
  scroll-margin-top: 5.5rem;
}

.year-photo-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.year-photo {
  position: relative;
  aspect-ratio: 4 / 5;
}

.year-card:nth-child(3n + 2) .year-photo {
  aspect-ratio: 1 / 1;
}

.year-card:nth-child(3n + 3) .year-photo {
  aspect-ratio: 5 / 6;
}

.year-photo-button::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: inset 0 0 0 0.65rem transparent;
  content: "";
  pointer-events: none;
  transition: box-shadow 300ms var(--ease-out);
}

.year-photo-button:hover::after,
.year-photo-button:focus-visible::after {
  box-shadow: inset 0 0 0 0.65rem rgba(255, 255, 255, 0.38);
}

.year-photo-button img {
  transition: opacity 350ms ease, transform 600ms var(--ease-out);
}

.year-photo-button:hover img,
.year-photo-button:focus-visible img {
  transform: scale(1.025);
}

.year-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-line);
}

.year-label {
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
}

.year-text h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 2.3vw, 2.25rem);
  font-weight: 600;
  line-height: 1.1;
}

.year-text p {
  max-width: 32rem;
  margin: 0;
  color: var(--color-muted);
  font-size: 0.86rem;
}

.letter {
  position: relative;
  padding-block: clamp(7rem, 13vw, 12rem);
}

.letter-card {
  position: relative;
  width: min(100%, 66rem);
  margin-left: auto;
  padding: clamp(3rem, 8vw, 7rem);
  background: var(--color-primary-deep);
  color: var(--color-on-primary);
}

.letter-card::before {
  position: absolute;
  inset: 1rem;
  border: 1px solid rgba(255, 250, 242, 0.18);
  content: "";
  pointer-events: none;
}

.section-kicker--light {
  color: #aac3d6;
}

.letter h2 {
  max-width: 12ch;
  font-size: clamp(3.1rem, 6vw, 6.5rem);
}

.letter-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 5rem);
  margin-top: 3rem;
  color: #dce8f1;
}

.letter-body p {
  margin: 0;
}

.signature {
  margin: 3.5rem 0 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: normal;
}

.letter-number {
  position: absolute;
  top: 12rem;
  left: 1rem;
  color: #93a3af;
  font-family: var(--font-display);
  font-size: clamp(4rem, 9vw, 9rem);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 2rem;
  border-top: 1px solid var(--color-line);
  color: var(--color-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer p {
  margin: 0;
}

.back-to-top {
  position: fixed;
  z-index: 40;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: grid;
  width: 3rem;
  height: 3rem;
  padding: 0;
  transform: translateY(1rem);
  place-items: center;
  border: 1px solid rgba(247, 251, 255, 0.24);
  border-radius: 50%;
  opacity: 0;
  visibility: hidden;
  background: var(--color-primary-deep);
  box-shadow: 0 0.75rem 2rem rgba(21, 59, 90, 0.22);
  color: var(--color-on-primary);
  cursor: pointer;
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms var(--ease-out);
}

.back-to-top.is-visible {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.back-to-top[hidden] {
  display: none;
}

.lightbox {
  width: min(calc(100% - 2rem), 72rem);
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--color-surface);
  color: var(--color-ink);
}

.lightbox::backdrop {
  background: rgba(14, 35, 52, 0.84);
  backdrop-filter: blur(8px);
}

.lightbox[open] {
  animation: modal-in 280ms var(--ease-out) both;
}

.lightbox-inner {
  position: relative;
  display: grid;
  min-height: min(44rem, calc(100dvh - 2rem));
  grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.75fr);
}

.lightbox-photo {
  position: relative;
  min-height: 28rem;
  touch-action: pan-y;
}

.lightbox-photo img {
  object-fit: contain;
  background: #122633;
}

.lightbox-meta {
  align-self: center;
  padding: clamp(2rem, 5vw, 4.5rem);
}

.lightbox-count {
  color: var(--color-primary);
}

.lightbox h2 {
  margin-bottom: 1rem;
  font-size: clamp(3rem, 6vw, 5.5rem);
}

#lightbox-caption {
  color: var(--color-muted);
}

.swipe-hint {
  display: none;
  margin-top: 1.5rem;
  font-size: 0.78rem;
}

.icon-button {
  display: grid;
  width: 3rem;
  height: 3rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease;
}

.icon-button:hover {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.lightbox-close {
  position: absolute;
  z-index: 5;
  top: 1rem;
  right: 1rem;
}

.lightbox-controls {
  position: absolute;
  right: 2rem;
  bottom: 2rem;
  display: flex;
  gap: 0.75rem;
}

.reveal,
.year-card {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

.reveal.is-visible,
.year-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(1rem) scale(0.985);
  }
}

@media (max-width: 900px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 9rem;
  }

  .hero-copy {
    justify-self: start;
  }

  .hero h1 {
    font-size: clamp(4rem, 15vw, 7rem);
  }

  .hero-visual {
    width: min(88%, 31rem);
    justify-self: center;
  }

  .hero::before {
    top: auto;
    bottom: 0;
    width: 46%;
    height: 48%;
  }

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

  .lightbox-inner {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .lightbox-photo {
    min-height: min(58dvh, 36rem);
  }

  .lightbox-meta {
    padding-bottom: 6rem;
  }

  .swipe-hint {
    display: block;
  }
}

@media (max-width: 640px) {
  .brand-date {
    display: none;
  }

  .site-nav {
    gap: 1rem;
  }

  .site-nav a {
    font-size: 0.62rem;
  }

  .hero {
    gap: 3.5rem;
    padding-bottom: 6rem;
  }

  .hero h1 {
    max-width: 10ch;
  }

  .hero-intro {
    margin-top: 1.5rem;
  }

  .vertical-note {
    right: -3rem;
  }

  .hero-accent {
    right: -1.25rem;
    bottom: -1.25rem;
  }

  .hero-index {
    display: none;
  }

  .opening-grid > p {
    font-size: 0.95rem;
  }

  .timeline-heading {
    display: block;
  }

  .timeline-hint {
    margin-top: 1.5rem;
  }

  .year-nav {
    width: 100%;
    padding-inline: var(--space-page);
  }

  .year-nav-list {
    justify-content: flex-start;
  }

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

  .year-card:nth-child(even) {
    margin-top: 0;
  }

  .year-meta {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .letter {
    width: 100%;
  }

  .letter-card {
    padding: 4rem var(--space-page);
  }

  .letter-card::before {
    inset: 0.65rem;
  }

  .letter-body {
    grid-template-columns: 1fr;
  }

  .letter-number {
    display: none;
  }

  .site-footer {
    display: block;
    text-align: center;
  }

  .site-footer p + p {
    margin-top: 0.4rem;
  }

  .lightbox {
    width: 100%;
    max-height: 100dvh;
    margin: auto 0 0;
  }

  .lightbox-inner {
    max-height: 100dvh;
  }

  .lightbox-photo {
    min-height: 55dvh;
  }

  .lightbox-meta {
    padding: 2rem var(--space-page) 6rem;
  }

  .lightbox-controls {
    right: var(--space-page);
    bottom: 1rem;
  }
}

@media (hover: none) {
  .hero-photo-button:active .hero-frame,
  .year-photo-button:active,
  .year-nav-button:active,
  .icon-button:active,
  .back-to-top:active {
    transform: scale(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .year-card {
    opacity: 1;
    transform: none;
  }
}
