:root {
  color-scheme: light;
  --paper: #fbf3e9;
  --ink: #39262b;
  --wine: #6b2d42;
  --cream: #fff0df;
  --pink: #e9aeb7;
  font-family: Georgia, Cambria, "Times New Roman", serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
main { display: grid; grid-template-columns: minmax(300px, 38%) minmax(0, 1fr); }

.cover {
  position: sticky;
  top: 0;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 30rem;
  height: 100svh;
  padding: 4rem 2rem;
  background:
    radial-gradient(ellipse at 100% 8%, #a05c632e, transparent 57%),
    radial-gradient(ellipse at 15% 90%, #7f3c514d, transparent 51%),
    linear-gradient(150deg, #3b1c29, #28131d 70%);
  color: var(--cream);
  text-align: center;
}

.cover::before, .cover::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: 1rem;
  border: 1px solid #efbdab52;
}

.cover::after {
  inset: 1.35rem;
  border-color: #efbdab29;
}

.cover-content { display: grid; justify-items: center; align-content: center; }
.dedication {
  margin: 0 0 1.15rem;
  color: var(--pink);
  font: 600 .7rem/1.4 system-ui, sans-serif;
  letter-spacing: .28em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(4.5rem, 8.4vw, 9.25rem);
  font-weight: 400;
  line-height: .82;
  letter-spacing: -.075em;
}
h1 em { display: block; color: var(--pink); font-weight: 400; }
.open-letter {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  min-height: 44px;
  margin-top: clamp(1.8rem, 6vh, 3.75rem);
  padding: .55rem .15rem;
  color: var(--cream);
  font: 500 .8rem/1.3 system-ui, sans-serif;
  text-decoration: none;
  border-bottom: 1px solid #efbdab88;
}
.open-letter span { color: var(--pink); font-size: 1rem; }
.open-letter:hover { border-bottom-color: var(--pink); color: var(--pink); }
.open-letter:focus-visible { outline: 2px solid var(--pink); outline-offset: .3rem; }

.letter {
  padding: clamp(4rem, 10vh, 8rem) clamp(2rem, 5vw, 7rem) clamp(5rem, 10vh, 8rem);
  background: radial-gradient(ellipse at 50% 0%, #fffaf3, transparent 24rem), var(--paper);
}
.letter-content {
  max-width: 36rem;
  margin: 0 auto;
  scroll-margin-top: 2rem;
  font-size: clamp(1.1rem, 1.75vw, 1.3rem);
  line-height: 1.8;
  overflow-wrap: break-word;
}
.letter-content:focus { outline: none; }
.letter-content > p { margin: 0 0 1.55em; }
.letter-content > p:first-child::first-letter {
  float: left;
  margin: .07em .13em 0 0;
  color: var(--wine);
  font-size: 4.1em;
  line-height: .79;
}
.letter-content > p:last-child { margin-bottom: 0; }

.letter-content > .emphasis {
  margin: 2.1em 0;
  padding: .05em 0 .05em 1em;
  border-left: 1px solid #a46471;
  color: var(--wine);
  font-size: 1.21em;
  line-height: 1.57;
}
.emphasis strong { font-weight: 600; }
.letter-content > .emphasis-center {
  padding: .8em 0;
  border: solid #bc8e8e;
  border-width: 1px 0;
  text-align: center;
  font-size: 1.55em;
  font-style: italic;
}
.refrain { margin: 2.1em 0; color: var(--wine); }
.refrain p { margin: 0 0 .48em; }

@media (max-width: 760px) {
  main { grid-template-columns: none; }
  .cover { position: relative; min-height: 24rem; height: 80svh; }
  h1 { font-size: clamp(4.2rem, 16vw, 7rem); }
  .letter { padding: 3.75rem clamp(1.35rem, 6vw, 3.25rem) max(4rem, env(safe-area-inset-bottom)); }
  .letter-content { font-size: clamp(1.095rem, 4.75vw, 1.25rem); line-height: 1.74; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.cover-plumeria {
  display: block;
  width: clamp(7.5rem, 25svh, 12.5rem);
  height: auto;
  margin: -1rem 0 -.45rem;
  filter: drop-shadow(0 .45rem .95rem #190c1880);
}

mark {
  padding: 0 .1em .06em;
  color: inherit;
  background: linear-gradient(transparent 46%, #efc5c0 46% 92%, transparent 92%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.flower-break {
  display: grid;
  grid-template-columns: 1fr minmax(5rem, 9rem) 1fr;
  align-items: center;
  gap: clamp(.7rem, 3vw, 1.6rem);
  max-width: 24rem;
  margin: .65rem auto 1.65rem;
}

.flower-break::before, .flower-break::after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, transparent, #aa6f7270);
}
.flower-break::after { transform: scaleX(-1); }
.flower-break img { display: block; width: 100%; height: auto; }
.flower-break-turn { margin-block: 1rem 2.15rem; }
.flower-break-turn img { transform: scaleX(-1) rotate(-7deg); }

@media (max-width: 760px) {
  .cover-plumeria { width: min(10rem, 24svh); margin-top: -.85rem; }
  .flower-break { grid-template-columns: 1fr minmax(5rem, 7.5rem) 1fr; max-width: 19rem; }
}

@media (max-width: 760px) {
  .cover { padding-block: 2.4rem; }
}
