/* === Variables === */
:root {
    --font-display: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-body: var(--font-display);
    --transition-speed: 200ms;
    --section-padding: clamp(0.5rem, 2vh, 1rem);
    --content-width: 1200px;
    --nav-height: 60px;

    /* Default light theme - overridden by JS from config */
    --primary: #8B4513;
    --secondary: #f3912b;
    --accent: #e5e1e3;
    --text-dark: #2c1810;
    --text-secondary: #781b12;
    --text-muted: #41512d;
    --text-light: #ffffff;
    --bg-light: #ffffff;
    --bg-dark: #e5e1e3;
    --mountain-gradient: linear-gradient(135deg, #781b12 0%, #f3912b 50%, #e5e1e3 100%);
    --primary-rgb: 139, 69, 19;
    --text-on-primary: #ffffff;
    --shadow-hover: 0 3px 8px rgba(var(--primary-rgb), 0.25);
    --shadow-active: 0 1px 4px rgba(var(--primary-rgb), 0.2);

    /* Dark-mode-only vars (overridden below) */
    --glass-bg: transparent;
    --glass-border: transparent;
    --glass-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 0.5rem);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-synthesis: none;
    overflow-x: hidden;
}

body:not(.config-loaded) > *:not(#loader) { visibility: hidden; }

h1, h2, h3, h4, h5, h6 { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
p, li, span, div { text-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.05); }
img { max-width: 100%; height: auto; display: block; }
.hidden { display: none; }

/* === Loader === */
#loader {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--bg-light);
    z-index: 9999;
    transition: opacity 300ms ease;
}

#loader.fade-out { opacity: 0; pointer-events: none; }
.loader-icon { font-size: 3rem; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* === Navigation === */
#nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 1000;
    transition: all var(--transition-speed) ease;
    contain: layout style;
}

#nav.scrolled { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }

#nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    height: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 2rem;
}

#nav a {
    text-decoration: none;
    color: inherit;
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    transition: color var(--transition-speed) ease;
    padding: 0.5rem 0;
}

#nav a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-speed) ease;
}

#nav a:hover::after, #nav a.active::after { width: 100%; }

/* === Hero === */
.hero {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: var(--section-padding) 2rem;
    position: relative;
    overflow: hidden;
    contain: layout style paint;
    background: var(--mountain-gradient);
    color: var(--text-light);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-image, url('./images/crested_butte.webp')) no-repeat center/cover;
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(27,54,93,0.7) 0%, rgba(46,89,132,0.6) 50%, rgba(74,123,167,0.7) 100%);
    z-index: 1;
}

.hero > div { position: relative; z-index: 2; }

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 300;
    line-height: 1.1;
    margin-bottom: 1rem;
    animation: hero-scale 1s ease forwards;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8), 0 0 20px rgba(0,0,0,0.5), 0 0 40px rgba(27,54,93,0.3);
    color: var(--text-on-primary);
}

.hero-date {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    letter-spacing: 0.2em;
    animation: hero-scale 1s ease 0.2s forwards;
    font-weight: 400;
    position: relative;
    z-index: 2;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8), 0 0 15px rgba(0,0,0,0.5);
    color: var(--text-on-primary);
}

.hero-accent {
    color: var(--accent);
    display: inline-block;
    transform: scale(1.1);
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.4));
}

@keyframes hero-scale {
    0%   { transform: scale(0.98); }
    50%  { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* === Sections === */
section {
    min-height: 100vh;
    padding: calc(var(--nav-height) + 0.5rem) 2rem 50vh;
    max-width: var(--content-width);
    margin: 0 auto;
    contain: layout style;
    overflow: visible;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    text-align: center;
    margin: 0 0 1.5rem 0;
    position: relative;
    font-weight: 300;
    letter-spacing: -0.02em;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -1rem; left: 50%;
    transform: translateX(-50%);
    width: 60px; height: 2px;
    background: var(--primary);
}

/* === Cards === */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
    align-items: stretch;
}

.card {
    background: var(--bg-light);
    padding: 1.75rem;
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-speed) ease;
    container-type: inline-size;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    color: var(--text-dark);
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--primary);
    transform: translateX(-100%);
    transition: transform 300ms ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(var(--primary-rgb), 0.15);
}

.card:hover::before { transform: translateX(0); }

.card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

@container (min-width: 400px) { .card h3 { font-size: 1.75rem; } }
.card p { margin: 0.25rem 0; }
.card p:first-of-type { margin-top: 0.5rem; }

/* === Animations === */
.animate {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.animate.visible { opacity: 1; transform: translateY(0); }
.animate:nth-child(2) { transition-delay: 100ms; }
.animate:nth-child(3) { transition-delay: 200ms; }
.animate:nth-child(4) { transition-delay: 300ms; }

/* === Footer === */
footer {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-light);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
    color: var(--text-dark);
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: opacity var(--transition-speed) ease;
}

footer a:hover { opacity: 0.8; }

.footer-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

/* === Theme Toggle === */
.theme-toggle {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 2000;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 48px; height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* === Countdown === */
.countdown {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.countdown-item { text-align: center; }

.countdown-value {
    font-size: 2.5rem;
    font-weight: 300;
    font-family: var(--font-display);
    color: var(--text-on-primary);
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8), 0 0 20px rgba(0,0,0,0.5), 0 0 40px rgba(27,54,93,0.3);
}

.countdown-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
    color: var(--text-on-primary);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8), 0 0 15px rgba(0,0,0,0.5);
}

/* === Timeline === */
.timeline-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 1rem;
    min-height: fit-content;
    max-height: calc(100vh - 120px);
    padding-bottom: 1rem;
}

.timeline-horizontal {
    display: flex;
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    gap: 3rem;
    padding: 2rem 0;
    flex: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
    align-items: start;
}

.timeline-horizontal::-webkit-scrollbar { display: none; }

.timeline-item-horizontal {
    flex: 0 0 700px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timeline-card {
    background: var(--bg-light);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-speed) ease;
    width: 100%;
    max-width: 680px;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
}

.timeline-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(var(--primary-rgb), 0.15);
}

.timeline-text { padding: 1rem 1.5rem; }

.timeline-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.timeline-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    line-height: 1.3;
}

.timeline-description {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.9rem;
    margin: 0;
}

.timeline-images-horizontal {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1.5rem 1.5rem;
}

.timeline-image-wrapper {
    background: var(--accent);
    border-radius: 12px;
    padding: 0.5rem;
    overflow: hidden;
}

.timeline-photo {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-speed) ease;
    display: block;
}

.timeline-photo:hover { transform: scale(1.02); }

.portrait-row { display: flex; gap: 0.75rem; }
.portrait-row .timeline-image-wrapper { flex: 1; max-width: calc(50% - 0.375rem); }

.timeline-nav {
    background: var(--bg-light);
    border: 2px solid var(--primary);
    color: var(--primary);
    width: 50px; height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    align-self: flex-start;
    top: calc(50vh - 25px);
    z-index: 10;
}

.timeline-nav:hover {
    background: var(--primary);
    color: var(--text-on-primary);
    transform: scale(1.1);
}

.timeline-nav:disabled { opacity: 0.5; cursor: not-allowed; transform: scale(1); }
.timeline-nav:disabled:hover { background: var(--bg-light); color: var(--primary); }

/* === Travel === */
.horizontal-cards {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 3rem;
}

.horizontal-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-direction: row;
}

.horizontal-card .card-content { flex: 1; }
.horizontal-card:nth-child(even) { flex-direction: row-reverse; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h3 { margin: 0; flex: 1; }

.airport-code {
    font-family: monospace;
    font-size: 0.875rem;
    font-weight: bold;
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-left: 1rem;
}

.travel-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.5rem;
    background: rgba(var(--primary-rgb), 0.05);
    border-radius: 6px;
}

.metric-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.metric-value { font-weight: 600; font-size: 0.9rem; text-align: center; }

.cost-1, .availability-excellent { color: #22c55e; }
.cost-2, .availability-good { color: #eab308; }
.cost-3, .availability-limited { color: #f97316; }
.cost-4 { color: #ef4444; }

.airlines {
    font-size: 0.875rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.airport-description { margin: 0.5rem 0; }

.travel-tips { margin-top: 3rem; }

.travel-tips h3 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.travel-tips ul {
    list-style: none;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    color: var(--text-dark);
}

.travel-tips li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.travel-tips li::before { content: "\2708\FE0F"; position: absolute; left: 0; top: 0; }
.travel-tips li:last-child { margin-bottom: 0; }

/* === Hotels === */
.hotel-card {
    position: relative;
    min-height: auto !important;
    height: auto !important;
}

.hotel-card h3 {
    font-size: 1.25rem !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hotel-card p { margin: 0.5rem 0; font-size: 0.95rem; }

.hotel-description {
    margin: 0.75rem 0 1rem 0 !important;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.hotel-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.1);
}

.hotel-rate { color: var(--primary); font-size: 1.1rem; font-weight: 600; }
.hotel-code { color: var(--text-muted); font-size: 0.875rem; }

.hotel-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: auto;
}

/* === Buttons (shared base) === */
.maps-button,
.book-button,
.registry-button,
.submit-button,
.pinterest-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
    white-space: nowrap;
    border: 1.5px solid transparent;
}

.maps-button {
    background: var(--bg-light);
    color: var(--text-secondary);
    border-color: var(--primary);
    margin: 0 0 1rem 0;
    width: 100%;
    justify-content: flex-start;
}

.card .maps-button { margin: 0.75rem 0 0.25rem 0; }

.maps-button:hover {
    background: var(--primary);
    color: var(--text-on-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.maps-button:active { transform: translateY(0); box-shadow: var(--shadow-active); }
.maps-button:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.maps-button:focus:not(:focus-visible) { outline: none; }

.maps-icon { font-size: 1rem; opacity: 0.8; }
.maps-button:hover .maps-icon { opacity: 1; }
.maps-text { flex: 1; }
.maps-arrow, .pinterest-arrow { font-size: 0.75rem; opacity: 0.6; transition: all var(--transition-speed) ease; }
.maps-button:hover .maps-arrow,
.pinterest-button:hover .pinterest-arrow { opacity: 1; transform: translate(2px, -2px); }

.book-button,
.maps-button.compact {
    padding: 0.875rem 1rem;
    font-size: 0.85rem;
    min-height: 44px;
    width: auto;
    margin: 0;
}

.book-button {
    background: var(--primary);
    color: var(--text-on-primary);
    border-color: var(--primary);
    line-height: 1.2;
}

.book-button:hover {
    background: var(--text-secondary);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.book-button:active { transform: translateY(0); box-shadow: var(--shadow-active); }

.hotel-actions .maps-button.compact {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    line-height: 1.2;
}

.hotel-actions .maps-button.compact:hover {
    background: var(--primary);
    color: var(--text-on-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.hotel-actions .maps-button.compact:active { transform: translateY(0); box-shadow: var(--shadow-active); }

.pinterest-button {
    background: #BD081C;
    color: white;
    margin-top: 1rem;
}

.pinterest-button:hover {
    background: #A0061A;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(189, 8, 28, 0.25);
}

.pinterest-button:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(189, 8, 28, 0.2); }
.pinterest-icon { font-size: 1rem; opacity: 0.9; }
.pinterest-text { flex: 1; }

.registry-button {
    padding: 1rem 2rem;
    background: var(--primary);
    color: var(--text-on-primary);
    font-size: 1rem;
    min-width: 200px;
    margin-top: auto;
}

.registry-button:hover {
    background: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}

.registry-button:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.2); }

.submit-button {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.submit-button:hover:not(:disabled) {
    background: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.submit-button:disabled { opacity: 0.6; cursor: not-allowed; }

/* === Dress Code === */
.dress-code {
    background: rgba(var(--primary-rgb), 0.05);
    border-left: 3px solid var(--primary);
    padding: 1rem 1.25rem;
    margin: 1.25rem 0 0 0;
    border-radius: 0 8px 8px 0;
    line-height: 1.4;
}

.dress-code-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.dress-code-title::before { content: "\1F454"; opacity: 0.8; }

.dress-code-description {
    font-size: 0.825rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
}

.dress-code-details {
    background: rgba(var(--primary-rgb), 0.03);
    padding: 1.25rem;
    border-radius: 8px;
    margin-top: 0.75rem;
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    line-height: 1.6;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.dress-code-section {
    margin: 0.5rem 0;
    padding: 0.625rem 0.75rem;
    background: rgba(var(--primary-rgb), 0.02);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}

.dress-code-section:first-child { margin-top: 0; }
.dress-code-section:last-of-type { margin-bottom: 0.25rem; }

.dress-code-heading {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.dress-code-section p { margin: 0; color: var(--text-muted); font-size: 0.875rem; line-height: 1.4; }
.dress-code-intro { margin-bottom: 1.5rem; font-weight: 500; }

/* === Registry === */
.registry-wrapper { text-align: center; max-width: 800px; margin: 0 auto; }
.registry-message { font-size: 1.125rem; margin-bottom: 2rem; }

.registry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.registry-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2.5rem 2rem;
}

.registry-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.registry-card h3 { margin-bottom: 0.5rem; font-size: 1.5rem; }

.registry-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

/* === RSVP Form === */
.rsvp-wrapper { text-align: center; }

.form-divider {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid var(--accent);
}

.form-container {
    background: var(--bg-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.rsvp-form { padding: 2rem; text-align: left; }
.form-group { margin-bottom: 1.5rem; }

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--accent);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
    background: var(--bg-light);
    color: var(--text-dark);
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

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

.radio-group { display: flex; gap: 1.5rem; margin-top: 0.5rem; }

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input[type="radio"] {
    width: 18px; height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.plus-one-section { margin-top: 2rem; padding-top: 2rem; }

.form-message {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.form-message.success { display: block; background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.form-message.error { display: block; background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* === Scrollbar === */
@supports (scrollbar-width: thin) {
    * { scrollbar-width: thin; scrollbar-color: var(--primary) transparent; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* ==========================================================
   DARK MODE — all overrides consolidated in one block
   ========================================================== */
[data-theme="dark"] {
    --text-dark: #F5F5F5;
    --text-secondary: #D4AF37;
    --text-muted: #A3A3A3;
    --text-light: #1A1A1A;
    --bg-light: #0A0A0A;
    --bg-dark: #131415;
    --mountain-gradient: linear-gradient(135deg, #0A0A0A 0%, #131415 50%, #1A1A1A 100%);
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Nav */
[data-theme="dark"] #nav {
    background: rgba(3, 7, 18, 0.7);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-dark);
}

[data-theme="dark"] #nav.scrolled { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); }

/* Cards — use glass variables */
[data-theme="dark"] .card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--glass-shadow);
    border: var(--glass-border);
}

[data-theme="dark"] .card:hover {
    box-shadow: 0 12px 40px rgba(var(--primary-rgb), 0.15);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
}

/* Footer */
[data-theme="dark"] footer {
    background: var(--bg-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Theme toggle */
[data-theme="dark"] .theme-toggle {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: var(--text-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .theme-toggle:hover {
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.2);
    border-color: rgba(var(--primary-rgb), 0.4);
    background: rgba(255, 255, 255, 0.1);
}

/* Timeline */
[data-theme="dark"] .timeline-card {
    background: var(--bg-dark);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(var(--primary-rgb), 0.2);
}

[data-theme="dark"] .timeline-card:hover {
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
    transform: translateY(-5px);
    border-color: rgba(var(--primary-rgb), 0.4);
}

[data-theme="dark"] .timeline-nav {
    background: var(--bg-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

[data-theme="dark"] .timeline-nav:disabled:hover { background: var(--bg-dark); }
[data-theme="dark"] .timeline-image-wrapper { background: rgba(64, 64, 64, 0.3); }

/* Travel */
[data-theme="dark"] .travel-tips ul {
    background: var(--bg-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .airport-code {
    background: rgba(var(--primary-rgb), 0.3);
    color: var(--text-secondary);
}

/* Hotels */
[data-theme="dark"] .hotel-info { border-bottom-color: rgba(var(--primary-rgb), 0.2); }
[data-theme="dark"] .hotel-rate { color: var(--text-secondary); }

/* Buttons (dark) */
[data-theme="dark"] .maps-button {
    background: var(--bg-dark);
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

[data-theme="dark"] .maps-button:hover {
    background: var(--text-secondary);
    color: var(--bg-dark);
}

[data-theme="dark"] .book-button {
    background: var(--text-secondary);
    color: var(--bg-dark);
    border-color: var(--text-secondary);
}

[data-theme="dark"] .book-button:hover {
    background: var(--primary);
    color: var(--text-on-primary);
    border-color: var(--primary);
}

[data-theme="dark"] .hotel-actions .maps-button.compact {
    color: var(--text-secondary);
    border-color: var(--text-secondary);
    background: transparent;
}

[data-theme="dark"] .hotel-actions .maps-button.compact:hover {
    background: var(--text-secondary);
    color: var(--bg-dark);
}

[data-theme="dark"] .pinterest-button {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
}

[data-theme="dark"] .pinterest-button:hover {
    background: rgba(var(--primary-rgb), 0.2);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

[data-theme="dark"] .registry-button {
    background: var(--text-secondary);
    color: var(--bg-dark);
}

[data-theme="dark"] .registry-button:hover {
    background: var(--primary);
    color: var(--text-on-primary);
}

[data-theme="dark"] .submit-button:hover:not(:disabled) { background: var(--secondary); }

/* Dress code (dark) */
[data-theme="dark"] .dress-code {
    background: rgba(var(--primary-rgb), 0.1);
    border-left-color: var(--text-secondary);
}

[data-theme="dark"] .dress-code-title { color: var(--text-secondary); }

[data-theme="dark"] .dress-code-details {
    background: rgba(var(--primary-rgb), 0.05);
    border-color: rgba(var(--primary-rgb), 0.1);
    color: var(--text-muted);
}

[data-theme="dark"] .dress-code-section {
    background: rgba(var(--primary-rgb), 0.03);
    border-left-color: var(--text-secondary);
}

[data-theme="dark"] .dress-code-heading { color: var(--text-secondary); }

/* Form (dark) */
[data-theme="dark"] .form-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--glass-shadow);
    border: var(--glass-border);
}

[data-theme="dark"] .form-group input[type="text"],
[data-theme="dark"] .form-group input[type="email"],
[data-theme="dark"] .form-group textarea {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dark);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .form-group input[type="text"]:focus,
[data-theme="dark"] .form-group input[type="email"]:focus,
[data-theme="dark"] .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
    background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}

@media print {
    #nav, footer, .no-print { display: none !important; }
    body { color: black; background: white; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .timeline-item-horizontal { flex: 0 0 400px; }
    .timeline-nav { width: 48px; height: 48px; }
}

/* Mobile */
@media (max-width: 768px) {
    .theme-toggle { top: 70px; right: 10px; width: 40px; height: 40px; font-size: 1rem; }

    #nav { height: auto; min-height: 60px; padding: 0.5rem 0; }

    #nav ul {
        gap: 0.25rem; font-size: 0.75rem; padding: 0 0.5rem;
        flex-wrap: wrap; justify-content: center; height: auto;
    }

    #nav a {
        padding: 0.5rem 0.75rem; white-space: nowrap;
        min-height: 44px; display: flex; align-items: center;
        border-radius: 6px; margin: 0.125rem; touch-action: manipulation;
    }

    .hero h1 { font-size: clamp(2.5rem, 12vw, 4rem); }
    .section-title { font-size: 2rem; }

    section {
        padding: calc(var(--nav-height) + 0.5rem) 1rem 40vh;
    }

    .maps-icon { font-size: 0.9rem; }

    /* Timeline mobile */
    .timeline-container {
        gap: 0; padding: 0; max-height: calc(100vh - 100px);
        overflow: hidden; margin-left: -0.75rem; margin-right: -0.75rem; width: 100vw;
    }

    .timeline-nav { display: none; }

    .timeline-horizontal {
        scroll-snap-type: none; overscroll-behavior-x: contain;
        max-height: calc(100vh - 120px); align-items: flex-start;
        gap: 0; padding: 0; margin: 0;
    }

    .timeline-item-horizontal {
        flex: 0 0 100vw; width: 100vw; max-width: 100vw;
        transition: opacity 0.3s ease, transform 0.3s ease;
        max-height: calc(100vh - 140px); overflow-y: auto;
        display: flex; flex-direction: column;
        justify-content: flex-start; align-items: center;
        padding: 0 1rem; margin: 0;
    }

    .timeline-card { max-width: calc(100vw - 2rem); width: 100%; margin: 0; }
    .timeline-text { padding: 1rem; }
    .timeline-title { font-size: 1.1rem; }
    .timeline-images-horizontal { padding: 0 1rem 1rem; gap: 0.5rem; }
    .portrait-row .timeline-image-wrapper { max-width: calc(50% - 0.25rem); }

    /* Travel mobile */
    .horizontal-card { flex-direction: column !important; text-align: center; }
    .travel-metrics { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .card-header { flex-direction: column; gap: 0.5rem; text-align: center; }
    .airport-code { margin-left: 0; }

    /* Hotels mobile */
    .hotel-card h3 { font-size: 1.1rem !important; white-space: normal; }
    .hotel-actions { grid-template-columns: 1fr; gap: 0.75rem; padding: 0 0.5rem; }
    .hotel-card { padding: 1.5rem; margin-bottom: 1rem; }
    .hotel-description { margin: 1rem 0 !important; line-height: 1.5; }

    .book-button, .maps-button.compact {
        width: 100%; min-height: 48px; padding: 0.875rem 1rem;
        font-size: 0.9rem; touch-action: manipulation;
    }

    /* Registry mobile */
    .registry-grid { grid-template-columns: 1fr !important; gap: 1.5rem; max-width: none; padding: 0 1rem; }
    .registry-card { padding: 2rem 1.5rem !important; }

    /* RSVP mobile */
    .rsvp-form { padding: 1.5rem 1rem; margin: 1rem; max-width: calc(100vw - 2rem); }
    .radio-group { flex-direction: column; gap: 1rem; }

    .form-group input, .form-group textarea, .form-group select {
        font-size: 16px; padding: 0.875rem; min-height: 48px; touch-action: manipulation;
    }

    .submit-button {
        padding: 1rem; min-height: 48px; font-size: 1rem;
        touch-action: manipulation; margin-top: 1.5rem;
    }

    .form-message { margin: 1rem; padding: 1rem; font-size: 0.95rem; }
}

/* Extra small */
@media (max-width: 480px) {
    #nav ul { gap: 0.125rem; font-size: 0.7rem; padding: 0 0.25rem; }
    #nav a { padding: 0.375rem 0.5rem; font-size: 0.7rem; }

    .hero h1 { font-size: clamp(2rem, 10vw, 3rem); }
    .section-title { font-size: 1.75rem; }

    .timeline-container { padding: 0; }
    .timeline-card { margin: 0; }
    .timeline-text { padding: 0.5rem 0.875rem; }
    .registry-grid { padding: 0 0.5rem; }
    .hotel-card { padding: 1rem; }
    .rsvp-form { padding: 1rem 0.75rem; margin: 0.5rem; }

    section { padding: calc(var(--nav-height) + 0.5rem) 0.75rem 30vh; }
}
