:root {
  --paper: #f4efe2;       /* warm ivory washi (the letter) */
  --paper-alt: #ece4d2;
  --desk: #bdb49c;        /* muted taupe surface the letter rests on */
  --ink: #3a3f2c;         /* deep olive-gray body text */
  --green: #33502b;       /* headings / accents */
  --green-bright: #416434;
  --green-deep: #24391e;
  --muted: #6f755a;
  --gold: #9a7c3b;        /* small warm accent */
  --gold-bright: #b6923f;
  --line: rgba(51, 80, 43, 0.22);
  --serif: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --sans: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --jp: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --script: "Sonetha", "Cormorant Garamond", cursive;
}

/* Apple Garamond — used if a licensed copy is placed in fonts/.
   Falls back to EB Garamond (Google Fonts) automatically. */
@font-face {
  font-family: "Apple Garamond";
  src: url("fonts/AppleGaramond.woff2") format("woff2"),
       url("fonts/AppleGaramond.ttf") format("truetype"),
       url("fonts/AppleGaramond.otf") format("opentype");
  font-weight: 400 600;
  font-display: swap;
}

/* Sonetha Script (Gilar Studio) — used only for the couple's names. */
@font-face {
  font-family: "Sonetha";
  src: url("fonts/Sonetha.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  position: relative;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  background-color: var(--paper);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* Paper crinkle relief + fine grain — embossed subtly into the ivory */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    url("paper-relief.svg"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.62' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 700px 700px, 300px 300px;
  background-repeat: repeat, repeat;
  opacity: 0.3;
  mix-blend-mode: soft-light;
}

/* Content wrapper — sits above the full-page paper texture */
.sheet {
  position: relative;
  z-index: 1;
}

/* Paper Shaders WebGL texture — full-bleed, continuous behind the whole page */
#paper-shader {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
}
#paper-shader canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Handmade-washi fibers + flecks over the paper */
.paper-fibers {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("paper-fibers.svg") center / cover no-repeat;
  opacity: 0.5;
  mix-blend-mode: multiply;
}

/* soft warm edge shading, like a scanned card */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 95% at 50% 42%, transparent 60%, rgba(58, 52, 30, 0.10) 100%);
}

/* Watercolor fern sprays framing the page (white bg drops out via multiply) */
.fern {
  position: fixed;
  width: min(30vw, 340px);
  height: min(58vw, 660px);
  background: url("fern3-clean.png?v=1") center / contain no-repeat;
  opacity: 0;                 /* hidden until the watercolor reveal */
  filter: blur(11px);
  transition: opacity 2.2s ease, filter 2.2s ease;
  z-index: 5;
  pointer-events: none;
}
.fern--tl { top: 0; left: 0; transform: scaleY(-1); }        /* hangs down from top-left */
.fern--br { bottom: 0; right: 0; transform: scaleX(-1); }     /* rises from bottom-right */

/* ferns bloom into view like watercolor once the page settles */
body.ferns-in .fern { opacity: 0.85; filter: blur(0); }

/* keep real content above the decorative layers */
section, .footer { position: relative; z-index: 2; }

/* Hamburger toggle — floating, top-right, no bar */
.nav__toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.6rem;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 30px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 40;
}
.nav__toggle span {
  display: block;
  width: 26px;
  height: 1.5px;
  background: var(--green);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
body.menu-open .nav__toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
body.menu-open .nav__toggle span:nth-child(2) { opacity: 0; }
body.menu-open .nav__toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Full-screen menu overlay */
.menu {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 239, 226, 0.97);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
body.menu-open .menu { opacity: 1; visibility: visible; }
body.menu-open { overflow: hidden; }
.menu__inner { text-align: center; }
.menu__mark {
  font-family: var(--serif);
  font-size: clamp(2.25rem, 7vw, 3.25rem);
  color: var(--gold);
  opacity: 0.85;
  margin-bottom: 1.5rem;
}
.menu__links { list-style: none; }
.menu__links li {
  margin: 0.5rem 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
body.menu-open .menu__links li { opacity: 1; transform: none; }
body.menu-open .menu__links li:nth-child(1) { transition-delay: 0.06s; }
body.menu-open .menu__links li:nth-child(2) { transition-delay: 0.10s; }
body.menu-open .menu__links li:nth-child(3) { transition-delay: 0.14s; }
body.menu-open .menu__links li:nth-child(4) { transition-delay: 0.18s; }
body.menu-open .menu__links li:nth-child(5) { transition-delay: 0.22s; }
body.menu-open .menu__links li:nth-child(6) { transition-delay: 0.26s; }
body.menu-open .menu__links li:nth-child(7) { transition-delay: 0.30s; }
body.menu-open .menu__links li:nth-child(8) { transition-delay: 0.34s; }
.menu__links a {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 500;
  color: var(--green);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
}
.menu__links a:hover { color: var(--gold); }

/* HERO */
.hero {
  min-height: 92vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 5rem 1.5rem;
}
.hero__monogram {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 7vw, 3.75rem);
  color: var(--green);
  line-height: 1;
  margin-bottom: 1.5rem;
  opacity: 0.85;
}
.hero__eyebrow {
  font-family: var(--serif);
  font-style: normal;
  letter-spacing: 0.1em;
  font-size: clamp(1rem, 3vw, 1.3rem);
  color: var(--gold);
  margin-bottom: 0.75rem;
}
.hero__names {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3.5rem, 14vw, 8rem);
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--green);
}
.hero__names span { color: var(--green-bright); font-weight: 400; margin: 0 0.12em; }
.hero__invite {
  font-family: var(--serif);
  font-style: normal;
  font-size: clamp(1rem, 3vw, 1.3rem);
  color: var(--ink);
  margin: 1rem 0 2rem;
}
.hero__date {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

/* BUTTONS + LINKS */
.btn {
  display: inline-block;
  padding: 0.9rem 2.75rem;
  background: linear-gradient(160deg, var(--green-bright), var(--green-deep));
  color: var(--paper);
  text-decoration: none;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 2px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(36, 57, 30, 0.22);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(36, 57, 30, 0.30); }
.link {
  color: var(--green);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
}
.link:hover { color: var(--green-deep); border-color: var(--green); }

/* RSVP tear-off reply slip */
.rsvp-slip {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
}
.rsvp-slip__perf {
  border-top: 2px dashed var(--gold);
  opacity: 0.5;
  margin: 0 8px 11px;
}
.tearstrip {
  position: relative;
  display: inline-block;
  padding: 1.05rem 3.4rem;
  white-space: nowrap;
  background: linear-gradient(160deg, var(--green-bright), var(--green-deep));
  color: var(--paper);
  text-decoration: none;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 500;
  -webkit-mask: url("strip-mask.svg") center / 100% 100% no-repeat;
  mask: url("strip-mask.svg") center / 100% 100% no-repeat;
  transform-origin: top center;
  transition: transform 0.45s cubic-bezier(0.2, 0.75, 0.25, 1), filter 0.45s ease;
  filter: drop-shadow(0 5px 12px rgba(36, 57, 30, 0.26));
}
.rsvp-slip:hover .tearstrip,
.rsvp-slip:focus-within .tearstrip {
  transform: perspective(720px) rotateX(18deg) translateY(-2px);
  filter: drop-shadow(0 22px 26px rgba(36, 57, 30, 0.34));
}
.tearstrip:active {
  transform: perspective(720px) rotateX(30deg) translateY(2px);
}
.rsvp-slip__hint {
  margin-top: 0.85rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* SECTIONS */
.section {
  max-width: 860px;
  margin: 0 auto;
  padding: 5.5rem 1.5rem;
  text-align: center;
}
.section--alt { max-width: none; background: rgba(51, 80, 43, 0.06); border-block: 1px solid var(--line); }
.section--alt > * { max-width: 860px; margin-left: auto; margin-right: auto; }
.section__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
}
.section__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 6vw, 3.25rem);
  color: var(--green);
  margin-bottom: 2.5rem;
}
.section__lead { color: var(--muted); margin-bottom: 2rem; }
.section__title::after {
  content: "";
  display: block;
  width: 54px;
  height: 1px;
  background: var(--gold);
  margin: 1rem auto 0;
  opacity: 0.7;
}

/* OUR MOMENTS — vertical slideshow with a torn/deckled edge */
.slideshow {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
}
.slides {
  position: relative;
  aspect-ratio: 3 / 4;
  /* rough hand-torn edge */
  -webkit-mask: url("frame-mask.svg") center / 100% 100% no-repeat;
  mask: url("frame-mask.svg") center / 100% 100% no-repeat;
  filter: drop-shadow(0 14px 30px rgba(40, 36, 22, 0.22));
}
.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.slide.is-active { opacity: 1; }
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.slide__ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: rgba(51, 80, 43, 0.06);
  color: var(--muted);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

/* arrows */
.slideshow__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(244, 239, 226, 0.85);
  color: var(--green);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(40, 36, 22, 0.18);
  transition: background 0.2s ease;
}
.slideshow__nav:hover { background: #fff; }
.slideshow__prev { left: 0.75rem; }
.slideshow__next { right: 0.75rem; }

/* dots */
.slideshow__dots {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
}
.dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease;
}
.dot.is-active { background: var(--gold); }

/* CARDS */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.card {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--line);
  padding: 2.25rem 1.5rem;
  border-radius: 3px;
}
.card h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--green);
  margin-bottom: 0.5rem;
}
.card__time { color: var(--gold); letter-spacing: 0.1em; margin-bottom: 0.75rem; }
.card p { color: var(--ink); margin-bottom: 0.75rem; }

/* TIMELINE */
.timeline { list-style: none; max-width: 460px; margin: 0 auto; text-align: left; }
.timeline li {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.timeline__time { min-width: 90px; color: var(--gold); letter-spacing: 0.08em; }

/* RSVP */
.rsvp__embed {
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.6);
}
.rsvp__embed iframe { display: block; }
.rsvp__fallback { margin-top: 1rem; color: var(--muted); font-size: 0.9rem; }

/* FAQ */
.faq { max-width: 620px; margin: 0 auto; text-align: left; }
.faq details { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.faq summary {
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--green);
  list-style: none;
  display: flex;
  justify-content: space-between;
}
.faq summary::after { content: "+"; color: var(--gold); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink); margin-top: 0.75rem; }

/* FOOTER */
.footer {
  text-align: center;
  padding: 3.5rem 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}
.footer__note { margin-top: 0.5rem; font-size: 0.85rem; font-family: var(--sans); }

/* ===== WELCOME / SPLASH PAGE ===== */
.splash {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 3rem 1.5rem;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* dark green scrim keeps the messages legible over the photo */
.splash__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(28, 36, 24, 0.58), rgba(28, 36, 24, 0.64)),
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(20, 26, 16, 0.45) 100%);
}
.splash__content {
  position: relative;
  z-index: 1;
  max-width: 960px;
  text-align: center;
  color: var(--paper);
}
.splash__eyebrow {
  font-family: var(--serif);
  letter-spacing: 0.1em;
  font-size: clamp(1rem, 3vw, 1.3rem);
  color: var(--gold-bright);
  margin-bottom: 0.6rem;
}
.splash__names {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3.25rem, 12vw, 6.5rem);
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}
.splash__names span { margin: 0 0.12em; color: var(--gold-bright); }
.splash__messages {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 2.5rem;
  margin: 2.25rem auto 2.5rem;
}
.splash__msg {
  flex: 1 1 0;
  max-width: 34ch;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.3vw, 1.7rem);
  line-height: 1.95;
  color: #f3efe4;
}
.splash__msg[lang="ja"] { font-family: var(--jp); line-height: 2.15; }
.splash__divider {
  width: 1px;
  align-self: stretch;
  background: linear-gradient(transparent, rgba(236, 214, 162, 0.7), transparent);
}
@media (max-width: 720px) {
  .splash__messages { flex-direction: column; gap: 1.75rem; align-items: center; }
  .splash__msg { max-width: 40ch; }
  .splash__divider { width: 60%; height: 1px; background: linear-gradient(90deg, transparent, rgba(236, 214, 162, 0.7), transparent); }
}

/* ===== PAGE TRANSITIONS ===== */
/* every page gently fades in on load, over the shared ivory tone */
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
body { animation: pageIn 0.7s ease both; }

/* the welcome page fades out (to ivory) before handing off to the main site */
.splash { transition: opacity 0.6s ease; }
body.leaving .splash { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  .splash { transition: none; }
  .fern { opacity: 0.85; filter: none; transition: none; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .fern { width: 40vw; }
  body.ferns-in .fern { opacity: 0.75; }
}
