/* 
   Wedding Invitation: Kristina & Stas
   GLOBAL BASE STYLES
*/

:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --light-grey: #f9f9f9;
    --mid-grey: #e0e0e0;
    --dark-grey: #555555;
    --font-heading: 'Cormorant Garamond', serif;
    --font-text: 'Montserrat', sans-serif;
}

/* --- 1. Global Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-text);
    background-color: var(--bg-color);
    background-image: url("https://www.transparenttextures.com/patterns/cream-paper.png");
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- 2. Typography --- */
h1, h2, h3, .names {
    font-family: var(--font-heading);
    font-weight: 600;
    margin: 0 0 20px 0;
    text-align: center;
}

h2 { font-size: 2.5rem; margin-bottom: 30px; letter-spacing: 1px; }

p {
    font-size: 1rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto 20px auto;
    color: var(--dark-grey);
}

/* --- 3. Common Components --- */
section {
    padding: 80px 20px;
    max-width: 800px;
    margin: 0 auto;
}

#preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s ease;
}
.heart-pulse { font-size: 3rem; animation: pulse 1.5s infinite; }
@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

/* Hero */
.hero {
    height: 100vh; width: 100%; max-width: 100%; margin: 0;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 0 20px; box-sizing: border-box;
    background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%), url("bg.jpg");
    background-size: cover; background-position: center;
}
.hero .names { font-size: clamp(2.5rem, 10vw, 4.5rem); font-style: italic; text-shadow: 0 2px 15px white; }
.hero .date { font-size: clamp(1rem, 3vw, 1.3rem); text-transform: uppercase; letter-spacing: 5px; text-shadow: 0 2px 10px white; }

/* Countdown */
.countdown { display: flex; gap: 15px; justify-content: center; }
.time-box {
    background: rgba(255, 255, 255, 0.4); backdrop-filter: blur(8px);
    border: 1px solid rgba(0,0,0,0.05); padding: 15px 10px; border-radius: 8px; min-width: 70px;
}
.time-box span { display: block; font-family: var(--font-heading); font-size: 2rem; }
.time-box small { font-size: 0.6rem; text-transform: uppercase; }

/* Calendar */
.calendar-section { padding: 100px 20px; text-align: center; }
.calendar-section h2 { font-size: clamp(3rem, 10vw, 4.5rem); font-style: italic; font-weight: 400; }
.calendar-subtitle { text-transform: uppercase; letter-spacing: 6px; font-size: 0.8rem; color: #999; margin-bottom: 60px; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; max-width: 350px; margin: 0 auto; }
.day-name { font-weight: 600; font-size: 0.75rem; color: #bbb; text-transform: uppercase; padding-bottom: 20px; }
.day { padding: 15px 0; font-size: 1.1rem; position: relative; z-index: 1; color: #444; }
.day.special { font-weight: 600; color: #333; }
.heart-outline {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 45px; height: 45px; border: 1px solid #c4a484; border-radius: 50%; z-index: -1;
}

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 30px; position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 1px; background-color: var(--mid-grey); }
.timeline-item { position: relative; display: flex; flex-direction: column; }
.timeline-item::before { content: ''; position: absolute; left: -24.5px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background-color: var(--text-color); border: 2px solid var(--bg-color); }
.time { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 600; text-align: left; }
.event h3 { text-align: left; font-size: 1.5rem; margin-bottom: 5px; }
.event p { text-align: left; margin: 0 0 15px 0; }

/* Buttons */
.btn {
    display: inline-block; padding: 14px 30px; background-color: var(--text-color); color: var(--bg-color);
    text-decoration: none; text-transform: uppercase; font-size: 0.85rem; border-radius: 6px;
    border: 1px solid var(--text-color); cursor: pointer; transition: all 0.3s ease;
}
.btn:hover { background-color: var(--dark-grey); transform: translateY(-1px); }
.btn.outline { background-color: transparent; color: var(--text-color); }

/* Form */
.rsvp { background-color: var(--light-grey); border-radius: 15px; padding: 60px 20px; }
input[type="text"], select {
    width: 100%; padding: 14px; border: 1px solid var(--mid-grey); border-radius: 8px;
    font-family: var(--font-text); font-size: 1rem; background-color: var(--bg-color);
    appearance: none; -webkit-appearance: none; outline: none;
}
select {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%0-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat; background-position: right 15px center; background-size: 12px auto;
}

/* Animations */
.fade-in { opacity: 0; transform: translateY(20px); transition: 0.8s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* Popup */
.popup {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.95); backdrop-filter: blur(5px);
    display: flex; justify-content: center; align-items: center;
    z-index: 10000; opacity: 0; pointer-events: none; transition: 0.4s;
}
.popup.active { opacity: 1; pointer-events: auto; }
.popup-content { background: white; padding: 50px; border-radius: 20px; box-shadow: 0 20px 50px rgba(0,0,0,0.1); }

/* --- 4. BROWSER SPECIFIC OVERRIDES --- */

/* --- MICROSOFT EDGE --- */
.is-edge body {
    -webkit-font-smoothing: auto; /* Edge handles smoothing differently */
}
.is-edge .time-box {
    background: rgba(255, 255, 255, 0.6); /* Slightly more opaque for Edge */
    backdrop-filter: blur(10px) saturate(180%);
}
.is-edge .names {
    letter-spacing: 1px; /* Tweak spacing for Edge rendering */
}
.is-edge ::-webkit-scrollbar {
    width: 10px; /* Thicker scrollbar for Edge users */
}

/* --- APPLE SAFARI / iOS --- */
.is-safari body {
    cursor: pointer; /* Fix click issues on iOS */
}
.is-safari .time-box, .is-safari .popup {
    -webkit-backdrop-filter: blur(8px); /* Crucial prefix for Safari */
}
.is-safari input[type="text"], .is-safari select {
    font-size: 16px; /* Prevent auto-zoom on focus in iOS */
    border-radius: 0; /* Clear iOS default rounded corners if needed */
    border-radius: 8px; /* Re-apply our radius */
}
.is-safari .btn {
    -webkit-appearance: none;
}

/* --- GOOGLE CHROME --- */
.is-chrome .fade-in {
    will-change: transform, opacity; /* Hardware acceleration hint */
}

/* --- MOZILLA FIREFOX --- */
.is-firefox html {
    scrollbar-width: thin;
    scrollbar-color: var(--mid-grey) transparent;
}
.is-firefox .time-box {
    background: rgba(255, 255, 255, 0.8); /* Firefox filter performance tweak */
}

/* --- 5. RESPONSIVE --- */
@media (max-width: 600px) {
    .hero .names { font-size: 3rem; }
    .timeline::before, .timeline-item::before { display: none; }
    .timeline { padding-left: 0; }
    .time, .event h3, .event p { text-align: center; }
}

@media (min-width: 768px) {
    .timeline { flex-direction: row; justify-content: space-between; padding-left: 0; }
    .timeline::before, .timeline-item::before { display: none; }
    .timeline-item { width: 45%; text-align: center; align-items: center; }
    .time { text-align: center; }
}
