:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #090c12;
  color: #f8fafc;
  font-synthesis: none;
}

* { box-sizing: border-box; }

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

body {
  min-height: 100svh;
  background:
    radial-gradient(circle at 8% 0%, rgba(211, 54, 48, 0.12), transparent 30%),
    #090c12;
}

.farewell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(16px, 2vw, 28px);
  min-height: 100svh;
  padding: clamp(18px, 2.5vw, 38px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.brand {
  display: block;
  width: 82px;
  height: 47px;
  object-fit: contain;
}

.closed-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.closed-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f0574f;
  box-shadow: 0 0 12px rgba(240, 87, 79, 0.72);
}

.photo-gallery {
  display: grid;
  grid-template-columns: 1.14fr 0.86fr;
  gap: clamp(10px, 1.2vw, 18px);
  min-height: 420px;
}

.photo {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: clamp(18px, 2vw, 30px);
  background: #111722;
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.32);
}

.photo::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 24%;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(4, 7, 12, 0.5));
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(.2, .7, .2, 1);
}

.photo:hover img { transform: scale(1.015); }
.photo-primary img { object-position: 50% 48%; }
.photo-secondary img { object-position: 50% 45%; }

.photo figcaption {
  position: absolute;
  z-index: 2;
  right: 20px;
  bottom: 17px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.farewell-note {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(360px, 1.2fr) auto;
  align-items: center;
  gap: clamp(24px, 4vw, 72px);
  padding: 4px 4px 2px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #f0574f;
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.15rem, 3.8vw, 4.15rem);
  font-weight: 780;
  letter-spacing: -0.05em;
  line-height: 1;
}

.message {
  max-width: 650px;
  margin: 0;
  color: rgba(255, 255, 255, 0.63);
  font-size: clamp(0.92rem, 1.25vw, 1.07rem);
  line-height: 1.65;
}

.signature {
  min-width: 130px;
  margin: 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.72rem;
  line-height: 1.7;
  text-align: right;
}

.signature strong {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.86rem;
  font-weight: 750;
}

@media (max-width: 820px) {
  .farewell {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    padding: 16px;
  }

  .identity span { display: none; }

  .photo-gallery {
    display: grid;
    flex: 1;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(430px, 62svh);
    min-height: 0;
  }

  .photo {
    grid-area: 1 / 1;
    animation: photo-fade 12s infinite;
  }

  .photo-secondary {
    opacity: 0;
    animation-delay: 6s;
  }

  .photo figcaption { display: none; }

  .farewell-note {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px 18px;
    padding: 8px 4px 4px;
  }

  .message {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .signature {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
  }

  h1 { font-size: clamp(2.2rem, 11vw, 3.4rem); }
}

@media (max-width: 480px) {
  .farewell-note { grid-template-columns: 1fr; }

  .signature {
    grid-column: 1;
    grid-row: 3;
    text-align: left;
  }
}

@keyframes photo-fade {
  0%, 42% { opacity: 1; transform: scale(1); }
  50%, 92% { opacity: 0; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .photo,
  .photo img { animation: none; transition: none; }
  .photo-secondary { display: none; }
}
