:root {
  --archive-bg: url("https://www.archives.gov/files/research/still-pictures/ww2-111-sc-407101.jpeg");
  --grenade-cursor: url("assets/grenade-cursor.svg") 14 4;
  --ink: #181818;
  --paper: #f7f1e6;
  --paper-deep: #e8dcc8;
  --olive: #4a5637;
  --brass: #a87d35;
  --oxblood: #722b28;
  --navy: #1f3349;
  --shadow: 0 24px 70px rgba(24, 24, 24, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(247, 241, 230, 0.94), rgba(247, 241, 230, 0.98)),
    radial-gradient(circle at top left, rgba(168, 125, 53, 0.18), transparent 36%),
    var(--paper);
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.6;
  cursor: var(--grenade-cursor), auto;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  cursor: var(--grenade-cursor), pointer;
}

button,
input,
select,
textarea,
summary,
[role="button"] {
  cursor: var(--grenade-cursor), pointer;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 64px);
  color: #fff7ea;
  background: linear-gradient(180deg, rgba(16, 18, 18, 0.78), rgba(16, 18, 18, 0));
}

.brand,
.site-header nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 32px;
  border: 1px solid rgba(255, 247, 234, 0.6);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1rem;
}

.site-header nav a {
  padding: 8px 0;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.hero {
  position: relative;
  display: grid;
  min-height: 92vh;
  align-items: end;
  overflow: hidden;
  padding: 160px clamp(20px, 7vw, 88px) 76px;
  color: #fff7ea;
  background-image:
    linear-gradient(90deg, rgba(10, 12, 12, 0.8), rgba(10, 12, 12, 0.42) 48%, rgba(10, 12, 12, 0.12)),
    var(--archive-bg);
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  isolation: isolate;
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: var(--archive-bg) center / cover fixed;
  filter: sepia(0.78) contrast(1.08) brightness(0.82);
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(12, 11, 9, 0.18), rgba(12, 11, 9, 0.76)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px);
}

.hero-content {
  max-width: 760px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--brass);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero .kicker {
  color: #eacb8c;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  line-height: 0.98;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(4rem, 12vw, 9.5rem);
}

h2 {
  font-size: clamp(2.3rem, 6vw, 5rem);
}

.hero-content p:not(.kicker) {
  max-width: 570px;
  margin: 24px 0 0;
  font-size: clamp(1rem, 2vw, 1.28rem);
}

.hero-link {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  margin-top: 34px;
  padding: 0 20px;
  border: 1px solid rgba(255, 247, 234, 0.75);
  background: rgba(255, 247, 234, 0.12);
  color: #fff7ea;
  font-weight: 800;
  text-decoration: none;
  backdrop-filter: blur(8px);
}

.about-section,
.photo-section {
  padding: clamp(64px, 9vw, 116px) clamp(20px, 7vw, 88px);
}

.about-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1.2fr);
  gap: clamp(28px, 7vw, 90px);
  background: var(--paper);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  align-self: end;
  font-size: 1.02rem;
}

.about-grid p {
  margin: 0;
}

.photo-section {
  background:
    linear-gradient(180deg, rgba(31, 51, 73, 0.08), rgba(114, 43, 40, 0.08)),
    var(--paper-deep);
}

.section-copy {
  margin-bottom: 32px;
}

.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -6px 0 24px;
}

.gallery-tabs button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(24, 24, 24, 0.18);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 251, 242, 0.74);
  cursor: var(--grenade-cursor), pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
}

.gallery-tabs button.active {
  border-color: var(--oxblood);
  color: #fff7ea;
  background: var(--oxblood);
}

.tag-tabs {
  margin-top: -14px;
}

.tag-tabs button {
  min-height: 34px;
  border-color: rgba(74, 86, 55, 0.28);
  color: var(--olive);
  background: rgba(255, 251, 242, 0.52);
  font-size: 0.8rem;
}

.tag-tabs button.active {
  border-color: var(--olive);
  background: var(--olive);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.gallery:has(.photo-card-uploaded) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
  gap: clamp(18px, 3vw, 34px);
}

.empty-gallery {
  grid-column: 1 / -1;
  margin: 0;
  font-weight: 800;
}

.photo-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(24, 24, 24, 0.14);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 251, 242, 0.78);
  box-shadow: 0 12px 34px rgba(24, 24, 24, 0.08);
  cursor: var(--grenade-cursor), pointer;
  font: inherit;
  text-align: left;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.photo-card:hover,
.photo-card:focus-visible {
  border-color: rgba(114, 43, 40, 0.45);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.photo-card-uploaded {
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: #151515;
}

.photo-card-uploaded .photo-frame {
  aspect-ratio: 16 / 10;
  min-height: min(72vh, 720px);
  border-radius: 0;
}

.photo-card-uploaded .photo-meta {
  padding: 18px;
  color: #fff7ea;
  background: linear-gradient(180deg, rgba(21, 21, 21, 0.62), rgba(21, 21, 21, 0.92));
}

.photo-card-uploaded .photo-meta small {
  color: rgba(255, 247, 234, 0.72);
}

.photo-card-uploaded .tag-list span {
  border-color: rgba(255, 247, 234, 0.28);
  color: #fff7ea;
  background: rgba(255, 247, 234, 0.12);
}

.photo-frame {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
  background:
    linear-gradient(145deg, rgba(24, 24, 24, 0.12), rgba(255, 255, 255, 0.16)),
    var(--archive-bg) center / cover;
  filter: sepia(0.82) saturate(0.72) contrast(1.04);
}

.photo-frame::after {
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px dashed rgba(255, 247, 234, 0.7);
  color: #fff7ea;
  content: "Photo placeholder";
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.uploaded-frame {
  background-position: center;
  background-size: cover;
  filter: sepia(0.38) saturate(0.9) contrast(1.02);
}

.uploaded-frame::after {
  content: none;
}

.portrait {
  background-position: 28% center;
}

.landscape {
  background-position: center 30%;
}

.letter {
  background-position: 58% center;
}

.home {
  background-position: 72% center;
}

.leave {
  background-position: 40% 70%;
}

.keepsake {
  background-position: 83% 50%;
}

.photo-meta {
  display: grid;
  gap: 2px;
}

.photo-meta strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.55rem;
  line-height: 1;
}

.photo-meta small {
  color: rgba(24, 24, 24, 0.68);
  font-weight: 700;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(74, 86, 55, 0.24);
  border-radius: 999px;
  color: var(--olive);
  background: rgba(74, 86, 55, 0.08);
  font-size: 0.76rem;
  font-weight: 900;
}

.site-footer {
  padding: 34px clamp(20px, 7vw, 88px);
  color: #fff7ea;
  background: var(--navy);
}

.site-footer p {
  margin: 0;
  max-width: 760px;
}

.lightbox {
  width: min(100vw - 24px, 1500px);
  max-width: none;
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  box-shadow: var(--shadow);
  color: #fff7ea;
}

.lightbox::backdrop {
  background: rgba(12, 12, 12, 0.72);
}

.close-button {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff7ea;
  background: rgba(24, 24, 24, 0.74);
  cursor: var(--grenade-cursor), pointer;
  font-size: 1.5rem;
}

.lightbox-image {
  display: grid;
  min-height: min(78vh, 920px);
  place-items: center;
  background:
    linear-gradient(180deg, rgba(24, 24, 24, 0.08), rgba(24, 24, 24, 0.24)),
    var(--archive-bg) center / cover;
  filter: sepia(0.82) saturate(0.72) contrast(1.04);
}

.lightbox-image:has(img) {
  background: #111;
  filter: none;
}

.lightbox-image img {
  display: block;
  width: 100%;
  height: min(78vh, 920px);
  object-fit: contain;
  background: #111;
}

.admin-page {
  min-height: 100vh;
  padding: clamp(28px, 6vw, 64px);
  background: var(--paper);
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
  gap: clamp(24px, 5vw, 56px);
  max-width: 1180px;
  margin: 0 auto;
}

.admin-panel {
  padding: 22px;
  border: 1px solid rgba(24, 24, 24, 0.12);
  border-radius: 8px;
  background: rgba(255, 251, 242, 0.86);
  box-shadow: 0 12px 34px rgba(24, 24, 24, 0.08);
}

.admin-panel h1,
.admin-panel h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-field {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.admin-field input,
.admin-field textarea,
.admin-field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(24, 24, 24, 0.18);
  border-radius: 5px;
  color: var(--ink);
  background: #fffaf0;
  font: inherit;
}

.admin-field textarea {
  min-height: 92px;
  resize: vertical;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--navy);
  border-radius: 5px;
  color: #fff7ea;
  background: var(--navy);
  cursor: var(--grenade-cursor), pointer;
  font: inherit;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
}

.admin-button.secondary {
  color: var(--navy);
  background: transparent;
}

.admin-status {
  min-height: 24px;
  color: var(--oxblood);
  font-weight: 800;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-list article {
  padding: 14px;
  border: 1px solid rgba(24, 24, 24, 0.12);
  border-radius: 6px;
  background: rgba(247, 241, 230, 0.82);
}

.admin-list h3 {
  font-size: 1.5rem;
}

.lightbox h3,
.lightbox p {
  margin-right: 28px;
  margin-left: 28px;
}

.lightbox-tags {
  margin-top: 14px;
}

.lightbox h3 {
  margin-top: 24px;
  font-size: 2.2rem;
}

.lightbox p {
  margin-bottom: 28px;
  color: rgba(255, 247, 234, 0.82);
}

@media (max-width: 840px) {
  .site-header {
    position: absolute;
  }

  .hero {
    min-height: 86vh;
    background-attachment: scroll;
  }

  .hero::before {
    background-attachment: scroll;
  }

  .about-section,
  .about-grid,
  .gallery,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .photo-card-uploaded .photo-frame {
    min-height: 58vh;
  }
}

@media (max-width: 560px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .hero {
    padding-top: 176px;
  }

  h1 {
    font-size: clamp(3.2rem, 18vw, 5.2rem);
  }
}
