:root {
  --bg-deep: #070708;
  --bg-mid: #101014;
  --ink: #ece8e3;
  --ink-soft: #a8a29a;
  --ink-mute: #6f6a63;
  --ember: #9a3b32;
  --ember-soft: #c45a48;
  --ember-glow: rgba(154, 59, 50, 0.28);
  --line: rgba(236, 232, 227, 0.14);
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-button: "Outfit", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: var(--font-body);
  background: var(--bg-deep);
  overflow: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, #1a1214 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 100%, #120e12 0%, transparent 50%),
    linear-gradient(180deg, #0b0b0d 0%, var(--bg-deep) 45%, #050506 100%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: drift 18s ease-in-out infinite;
}

.glow-a {
  width: min(55vw, 420px);
  height: min(55vw, 420px);
  top: 12%;
  left: 50%;
  translate: -50% 0;
  background: var(--ember-glow);
}

.glow-b {
  width: min(40vw, 280px);
  height: min(40vw, 280px);
  bottom: 8%;
  right: 12%;
  background: rgba(80, 70, 90, 0.18);
  animation-delay: -7s;
  animation-duration: 22s;
}

.veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.55) 100%);
}

#embers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

#bg-music {
  display: none;
}

.memorial {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 58rem;
  margin: 0 auto;
  padding: 1.25rem 2rem 1.5rem;
  overflow: hidden;
}

.remembrance {
  margin: 0 0 0.7rem;
  font-size: clamp(0.85rem, 2.2vh, 1.15rem);
  font-weight: 400;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--ink-mute);
  opacity: 0;
  animation: rise 1.2s ease 0.15s forwards;
}

.name-logo {
  display: block;
  width: auto;
  height: clamp(3.2rem, 9vh, 5.5rem);
  margin: 0 0 0.55rem;
  object-fit: contain;
  opacity: 0;
  animation: rise 1.2s ease 0.05s forwards;
}

.name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.8rem, 11vh, 7rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-shadow: 0 0 60px var(--ember-glow);
  opacity: 0;
  animation: rise 1.4s ease 0.35s forwards;
}

.aka {
  margin: 0.55rem 0 0;
  font-family: var(--font-body);
  font-style: normal;
  font-size: clamp(1.2rem, 3vh, 1.7rem);
  font-weight: 400;
  color: var(--ember-soft);
  letter-spacing: 0.06em;
  opacity: 0;
  animation: rise 1.4s ease 0.55s forwards;
}

.divider {
  width: 100%;
  max-width: 10rem;
  margin: 0.7rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: rise 1.2s ease 0.75s forwards;
}

.divider span {
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--line) 20%,
    var(--ember) 50%,
    var(--line) 80%,
    transparent
  );
  transform-origin: center;
  animation: draw 1.6s ease 0.9s both;
}

.message {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(calc(0.95rem + 4px), calc(2.2vh + 4px), calc(1.15rem + 4px));
  font-weight: 300;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 42rem;
  width: 100%;
  letter-spacing: 0.01em;
  opacity: 0;
  animation: rise 1.4s ease 0.95s forwards;
}

.letter {
  margin: 0.85rem 0 0;
  max-width: 52rem;
  width: 100%;
  text-align: left;
  opacity: 0;
  animation: rise 1.4s ease 1.1s forwards;
}

.letter p {
  margin: 0 0 0.55rem;
  font-size: clamp(calc(0.82rem + 4px), calc(1.7vh + 4px), calc(0.95rem + 4px));
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-soft);
}

.letter p:last-child {
  margin-bottom: 0;
}

.letter-sign {
  margin-top: 0.65rem !important;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 0.95rem;
  opacity: 0;
  animation: rise 1.2s ease 1.3s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.55rem 1.4rem;
  border: 1px solid rgba(196, 90, 72, 0.45);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(154, 59, 50, 0.22), rgba(154, 59, 50, 0.08));
  color: var(--ink);
  font-family: var(--font-button);
  font-size: 0.96rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn:hover,
.btn:focus-visible {
  background: linear-gradient(180deg, rgba(154, 59, 50, 0.38), rgba(154, 59, 50, 0.16));
  border-color: rgba(196, 90, 72, 0.75);
  outline: none;
}

.btn-secondary {
  border-color: rgba(236, 232, 227, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: rgba(236, 232, 227, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes draw {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translate(-50%, 0) scale(1);
  }
  50% {
    transform: translate(-48%, 12px) scale(1.08);
  }
}

@media (max-width: 720px) {
  body {
    overflow-y: auto;
    height: auto;
    min-height: 100dvh;
  }

  .memorial {
    justify-content: flex-start;
    padding: 1.5rem 1.15rem 2rem;
    overflow: visible;
  }

  .name-logo {
    height: clamp(2.6rem, 8vh, 4rem);
  }

  .name {
    font-size: clamp(2.4rem, 11vw, 4rem);
  }

  .actions {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .name-logo,
  .remembrance,
  .name,
  .aka,
  .divider,
  .message,
  .letter,
  .actions {
    opacity: 1;
  }
}
