/*
    Classic Elegant - Timeless Heritage Edition
    A premium design system for traditional and formal invitations.
*/

:root {
    --primary: #1a2a3a; /* Deep Navy */
    --secondary: #f4f7f9; /* Soft Cloud */
    --accent: #b8860b; /* Heritage Gold */
    --text: #2c3e50;
    --muted: #7f8c8d;
    --border: rgba(184, 134, 11, 0.2);
    --font-script: 'Meie Script', cursive;
    --font-serif: 'Spectral', serif;
    --font-sans: 'Montserrat', sans-serif;
    --transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-serif);
    background-color: var(--secondary);
    color: var(--text);
    line-height: 1.8;
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden;
    height: 100vh;
}

/* --- Intro Screen --- */
.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-color: var(--primary);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 1.2s cubic-bezier(0.7, 0, 0.3, 1);
}

.intro-screen.opened {
    transform: translateY(-100%);
}

.intro-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M50 0 L100 50 L50 100 L0 50 Z" fill="none" stroke="%23b8860b" stroke-width="0.1" opacity="0.1"/></svg>');
    opacity: 0.3;
}

.intro-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    padding: 2rem;
}

.intro-seal {
    width: 80px;
    height: 80px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 3rem;
    position: relative;
}

.seal-text {
    font-family: var(--font-script);
    font-size: 2.5rem;
    color: var(--accent);
}

.intro-subtitle {
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.5rem;
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 2rem;
}

.intro-names {
    font-family: var(--font-script);
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 400;
    margin-bottom: 4rem;
}

.guest-card {
    margin-bottom: 3rem;
    padding: 2rem;
    border: 1px solid rgba(184, 134, 11, 0.3);
    background: rgba(255, 255, 255, 0.03);
}

.guest-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    opacity: 0.6;
}

.guest-name {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-top: 0.5rem;
    color: var(--accent);
}

.btn-open {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 1rem 3rem;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.3rem;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    transition: var(--transition);
}

.btn-open:hover {
    background: var(--accent);
    color: var(--primary);
}

/* --- Navigation --- */
nav {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 1000;
    transition: var(--transition);
    opacity: 0;
}

nav.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.nav-inner {
    background: rgba(26, 42, 58, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    display: flex;
    gap: 1.5rem;
    border: 1px solid var(--accent);
}

nav a {
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.1rem;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

nav a.active {
    color: var(--accent);
    transform: scale(1.2);
}

/* --- Music --- */
.music-toggle-btn {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  background: var(--accent);
  color: var(--primary);
}
.music-toggle-btn:hover { transform: scale(1.1); }
.music-toggle-btn svg { width: 20px; height: 20px; }

/* --- Sections --- */
section { padding: 6rem 1.5rem; position: relative; }
@media (min-width: 992px) {
    section { padding: 10rem 2rem; }
}
.container { max-width: 1100px; margin: 0 auto; text-align: center; }
.section-title-box { margin-bottom: 4rem; }
@media (min-width: 992px) {
    .section-title-box { margin-bottom: 6rem; }
}
.title { font-family: var(--font-script); font-size: clamp(2.5rem, 8vw, 4.5rem); color: var(--primary); margin-bottom: 1rem; }
.subtitle { font-style: italic; color: var(--muted); letter-spacing: 0.1rem; padding: 0 1rem; }

/* --- Hero --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary);
    color: white;
    padding: 0;
}

.hero-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at center, rgba(184, 134, 11, 0.05) 0%, transparent 70%);
}

.hero-box {
    position: relative;
    z-index: 1;
    border: 1px solid var(--accent);
    padding: 3rem 1.5rem;
    width: 90%;
    max-width: 600px;
}

@media (min-width: 768px) {
    .hero-box { padding: 6rem 4rem; }
}

.hero-header { display: flex; align-items: center; justify-content: center; gap: 2rem; color: var(--accent); margin-bottom: 2.5rem; }
.hero-header .line { width: 60px; height: 1px; background: currentColor; }
.hero-subtitle { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 0.4rem; font-size: 0.75rem; margin-bottom: 2.5rem; }
.hero-names { font-family: var(--font-script); font-size: clamp(3.5rem, 10vw, 5.5rem); margin-bottom: 2.5rem; line-height: 1.1; }
.hero-date { font-size: 1.3rem; letter-spacing: 0.2rem; color: var(--accent); }

.btn-calendar {
    margin-top: 4rem;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.8rem 2rem;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-calendar:hover { background: var(--accent); color: var(--primary); }

/* --- Couple --- */
.couple-layout { display: flex; align-items: center; justify-content: center; gap: 4rem; flex-wrap: wrap; }
.couple-card { flex: 1; min-width: 300px; }
.portrait-frame {
    width: 250px;
    height: 350px;
    margin: 0 auto 3rem;
    border: 1px solid var(--accent);
    padding: 10px;
    position: relative;
}

.portrait-frame::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 1px solid var(--accent);
    opacity: 0.3;
}

.portrait-placeholder {
    width: 100%;
    height: 100%;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--accent);
    opacity: 0.3;
}

.couple-card h3 { font-family: var(--font-script); font-size: 2.5rem; margin-bottom: 1.5rem; color: var(--primary); }
.parents { font-size: 0.9rem; color: var(--muted); }
.couple-divider { font-size: 2rem; color: var(--accent); }

/* --- Event --- */
.event { background-color: var(--primary); color: white; }
.event .title { color: var(--accent); }

.countdown { display: flex; justify-content: center; gap: 1rem; margin-bottom: 4rem; }
@media (min-width: 768px) {
    .countdown { gap: 3rem; margin-bottom: 6rem; }
}
.timer-item span { display: block; font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; }
@media (min-width: 768px) {
    .timer-item span { font-size: 4rem; }
}
.timer-item label { font-family: var(--font-sans); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1rem; opacity: 0.5; }

.event-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr)); gap: 4rem; }
.event-card {
    padding: 5rem 3rem;
    border: 1px solid rgba(184, 134, 11, 0.2);
    position: relative;
    background: rgba(255, 255, 255, 0.02);
}

.event-card i { font-size: 2.5rem; color: var(--accent); margin-bottom: 2rem; display: block; }
.event-card h3 { font-family: var(--font-script); font-size: 2.2rem; margin-bottom: 2.5rem; }
.event-info .date { font-size: 1.4rem; margin-bottom: 0.5rem; }
.event-info .time { color: var(--accent); margin-bottom: 2rem; }
.event-info .line { width: 40px; height: 1px; background: var(--accent); margin: 2rem auto; opacity: 0.3; }

/* --- Location --- */
.location-box { background: white; border: 1px solid var(--accent); overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,0.05); }
.location-details { padding: 5rem 2rem; color: var(--primary); }
.location-details i { font-size: 2.5rem; color: var(--accent); margin-bottom: 2rem; }
.full-address { font-size: 1.2rem; margin-bottom: 3rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.btn-location {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.2rem 3rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    font-size: 0.8rem;
}

/* --- Gallery --- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1px; background: var(--accent); border: 1px solid var(--accent); }
.gallery-item { aspect-ratio: 1; overflow: hidden; background: white; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); filter: sepia(0.2); }
.gallery-item:hover img { transform: scale(1.05); filter: sepia(0); }

/* --- RSVP --- */
.rsvp-layout { display: grid; grid-template-columns: 1fr; gap: 3rem; text-align: left; }
@media (min-width: 992px) {
    .rsvp-layout { grid-template-columns: 1fr 1fr; gap: 5rem; }
}
.heritage-form { background: white; padding: 2rem; border: 1px solid var(--border); }
@media (min-width: 768px) {
    .heritage-form { padding: 4rem; }
}
.heritage-form label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15rem; color: var(--primary); margin-bottom: 1rem; }
.heritage-form input, .heritage-form textarea {
    width: 100%;
    padding: 1rem 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-serif);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

.heritage-form input:focus, .heritage-form textarea:focus { outline: none; border-bottom-color: var(--accent); }
.btn-submit {
    width: 100%;
    padding: 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.wishes-list { max-height: 600px; overflow-y: auto; padding-right: 2rem; }
.wishes-header { display: flex; align-items: center; gap: 1.5rem; color: var(--primary); font-size: 1.2rem; margin-bottom: 3rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.wish-item { margin-bottom: 3rem; }
.wish-meta { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.wish-name { font-family: var(--font-script); font-size: 1.6rem; color: var(--primary); }
.wish-time { font-size: 0.7rem; opacity: 0.5; }
.wish-text { font-style: italic; color: var(--muted); }
.wish-divider { color: var(--accent); text-align: center; margin-top: 1.5rem; opacity: 0.3; }

/* --- Footer --- */
.main-footer { padding: 12rem 2rem; text-align: center; background: white; border-top: 1px solid var(--border); }
.footer-ornament { color: var(--accent); font-size: 2rem; margin: 2rem 0; }
.footer-quote { font-style: italic; font-size: 1.4rem; max-width: 800px; margin: 0 auto 4rem; color: var(--muted); }
.footer-names { font-family: var(--font-script); font-size: 4rem; color: var(--primary); margin-bottom: 4rem; }
.footer-copy { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.2rem; opacity: 0.4; }

/* --- Animations --- */
.animate-reveal { opacity: 0; transform: translateY(50px); }

/* --- Responsive --- */
@media (max-width: 992px) {
    .rsvp-layout { grid-template-columns: 1fr; }
    .couple-divider { transform: rotate(90deg); }
}

/* ── Responsive Fix ── */
@media (max-width: 600px) {
  /* Countdown */
  .countdown {
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 3rem;
  }
  .timer-item {
    flex: 1 1 calc(50% - 0.8rem);
    min-width: 60px;
  }
  .timer-item span {
    font-size: clamp(1.8rem, 8vw, 2rem) !important;
  }

  /* Event cards */
  .event-cards {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .event-card {
    padding: 3rem 1.5rem;
  }

  /* RSVP layout */
  .rsvp-layout {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-quote {
    font-size: clamp(1rem, 4vw, 1.4rem);
    word-break: break-word;
    overflow-wrap: break-word;
    padding: 0 1rem;
  }
  .footer-names {
    font-size: clamp(2rem, 8vw, 4rem);
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .main-footer {
    padding: 6rem 1.5rem 8rem !important; /* Add extra bottom padding for fixed navigation safety */
  }

  /* Section padding */
  section {
    padding: 4rem 1.5rem;
  }
}

/* Height-based scaling for short viewports (eg. small phones or mock frames) */
@media (max-height: 720px) {
  .intro-seal {
    margin-bottom: 1.5rem;
    width: 60px;
    height: 60px;
  }
  .seal-text {
    font-size: 1.8rem;
  }
  .intro-names {
    margin-bottom: 2rem;
  }
  .guest-card {
    margin-bottom: 1.5rem;
    padding: 1rem;
  }
  .intro-subtitle {
    margin-bottom: 1rem;
  }
  .hero-box {
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .hero-header {
    margin-bottom: 1.5rem;
  }
  .hero-subtitle {
    margin-bottom: 1.5rem;
  }
  .hero-names {
    margin-bottom: 1.5rem;
    font-size: clamp(2.5rem, 8vw, 3.8rem);
  }
  .btn-calendar {
    margin-top: 2rem;
  }
}

