:root {
  --ink: #30263a;
  --muted: #86727e;
  --rose: #b9364d;
  --pink: #f3c3c3;
  --paper: #fffaf3;
  --line: #e5ccd0;
  --gold: #e8ac4a;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 15%, rgba(255,255,255,.78) 0 1px, transparent 2px),
    radial-gradient(circle at 86% 72%, rgba(255,255,255,.58) 0 1px, transparent 2px),
    #eee0d8;
  background-size: 23px 23px, 31px 31px, auto;
  font-family: "Noto Sans SC", sans-serif;
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  content: "";
  width: 180px;
  height: 180px;
  border: 1px solid rgba(185, 54, 77, .17);
  border-radius: 50%;
}

body::before { top: 7vh; left: 4vw; }
body::after { right: 5vw; bottom: 5vh; width: 230px; height: 230px; }

button { font: inherit; }

.card-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(380px, 1.02fr) minmax(430px, .98fr);
  width: min(1180px, calc(100% - 48px));
  min-height: min(760px, calc(100vh - 80px));
  margin: 40px auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 28px 70px rgba(94, 52, 68, .2);
}

.visual-panel {
  position: relative;
  min-height: 760px;
  overflow: hidden;
  background: #e6bdc2 url("assets/maou-original.jpg") center 22% / cover no-repeat;
}

.visual-panel::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.28), transparent 22%, transparent 76%, rgba(65,31,52,.14)),
    linear-gradient(0deg, rgba(49,35,57,.18), transparent 26%);
  mix-blend-mode: multiply;
}

.visual-panel::before {
  position: absolute;
  inset: 22px;
  z-index: 2;
  border: 1px solid rgba(255, 250, 235, .72);
  content: "";
  pointer-events: none;
}

.panel-tag,
.character-credit,
.comic-caption {
  position: absolute;
  z-index: 3;
  text-transform: uppercase;
}

.panel-tag {
  top: 45px;
  left: 48px;
  color: #fff8e8;
  font-size: 10px;
  letter-spacing: 2px;
}

.comic-caption {
  right: 42px;
  bottom: 44px;
  color: #fff8e8;
  font-size: clamp(38px, 5vw, 66px);
  font-weight: 700;
  line-height: .86;
  letter-spacing: 3px;
  text-align: right;
  text-shadow: 4px 4px 0 rgba(122, 31, 61, .4);
  transform: rotate(-7deg);
}

.comic-caption span { color: #ffd16f; }

.character-credit {
  bottom: 52px;
  left: 48px;
  color: rgba(255, 248, 232, .87);
  font-family: "Ma Shan Zheng", cursive;
  font-size: 16px;
  line-height: 1.3;
  transform: rotate(-5deg);
}

.spark {
  position: absolute;
  z-index: 3;
  color: #fff4ce;
  font-size: 30px;
  animation: twinkle 2.4s infinite ease-in-out;
}

.spark-one { top: 26%; left: 16%; }
.spark-two { top: 17%; right: 24%; animation-delay: .8s; }

.message-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 52px clamp(38px, 5vw, 72px) 34px;
  background:
    linear-gradient(90deg, rgba(228, 190, 188, .18) 1px, transparent 1px),
    linear-gradient(rgba(228, 190, 188, .18) 1px, transparent 1px),
    var(--paper);
  background-size: 26px 26px;
}

.message-panel::before {
  position: absolute;
  top: 0;
  left: 32px;
  width: 1px;
  height: 100%;
  content: "";
  background: #e9bbc2;
  opacity: .68;
}

.topline {
  display: flex;
  justify-content: space-between;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
  color: var(--rose);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
}

.message-content {
  position: relative;
  z-index: 1;
  max-width: 510px;
  margin: auto 0;
  padding: 36px 0 24px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Ma Shan Zheng", cursive;
  font-size: clamp(52px, 5.1vw, 74px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: 0;
}

h1 em {
  color: var(--rose);
  font-style: normal;
}

.ink-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 165px;
  margin: 28px 0 25px;
  color: var(--rose);
}

.ink-divider span {
  display: block;
  width: 55px;
  height: 1px;
  background: var(--rose);
  opacity: .65;
}

.ink-divider i { font-size: 18px; font-style: normal; }

.message {
  max-width: 480px;
  margin: 0 0 14px;
  color: #554652;
  font-size: 14px;
  line-height: 2;
}

blockquote {
  margin: 26px 0 24px;
  padding: 12px 0 12px 20px;
  border-left: 3px solid var(--gold);
  color: var(--rose);
  font-family: "Ma Shan Zheng", cursive;
  font-size: 25px;
  line-height: 1.45;
}

.signature {
  margin: 0;
  color: var(--muted);
  font-family: "Ma Shan Zheng", cursive;
  font-size: 18px;
  line-height: 1.65;
  text-align: right;
}

.signature strong { color: var(--rose); font-weight: 400; }

.wish-button {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 25px 1fr 25px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid var(--rose);
  color: var(--rose);
  background: rgba(255, 250, 243, .73);
  cursor: pointer;
  letter-spacing: 1px;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.wish-button:hover,
.wish-button:focus-visible {
  color: #fffaf3;
  background: var(--rose);
  outline: none;
  transform: translateY(-2px);
}

.button-label { font-size: 12px; text-align: center; }
.button-icon { font-size: 19px; }
.button-arrow { font-size: 20px; text-align: right; }

.secret-note {
  position: absolute;
  right: 7%;
  bottom: 90px;
  z-index: 3;
  width: 230px;
  padding: 28px 22px 20px;
  color: #5d3d48;
  background: #f8d57e;
  box-shadow: 8px 13px 0 rgba(111, 58, 74, .1);
  opacity: 0;
  transform: translateY(18px) rotate(5deg);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}

.secret-note.is-open {
  opacity: 1;
  transform: translateY(0) rotate(5deg);
}

.secret-note p {
  margin: 0;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 22px;
  line-height: 1.45;
}

.note-pin {
  position: absolute;
  top: 8px;
  left: 50%;
  color: var(--rose);
  font-size: 22px;
  transform: translateX(-50%);
}

.stamp {
  position: absolute;
  right: 28px;
  top: 45px;
  padding: 9px 8px 6px;
  border: 2px solid rgba(185, 54, 77, .65);
  color: rgba(185, 54, 77, .75);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 1px;
  text-align: center;
  transform: rotate(8deg);
}

.stamp span { font-size: 13px; }

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

.heart {
  position: absolute;
  bottom: 4vh;
  color: var(--rose);
  font-size: 18px;
  animation: float-up 2.2s ease-out forwards;
}

@keyframes twinkle {
  0%, 100% { opacity: .35; transform: scale(.86) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.12) rotate(10deg); }
}

@keyframes float-up {
  0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(.6); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift), -78vh) rotate(330deg) scale(1.35); }
}

@media (max-width: 820px) {
  .card-shell {
    grid-template-columns: 1fr;
    width: min(590px, calc(100% - 28px));
    margin: 14px auto;
  }

  .visual-panel { min-height: 470px; }
  .message-panel { min-height: 660px; padding: 30px 34px 28px; }
  .message-panel::before { left: 20px; }
  .panel-tag { top: 36px; left: 34px; }
  .comic-caption { right: 30px; bottom: 28px; }
  .character-credit { bottom: 35px; left: 32px; }
  .message-content { padding-top: 30px; }
  .stamp { top: 28px; right: 24px; }
}

@media (max-width: 470px) {
  .visual-panel { min-height: 410px; }
  .message-panel { min-height: 710px; padding: 25px 27px 24px; }
  .message-panel::before { left: 14px; }
  .topline { font-size: 9px; letter-spacing: 1.4px; }
  h1 { font-size: 51px; }
  .message { font-size: 13px; line-height: 1.9; }
  blockquote { font-size: 23px; }
  .secret-note { right: 9%; bottom: 87px; width: 205px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
