/* ===========================
   Color Palette & Variables
   =========================== */
:root {
  --orange: #FF8C3A;
  --dark-maroon: #480202;
  --light-peach: #FFBF92;
  --rust-brown: #883216;
  --deep-red: #680404;
  --rust-accent: #BC3E10;
  --cream: #FFF5EB;

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Cormorant Garamond', 'Noto Serif KR', Georgia, serif;
}

/* Korean page: Korean font first so numbers and hangul render consistently */
:root[lang="ko"] {
  --font-heading: 'Noto Serif KR', 'Playfair Display', Georgia, serif;
  --font-body: 'Noto Serif KR', 'Cormorant Garamond', Georgia, serif;
}

/* ===========================
   Reset & Base
   =========================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 18px;
  font-variant-numeric: lining-nums;
  color: var(--dark-maroon);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  height: 100%;
  overflow: hidden;
}

ul {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-container {
  height: 100%;
  overflow-y: auto;
}

/* ===========================
   Language Switcher
   =========================== */
.language-switcher {
  position: fixed;
  top: calc(24px + env(safe-area-inset-top));
  right: calc(24px + env(safe-area-inset-right));
  z-index: 200;
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(72, 2, 2, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.language-link {
  min-width: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-align: center;
  color: #ffffff;
  transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
  opacity: 0.85;
}

.language-link:hover,
.language-link:focus-visible {
  opacity: 1;
}

.language-link.active {
  background-color: rgba(255, 255, 255, 0.92);
  color: var(--dark-maroon);
  opacity: 1;
}

/* ===========================
   Hero Story Section
   =========================== */
.hero {
  background-color: var(--orange);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.hero-story {
  text-align: center;
  max-width: 800px;
  position: relative;
  z-index: 2;
}

.story-line {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: #ffffff;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  position: absolute;
  width: 100%;
  left: 0;
  pointer-events: none;
}

.story-line.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  position: relative;
  pointer-events: auto;
}

.story-line.exiting {
  opacity: 0;
  transform: translateY(-20px);
  position: absolute;
}

.story-block p {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: #ffffff;
  line-height: 1.6;
}

.rotating-word {
  color: var(--light-peach);
  display: inline-block;
  min-width: 120px;
  transition: opacity 0.25s ease;
}

.rotating-word.fade-out {
  opacity: 0;
}

.rotating-word.fade-word-in {
  opacity: 1;
}

/* ===========================
   Main Info Section
   =========================== */
.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.bg-video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 140, 58, 0.55);
  z-index: 1;
}

.main-info {
  background-color: var(--orange);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 20px;
  text-align: center;
  position: relative;
}

.main-info-content {
  max-width: 800px;
  margin: 0 auto;
}

.main-info .subtitle {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 4.5px;
  color: var(--dark-maroon);
  margin-bottom: 20px;
  text-transform: uppercase;
  opacity: 0.7;
}

.main-info h1 {
  font-family: var(--font-heading);
  font-size: 81px;
  font-weight: 400;
  color: var(--dark-maroon);
  line-height: 1.1;
  margin-bottom: 20px;
}

.main-info .tagline {
  font-family: var(--font-heading);
  font-size: 22px;
  font-style: italic;
  font-weight: 400;
  color: var(--dark-maroon);
  opacity: 0.75;
}

/* ===========================
   Event Details Section
   =========================== */
.event-details {
  background-color: var(--dark-maroon);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 20px;
  text-align: center;
  position: relative;
}

.event-details-content {
  max-width: 800px;
  margin: 0 auto;
}

.event-details h2 {
  font-family: var(--font-heading);
  font-size: 59px;
  font-weight: 400;
  color: var(--orange);
  margin-bottom: 24px;
}

.event-details .venue {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  color: var(--light-peach);
  line-height: 1.7;
  letter-spacing: 0.5px;
}

.event-details .event-time {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 400;
  font-style: italic;
  color: var(--orange);
  letter-spacing: 3px;
  margin-top: 28px;
}

/* ===========================
   Directions Section
   =========================== */
.directions {
  background-color: var(--light-peach);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
}

.directions-content {
  max-width: 900px;
  margin: 0 auto;
}

.directions h3 {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 400;
  font-style: italic;
  color: var(--rust-brown);
  margin-bottom: 28px;
}

.direction-text {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 400;
  color: var(--dark-maroon);
  line-height: 1.7;
}

.venue-list {
  margin-top: 28px;
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 12px 14px;
  align-items: baseline;
  text-align: center;
}

.venue-item {
  display: contents;
}

.venue-label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--rust-accent);
  text-align: center;
  white-space: nowrap;
}

.venue-name {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--dark-maroon);
  text-align: center;
  white-space: nowrap;
}

.map-link {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  color: var(--rust-accent);
  opacity: 0.6;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.map-link:hover {
  opacity: 1;
}

.direction-block {
  margin-top: 40px;
  text-align: center;
}

.direction-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 400;
  color: var(--rust-brown);
  margin-bottom: 14px;
}

.direction-block .direction-text {
  margin-bottom: 20px;
}

.map-images {
  display: flex;
  gap: 40px;
  justify-content: center;
  margin: 40px 0;
}

.map-placeholder {
  width: 350px;
  height: 400px;
  background-color: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--rust-brown);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--rust-brown);
}

.map-img {
  width: 55vw;
  max-width: 240px;
  height: auto;
  border-radius: 4px;
  border: 1px solid rgba(136, 50, 22, 0.2);
  box-shadow: 0 4px 20px rgba(72, 2, 2, 0.08);
}

/* ===========================
   RSVP Section
   =========================== */
.rsvp {
  background-color: var(--orange);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
}

.rsvp-content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.rsvp h2 {
  font-family: var(--font-heading);
  font-size: 59px;
  font-weight: 400;
  color: var(--dark-maroon);
  margin-bottom: 16px;
}

.rsvp-description {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 400;
  color: var(--dark-maroon);
  margin-bottom: 40px;
  line-height: 1.7;
}

.form-card {
  background-color: var(--light-peach);
  padding: 48px 40px;
  text-align: left;
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(72, 2, 2, 0.12);
}

/* ===========================
   Form Styles
   =========================== */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--dark-maroon);
  margin-bottom: 8px;
}

.required {
  color: var(--rust-accent);
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 0;
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--dark-maroon);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(72, 2, 2, 0.3);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  transition: border-bottom-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-bottom-color: var(--rust-accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

/* Phone input with country code */
.phone-input {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.country-code {
  width: 80px !important;
  flex-shrink: 0;
  cursor: pointer;
}

.phone-input input[type="tel"] {
  flex: 1;
}

/* Select dropdown arrow */
.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23480202' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 24px;
}

.form-note {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--rust-accent);
  margin-top: 8px;
  line-height: 1.5;
}

.submit-btn {
  display: block;
  width: 100%;
  padding: 16px;
  margin-top: 32px;
  background-color: var(--deep-red);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.submit-btn:hover {
  background-color: var(--dark-maroon);
  transform: translateY(-1px);
}

.submit-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.form-status {
  min-height: 24px;
  margin-top: 16px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--dark-maroon);
}

.form-status.is-success {
  color: var(--dark-maroon);
}

.form-status.is-error {
  color: var(--deep-red);
}

/* ===========================
   Scroll Indicator
   =========================== */
.scroll-indicator {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  color: var(--dark-maroon);
  opacity: 0;
  animation: bounce 2s ease infinite;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.scroll-indicator.on-dark {
  color: var(--orange);
}

.scroll-indicator.visible {
  opacity: 0.5;
}

.scroll-indicator.hidden {
  opacity: 0;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ===========================
   Scroll Animations
   =========================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children with delay */
.fade-in.delay-1 { transition-delay: 0.2s; }
.fade-in.delay-2 { transition-delay: 0.4s; }
.fade-in.delay-3 { transition-delay: 0.6s; }


/* ===========================
   Decorative Flourish
   =========================== */
.flourish {
  display: block;
  margin: 24px auto;
  width: 80px;
  height: 1px;
  border: none;
  background: var(--dark-maroon);
  opacity: 0.3;
  position: relative;
}

.flourish::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 8px;
  height: 8px;
  border: 1px solid var(--dark-maroon);
  opacity: 0.5;
  background: var(--orange);
}

.event-details .flourish {
  background: var(--orange);
  opacity: 0.4;
}

.event-details .flourish::before {
  border-color: var(--orange);
  background: var(--dark-maroon);
}

/* ===========================
   Grain Texture Overlay
   =========================== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ===========================
   Section Depth & Atmosphere
   =========================== */
.main-info::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, rgba(255, 140, 58, 0.9), transparent);
  pointer-events: none;
  z-index: 1;
}

.event-details::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, rgba(72, 2, 2, 0.95), transparent);
  pointer-events: none;
}

.map-placeholder {
  border-radius: 4px;
  transition: box-shadow 0.3s ease;
}

.map-placeholder:hover {
  box-shadow: 0 4px 20px rgba(72, 2, 2, 0.1);
}

/* ===========================
   Footer
   =========================== */
footer {
  background-color: var(--orange);
  padding: 40px 20px;
  text-align: center;
}

footer p {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dark-maroon);
  letter-spacing: 1px;
  opacity: 0.7;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
  .language-switcher {
    top: calc(14px + env(safe-area-inset-top));
    right: calc(14px + env(safe-area-inset-right));
  }

  .language-link {
    min-width: 44px;
    padding: 9px 12px;
  }

  .main-info h1 {
    font-size: 48px;
  }

  .event-details h2 {
    font-size: 40px;
  }

  .event-details .event-time {
    font-size: 22px;
  }

  .directions h3 {
    font-size: 36px;
  }

  .rsvp h2 {
    font-size: 40px;
  }

  .directions {
    text-align: center;
  }

  .map-images {
    flex-direction: column;
    align-items: center;
  }

  .map-placeholder {
    width: 100%;
    max-width: 350px;
    height: 320px;
  }

  .map-img {
    width: 55vw;
  }

  .form-card {
    padding: 32px 24px;
  }

  .hero {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .story-line,
  .story-block p {
    font-size: 1.6rem;
  }

  .main-info {
    padding: 80px 20px;
  }

  .event-details {
    padding: 80px 20px;
  }
}

@media (max-width: 480px) {
  .main-info {
    padding: 60px 16px;
  }

  .main-info h1 {
    font-size: 36px;
  }

  .main-info .subtitle {
    font-size: 14px;
    letter-spacing: 2.5px;
  }

  .main-info .tagline {
    font-size: 17px;
  }

  .event-details {
    padding: 60px 16px;
  }

  .event-details h2 {
    font-size: 32px;
  }

  .event-details .event-time {
    font-size: 18px;
    letter-spacing: 2px;
  }

  .directions {
    padding: 60px 16px;
  }

  .directions h3 {
    font-size: 28px;
  }

  .direction-text {
    font-size: 16px;
  }

  .map-placeholder {
    height: 280px;
  }

  .rsvp {
    padding: 60px 16px;
  }

  .rsvp h2 {
    font-size: 32px;
  }

  .rsvp-description {
    font-size: 15px;
    margin-bottom: 32px;
  }

  .form-card {
    padding: 28px 20px;
  }

  .form-group input[type="text"],
  .form-group input[type="tel"],
  .form-group textarea,
  .form-group select {
    padding: 14px 0;
  }

  .country-code {
    width: 70px !important;
  }

  .submit-btn {
    padding: 18px;
  }

  .form-note {
    line-height: 1.6;
  }

  .story-line,
  .story-block p {
    font-size: 1.3rem;
  }
}
