:root {
  --bg: #f3ede1;
  --bg-2: #e8dfcf;
  --paper: rgba(255, 252, 246, 0.16);
  --paper-strong: rgba(255, 250, 240, 0.22);
  --border: rgba(91, 75, 58, 0.04);
  --border-strong: rgba(91, 75, 58, 0.06);
  --text: #000000;
  --muted: #000000;
  --accent: #000000;
  --accent-2: #000000;
  --shadow: 0 22px 60px rgba(80, 63, 47, 0.12);
  --shadow-soft: 0 10px 30px rgba(80, 63, 47, 0.08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "American Typewriter", "Courier Prime", "Courier New", Courier, monospace;
  background-color: #efe6d8;
  background-image: url("./assets/linen-reference.jpg");
  background-repeat: repeat;
  background-size: 900px auto;
  background-position: top center;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.1), rgba(255, 252, 246, 0.06));
  opacity: 1;
}

::selection {
  background: rgba(145, 116, 86, 0.18);
}

img {
  max-width: 100%;
}

.page-shell {
  width: min(1120px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 16px 0 40px;
}

.poster-hero,
.story-card,
.donation-card,
.simple-actions,
.memory-panel {
  position: relative;
  border-radius: var(--radius-xl);
}

.poster-hero,
.story-card,
.donation-card,
.simple-actions,
.memory-panel {
  overflow: hidden;
}

.poster-hero {
  padding: clamp(22px, 4vw, 52px);
  text-align: center;
  background: rgba(255, 252, 246, 0.03);
  box-shadow: none;
}

.hero-heading {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.poster-hero::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: min(240px, 40%);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(109, 92, 72, 0.35), transparent);
  transform: translateX(-50%);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-family: "American Typewriter", "Courier Prime", "Courier New", Courier, monospace;
  font-size: clamp(1.55rem, 3vw, 2.55rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "American Typewriter", "Courier Prime", "Courier New", Courier, monospace;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 {
  margin-top: 10px;
  font-size: clamp(3.2rem, 7.6vw, 6.7rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 700;
}

.portrait-frame {
  position: relative;
  width: min(100%, 680px);
  margin: 24px auto 0;
  border-radius: 0;
  overflow: hidden;
  border: 0;
  box-shadow: none;
  background: transparent;
  aspect-ratio: 1 / 1.08;
}

.portrait-frame img,
.memory-feature-image img,
.memory-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(0.9) contrast(0.96) brightness(1.02);
}

.portrait-frame img {
  object-position: center 34%;
  transform: scale(1.005);
  mix-blend-mode: multiply;
  opacity: 0.96;
}

.dates {
  margin: 34px 0 0;
  color: var(--accent);
  font-family: "American Typewriter", "Courier Prime", "Courier New", Courier, monospace;
  font-size: clamp(1.55rem, 3vw, 2.55rem);
  line-height: 0.95;
  font-weight: 600;
  text-align: center;
}

.story-card,
.donation-card {
  margin-top: -8px;
  padding: clamp(20px, 3vw, 34px);
}

.story-card {
  max-width: 100%;
  background: rgba(255, 252, 246, 0.025);
  box-shadow: none;
}

.memory-story-hero {
  margin-top: 0;
}

.donation-card {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
  background: rgba(255, 252, 246, 0.03);
  box-shadow: none;
}

.donation-card-hero {
  margin-top: 16px;
}

.memory-panel {
  margin-top: 18px;
  padding: clamp(10px, 2vw, 22px);
  background: rgba(255, 252, 246, 0.02);
}

.simple-actions {
  margin-top: 14px;
  padding: 8px 0 0;
  text-align: center;
  background: rgba(255, 252, 246, 0.02);
  box-shadow: none;
}

.donation-card p,
.story-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 1.02rem;
  font-weight: 600;
}

.story-card p + p {
  margin-top: 1.1rem;
}

.donation-card p:first-of-type,
.story-card p:first-of-type {
  margin-top: 10px;
}

.section-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.photo-memories-button,
.donate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 26px;
  border-radius: 8px;
  border: 1px solid rgba(38, 33, 44, 0.22);
  background:
    linear-gradient(180deg, rgba(73, 67, 80, 0.98), rgba(50, 45, 58, 0.98));
  color: #c8ddf0;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(52, 45, 59, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.donate-button {
  margin-top: 16px;
}

.photo-memories-button:hover,
.photo-memories-button:focus-visible,
.donate-button:hover,
.donate-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(38, 33, 44, 0.38);
  box-shadow: 0 16px 28px rgba(52, 45, 59, 0.22);
  outline: none;
  color: #d7e8f5;
}

.donation-card-hero {
  text-align: center;
}

.action-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.memory-feature {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.memory-feature-image {
  min-height: 280px;
  background: transparent;
  position: relative;
}

.memory-feature-image::before,
.memory-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
  background: rgba(243, 235, 218, 0.18);
  border: 0;
  box-shadow: none;
}

.memory-feature-image::before {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: none;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.10), transparent 22%, transparent 78%, rgba(255, 252, 246, 0.12));
}

.memory-feature-image::after,
.memory-card::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.memory-feature-image::after {
  display: none;
}

.memory-feature-image img {
  height: 100%;
  object-position: center 34%;
}

.memory-feature-copy {
  padding: clamp(22px, 4vw, 40px);
  display: flex;
  align-items: center;
}

.memory-feature-copy h2 {
  max-width: 10ch;
}

.memory-gallery {
  column-count: 4;
  column-gap: 18px;
  margin-top: 20px;
}

.memory-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 16px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  break-inside: avoid;
  background: transparent;
  box-shadow: none;
  transform-origin: center;
  position: relative;
}

.memory-card:nth-child(4n + 1) {
  transform: rotate(-0.6deg);
}

.memory-card:nth-child(4n + 2) {
  transform: rotate(0.5deg);
}

.memory-card:nth-child(4n + 3) {
  transform: rotate(-0.3deg);
}

.memory-card:nth-child(4n + 4) {
  transform: rotate(0.4deg);
}

.memory-card img {
  object-position: center 34%;
  border-radius: 0;
  box-shadow: none;
  mix-blend-mode: multiply;
  opacity: 0.95;
}

.memory-card::before {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: none;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.04), rgba(255, 252, 246, 0.0));
}

.memory-empty p,
.story-card p,
.donation-card p {
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .memory-feature {
    grid-template-columns: 1fr;
  }

  .memory-gallery {
    column-count: 2;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100vw - 14px, 1120px);
    padding: 10px 0 18px;
  }

  .poster-hero,
  .story-card,
  .donation-card,
  .simple-actions,
  .memory-panel,
  .memory-feature {
    border-radius: 0;
  }

  .poster-hero {
    padding: 18px;
  }

  .portrait-frame {
    width: 100%;
    margin-top: 18px;
    aspect-ratio: 4 / 5;
    border-radius: 0;
  }

  .dates {
    font-size: clamp(1.9rem, 8vw, 2.8rem);
  }

  .memory-feature-copy,
  .story-card,
  .donation-card,
  .simple-actions,
  .memory-panel {
    padding: 18px;
  }

  .memory-gallery {
    column-count: 1;
  }

  .memory-card {
    transform: none !important;
  }

  .donation-card-hero {
    margin-top: 28px;
  }

  .donate-button {
    margin-top: 18px;
  }
}
