/* Playfair Display is loaded via <link> in the HTML head for optimal performance */

:root {
  --bg: #f8f5ee;
  --bg-soft: #fffdf9;
  --surface: rgba(255, 251, 244, 0.82);
  --surface-strong: #ffffff;
  --text: #40513b;
  --text-soft: #6d7e61;
  --accent: #556b2f;
  --accent-deep: #3a4d1f;
  --border: rgba(85, 107, 47, 0.24);
  --shadow: 0 18px 40px rgba(85, 107, 47, 0.12);
  --gold: #c9a84c;
  --gold-soft: rgba(201, 168, 76, 0.12);
  --gold-border: rgba(201, 168, 76, 0.32);
  --anim-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ── KEYFRAME ANIMATIONS ─────────────────────────────── */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-48px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(48px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes floatBob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-14px); }
}

@keyframes swayLR {
  0%, 100% { transform: rotate(-1.5deg) scale(1); }
  50%       { transform: rotate(1.5deg) scale(1.01); }
}

@keyframes pulseScale {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

@keyframes shimmerGold {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

@keyframes rotateInTL {
  from { transform: rotate(0deg) scale(0.5); opacity: 0; }
  to   { transform: rotate(90deg) scale(1); opacity: 1; }
}

@keyframes rotateInTR {
  from { transform: rotate(0deg) scale(0.5); opacity: 0; }
  to   { transform: rotate(-180deg) scale(1); opacity: 1; }
}

@keyframes rotateInBL {
  from { transform: rotate(90deg) scale(0.5); opacity: 0; }
  to   { transform: rotate(0) scale(1); opacity: 1; }
}

@keyframes rotateInBR {
  from { transform: scaleX(-1) scale(0.5); opacity: 0; }
  to   { transform: scaleX(-1) scale(1); opacity: 1; }
}

@keyframes countdownPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); color: var(--gold); }
  100% { transform: scale(1); }
}

@keyframes openingEntrance {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes curtainOpenLeft {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

@keyframes curtainOpenRight {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}

@keyframes sideDriftUp {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-20px); }
}

/* ── RESET & BASE ────────────────────────────────────── */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(85, 107, 47, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(236, 198, 145, 0.16), transparent 24%),
    linear-gradient(180deg, #fdfbf6 0%, #f7f4ec 100%);
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: auto;
  width: 220px;
  height: 220px;
  pointer-events: none;
  opacity: 0.25;
  filter: blur(4px);
  z-index: 0;
}

body::before {
  top: 8%;
  left: -60px;
  background: radial-gradient(circle, rgba(85, 107, 47, 0.7), transparent 58%);
}

body::after {
  bottom: 10%;
  right: -80px;
  background: radial-gradient(circle, rgba(231, 189, 133, 0.7), transparent 58%);
}

img {
  display: block;
  max-width: 100%;
}

.hidden {
  visibility: hidden;
}

/* ── FIXED SIDE DECORATIONS ──────────────────────────── */

.deco-fixed-left,
.deco-fixed-right {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.38;
  animation: sideDriftUp 6s ease-in-out infinite;
}

.deco-fixed-left {
  left: 4px;
  animation-delay: 0s;
}

.deco-fixed-right {
  right: 4px;
  transform: translateY(-50%) scaleX(-1);
  animation-delay: 3s;
}

.deco-fixed-left img,
.deco-fixed-right img {
  width: 100%;
  height: auto;
}

/* ── OPENING SCREEN ──────────────────────────────────── */

.opening-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at center, rgba(201, 168, 76, 0.06) 0%, transparent 70%),
    rgba(248, 245, 238, 0.94);
  backdrop-filter: blur(12px);
  z-index: 12;
  overflow: hidden;
  transition: opacity 0.55s var(--anim-ease), visibility 0.55s var(--anim-ease);
}

.opening-screen.closed {
  opacity: 0;
  visibility: hidden;
}

/* ── CURTAINS ────────────────────────────────────────── */

.curtain {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  z-index: 2;
  pointer-events: none;
  will-change: transform;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.00) 0px,  rgba(255, 255, 255, 0.00) 11px,
      rgba(0, 0, 0, 0.05)        11px, rgba(0, 0, 0, 0.05)        13px,
      rgba(255, 255, 255, 0.00) 13px,  rgba(255, 255, 255, 0.00) 27px,
      rgba(0, 0, 0, 0.05)        27px, rgba(0, 0, 0, 0.05)        29px,
      rgba(255, 255, 255, 0.00) 29px,  rgba(255, 255, 255, 0.00) 40px
    ),
    linear-gradient(160deg, #4e6428 0%, #3a4d1f 55%, #556b2f 100%);
}

.curtain-left {
  left: 0;
  border-right: 3px solid var(--gold);
  box-shadow: inset -16px 0 32px rgba(0, 0, 0, 0.22), 6px 0 18px rgba(0, 0, 0, 0.15);
}

.curtain-right {
  right: 0;
  border-left: 3px solid var(--gold);
  box-shadow: inset 16px 0 32px rgba(0, 0, 0, 0.22), -6px 0 18px rgba(0, 0, 0, 0.15);
}

.opening-screen.curtain-opening .curtain-left {
  animation: curtainOpenLeft 0.85s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.opening-screen.curtain-opening .curtain-right {
  animation: curtainOpenRight 0.85s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.opening-card {
  position: relative;
  max-width: 520px;
  padding: 52px 40px;
  text-align: center;
  overflow: visible;
  z-index: 3;
  animation: openingEntrance 0.9s var(--anim-ease) both;
}

/* ── CORNER DECORATIONS ──────────────────────────────── */

.deco-corner {
  position: absolute;
  width: 56px;
  height: 56px;
  pointer-events: none;
  opacity: 0.72;
}

.deco-tl { top: -4px;  left: -4px;  transform: rotate(90deg);   animation: rotateInTL 0.7s var(--anim-ease) 0.3s both; }
.deco-tr { top: -4px;  right: -4px;  animation: rotateInTR 0.7s var(--anim-ease) 0.45s both; }
.deco-bl { bottom: -4px; left: -4px;  transform: rotate(90deg); animation: rotateInBL 0.7s var(--anim-ease) 0.6s both; }
.deco-br { bottom: -4px; right: -4px; transform: scaleX(-1); animation: rotateInBR 0.7s var(--anim-ease) 0.75s both; }

.deco-corner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ── SECTION-HEADING DECOS ───────────────────────────── */

.section-heading {
  position: relative;
}

.heading-deco {
  position: absolute;
  width: 44px;
  height: 44px;
  pointer-events: none;
  opacity: 0.55;
}

.heading-deco-l {
  left: -8px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
}

.heading-deco-r {
  right: -8px;
  top: 50%;
  transform: translateY(-50%) rotate(-180deg);
}

/* ── CARD / PANEL SHARED ─────────────────────────────── */

.opening-card,
.panel,
.event-card,
.gallery-card,
.map-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 28px;
}

/* Gold accent top-line on cards */
.event-card::before,
.panel::before {
  content: '';
  display: block;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin-bottom: 18px;
  opacity: 0.7;
}

/* ── ARABIC / ISLAMIC TEXT ───────────────────────────── */

/* Arabic script uses 'Scheherazade New' (available on most modern OS) or falls back to 'Traditional Arabic' */
.opening-arabic {
  font-family: 'Scheherazade New', 'Traditional Arabic', serif;
  font-size: 1.3rem;
  color: var(--gold);
  direction: rtl;
  margin: 0 0 8px;
  letter-spacing: 0.04em;
  animation: fadeIn 1s ease 0.5s both;
}

.opening-arabic.small {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.hero-arabic {
  font-family: 'Scheherazade New', 'Traditional Arabic', serif;
  font-size: 1.05rem;
  color: var(--gold);
  direction: rtl;
  margin: 0 0 16px;
  opacity: 0.85;
}

.quran-verse {
  font-style: italic;
  font-size: 0.96rem;
  color: var(--text-soft);
  border-left: 3px solid var(--gold-border);
  padding-left: 14px;
  margin-top: 18px;
  text-align: left;
}

.quran-verse em {
  font-style: normal;
  font-weight: 700;
  color: var(--accent-deep);
}

.closing-dua {
  font-family: 'Scheherazade New', 'Traditional Arabic', serif;
  font-size: 1.5rem;
  color: var(--gold);
  direction: rtl;
  margin: 24px 0 8px;
}

.closing-dua-id {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-top: 0;
}

/* ── EYEBROW ─────────────────────────────────────────── */

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-deep);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-date {
  font-size: 2rem;
  letter-spacing: 0.12em;
}

/* ── TYPOGRAPHY ──────────────────────────────────────── */

h1,
h2,
h3 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  margin: 0;
}

h1 {
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 18px;
}

h3 {
  font-size: 1.45rem;
}

p,
label,
input,
select,
textarea,
button,
a {
  font: inherit;
}

p {
  line-height: 1.75;
}

/* ── PAGE SHELL ──────────────────────────────────────── */

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1160px, calc(100% - 80px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.section {
  padding: 52px 0;
}

/* ── HERO ────────────────────────────────────────────── */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 36px;
  min-height: 100vh;
}

/* Mountain backdrop */
.mountain-backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.14;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mountain-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hero-copy,
.hero-art {
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--gold);
  margin: -10px 0 18px;
}

.hero-text {
  font-size: 1.08rem;
  max-width: 58ch;
}

.hero-actions,
.gift-grid,
.event-grid,
.gallery-grid,
.interaction-grid {
  display: grid;
  gap: 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: 28px;
  gap: 12px;
}

/* Wayang illustration */
.hero-art {
  padding: 28px;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,251,244,0.95));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-art::before {
  content: '';
  position: absolute;
  inset: 16px;
  border: 1px solid var(--gold-border);
  border-radius: 24px;
  pointer-events: none;
}

.wayang-figure {
  animation: swayLR 7s ease-in-out infinite;
  transform-origin: bottom center;
}

.wayang-gallery {
  animation: floatBob 5s ease-in-out infinite;
}

/* ── BUTTONS ─────────────────────────────────────────── */

.primary-button,
.secondary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 14px 28px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.22s var(--anim-ease), box-shadow 0.22s var(--anim-ease), background 0.22s ease;
  position: relative;
  overflow: hidden;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent) 0%, #b9c9a8 50%, var(--accent) 100%);
  background-size: 200% auto;
  color: #fff;
  box-shadow: 0 14px 28px rgba(85, 107, 47, 0.28);
}

.primary-button:hover {
  background-position: right center;
  box-shadow: 0 18px 36px rgba(85, 107, 47, 0.38);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.8);
  color: var(--accent-deep);
  border: 1px solid rgba(85, 107, 47, 0.3);
}

.primary-button:hover,
.secondary-button:hover,
.sound-toggle:hover {
  transform: translateY(-3px);
}

/* Pulse on open button */
#openInvitationButton {
  animation: pulseScale 2.4s ease-in-out infinite;
}

#openInvitationButton:hover {
  animation: none;
  transform: translateY(-3px);
}

/* ── SECTION HEADING ─────────────────────────────────── */

.section-heading {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 32px;
}

.section-heading.narrow {
  max-width: 560px;
}

/* Gold underline on h2 in section headings */
.section-heading h2::after {
  content: '';
  display: block;
  width: 72px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 14px auto 0;
}

/* ── COUPLE GRID ─────────────────────────────────────── */

.couple-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
}

.person-card,
.connector {
  min-height: 100%;
}

.person-card {
  padding: 32px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: 26px;
  text-align: center;
  transition: transform 0.28s var(--anim-ease), box-shadow 0.28s var(--anim-ease);
}

.person-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(85, 107, 47, 0.18);
}

.person-card span,
.card-tag {
  display: inline-flex;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.connector {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-soft), rgba(255,255,255,0.86));
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  animation: floatBob 4s ease-in-out infinite;
}

/* ── COUNTDOWN ───────────────────────────────────────── */

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(80px, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.countdown div {
  padding: 20px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--gold-border);
  transition: transform 0.15s ease;
}

.countdown strong {
  display: block;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--gold);
}

.countdown span {
  font-size: 0.95rem;
}

.countdown strong.pop {
  animation: countdownPop 0.4s ease;
}

/* ── EVENT / GIFT / INTERACTION / GALLERY GRIDS ──────── */

.event-grid,
.gift-grid,
.interaction-grid,
.gallery-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.interaction-grid.single {
  grid-template-columns: minmax(0, 680px);
  justify-content: center;
}

.event-card,
.panel,
.gallery-card,
.map-card {
  padding: 28px;
}

.event-card,
.panel,
.gallery-card {
  transition: transform 0.28s var(--anim-ease), box-shadow 0.28s var(--anim-ease);
}

.event-card:hover,
.panel:hover,
.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 48px rgba(85, 107, 47, 0.16);
}

.map-card {
  margin-top: 20px;
  text-align: center;
}

.feature-card img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  width: 100%;
  border-radius: 22px;
  background: #fff;
}

.quote-card {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--gold-soft), rgba(255,255,255,0.9));
  border: 1px solid var(--gold-border);
}

.quote-card p {
  font-size: 1.18rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  text-align: center;
}

/* ── FORMS ───────────────────────────────────────────── */

form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: var(--accent-deep);
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(85, 107, 47, 0.3);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}

textarea {
  resize: vertical;
}

.form-message {
  min-height: 1.5em;
  margin: 0;
  color: var(--accent-deep);
  font-size: 0.95rem;
}

.guestbook-panel {
  display: grid;
  gap: 20px;
}

.guestbook-list {
  display: grid;
  gap: 14px;
}

.guestbook-item {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(201, 168, 76, 0.18);
  animation: fadeInUp 0.4s var(--anim-ease) both;
}

.guestbook-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
}

/* ── SOUND TOGGLE ────────────────────────────────────── */

.sound-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--gold-border);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.22s var(--anim-ease);
}

/* ── BANK LOGO ───────────────────────────────────────── */

.bank-logo {
  height: 40px;
  width: auto;
  margin: 4px 0 10px;
}

/* Compact text spacing inside transfer bank panel */
.gift-section .panel h3 {
  margin-bottom: 6px;
}

.gift-section .panel p {
  margin: 2px 0;
  line-height: 1.4;
}

/* ── CLOSING SECTION ─────────────────────────────────── */

.closing-section {
  padding-bottom: 72px;
}

/* ── SCROLL-REVEAL ANIMATION ─────────────────────────── */

[data-animate] {
  opacity: 0;
  transition:
    opacity 0.75s var(--anim-ease),
    transform 0.75s var(--anim-ease);
}

[data-animate='fade-up'] {
  transform: translateY(36px);
}

[data-animate='slide-left'] {
  transform: translateX(-48px);
}

[data-animate='slide-right'] {
  transform: translateX(48px);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translate(0);
}

[data-animate-delay='150'][data-animate].is-visible {
  transition-delay: 150ms;
}

[data-animate-delay='250'][data-animate].is-visible {
  transition-delay: 250ms;
}

/* ── RESPONSIVE ──────────────────────────────────────── */

@media (max-width: 920px) {
  .hero,
  .event-grid,
  .gift-grid,
  .interaction-grid,
  .gallery-grid,
  .couple-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 84px;
  }

  .connector {
    margin: 0 auto;
  }

  .heading-deco {
    display: none;
  }

  .deco-fixed-left,
  .deco-fixed-right {
    display: none;
  }

  .page-shell {
    width: min(1160px, calc(100% - 40px));
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 24px, 1160px);
    padding-top: 24px;
  }

  .section {
    padding: 40px 0;
  }

  .opening-card,
  .event-card,
  .panel,
  .gallery-card,
  .map-card,
  .person-card {
    padding: 22px;
  }

  .countdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  h1 {
    font-size: 2.5rem;
  }
}

