:root {
    /* Dark Mode (Default) */
    --bg-color: #000000;
    --text-primary: #e5e5e5;
    --text-secondary: #888888;
    --accent-color: #111111;
    --line-color: #222222;
    --btn-bg: #0a0a0a;
    --btn-border: #222222;
    --btn-hover: #1f1f1f;
    --btn-text: #cccccc;

    /* Toggle Switch Colors (mimicking Radix) */
    --switch-bg: #000000;
    --switch-knob: #ffffff;
    --switch-checked-bg: #e5e5e5;
    --switch-checked-knob: #0f0f0f;
}

[data-theme="light"] {
    /* Light Mode */
    --bg-color: #ffffff;
    --text-primary: #111111;
    --text-secondary: #555555;
    --accent-color: #e5e5e5;
    --line-color: #e5e5e5;
    --btn-bg: #f9f9f9;
    --btn-border: #dddddd;
    --btn-hover: #ececec;
    --btn-text: #333333;

    --switch-bg: #e5e5e5;
    --switch-knob: #ffffff;
    --switch-checked-bg: #111111;
    --switch-checked-knob: #ffffff;

    --glow-color: rgba(0, 0, 0, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        color 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-font-smoothing: antialiased;
}


.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
}

/* Top Hero Image */
.hero-image {
    width: 100%;
    aspect-ratio: 4 / 1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-image:hover img {
    transform: scale(1.05);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.header-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 500px;
    line-height: 1.5;
}

/* Theme Switcher */
.theme-switch-container {
    display: flex;
    align-items: center;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--switch-bg);
    transition: .4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background-color: var(--switch-knob);
    transition: .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--switch-checked-bg);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--switch-checked-bg);
}

input:checked+.slider:before {
    transform: translateX(20px);
    background-color: var(--switch-checked-knob);
}

.switch-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.switch-label:hover .switch-text {
    color: var(--text-primary);
}

/* Separator */
.separator {
    height: 1px;
    width: 100%;
    background-color: var(--line-color);
    margin-bottom: 3.5rem;
    transform-origin: left;
}

/* Gallery Layout */
.gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 5rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.gallery-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--accent-color);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
    filter: brightness(0.9) grayscale(0.1);
}

/* Aspect ratios for gallery */
.gallery-item.vertical {
    height: 100%;
}

.gallery-item.square {
    aspect-ratio: 1/1;
    /* Enforce square logic */
}

.gallery-item.full-width {
    width: 100%;
    aspect-ratio: 2/1;
    /* More panoramic */
}

/* Hover Effects for images */
.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.7));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1.5rem;
}

.hover-text {
    color: #ffffff;
    /* Must always be white against the black gradient for visibility */
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    transform: translateY(15px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: brightness(1.1) grayscale(0);
}

.gallery-item:hover .hover-overlay {
    opacity: 1;
}

.gallery-item:hover .hover-text {
    transform: translateY(0);
}

/* Contact Section (New Footer) */
.new-footer {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    margin: 0 2rem 2rem 2rem;
    background-color: #000000;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    padding: 0;
    max-width: 1000px;
    transform-origin: center;
}

@media (min-width: 1064px) {
    .new-footer {
        margin: 0 auto 2rem auto;
    }
}

.hyperspace-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.footer-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    flex: 1;
    padding: 4rem 3rem 2.5rem 3rem;
}

.hyperspace-text {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
    text-align: center;
    margin: auto 0;

    /* Mix blend difference on gradient text */
    background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    mix-blend-mode: difference;
    z-index: 10;
    position: relative;
    padding: 0 0.5rem;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 4rem;
}

.footer-credit {
    color: #90909c;
    font-size: 0.95rem;
    font-weight: 500;
}

.footer-socials {
    display: flex;
    gap: 0.75rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #d1d1d1;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.social-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.social-icon svg {
    width: 18px;
    height: 18px;
}

/* Reveal Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Separator scale animation */
.separator.animate-on-scroll {
    transform: scaleX(0);
}

.separator.animate-on-scroll.is-visible {
    transform: scaleX(1);
}

/* Staggered Delays */
.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}

.delay-5 {
    transition-delay: 0.5s;
}

.delay-6 {
    transition-delay: 0.6s;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .header {
        flex-direction: column;
        gap: 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item.square:first-child,
    .gallery-item.square:last-child {
        height: auto;
    }
}

/* --- Loading Screen & Page Reveal Animations --- */
body.loading {
    overflow: hidden;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.progress-container {
    width: 300px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: #ffffff;
    transition: width 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Initial Flow State for main content elements */
body>.container,
body>.contact-section {
    opacity: 0;
    filter: blur(12px);
    transform: translateY(30px);
    transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1),
        filter 1.5s cubic-bezier(0.16, 1, 0.3, 1),
        transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base styles for loaded content */
body.page-loaded>.container,
body.page-loaded>.contact-section {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* Add slight staggered entrance for content pieces */
body.page-loaded>.container {
    transition-delay: 0.1s;
}

body.page-loaded>.contact-section {
    transition-delay: 0.2s;
}

/* Map Section */
.map-container {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--btn-border);
}

.map-style-selector.absolute {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.map-dropdown {
    background-color: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--btn-border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.map-dropdown:focus {
    border-color: var(--text-secondary);
}