:root {
  --ink: #2b2422;
  --muted: #6d5e59;
  --paper: #fffaf3;
  --cream: #f7efe4;
  --rose: #a84d5f;
  --rose-dark: #743442;
  --teal: #1f6262;
  --mint: #dfece4;
  --gold: #cc9140;
  --plum: #563146;
  --white: #ffffff;
  --shadow: 0 22px 70px rgba(43, 36, 34, 0.16);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  line-height: 1.6;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.hero {
  position: relative;
  display: grid;
  min-height: 78svh;
  overflow: hidden;
  color: var(--white);
}

.hero__image,
.hero__shade {
  position: absolute;
  inset: 0;
}

.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
}

.hero__shade {
  background:
    linear-gradient(90deg, rgba(31, 98, 98, 0.88), rgba(86, 49, 70, 0.68) 46%, rgba(43, 36, 34, 0.1)),
    linear-gradient(0deg, rgba(43, 36, 34, 0.72), transparent 55%);
}

.hero__content {
  position: relative;
  z-index: 1;
  width: calc(100% - 32px);
  max-width: 1120px;
  align-self: end;
  margin: 0 auto;
  padding: 96px 0 56px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.letter h2,
.breath-layout h2,
.closing h2 {
  margin: 0;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 820px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3rem;
  font-weight: 700;
}

.hero h1 span {
  display: block;
}

.hero__copy {
  max-width: 670px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.08rem;
}

.hero__actions,
.closing {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__actions {
  margin-top: 34px;
}

.button,
.text-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.button {
  padding: 0 20px;
}

.button:hover,
.text-button:hover,
.promise-card:hover {
  transform: translateY(-2px);
}

.button:focus-visible,
.text-button:focus-visible,
.promise-card:focus-visible {
  outline: 3px solid rgba(204, 145, 64, 0.55);
  outline-offset: 3px;
}

.button--primary {
  color: var(--white);
  background: var(--rose);
  box-shadow: 0 16px 36px rgba(116, 52, 66, 0.28);
}

.button--primary:hover {
  background: var(--rose-dark);
}

.button--secondary {
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.button--secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.button--calm {
  color: var(--white);
  background: var(--teal);
  box-shadow: 0 16px 34px rgba(31, 98, 98, 0.24);
}

.button--calm:hover {
  background: #174f50;
}

.section-layout {
  width: calc(100% - 32px);
  max-width: 1120px;
  margin: 0 auto;
}

.letter-band {
  padding: 58px 0 72px;
  background: linear-gradient(180deg, var(--paper), var(--cream));
}

.letter {
  max-width: 840px;
  padding: 36px;
  border: 1px solid rgba(116, 52, 66, 0.15);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.letter h2,
.section-heading h2,
.breath-layout h2,
.closing h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.15rem;
}

.letter__body {
  display: grid;
  gap: 16px;
  max-width: 710px;
  margin-top: 26px;
}

.letter__body p {
  margin: 0;
}

.letter__signature {
  color: var(--rose-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
  font-weight: 700;
}

.text-button {
  margin-top: 28px;
  padding: 0 18px;
  color: var(--rose-dark);
  background: #f3ddd9;
}

.text-button:hover {
  background: #ebcbc5;
}

.promises-band {
  padding: 78px 0;
  background: var(--mint);
}

.memories-band {
  padding: 78px 0;
  background:
    linear-gradient(180deg, var(--cream), #fffaf3 58%, #f8ede7),
    var(--cream);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 30px;
}

.section-heading p,
.breath-layout p,
.closing p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.memories-heading {
  margin-bottom: 34px;
}

.memory-gallery {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr 0.82fr;
  grid-auto-rows: 260px;
  gap: 16px;
}

.memory-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(116, 52, 66, 0.16);
  border-radius: var(--radius);
  background: #1f2427;
  box-shadow: 0 18px 42px rgba(43, 36, 34, 0.16);
}

.memory-card--featured {
  grid-row: span 2;
}

.memory-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.04) contrast(1.02);
}

.memory-card--featured img {
  object-position: center;
}

.memory-card--contain {
  background:
    linear-gradient(135deg, rgba(31, 98, 98, 0.94), rgba(86, 49, 70, 0.94)),
    #1f2427;
}

.memory-card--contain img {
  object-fit: contain;
}

.memory-card figcaption {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  padding: 10px 12px;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(43, 36, 34, 0.62);
  backdrop-filter: blur(10px);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
}

.promise-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.promise-card {
  position: relative;
  display: grid;
  min-height: 218px;
  align-content: start;
  gap: 12px;
  padding: 22px;
  color: var(--ink);
  text-align: left;
  border: 1px solid rgba(31, 98, 98, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 34px rgba(31, 98, 98, 0.1);
}

.promise-card__check {
  position: relative;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(31, 98, 98, 0.35);
  border-radius: 50%;
  background: var(--white);
}

.promise-card__check::after {
  position: absolute;
  top: 7px;
  left: 6px;
  width: 13px;
  height: 7px;
  border-bottom: 3px solid var(--white);
  border-left: 3px solid var(--white);
  content: "";
  opacity: 0;
  transform: rotate(-45deg) scale(0.8);
}

.promise-card__title {
  color: var(--teal);
  font-size: 1.02rem;
  font-weight: 850;
  line-height: 1.25;
}

.promise-card__text {
  color: var(--muted);
  font-size: 0.95rem;
}

.promise-card.is-kept {
  border-color: rgba(168, 77, 95, 0.42);
  background: #fff6f4;
}

.promise-card.is-kept .promise-card__check {
  border-color: var(--rose);
  background: var(--rose);
}

.promise-card.is-kept .promise-card__check::after {
  opacity: 1;
  transform: rotate(-45deg) scale(1);
}

.promise-feedback {
  min-height: 28px;
  margin: 22px 0 0;
  color: var(--rose-dark);
  font-weight: 800;
}

.breath-band {
  padding: 78px 0;
  background: #fff7f0;
}

.forgiveness-band {
  padding: 78px 0;
  background:
    linear-gradient(180deg, rgba(255, 250, 243, 0.86), rgba(223, 236, 228, 0.86)),
    var(--paper);
}

.breath-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 42px;
  align-items: center;
}

.forgiveness-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 34px;
  align-items: center;
}

.breath-panel {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 30px;
  border: 1px solid rgba(204, 145, 64, 0.24);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.breath-orbit {
  display: grid;
  width: 180px;
  height: 180px;
  place-items: center;
  border: 1px solid rgba(31, 98, 98, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(223, 236, 228, 0.8), rgba(255, 255, 255, 0.3) 62%),
    var(--white);
}

.breath-circle {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(168, 77, 95, 0.92), rgba(204, 145, 64, 0.9)),
    var(--rose);
  box-shadow: 0 18px 34px rgba(168, 77, 95, 0.22);
  transform: scale(var(--breath-scale, 1));
  transition: transform var(--breath-duration, 500ms) ease-in-out;
}

.breath-label {
  min-height: 30px;
  margin: 0;
  color: var(--plum);
  font-weight: 850;
  text-align: center;
}

.forgiveness-panel {
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid rgba(168, 77, 95, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.forgiveness-meter {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #eadbd2;
}

.forgiveness-meter span {
  display: block;
  width: var(--forgiveness-percent, 50%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--gold), var(--teal));
  transition: width 220ms ease;
}

.forgiveness-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  color: var(--rose-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4.2rem;
  font-weight: 800;
  line-height: 1;
}

.forgiveness-value small {
  color: var(--muted);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
}

.forgiveness-panel input[type="range"] {
  width: 100%;
  accent-color: var(--rose);
  cursor: pointer;
}

.forgiveness-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.forgiveness-quick button {
  min-height: 42px;
  color: var(--teal);
  border: 1px solid rgba(31, 98, 98, 0.2);
  border-radius: var(--radius);
  background: var(--mint);
  cursor: pointer;
  font-weight: 850;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.forgiveness-quick button:hover {
  transform: translateY(-2px);
  background: #cfe2d7;
}

.forgiveness-message {
  min-height: 54px;
  margin: 0;
  color: var(--plum);
  font-weight: 800;
  text-align: center;
}

.closing-band {
  position: relative;
  overflow: hidden;
  padding: 86px 0 98px;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(86, 49, 70, 0.96), rgba(31, 98, 98, 0.96)),
    var(--plum);
}

.closing {
  max-width: 780px;
  flex-direction: column;
  align-items: flex-start;
}

.closing .section-kicker {
  color: #f0bf73;
}

.closing p {
  color: rgba(255, 255, 255, 0.86);
}

.petals {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 18px;
  border-radius: 10px 10px 10px 2px;
  opacity: 0.92;
  animation: petal-fall 2300ms ease-in forwards;
}

@keyframes petal-fall {
  0% {
    transform: translate3d(0, -10px, 0) rotate(0deg);
  }

  100% {
    transform: translate3d(var(--petal-drift), 105vh, 0) rotate(360deg);
    opacity: 0;
  }
}

@media (min-width: 760px) {
  .hero h1 {
    font-size: 4.4rem;
  }

  .hero__copy {
    font-size: 1.18rem;
  }

  .letter h2,
  .section-heading h2,
  .breath-layout h2,
  .closing h2 {
    font-size: 2.75rem;
  }
}

@media (min-width: 1120px) {
  .hero h1 {
    font-size: 5.25rem;
  }
}

@media (max-width: 980px) {
  .memory-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 280px;
  }

  .memory-card--featured {
    grid-column: span 2;
    grid-row: span 1;
  }

  .promise-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .breath-layout {
    grid-template-columns: 1fr;
  }

  .forgiveness-layout {
    grid-template-columns: 1fr;
  }

  .breath-panel {
    max-width: 420px;
  }
}

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

  .hero__content,
  .section-layout {
    max-width: 300px;
  }

  .hero__content {
    padding: 70px 0 38px;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .hero__copy {
    font-size: 1rem;
  }

  .hero__actions,
  .closing {
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .hero__actions {
    max-width: 300px;
  }

  .hero__copy {
    max-width: 300px;
  }

  .letter,
  .breath-panel {
    padding: 24px;
  }

  .promise-grid {
    grid-template-columns: 1fr;
  }

  .memory-gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .memory-card,
  .memory-card--featured {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 4 / 5;
  }

  .memory-card--featured {
    aspect-ratio: 4 / 3;
  }

  .memory-card--contain {
    aspect-ratio: 9 / 16;
  }

  .promise-card {
    min-height: 176px;
  }
}

@media (max-width: 420px) {
  .hero__content,
  .section-layout {
    max-width: 300px;
  }
}

@media (min-width: 520px) and (max-width: 640px) {
  .hero__content,
  .section-layout,
  .hero__copy,
  .hero__actions {
    max-width: 480px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
