@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;1,400&family=Noto+Serif+TC:wght@400;500&family=Pinyon+Script&display=swap');

:root {
  --paper: #fbf6eb;
  --ink: #29251e;
  --brown: #79512f;
  --gold: #aa8661;
  --line: #bba180;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: 'Noto Serif TC', serif;
  font-size: 15px;
  line-height: 1.8;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
.site-header {
  position: absolute;
  inset: 0 0 auto;
  height: 100px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 5%;
  color: white;
}
.monogram {
  font-family: 'Pinyon Script', cursive;
  font-size: 76px;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  transform: rotate(-7deg);
  font-weight: 400;
}
.monogram i { font-size: .43em; margin: 0 -5px 0 -9px; font-weight: 400; }
.monogram span:last-child { margin-left: -3px; }
.menu-toggle { border: 0; background: none; padding: 12px; color: inherit; }
.menu-toggle span { display: block; width: 26px; height: 1px; background: currentColor; margin: 7px 0; }
#navigation {
  position: absolute;
  right: 5%;
  top: 88px;
  min-width: 200px;
  background: var(--paper);
  color: var(--brown);
  padding: 15px 25px;
  box-shadow: 0 8px 30px #2b1c2220;
}
#navigation a { display: block; padding: 10px; letter-spacing: 3px; }
.hero { position: relative; height: 1050px; max-height: 115svh; min-height: 730px; color: white; overflow: hidden; }
.hero-photo { width: 100%; height: 100%; object-fit: cover; object-position: center 58%; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(#1d150e22, transparent 40%, #1d150e44); pointer-events: none; }
.hero-kicker { position: absolute; top: 114px; left: 6%; letter-spacing: 5px; line-height: 1.6; font: 15px/1.6 'Cormorant Garamond', serif; z-index: 1; }
.hero-title { position: absolute; bottom: 28px; left: 0; right: 0; text-align: center; z-index: 1; }
h1 { font: italic 100px/.95 'Cormorant Garamond', serif; margin: 0 0 30px; text-shadow: 0 2px 18px #20181040; }
h1 em { display: block; font-size: 32px; line-height: 1.5; }
.hero-title p { font: 17px/1.7 'Cormorant Garamond', serif; letter-spacing: 5px; }
.countdown-section { position: relative; text-align: center; padding: 30px 20px 45px; color: var(--brown); background: linear-gradient(160deg, #ffffff66, transparent), var(--paper); }
.countdown-section > p:first-child { letter-spacing: 3px; font-size: 14px; }
.countdown { display: flex; justify-content: center; gap: 34px; margin-top: 5px; }
.countdown div { display: flex; flex-direction: column; }
.countdown b { font: italic 47px/1.3 'Cormorant Garamond', serif; }
.countdown span { font: 11px 'Cormorant Garamond', serif; letter-spacing: 2px; }
.botanical { font-size: 44px; color: #ac8860; line-height: 1; transform: rotate(-25deg); margin: 14px auto 0; }
.motto { font: italic 17px/1.5 'Cormorant Garamond', serif; letter-spacing: 2px; margin: 4px 0 12px; }
.scroll { font: 11px 'Cormorant Garamond', serif; letter-spacing: 2px; }
.scroll span { display: block; margin-top: 5px; }
.section { padding: 75px 30px; max-width: 850px; margin: auto; text-align: center; }
.section-heading { margin-bottom: 34px; }
.eyebrow { font: 14px/1.7 'Cormorant Garamond', serif; letter-spacing: 4px; margin: 0 0 0; }
h2 { font-weight: 400; font-size: 30px; letter-spacing: 8px; margin: 0 0 18px; line-height: 1.7; }
.divider { display: block; height: 1px; width: 32px; background: var(--gold); margin: 15px auto; }
.weekday { font: 14px 'Cormorant Garamond', serif; letter-spacing: 4px; margin: 15px 0 0; }
.event-date { font: 40px 'Cormorant Garamond', serif; margin: 0 0 25px; }
.event-columns { display: grid; grid-template-columns: 1fr 1fr; margin: 0 auto 22px; max-width: 650px; }
.event-columns > div { padding: 0 14px; }
.event-columns > div + div { border-left: 1px solid var(--line); }
h3 { font-size: 20px; letter-spacing: 3px; font-weight: 400; margin: 2px 0; }
.event-columns p { margin: 0; line-height: 1.8; letter-spacing: 1px; }
.venue-en { font-family: 'Cormorant Garamond', serif; font-size: 18px; }
.line-icon { font: 42px/1.2 Georgia, serif; display: block; color: var(--brown); margin-bottom: 10px; }
.venue-banner { background: linear-gradient(120deg, #201a13, #77512e, #2b2019); color: #f4e8d7; padding: 28px 15px; margin-top: 30px; }
.venue-banner span { font: 32px 'Cormorant Garamond', serif; letter-spacing: 9px; }
.venue-banner p { font-size: 11px; letter-spacing: 3px; margin: 0; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0 15px; }
.button { border: 1px solid var(--brown); background: transparent; border-radius: 2px; padding: 10px 5px; font-size: 14px; letter-spacing: 1px; color: var(--brown); }
.filled { color: var(--paper); background: var(--brown); }
.button:hover { filter: brightness(.9); }
.transport { padding: 5px 10px 25px; }
.transport h2 { margin: 0 0 15px; font-size: 27px; }
.transport-row { display: grid; grid-template-columns: 60px 1fr; gap: 18px; text-align: left; max-width: 530px; margin: 18px auto; }
.transport-row svg { width: 48px; height: 48px; fill: none; stroke: var(--brown); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.transport-row h3 { font-size: 19px; line-height: 1.4; }
.transport-row p { margin: 0; font-size: 14px; letter-spacing: 1px; line-height: 1.7; }
.transport-source { font-size: 11px; color: var(--brown); border-bottom: 1px solid var(--line); }
.timeline { border-top: 1px solid var(--line); padding: 12px 0 0; }
.timeline h2 { font-size: 27px; margin-bottom: 10px; }
.timeline ol { list-style: none; padding: 0; max-width: 470px; margin: 0 auto; }
.timeline li { display: grid; grid-template-columns: 45px 90px 1fr; gap: 16px; text-align: left; align-items: center; min-height: 75px; }
.timeline li > div { padding: 8px 0 8px 28px; border-left: 1px solid var(--gold); position: relative; }
.timeline li > div::before { content: ''; width: 6px; height: 6px; background: var(--brown); border-radius: 50%; position: absolute; left: -3.5px; top: 25px; }
.timeline-icon { font-size: 32px; color: var(--brown); }
.timeline time { font: 18px 'Cormorant Garamond', serif; letter-spacing: 1px; }
.timeline h3 { font-size: 19px; }
.timeline li p { font: 12px 'Cormorant Garamond', serif; letter-spacing: 3px; margin: 0; }
.story { padding-top: 50px; }
.story .section-heading { margin-bottom: 45px; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 2px; }
.gallery .ring { grid-column: 1/-1; aspect-ratio: 2.65; object-position: center 48%; }
.gallery .portrait { aspect-ratio: .8; }
.gallery .bride { object-position: center 45%; }
.gallery .stairs { grid-column: 1/-1; aspect-ratio: 2.6; object-position: center 53%; }
.gallery .groom, .gallery .couple { aspect-ratio: 1.1; }
.gallery .groom { object-position: 57% center; }
.gallery .couple { object-position: center 40%; }
.dress { padding-top: 45px; }
.dress-intro { font-size: 17px; letter-spacing: 3px; margin: 35px 0 25px; }
.dress-title { font-size: 28px; letter-spacing: 6px; }
.outfits { display: flex; align-items: flex-end; justify-content: center; gap: 15px; margin: 25px auto 15px; max-width: 540px; }
.outfits svg { width: 23%; max-height: 260px; }
.swatches { display: flex; justify-content: center; gap: 24px; margin: 10px 0 20px; }
.swatches span { width: 44px; height: 44px; border-radius: 50%; background: #dfc5ac; }
.swatches span:nth-child(2) { background: #af827c; }
.swatches span:nth-child(3) { background: #747356; }
.swatches span:nth-child(4) { background: #765133; }
.swatches span:nth-child(5) { background: #202529; }
.dress-note { font-size: 14px; letter-spacing: 1px; line-height: 2; }
.thanks { padding-top: 10px; }
.thanks .botanical { margin-left: 60%; }
.thanks h2 { font: 100px/1.2 'Pinyon Script', cursive; color: var(--brown); letter-spacing: 0; margin: 0 0 10px; }
.thanks-copy { letter-spacing: 3px; font-size: 16px; line-height: 2; margin: 30px 0 20px; }
.signature { font: italic 37px 'Cormorant Garamond', serif; color: var(--brown); margin: 25px 0 5px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
@media (min-width: 900px) {
  .hero { height: 1000px; max-height: none; }
  .hero-photo { object-position: center 65%; }
  .hero-title { bottom: 55px; }
  h1 { font-size: 115px; }
  .site-header { padding-left: 8%; padding-right: 8%; }
}
@media (max-width: 600px) {
  .site-header { height: 85px; padding: 6px 22px; }
  .monogram { font-size: 67px; }
  .hero { height: 900px; max-height: 110svh; min-height: 720px; }
  .hero-photo { object-position: center center; }
  .hero-kicker { top: 90px; left: 27px; font-size: 14px; }
  .hero-title { bottom: 18px; }
  h1 { font-size: 76px; margin-bottom: 20px; }
  h1 em { font-size: 26px; }
  .hero-title p { font-size: 15px; }
  .section { padding: 65px 17px; }
  h2 { font-size: 27px; letter-spacing: 6px; }
  .section-heading { margin-bottom: 30px; }
  .event-date { font-size: 34px; }
  .event-columns > div { padding: 0 7px; }
  .event-columns h3 { font-size: 18px; letter-spacing: 2px; }
  .event-columns p { font-size: 13px; }
  .event-columns .venue-en { font-size: 16px; }
  .button { font-size: 12px; letter-spacing: 0; }
  .actions { gap: 9px; }
  .transport { padding: 0 5px 25px; }
  .transport-row { grid-template-columns: 45px 1fr; gap: 15px; }
  .transport-row svg { width: 42px; }
  .transport-row p { font-size: 12px; }
  .timeline li { grid-template-columns: 34px 65px 1fr; gap: 12px; }
  .timeline li > div { padding-left: 23px; }
  .story { padding: 35px 10px; }
  .gallery { gap: 5px; }
  .dress { padding-top: 45px; }
  .dress-intro { font-size: 14px; letter-spacing: 2px; }
  .outfits { gap: 4px; }
  .swatches { gap: 19px; }
  .swatches span { width: 36px; height: 36px; }
  .dress-note { font-size: 12px; }
  .thanks h2 { font-size: 78px; }
  .thanks-copy { font-size: 14px; letter-spacing: 2px; }
  .signature { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
/* 喜帖以手機直式構圖為主，桌面保留相同比例。 */
main { max-width: 640px; margin: 0 auto; background: var(--paper); }
.site-header { max-width: 640px; width: 100%; left: 50%; right: auto; transform: translateX(-50%); }
.botanical svg { width: 65px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1; }
@media (min-width: 900px) {
  .site-header { padding-left: 30px; padding-right: 30px; }
  .hero-title { bottom: 22px; }
  h1 { font-size: 90px; }
}
/* 姓名放在照片中段左側，避開下方新人；日期保留在底部。 */
.hero-title {
  inset: 0;
  text-align: left;
  pointer-events: none;
}
.hero-title h1 {
  position: absolute;
  top: 43%;
  left: 6%;
  width: 42%;
  margin: 0;
  transform: translateY(-50%);
  font-size: clamp(42px, 11vw, 78px);
  line-height: 1.05;
  text-align: center;
}
.hero-title h1 em {
  font-size: .36em;
  line-height: 1.6;
}
.hero-title > p {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
}


/* 首頁只改透明度，保留姓名原本的位置與照片構圖。 */
@keyframes wedding-name-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-title h1 {
    animation: wedding-name-in 1.5s ease-out both;
  }
  .reveal-pending {
    opacity: 0;
    transform: translateY(14px);
  }
  .reveal-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 850ms ease-out, transform 850ms ease-out;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-title h1 { animation: none; }
  .reveal-pending, .reveal-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* 按下後才載入音樂；不遮住喜帖的主要內容。 */
.music-toggle {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--gold);
  border-radius: 28px;
  background: var(--paper);
  color: var(--brown);
  box-shadow: 0 3px 16px #30200f20;
  font-size: 13px;
}
.music-toggle > span:first-child { font-size: 21px; line-height: 1; }
.music-toggle[aria-pressed="true"] { background: var(--brown); color: var(--paper); }
.music-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.music-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 信封式入口：不支援 JavaScript 時直接顯示喜帖。 */
.cover-is-open { overflow: hidden; }
.cover-is-open .hero-title h1 { animation: none; }
.invitation-cover[hidden] { display: none; }
.invitation-cover {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: radial-gradient(ellipse at center, #fffdf7, #eee3d1);
}
.cover-card {
  width: min(100%, 450px);
  padding: 55px 24px;
  border: 1px solid var(--line);
  outline: 1px solid #bba18066;
  outline-offset: 7px;
  text-align: center;
  color: var(--brown);
}
.cover-monogram { font-size: 105px; margin: 35px auto 25px; }
.cover-card h2 { font: 35px/1.4 'Cormorant Garamond', serif; letter-spacing: 1px; margin: 15px 0; }
.cover-date { font: 12px/1.8 'Cormorant Garamond', serif; letter-spacing: 2px; }
.cover-open {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  min-height: 48px;
  padding: 12px 25px;
  margin-top: 24px;
  background: var(--brown);
  color: var(--paper);
  border: 1px solid var(--brown);
  letter-spacing: 3px;
  font-size: 14px;
}
.cover-open:hover { background: #603e23; }
.cover-hint { font-size: 11px; letter-spacing: 1px; margin: 18px 0 0; }
.music-status.music-notice {
  position: fixed;
  width: auto;
  height: auto;
  clip-path: none;
  white-space: normal;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 30;
  padding: 12px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 12px;
}
