:root {
  --ink: #f4f0e8;
  --gold: #d7b184;
  --gold-soft: rgba(215, 177, 132, .54);
  --night: #080a0c;
  --shadow: rgba(0, 0, 0, .62);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--night);
}

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--night);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", Times, serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.memorial {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  background: var(--night);
}

.media,
.poster,
.poster img,
.background-video,
.veil,
.soft-grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.media {
  z-index: -1;
  overflow: hidden;
  background: #111418;
}

.poster {
  margin: 0;
}

.poster img,
.background-video {
  display: block;
  object-fit: cover;
  object-position: 42% center;
}

.poster img {
  filter: saturate(.93) contrast(1.03) brightness(.88);
  transform: scale(1.012);
}

.background-video {
  opacity: 0;
  transition: opacity 1.5s ease;
  filter: saturate(.94) contrast(1.03) brightness(.88);
}

.background-video.is-ready {
  opacity: 1;
}

.veil {
  pointer-events: none;
}

.veil--global {
  background:
    linear-gradient(180deg, rgba(4, 6, 8, .07) 0%, rgba(4, 6, 8, .03) 44%, rgba(4, 6, 8, .34) 100%);
}

.veil--content {
  background:
    linear-gradient(90deg,
      rgba(6, 8, 10, .02) 0%,
      rgba(6, 8, 10, .04) 34%,
      rgba(6, 8, 10, .42) 57%,
      rgba(6, 8, 10, .82) 100%);
}

.veil--edge {
  box-shadow:
    inset 0 0 12vw 4vw rgba(0, 0, 0, .27),
    inset 0 -15vh 20vh rgba(0, 0, 0, .18);
}

.soft-grain {
  opacity: .045;
  mix-blend-mode: screen;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
}

.tribute {
  width: min(46rem, 46vw);
  margin-left: auto;
  margin-right: clamp(2rem, 7vw, 8rem);
  padding:
    max(2rem, env(safe-area-inset-top))
    0
    max(2rem, env(safe-area-inset-bottom));
  text-align: center;
  animation: tribute-in 1.5s cubic-bezier(.22, .61, .36, 1) both;
}

.site-mark {
  display: grid;
  grid-template-columns: minmax(2rem, 7rem) auto auto minmax(2rem, 7rem);
  align-items: center;
  justify-content: center;
  column-gap: .9rem;
  margin-bottom: clamp(2.2rem, 5vh, 4.5rem);
  color: var(--gold);
}

.site-mark__line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft));
}

.site-mark__line:last-child {
  background: linear-gradient(90deg, var(--gold-soft), transparent);
}

.site-mark__name {
  font-size: clamp(.92rem, 1.5vw, 1.25rem);
  letter-spacing: .16em;
  text-transform: lowercase;
  text-shadow: 0 2px 14px var(--shadow);
}

.site-mark__heart {
  font-size: .72rem;
  opacity: .9;
}

.message {
  text-shadow:
    0 3px 28px rgba(0, 0, 0, .76),
    0 1px 2px rgba(0, 0, 0, .8);
}

.message h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(3rem, 5.7vw, 6.75rem);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.message p {
  margin: clamp(1.5rem, 3.2vh, 2.75rem) 0 0;
  color: var(--gold);
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: clamp(1.45rem, 3vw, 3.35rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: .01em;
}

.memory-sign {
  display: grid;
  grid-template-columns: minmax(3rem, 10rem) auto minmax(3rem, 10rem);
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  margin-top: clamp(2.6rem, 5.5vh, 5rem);
  color: var(--gold);
}

.memory-sign span {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft));
}

.memory-sign span:last-child {
  background: linear-gradient(90deg, var(--gold-soft), transparent);
}

.memory-sign svg {
  width: clamp(1.35rem, 2vw, 2rem);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  filter: drop-shadow(0 0 8px rgba(215, 177, 132, .28));
}

@keyframes tribute-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .poster img,
  .background-video {
    object-position: 36% center;
  }

  .veil--content {
    background:
      linear-gradient(180deg,
        rgba(5, 7, 9, .04) 0%,
        rgba(5, 7, 9, .08) 45%,
        rgba(5, 7, 9, .82) 100%);
  }

  .tribute {
    width: min(92vw, 44rem);
    align-self: end;
    margin: 0 auto;
    padding:
      max(3rem, env(safe-area-inset-top))
      1.25rem
      max(3rem, calc(env(safe-area-inset-bottom) + 1rem));
  }

  .site-mark {
    margin-bottom: clamp(1.2rem, 3vh, 2.2rem);
  }

  .message h1 {
    font-size: clamp(2.5rem, 8.5vw, 5rem);
  }

  .message p {
    font-size: clamp(1.35rem, 4.8vw, 2.7rem);
  }

  .memory-sign {
    margin-top: clamp(1.7rem, 3vh, 2.8rem);
  }
}

@media (max-width: 640px) {
  .memorial {
    min-height: 100svh;
  }

  .poster img,
  .background-video {
    object-position: 31% center;
  }

  .poster img {
    filter: saturate(.9) contrast(1.04) brightness(.78);
  }

  .background-video {
    filter: saturate(.91) contrast(1.04) brightness(.78);
  }

  .veil--global {
    background:
      linear-gradient(180deg, rgba(5, 7, 9, .12) 0%, rgba(5, 7, 9, .02) 38%, rgba(5, 7, 9, .5) 68%, rgba(5, 7, 9, .92) 100%);
  }

  .tribute {
    width: 100%;
    padding-left: clamp(1.15rem, 6vw, 2rem);
    padding-right: clamp(1.15rem, 6vw, 2rem);
  }

  .site-mark {
    grid-template-columns: minmax(1rem, 4rem) auto auto minmax(1rem, 4rem);
    column-gap: .55rem;
  }

  .site-mark__name {
    font-size: .85rem;
    letter-spacing: .13em;
  }

  .message h1 {
    font-size: clamp(2.55rem, 12.4vw, 4.2rem);
    line-height: 1.02;
  }

  .message p {
    margin-top: 1.2rem;
    font-size: clamp(1.4rem, 7vw, 2rem);
  }

  .memory-sign {
    grid-template-columns: minmax(2rem, 5.5rem) auto minmax(2rem, 5.5rem);
    gap: .75rem;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .tribute {
    width: min(48rem, 49vw);
    margin-right: 4vw;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .site-mark {
    margin-bottom: 1rem;
  }

  .message h1 {
    font-size: clamp(2.4rem, 7.7vh, 4.6rem);
  }

  .message p {
    margin-top: .9rem;
    font-size: clamp(1.25rem, 4.3vh, 2.25rem);
  }

  .memory-sign {
    margin-top: 1.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tribute {
    animation: none;
  }

  .background-video {
    transition: none;
  }
}
