:root {
  --vh: 100vh;
}

body {
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #000;
  font-family: 'Sacramento', cursive;
}

.hero {
  position: relative;
  height: var(--vh);
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  animation: bgFade 36s infinite;
}

.hero-bg.bg1 { background-image: url('../画像/上段1.jpg'); animation-delay: 0s; }
.hero-bg.bg2 { background-image: url('../画像/上段2.jpg'); animation-delay: 6s; }
.hero-bg.bg3 { background-image: url('../画像/上段3.jpg'); animation-delay: 12s; }
.hero-bg.bg4 { background-image: url('../画像/上段4.jpg'); animation-delay: 18s; }
.hero-bg.bg5 { background-image: url('../画像/上段5.jpg'); animation-delay: 24s; }
.hero-bg.bg6 { background-image: url('../画像/上段6.jpg'); animation-delay: 30s; }

@keyframes bgFade {
  0% { opacity: 0; }
  10% { opacity: 1; }
  30% { opacity: 1; }
  40% { opacity: 0; }
  100% { opacity: 0; }
}

.typing {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid rgba(255,255,255,0.8);
  opacity: 0;
  animation-fill-mode: forwards;
  letter-spacing: 0.05em;
  text-shadow: 0 0 14px rgba(255,255,255,0.7);
}

.wedding {
  font-size: 4.8rem;
  animation:
    typingWedding 2.2s steps(24) forwards 0.2s,
    blink 0.8s step-end 2.2s forwards;
}

.info {
  font-size: 3.0rem;
  margin-top: 5px;
  animation:
    typingInfo 2s steps(26) forwards 2.4s,
    blink 0.8s step-end 4.4s forwards;
}

@keyframes typingWedding {
  from { width: 0; opacity: 1; }
  to   { width: 100%; opacity: 1; border-right: 0; }
}

@keyframes typingInfo {
  from { width: 0; opacity: 1; }
  to   { width: 100%; opacity: 1; border-right: 0; }
}

@keyframes blink {
  0% { border-color: rgba(255,255,255,0.8); }
  50% { border-color: transparent; }
  100% { border-color: transparent; border-right: 0; }
}

.couple-name {
  font-family: 'Noto Serif JP', serif;
  font-size: 2.2rem;
  color: #fff;
  opacity: 0;
  margin-top: 30px;
  animation: fadeInName 1.6s ease forwards;
  animation-delay: 4.6s;
}

.wedding-date {
  font-family: 'Noto Serif JP', serif;
  font-size: 1.6rem;
  color: #fff;
  opacity: 0;
  margin-top: 8px;
  letter-spacing: 0.1em;
  animation: fadeInDate 1.6s ease forwards;
  animation-delay: 5.2s;
}

@keyframes fadeInName {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDate {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-envelope {
  min-height: 100vh;
  background: url('../画像/background_texture.jpg') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 0;
  margin-bottom: 0;
}

.envelope-wrapper {
  width: min(90vw, 260px);
  height: calc(min(90vw, 260px) * 0.66);
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1200px;
  overflow: visible;
}

.envelope {
  position: relative;
  width: 100%;
  height: 100%;
  background: #f5f1e8;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.12));
  cursor: pointer;
  overflow: hidden;
}

.envelope.open {
  overflow: visible;
}

.flap {
  position: absolute;
  top: -0.5%;
  left: 50%;
  width: 100%;
  height: 50%;
  transform-origin: top;
  transform: translateX(-50%) rotateX(0deg);
  transition: transform 0.8s ease;
}

.flap svg {
  width: 100%;
  height: 100%;
}

.envelope.open .flap {
  transform: translateX(-50%) rotateX(180deg);
}

.seal {
  position: absolute;
  bottom: 45%;
  left: 50%;
  transform: translateX(-50%);
  width: 20%;
  height: 20%;
  background: url('../画像/seal.png') center/contain no-repeat;
  transition: opacity 0.6s ease, transform 0.6s ease;
  z-index: 5;
}

.seal.open {
  opacity: 0;
  transform: translateX(-50%) scale(0.2) rotate(40deg);
}

.touch-inside {
  position: absolute;
  top: 62%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Noto Serif JP', serif;
  font-size: 0.9rem;
  color: #555;
  opacity: 0.9;
  text-align: center;
  pointer-events: none;
}

.letter {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(90vw, 430px);
  height: 520px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 1s ease;
  z-index: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.fold {
  width: min(90vw, 430px);
  height: calc(min(90vw, 430px) * 1.41 / 3);
  background: #ffffff;
  border: 4px double #b22222;
  padding: 18px 22px;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.05);
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex-direction: column;
  font-family: 'Noto Serif JP', serif;
  font-size: 0.78rem;
  line-height: 1.6;
}

.date-font {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.85rem;
}

.flower {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 60px;
  opacity: 0.9;
}

.fold-top {
  transform-origin: bottom;
  transform: rotateX(180deg);
  transition: transform 1s ease 0.6s;
  border-bottom: 2px solid rgba(0,0,0,0.15);
}

.fold-middle {
  z-index: 3;
  border-top: 2px solid rgba(0,0,0,0.15);
  border-bottom: 2px solid rgba(0,0,0,0.15);
}

.fold-bottom {
  transform-origin: top;
  transform: rotateX(-180deg);
  transition: transform 1s ease 1.2s;
  border-top: 2px solid rgba(0,0,0,0.15);
}

.envelope.open #letter {
  opacity: 1;
  transform: translateX(-50%);
}

.envelope.open .fold-top { transform: rotateX(0deg); }
.envelope.open .fold-bottom { transform: rotateX(0deg); }

.envelope:not(.open) #letter {
  opacity: 0;
  transform: translateX(-50%) translateY(100%) scale(1);
}

.envelope:not(.open) .fold-top {
  transform: rotateX(180deg);
}

.envelope:not(.open) .fold-bottom {
  transform: rotateX(-180deg);
}

.countdown {
  margin-top: 0px;
  text-align: center;
  width: 100%;
  font-family: 'Noto Serif JP', serif;
  color: #fff;
  background: url('../画像/wedding_bg.jpg') center/cover no-repeat;
  padding: 100px 0;
}

.countdown-title {
  font-size: 2.4rem;
  letter-spacing: 0.15em;
  margin-bottom: 30px;
}

.countdown-days {
  font-size: 7rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.countdown-label {
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  margin-bottom: 50px;
}

.countdown-time {
  display: flex;
  justify-content: center;
  gap: 60px;
}

.countdown-item {
  text-align: center;
}

.countdown-number {
  font-size: 3.6rem;
  font-weight: 600;
}

.countdown-unit {
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  margin-top: 5px;
}

.section-map {
  width: 100%;
  background: #000;
  padding: 60px 0 80px;
  text-align: center;
}

.map-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 2rem;
  color: #fff;
  margin-bottom: 25px;
  letter-spacing: 0.1em;
}

.map-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 0 18px rgba(255,255,255,0.25);
}

.map-wrapper iframe {
  width: 100%;
  height: 420px;
  border: 0;
}

section {
  overflow: visible !important;
}

.section-envelope,
.section-countdown {
  overflow: visible !important;
}

.section-rsvp {
  background: #000;
  text-align: center;
  padding: 60px 0 80px;
  color: #fff;
  font-family: 'Noto Serif JP', serif;
}

.rsvp-text {
  font-size: 1.2rem;
  line-height: 1.8;
  margin-bottom: 35px;
  letter-spacing: 0.05em;
}

.rsvp-button {
  display: inline-block;
  padding: 16px 48px;
  background: #ffffff;
  color: #000;
  font-size: 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  letter-spacing: 0.05em;
  box-shadow: 0 0 12px rgba(255,255,255,0.35);
  transition: 0.3s ease;
}

.rsvp-button:hover {
  background: #e8e8e8;
  box-shadow: 0 0 18px rgba(255,255,255,0.55);
}

.section-info {
  padding: 60px 20px;
  background: #fdfbf7;
  text-align: center;
}

.info-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 32px;
  margin-bottom: 40px;
  letter-spacing: 2px;
}

.info-wrapper {
  max-width: 600px;
  margin: 0 auto;
}

.info-item {
  margin-bottom: 30px;
}

.info-heading {
  font-family: 'Noto Serif JP', serif;
  font-size: 22px;
  margin-bottom: 10px;
}

.info-text {
  font-family: 'Noto Serif JP', serif;
  font-size: 18px;
  line-height: 1.6;
}


