/*
    Night Sky - Celestial Romance
    A deep space design system with twinkling starlight.
*/

:root {
    --space: #0b0e14;
    --space-light: #1a202c;
    --star: #f6e05e;
    --nebula: #4a5568;
    --text: #e2e8f0;
    --gold: #d4af37;
    --font-celestial: 'Cinzel', serif;
    --font-serif: 'Cormorant Garamond', serif;
    --transition: all 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
}

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

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

/* --- Star Background --- */
#stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.5;
    animation: twinkle var(--duration) infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* --- Intro Screen --- */
.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-color: var(--space);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 1.5s cubic-bezier(0.82, 0.01, 0.77, 0.41);
}

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

.moon {
    position: absolute;
    width: 150px;
    height: 150px;
    background: var(--star);
    border-radius: 50%;
    box-shadow: 0 0 50px var(--star);
    opacity: 0.2;
    top: 10%;
    right: 10%;
}

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

.intro-tag {
    font-family: var(--font-celestial);
    text-transform: uppercase;
    letter-spacing: 0.6rem;
    font-size: 0.8rem;
    color: var(--gold);
    margin-bottom: 2rem;
}

.intro-names {
    font-family: var(--font-celestial);
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    margin-bottom: 4rem;
    background: linear-gradient(to right, var(--gold), #fff, var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.guest-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 3rem;
    border-radius: 20px;
}

.guest-card .to { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.3rem; opacity: 0.6; }
.guest-card .name { font-family: var(--font-serif); font-size: 2.2rem; margin: 1rem 0 3rem; color: var(--gold); }

.btn-starlight {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 1.2rem 3rem;
    font-family: var(--font-celestial);
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    transition: var(--transition);
}

.btn-starlight:hover { background: var(--gold); color: var(--space); box-shadow: 0 0 30px var(--gold); }

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

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

.nav-cosmic {
    background: rgba(11, 14, 20, 0.8);
    backdrop-filter: blur(15px);
    padding: 0.8rem 1.5rem;
    border-radius: 100px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    display: flex;
    gap: 1.5rem;
}

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

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

/* --- Music --- */
.music-widget {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    cursor: pointer;
}

.orbit {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.planet {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    top: -4px;
    left: 50%;
}

.music-widget.playing .orbit { animation: orbitRotate 4s infinite linear; }
@keyframes orbitRotate { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }

/* --- 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 h2 { font-family: var(--font-celestial); font-size: 3rem; color: var(--gold); letter-spacing: 0.5rem; margin-bottom: 2rem; }
.star-divider { display: flex; align-items: center; justify-content: center; gap: 2rem; color: var(--gold); opacity: 0.5; margin-bottom: 6rem; }
.star-divider span { width: 50px; height: 1px; background: currentColor; }

/* --- Hero --- */
.hero { height: 100vh; display: flex; align-items: center; justify-content: center; padding: 0; }
.celestial-circle {
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 4rem 2rem;
    border-radius: 50%;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.05) 0%, transparent 70%);
    width: 95%;
}

@media (min-width: 768px) {
    .celestial-circle { padding: 8rem 4rem; width: auto; }
}

.hero-subtitle { font-family: var(--font-celestial); font-size: 0.75rem; letter-spacing: 0.5rem; color: var(--gold); margin-bottom: 2.5rem; }
.hero-names { font-family: var(--font-celestial); font-size: 3.5rem; line-height: 1.2; margin-bottom: 2.5rem; }
.hero-divider { width: 40px; height: 1px; background: var(--gold); margin: 2rem 0; }
.hero-date { font-family: var(--font-serif); font-size: 1.2rem; letter-spacing: 0.2rem; }

/* --- Couple --- */
.couple-grid { display: flex; justify-content: center; gap: 6rem; flex-wrap: wrap; }
.couple-card { flex: 1; min-width: 300px; max-width: 400px; }
.portrait-aura {
    width: 180px;
    height: 180px;
    margin: 0 auto 3rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.portrait-aura::before {
    content: '';
    position: absolute;
    width: 120%;
    height: 120%;
    border: 1px dashed rgba(212, 175, 55, 0.1);
    border-radius: 50%;
    animation: orbitRotate 15s infinite linear;
}

.avatar { font-size: 4rem; color: var(--gold); opacity: 0.3; }
.couple-card h3 { font-family: var(--font-celestial); font-size: 2rem; color: var(--gold); margin-bottom: 1.5rem; }
.parents { color: var(--text); opacity: 0.7; font-size: 0.9rem; }

/* --- Event --- */
.countdown { display: flex; justify-content: center; gap: 1rem; margin-bottom: 4rem; }
@media (min-width: 768px) {
    .countdown { gap: 3rem; margin-bottom: 8rem; }
}
.timer-box span { display: block; font-family: var(--font-celestial); font-size: 2rem; color: var(--gold); line-height: 1; }
@media (min-width: 768px) {
    .timer-box span { font-size: 4rem; }
}
.timer-box label { 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%, 280px), 1fr)); gap: 4rem; }
.event-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(212, 175, 55, 0.1);
    padding: 6rem 3rem;
    border-radius: 30px;
    position: relative;
    overflow: hidden;
}

.event-card i { font-size: 3rem; color: var(--gold); margin-bottom: 3rem; display: block; }
.event-card h3 { font-family: var(--font-celestial); font-size: 1.8rem; margin-bottom: 2.5rem; }
.info .date { font-size: 1.5rem; margin-bottom: 1rem; color: var(--gold); }
.info .venue { font-size: 0.9rem; opacity: 0.6; margin-top: 2rem; }

/* --- Location --- */
.map-card { background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(212, 175, 55, 0.1); border-radius: 30px; overflow: hidden; }
.map-frame { border-bottom: 1px solid rgba(212, 175, 55, 0.1); }
.map-info { padding: 4rem 2rem; }
.map-info i { font-size: 2rem; color: var(--gold); margin-bottom: 2rem; }
.map-info p { font-size: 1.2rem; margin-bottom: 3rem; max-width: 600px; margin-left: auto; margin-right: auto; }

/* --- Gallery --- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.gallery-item { aspect-ratio: 1; overflow: hidden; border: 1px solid rgba(212, 175, 55, 0.2); border-radius: 10px; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); filter: brightness(0.8) contrast(1.2); }
.gallery-item:hover img { transform: scale(1.1); filter: brightness(1.1); }

/* --- RSVP --- */
.rsvp-layout { display: grid; grid-template-columns: 1fr; gap: 3rem; text-align: left; }
@media (min-width: 768px) { .rsvp-layout { grid-template-columns: 1fr 1fr; gap: 5rem; } }
.celestial-form { background: rgba(255, 255, 255, 0.02); padding: 4rem; border: 1px solid rgba(212, 175, 55, 0.1); border-radius: 30px; }
.celestial-form label { display: block; font-family: var(--font-celestial); font-size: 0.7rem; letter-spacing: 0.2rem; color: var(--gold); margin-bottom: 1rem; }
.celestial-form input, .celestial-form textarea {
    width: 100%;
    padding: 1rem 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    color: white;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

.celestial-form input:focus, .celestial-form textarea:focus { outline: none; border-bottom-color: var(--gold); }
.btn-submit {
    width: 100%;
    padding: 1.5rem;
    background: var(--gold);
    color: var(--space);
    border: none;
    font-family: var(--font-celestial);
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.wishes-list { max-height: 600px; overflow-y: auto; padding-right: 2rem; }
.wish-item { position: relative; padding: 2rem; background: rgba(255,255,255,0.01); border-radius: 15px; margin-bottom: 2rem; border-left: 1px solid var(--gold); }
.wish-head { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.wish-head strong { font-family: var(--font-celestial); color: var(--gold); }
.wish-head span { font-size: 0.7rem; opacity: 0.4; }
.wish-star { position: absolute; top: 1rem; right: 1rem; color: var(--gold); opacity: 0.2; }

/* --- Footer --- */
.celestial-footer { padding: 12rem 2rem; text-align: center; }
.footer-content .quote { font-style: italic; font-size: 1.6rem; margin-bottom: 4rem; opacity: 0.6; }
.footer-content .names { font-family: var(--font-celestial); font-size: 3rem; color: var(--gold); margin-bottom: 4rem; }
.copy { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.3rem; opacity: 0.3; }

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

/* --- Responsive --- */
@media (max-width: 992px) {
    .event-cards, .rsvp-layout { grid-template-columns: 1fr; }
    .hero-names { font-size: 2.5rem; }
}

/* ── Responsive Fix ── */
@media (max-width: 600px) {
  /* Countdown */
  .countdown {
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 3rem;
  }
  .timer-box {
    flex: 1 1 calc(50% - 0.8rem);
    min-width: 60px;
  }
  .timer-box 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;
    border-radius: 15px;
  }

  /* RSVP layout */
  .rsvp-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .celestial-form {
    padding: 2rem;
    border-radius: 15px;
  }

  /* Footer */
  .celestial-footer {
    padding: 5rem 1.5rem;
  }
  .footer-content .quote {
    font-size: clamp(1rem, 4vw, 1.6rem);
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .footer-content .names {
    font-size: clamp(1.8rem, 7vw, 3rem);
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Couple */
  .couple-card {
    min-width: unset;
    width: 100%;
  }

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