:root {
  color-scheme: light;
  --ink: #21313d;
  --muted: #5f6f79;
  --paper: #fffaf0;
  --panel: #ffffff;
  --line: rgba(33, 49, 61, 0.14);
  --gold: #f1b64d;
  --coral: #e85f55;
  --sky: #5ca6d8;
  --leaf: #4e9b6d;
  --shadow: 0 18px 46px rgba(49, 68, 79, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f6fbf7;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.hero {
  position: relative;
  min-height: 82svh;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: 4rem 1.25rem 3rem;
  isolation: isolate;
}

.hero__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -3;
  transform: scale(1.02);
}

.hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 250, 240, 0.9) 0%, rgba(255, 250, 240, 0.74) 42%, rgba(255, 250, 240, 0.2) 100%),
    linear-gradient(180deg, rgba(255, 250, 240, 0) 0%, rgba(246, 251, 247, 0.8) 100%);
  z-index: -2;
}

.hero__content,
.section-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.hero__content {
  max-width: 760px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.7rem;
  color: #9b4a39;
  font-size: 0.9rem;
  font-weight: 700;
}

h1,
h2,
p {
  overflow-wrap: break-word;
}

h1 {
  margin: 0;
  font-size: 4rem;
  line-height: 1.05;
}

.hero__lead {
  max-width: 38rem;
  margin: 1rem 0 1.5rem;
  color: #304352;
  font-size: 1.25rem;
  line-height: 1.75;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(4.6rem, 1fr));
  gap: 0.75rem;
  max-width: 35rem;
  margin: 0 0 0.85rem;
}

.countdown__unit {
  min-height: 5.4rem;
  padding: 0.7rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 26px rgba(76, 91, 96, 0.12);
  text-align: center;
  backdrop-filter: blur(10px);
}

.countdown__unit strong {
  display: block;
  min-width: 0;
  color: #b63c35;
  font-size: 2rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.countdown__unit span {
  display: block;
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.countdown__status {
  min-height: 1.6rem;
  margin: 0 0 1.35rem;
  color: #42545f;
  font-size: 1rem;
}

.hero__actions,
.blessing-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  min-height: 2.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.72rem 1rem;
  font-weight: 700;
  line-height: 1;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.button svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
  flex: 0 0 auto;
}

.button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(92, 166, 216, 0.42);
  outline-offset: 3px;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  color: #fff;
  background: #d94f43;
  box-shadow: 0 12px 24px rgba(217, 79, 67, 0.24);
}

.button--primary:hover {
  background: #c9443a;
}

.button--ghost {
  color: #254455;
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(33, 49, 61, 0.12);
}

.band {
  padding: 4rem 1.25rem;
  background: #f6fbf7;
}

.band--message {
  background: linear-gradient(180deg, #f6fbf7 0%, #fffaf0 100%);
}

.band--blessing {
  background: linear-gradient(180deg, #fffaf0 0%, #eaf6ee 100%);
}

.message-panel {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.message-panel h2,
.section-heading h2,
.blessing-layout h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.32;
}

.section-heading {
  max-width: 42rem;
  margin-bottom: 1.35rem;
}

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

.reminder-card {
  min-height: 11rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 1.15rem;
  box-shadow: 0 12px 28px rgba(49, 68, 79, 0.08);
}

.reminder-card__mark {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  border-radius: 8px;
  color: #fff;
  background: var(--sky);
}

.reminder-card:nth-child(2) .reminder-card__mark {
  background: var(--leaf);
}

.reminder-card:nth-child(3) .reminder-card__mark {
  background: var(--gold);
}

.reminder-card:nth-child(4) .reminder-card__mark {
  background: var(--coral);
}

.reminder-card__mark svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

.reminder-card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.1rem;
}

.reminder-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.blessing-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(20rem, 1.15fr);
  gap: 2rem;
  align-items: start;
}

.blessing-box {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  padding: 1.25rem;
  box-shadow: 0 12px 28px rgba(49, 68, 79, 0.1);
}

.blessing-box label {
  display: block;
  margin-bottom: 0.55rem;
  color: #40525e;
  font-weight: 700;
}

.blessing-row input {
  min-width: 12rem;
  flex: 1 1 14rem;
  min-height: 2.9rem;
  border: 1px solid rgba(33, 49, 61, 0.18);
  border-radius: 8px;
  padding: 0.72rem 0.85rem;
  color: var(--ink);
  background: #fff;
}

.blessing-result {
  margin: 1rem 0 0;
  padding: 1rem;
  border-radius: 8px;
  color: #314350;
  background: #fff7df;
  line-height: 1.7;
}

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

.cheer-piece {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 2px;
  background: var(--piece-color);
  opacity: 0;
  transform: translate(-50%, -50%) rotate(0deg);
  animation: cheer-pop 920ms ease-out forwards;
}

.cheer-piece--round {
  border-radius: 50%;
}

.cheer-piece--dash {
  width: 1rem;
  height: 0.32rem;
}

.poster-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.poster-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 33, 41, 0.48);
  backdrop-filter: blur(8px);
}

.poster-dialog {
  position: relative;
  width: min(42rem, 100%);
  max-height: min(92svh, 56rem);
  overflow: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: #fffaf0;
  padding: 1.25rem;
  box-shadow: 0 26px 70px rgba(19, 34, 44, 0.28);
}

.poster-dialog h2 {
  margin: 0 2.5rem 1rem 0;
  font-size: 1.6rem;
  line-height: 1.3;
}

.poster-dialog__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #314350;
  background: rgba(255, 255, 255, 0.78);
}

.poster-dialog__close svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.poster-preview {
  min-height: 24rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(92, 166, 216, 0.16), rgba(241, 182, 77, 0.2)),
    #ffffff;
}

.poster-preview img {
  display: block;
  width: min(100%, 18rem);
  max-height: 60svh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(49, 68, 79, 0.2);
}

.poster-loading {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  color: var(--muted);
}

.poster-loading span {
  width: 2.25rem;
  height: 2.25rem;
  border: 4px solid rgba(92, 166, 216, 0.24);
  border-top-color: #5ca6d8;
  border-radius: 50%;
  animation: poster-spin 840ms linear infinite;
}

.poster-loading p,
.poster-status {
  margin: 0;
}

.poster-status {
  min-height: 1.6rem;
  margin-top: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

.poster-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  transform: none;
  box-shadow: none;
}

.noscript {
  margin: 0;
  padding: 1rem;
  color: #742c24;
  background: #fff3d6;
  text-align: center;
}

@keyframes cheer-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6) rotate(0deg);
  }
  16% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.9) rotate(var(--spin));
  }
}

@keyframes poster-spin {
  to {
    transform: rotate(360deg);
  }
}

@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;
  }
}

@media (max-width: 880px) {
  h1 {
    font-size: 3rem;
  }

  .hero__veil {
    background:
      linear-gradient(180deg, rgba(255, 250, 240, 0.92) 0%, rgba(255, 250, 240, 0.72) 58%, rgba(246, 251, 247, 0.88) 100%);
  }

  .reminder-grid,
  .blessing-layout {
    grid-template-columns: 1fr;
  }

  .reminder-grid {
    gap: 0.8rem;
  }
}

@media (max-width: 560px) {
  .hero {
    min-height: 84svh;
    padding: 3rem 1rem 2.4rem;
  }

  h1 {
    font-size: 2.45rem;
  }

  .hero__lead {
    font-size: 1.05rem;
  }

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

  .countdown__unit {
    min-height: 4.75rem;
  }

  .countdown__unit strong {
    font-size: 1.7rem;
  }

  .button,
  .blessing-row input,
  .poster-actions .button {
    width: 100%;
  }

  .band {
    padding: 3rem 1rem;
  }

  .message-panel {
    padding: 1.35rem;
  }

  .message-panel h2,
  .section-heading h2,
  .blessing-layout h2,
  .poster-dialog h2 {
    font-size: 1.55rem;
  }

  .poster-dialog {
    padding: 1rem;
  }

  .poster-preview {
    min-height: 20rem;
  }

  .poster-preview img {
    width: min(100%, 15.5rem);
  }
}
