:root {
  color-scheme: light;
  font-size: clamp(15px, 1.1vw + 14px, 17px);
  --ink: #3a2f2a;
  --ink-muted: #6b5a50;
  --paper: #f4efe4;
  --paper-deep: #f4efe4;
  --accent: #b8895a;
  --accent-strong: #7a3b2a;
  --frame: #d3b38f;
  --shadow: 0 18px 40px rgba(58, 47, 42, 0.12);
  --card-radius: 12px;
  --card-border: 1px solid rgba(210, 196, 173, 0.55);
  --card-shadow: 0 10px 22px rgba(58, 47, 42, 0.08);
  --card-gap: var(--space-2);
  --divider-line: linear-gradient(90deg, transparent, rgba(210, 196, 173, 0.6), transparent);
  --paper-noise: var(--paper-grain);
  --music-accent: rgba(170, 2, 2, 0.52);
  --music-accent-strong: #b21a1a;
  --enter-duration: 1.8s;
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Crect width='220' height='220' fill='none'/%3E%3Cg fill='%23d6cab9' fill-opacity='0.16'%3E%3Ccircle cx='18' cy='24' r='1'/%3E%3Ccircle cx='46' cy='52' r='1.2'/%3E%3Ccircle cx='82' cy='34' r='0.9'/%3E%3Ccircle cx='112' cy='68' r='1.1'/%3E%3Ccircle cx='152' cy='30' r='0.9'/%3E%3Ccircle cx='30' cy='112' r='1'/%3E%3Ccircle cx='70' cy='118' r='1.1'/%3E%3Ccircle cx='104' cy='126' r='0.9'/%3E%3Ccircle cx='170' cy='116' r='1'/%3E%3Ccircle cx='42' cy='156' r='0.9'/%3E%3Ccircle cx='92' cy='170' r='1.2'/%3E%3Ccircle cx='138' cy='182' r='0.8'/%3E%3C/g%3E%3C/svg%3E");
  --space-1: 5px;
  --space-2: 10px;
  --space-3: 16px;
  --space-4: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Serif SC", "Microsoft YaHei",
    "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.6;
  background:
    var(--paper-grain),
    linear-gradient(180deg, #f4efe4 0%, #f1e9d9 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

.invitation {
  width: 100%;
  background:
    var(--paper-grain),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  box-shadow: none;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  padding-bottom: 64px;
  min-height: 100vh;
}

.invitation.is-entering {
  animation: page-rise 0.9s ease-out both;
}

.section-inner {
  width: min(40ch, 100%);
  margin: 0 auto;
  padding: 0 clamp(12px, 4vw, 20px);
}

.hero-inner {
  width: 100%;
  margin: 0;
  padding: 0;
}
.section-inner > * + * {
  margin-top: var(--space-2);
}

.hero {
  position: relative;
  padding: 0 0 calc(var(--space-4) + var(--space-1));
}

.hero-frame {
  border: none;
  padding: 0;
  background: transparent;
}

.hero-image {
  width: 100%;
  display: block;
  border-radius: 0;
  aspect-ratio: 9 / 13;
  object-fit: cover;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.hero-image.is-loading {
  opacity: 0;
}

.hero-content {
  width: min(40ch, 100%);
  margin: var(--space-3) auto 0;
  display: grid;
  gap: var(--space-2);
  padding: 0 clamp(12px, 4vw, 20px);
}

.hero-overlay {
  text-align: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.title {
  margin: var(--space-1) 0 var(--space-1);
  font-size: 1.9rem;
  letter-spacing: 0.16em;
  font-weight: 600;
  line-height: 1.2;
}

.subtitle {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink-muted);
  line-height: 1.5;
  letter-spacing: 0.08em;
  font-weight: 500;
  font-family: "Noto Serif SC", "Songti SC", "STSong", "PingFang SC", "Microsoft YaHei", serif;
}

.hero-card {
  margin-top: var(--space-2);
  background: rgba(255, 252, 247, 0.85);
  border: var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--space-3);
  display: grid;
  gap: var(--space-2);
  text-align: center;
  box-shadow: none;
}

.names {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.hero-divider {
  width: 70%;
  height: 1px;
  margin: 2px auto 4px;
  background: linear-gradient(90deg, transparent, #d6bda0, transparent);
}

.amp {
  color: var(--accent-strong);
}

.facts {
  display: grid;
  gap: var(--space-2);
}

.fact-item {
  display: grid;
  gap: 4px;
}

.fact-label {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--accent-strong);
}

.fact-value {
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.5;
}

.fact-value.subtle {
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.section {
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  padding: var(--space-3) 0 calc(var(--space-3) + var(--space-1));
}

.section + .section {
  border-top: none;
}

.info-card {
  text-align: left;
}

.line {
  margin: 4px 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.section-title {
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  text-align: left;
  margin-bottom: var(--space-1);
  line-height: 1.3;
}

.section-desc {
  text-align: left;
  font-size: 1rem;
  color: var(--ink-muted);
  margin: 0 0 var(--space-2);
  line-height: 1.6;
}

.section-hint {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: -2px 0 var(--space-2);
}

.detail-grid {
  margin-top: var(--space-2);
  display: grid;
  gap: var(--card-gap);
  text-align: left;
}

.detail-row {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--card-radius);
  background: rgba(255, 252, 247, 0.85);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}

.detail-label {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  color: var(--accent-strong);
}

.detail-value {
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.6;
}

.actions {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.actions.single {
  margin-bottom: 0;
}

.map-card {
  position: relative;
  border-radius: var(--card-radius);
  overflow: hidden;
  border: var(--card-border);
  background: rgba(255, 252, 247, 0.85);
  box-shadow: var(--card-shadow);
}

.map-image {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #f5efe4;
}

.map-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--ink-muted);
}

.map-overlay span {
  display: inline-block;
  background: rgba(255, 253, 248, 0.92);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
}


.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-align: center;
  min-height: 44px;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(90deg, #c59a6d, #a7734c);
  color: #fff;
  box-shadow: 0 10px 20px rgba(122, 59, 42, 0.2);
}

.btn-ghost {
  background: #fff7eb;
  border-color: #e7d5c2;
}



.gallery {
  padding-bottom: calc(var(--space-4) + var(--space-2));
}

.gallery-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.gallery-item {
  border-radius: var(--card-radius);
  overflow: hidden;
  border: var(--card-border);
  background: rgba(255, 252, 247, 0.85);
  cursor: zoom-in;
}

.gallery-item img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f4efe4;
}

.gallery-video {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f2e7d6;
}

.contact-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--card-gap);
  margin: var(--space-2) 0 var(--space-2);
}

.contact-actions .btn {
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 18px;
  border-radius: var(--card-radius);
  background: rgba(255, 252, 247, 0.95);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}

.contact-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.08em;
}

.contact-sub {
  font-size: 0.85rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.actions.secondary {
  margin: 10px 0 0;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: var(--card-radius);
  background: #fffdf8;
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}

.timeline-time {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-strong);
}

.timeline-content {
  display: grid;
  gap: 4px;
}

.timeline-title {
  font-size: 0.95rem;
  color: var(--ink);
}

.timeline-sub {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.music-toggle {
  position: fixed;
  right: 16px;
  top: 16px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: var(--music-accent);
  box-shadow: 0 10px 24px rgba(122, 59, 42, 0.2);
  z-index: 16;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.music-toggle::before {
  content: "";
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: url("assets/music-disc.png") center / cover no-repeat;
  box-shadow: none;
}

.music-toggle.is-playing::before {
  animation: disc-spin 3.2s linear infinite;
}

.music-toggle.is-playing {
  filter: drop-shadow(0 8px 18px rgba(122, 59, 42, 0.35));
  background: var(--music-accent-strong);
}


.music-badge {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--music-accent-strong);
  opacity: 0.9;
  z-index: 1;
}

.music-badge::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 2px;
  background: var(--music-accent-strong);
  transform: translate(-50%, -50%) rotate(-45deg);
  border-radius: 999px;
}

.music-toggle.is-playing .music-badge {
  display: none;
}

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

.music-toggle:active {
  transform: translateY(0) scale(0.98);
}

.music-toggle:focus-visible {
  outline: 2px solid rgba(184, 137, 90, 0.6);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fab {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 18;
  display: grid;
  justify-items: end;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab.left {
  left: 16px;
  right: auto;
  justify-items: start;
}

.fab.snap-left {
  left: 10px;
  right: auto;
  justify-items: start;
}

.fab.snap-right {
  right: 10px;
  left: auto;
  justify-items: end;
}

.fab-toggle {
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  background: linear-gradient(90deg, #c59a6d, #a7734c);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  position: relative;
  padding-right: 28px;
}

.fab-toggle::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid rgba(255, 255, 255, 0.9);
  transform: translateY(-40%);
  transition: transform 0.2s ease;
}

.fab-toggle[aria-expanded="true"]::after {
  transform: translateY(-40%) rotate(180deg);
}

.fab-toggle::before {
  content: "";
  position: absolute;
  inset: -6px;
  pointer-events: none;
  display: none;
}

.fab-panel {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.96);
  border: var(--card-border);
  box-shadow: 0 16px 34px rgba(58, 47, 42, 0.16);
  backdrop-filter: blur(10px);
}

.fab-panel .btn {
  width: 100%;
}

.note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: var(--space-2) 0 0;
  position: relative;
}

.note::before {
  content: "";
  display: block;
  width: 64%;
  height: 1px;
  margin: 0 auto var(--space-1);
  background: var(--divider-line);
}

.double-happiness-section {
  padding-top: 6px;
  padding-bottom: 18px;
}

.double-happiness-image {
  width: min(150px, 52vw);
  margin: 0 auto;
  display: block;
  opacity: 0.95;
}


.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(58, 47, 42, 0.9);
  color: #fff;
  font-size: 12px;
  z-index: 20;
}

.enter-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 239, 228, 0.92);
  opacity: 0;
  pointer-events: none;
  z-index: 24;
  visibility: hidden;
  transition: opacity var(--enter-duration, 1.8s) ease-out;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  background-image: url("assets/double-happiness.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: min(200px, 60vw);
}

.enter-overlay-image {
  width: min(200px, 60vw);
  height: auto;
  display: block;
  opacity: 0.95;
}

.enter-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.enter-overlay.is-fading {
  opacity: 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 8, 0.75);
  display: grid;
  place-items: center;
  z-index: 30;
  padding: 16px;
}

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: var(--card-radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.hidden {
  display: none;
}


@keyframes page-rise {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes disc-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}


@media (prefers-reduced-motion: reduce) {
  .music-toggle::before {
    animation: none;
  }
  .music-toggle.is-playing::after {
    animation: none;
  }
}

@media (max-width: 360px) {
  .invitation {
    border-radius: var(--card-radius);
  }

  .title {
    font-size: 26px;
  }

  .names {
    font-size: 18px;
  }

  .contact-actions {
    grid-template-columns: 1fr;
  }
}

.invite-block {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--card-radius);
  background: transparent;
  box-shadow: none;
  position: relative;
  text-align: center;
}

.invite-block::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  background: var(--paper-noise);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}

.invite-line {
  margin: 0;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: 0.08em;
  font-family: "Noto Serif SC", "Songti SC", "STSong", "PingFang SC", "Microsoft YaHei", serif;
  position: relative;
  z-index: 1;
}

.invite-line:empty {
  display: none;
}

.invite-line + .invite-line {
  margin-top: var(--space-1);
}
