:root {
  --paper: #efe3cc;
  --paper-light: #f8efd9;
  --paper-dark: #d6c19c;
  --ink: #211910;
  --ink-soft: #5b4732;
  --red: #c82018;
  --blue: #123e61;
  --gold: #a57532;
  --line: rgba(33, 25, 16, 0.18);
  --shadow: 0 18px 50px rgba(33, 25, 16, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(33, 25, 16, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(33, 25, 16, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(200, 32, 24, 0.1), transparent 24rem),
    var(--paper);
  background-size: 38px 38px, 38px 38px, auto, auto;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  border: clamp(0.55rem, 1.4vw, 1rem) solid rgba(33, 25, 16, 0.82);
  mix-blend-mode: multiply;
  z-index: 10;
}

a {
  color: inherit;
}

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

.paper-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.42;
  background-image: url("assets/textures/paper.svg");
  mix-blend-mode: multiply;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1.1rem clamp(1.2rem, 5vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 239, 217, 0.72);
  backdrop-filter: blur(12px);
}

.mark,
.topbar nav {
  display: flex;
  align-items: center;
}

.mark {
  gap: 0.75rem;
  text-decoration: none;
  font: 800 0.78rem/1.2 Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mark img {
  width: 2.75rem;
  height: 2.75rem;
  object-fit: contain;
}

.topbar nav {
  gap: clamp(0.7rem, 2vw, 1.2rem);
  font: 800 0.74rem/1 Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.topbar nav a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.topbar nav a:hover {
  border-color: currentColor;
}

.hero {
  min-height: 76vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 28rem);
  align-items: center;
  gap: clamp(2rem, 8vw, 8rem);
  padding: clamp(3rem, 8vw, 7rem) clamp(1.2rem, 6vw, 6rem);
}

.overline,
.section-label {
  margin: 0 0 0.8rem;
  color: var(--red);
  font: 900 0.78rem/1 Arial, sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 9ch;
  margin: 0;
  color: var(--ink);
  font-size: clamp(4.6rem, 15vw, 12rem);
  line-height: 0.86;
  letter-spacing: 0;
}

.hero-copy p:not(.overline) {
  max-width: 42rem;
  margin: 1.4rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
}

.archive-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.7rem;
  min-height: 3rem;
  padding: 0.82rem 1rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper-light);
  text-decoration: none;
  font: 900 0.78rem/1 Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 5px 5px 0 rgba(200, 32, 24, 0.22);
}

.crest-photo {
  position: relative;
  margin: 0;
  padding: 1rem 1rem 3.25rem;
  background: #fbf4e4;
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}

.crest-photo::before {
  content: "";
  position: absolute;
  top: -1.2rem;
  left: 50%;
  width: 8.5rem;
  height: 2rem;
  background: rgba(214, 193, 156, 0.7);
  transform: translateX(-50%) rotate(-4deg);
  border: 1px solid rgba(33, 25, 16, 0.08);
}

.crest-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  padding: 2rem;
  background:
    radial-gradient(circle at 50% 42%, rgba(18, 62, 97, 0.12), transparent 13rem),
    #111;
}

.crest-photo figcaption,
.photo-card figcaption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.95rem;
  font: 800 0.76rem/1 Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section {
  padding: clamp(3.5rem, 7vw, 6rem) clamp(1.2rem, 6vw, 6rem);
}

h2 {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.gallery-intro p {
  max-width: 50rem;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.gallery {
  border-block: 1px solid var(--line);
  background:
    linear-gradient(rgba(18, 62, 97, 0.06), rgba(18, 62, 97, 0.02)),
    rgba(214, 193, 156, 0.32);
}

.archives {
  border-top: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 44%),
    rgba(248, 239, 217, 0.46);
}

.archives-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 34rem);
  gap: clamp(1.2rem, 5vw, 4rem);
  align-items: end;
  margin-bottom: 1.4rem;
}

.archives-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.archive-index {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  counter-reset: archive;
}

.archive-link {
  position: relative;
  display: grid;
  min-height: 13.5rem;
  align-content: start;
  gap: 0.72rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(248, 239, 217, 0.84), rgba(239, 227, 204, 0.72)),
    var(--paper);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 5px 5px 0 rgba(33, 25, 16, 0.06);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.archive-link::before {
  counter-increment: archive;
  content: counter(archive, decimal-leading-zero);
  color: rgba(33, 25, 16, 0.24);
  font: 900 2.2rem/0.85 Arial, sans-serif;
}

.archive-link:hover {
  transform: translateY(-3px) rotate(-0.2deg);
  border-color: rgba(200, 32, 24, 0.45);
  box-shadow: 8px 8px 0 rgba(200, 32, 24, 0.16);
}

.archive-link span {
  color: var(--red);
  font: 900 0.72rem/1.2 Arial, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.archive-link time {
  display: inline-flex;
  width: fit-content;
  padding: 0.26rem 0.42rem;
  border: 1px solid rgba(33, 25, 16, 0.18);
  color: var(--ink-soft);
  background: rgba(248, 239, 217, 0.56);
  font: 800 0.72rem/1 Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-link strong {
  font-size: 1.2rem;
  line-height: 1.08;
}

.archive-link em {
  color: var(--ink-soft);
  font-size: 0.94rem;
  font-style: normal;
}

.archive-link.is-featured {
  grid-column: span 2;
  color: var(--paper-light);
  background:
    linear-gradient(135deg, rgba(200, 32, 24, 0.24), transparent),
    var(--ink);
}

.archive-link.is-featured::before,
.archive-link.is-featured em,
.archive-link.is-featured time {
  color: rgba(248, 239, 217, 0.68);
}

.archive-link.is-featured time {
  border-color: rgba(248, 239, 217, 0.2);
  background: rgba(248, 239, 217, 0.08);
}

.gallery-intro {
  display: grid;
  grid-template-columns: 0.28fr 1fr 0.32fr;
  align-items: end;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.upload-button {
  justify-self: end;
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper-light);
  cursor: pointer;
  font: 900 0.78rem/1 Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.album-shelf {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.album-card {
  position: relative;
  min-height: 18rem;
  display: grid;
  align-content: end;
  justify-items: start;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper-light);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  box-shadow: 9px 9px 0 rgba(33, 25, 16, 0.08);
}

.album-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, transparent 15%, rgba(33, 25, 16, 0.78)),
    linear-gradient(90deg, rgba(200, 32, 24, 0.18), transparent);
}

.album-card::after {
  content: "";
  position: absolute;
  top: 0.8rem;
  left: 50%;
  z-index: 2;
  width: 8rem;
  height: 1.6rem;
  background: rgba(214, 193, 156, 0.72);
  border: 1px solid rgba(33, 25, 16, 0.08);
  transform: translateX(-50%) rotate(-2deg);
}

.album-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.18) contrast(0.92) saturate(0.82);
  opacity: 0.82;
  transition: transform 260ms ease, opacity 260ms ease;
}

.album-card span,
.album-card strong,
.album-card em {
  position: relative;
  z-index: 2;
}

.album-card span {
  color: var(--paper-dark);
  font: 900 0.72rem/1 Arial, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.album-card strong {
  max-width: 14rem;
  font: 800 clamp(1.45rem, 3vw, 2.25rem)/0.95 Georgia, "Times New Roman", serif;
}

.album-card em {
  color: rgba(248, 239, 217, 0.78);
  font: 800 0.76rem/1 Arial, sans-serif;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.album-card:hover img,
.album-card.active img {
  opacity: 1;
  transform: scale(1.035);
}

.album-card.active {
  outline: 4px solid rgba(200, 32, 24, 0.55);
  outline-offset: -8px;
}

.album-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.album-heading span,
.album-heading p {
  margin: 0;
  color: var(--red);
  font: 900 0.72rem/1 Arial, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.album-heading h3 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 0.95;
}

.photo-wall {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: start;
}

.photo-card {
  position: relative;
  min-height: 15rem;
  margin: 0;
  padding: 0.55rem 0.55rem 2.65rem;
  background: #fbf4e4;
  box-shadow: 0 12px 26px rgba(33, 25, 16, 0.16);
}

.photo-card:nth-child(even) {
  margin-top: 1.2rem;
}

.tilt-left {
  transform: rotate(-1.5deg);
}

.tilt-right {
  transform: rotate(1.4deg);
}

.photo-card img,
.photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 4.35;
  object-fit: cover;
  background:
    linear-gradient(135deg, rgba(33, 25, 16, 0.18), rgba(248, 239, 217, 0.16)),
    var(--paper-dark);
  filter: sepia(0.25) contrast(0.94) saturate(0.78);
}

.photo-placeholder {
  display: grid;
  place-items: center;
  color: rgba(33, 25, 16, 0.42);
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 800;
  text-align: center;
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 32rem);
  gap: 2rem;
  align-items: start;
}

address {
  display: grid;
  gap: 0.9rem;
  padding: 1.4rem;
  border: 1px solid var(--line);
  background: rgba(248, 239, 217, 0.64);
  font-style: normal;
  box-shadow: 8px 8px 0 rgba(33, 25, 16, 0.07);
}

address a,
address span {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

address a {
  color: var(--blue);
  font-weight: 700;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.4rem clamp(1.2rem, 6vw, 6rem) 2.4rem;
  color: var(--paper-light);
  background: var(--ink);
}

.footer p {
  max-width: 38rem;
  margin: 0;
  color: rgba(248, 239, 217, 0.68);
  font-size: 0.92rem;
}

.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: flex-end;
}

.sources a {
  color: var(--paper-light);
  font: 800 0.72rem/1 Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  .hero,
  .gallery-intro,
  .archives-heading,
  .contact {
    grid-template-columns: 1fr;
  }

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

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

  .archive-link.is-featured {
    grid-column: span 2;
  }

  .upload-button {
    justify-self: start;
  }
}

@media (max-width: 680px) {
  body::before {
    border-width: 0.45rem;
  }

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

  .topbar nav {
    width: 100%;
    justify-content: space-between;
    gap: 0.45rem;
    overflow-x: auto;
  }

  .hero {
    min-height: auto;
  }

  .hero h1 {
    font-size: clamp(4rem, 25vw, 6.7rem);
    line-height: 0.9;
  }

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

  .album-shelf {
    grid-template-columns: 1fr;
  }

  .album-heading {
    align-items: start;
    flex-direction: column;
  }

  .archive-index {
    grid-template-columns: 1fr;
  }

  .archive-link.is-featured {
    grid-column: auto;
  }

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

  .footer {
    display: block;
  }

  .sources {
    justify-content: flex-start;
    margin-top: 1rem;
  }
}
