@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

:root {
    --bg-dark: #0f172a; /* Deep blue-black */
    --bg-darker: #020617; /* Near black */
    --bg-card: #1e293b; /* Slate blue for cards/sections */
    --accent-primary: #38bdf8; /* Modern sky blue */
    --accent-secondary: #f472b6; /* Vibrant pink for personal favorites */
    --accent-yellow: #fbbf24; /* Warm yellow for gallery */
    --text-main: #f1f5f9; /* Off-white */
    --text-muted: #94a3b8; /* Muted slate */
    --border-color: rgba(255, 255, 255, 0.1);
}

/* styles.css - external file */
/* Global resets and base typography */
* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; } /* Enables smooth jumping between sections */
body { 
    font-family: 'Inter', Arial, sans-serif; 
    color: var(--text-main); 
    background: var(--bg-darker); 
    line-height: 1.6;
    letter-spacing: -0.01em;
}

/* Navigation - Fixed to the top of the screen */
nav {
    position: fixed;
    top:0; left:0; width:100%;
    background: rgba(15, 23, 42, 0.8); /* Semi-transparent bg-dark */
    backdrop-filter: blur(8px); /* Modern blur effect */
    z-index:100; /* Ensure it stays above all other content */
    padding:1rem;
    border-bottom: 1px solid var(--border-color);
}
nav ul { list-style:none; text-align:center; }
nav li { display:inline-block; margin:0 1.5rem; vertical-align: middle; }

/* Visual separator (vertical line) between the 3rd and 4th menu items */
nav li:nth-child(3) {
    margin-right: 3rem;
    position: relative;
}
nav li:nth-child(3)::after {
    content: "";
    position: absolute;
    right: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    height: 1.5rem;
    width: 1px;
    background: var(--border-color);
}

/* Navigation links styling and hover effects */
nav a { color: var(--text-muted); text-decoration:none; font-weight:bold; transition: all 0.3s; display: inline-block; }
nav a:hover, nav a.active { color: var(--accent-primary); }
nav a.active { border-bottom: 2px solid var(--accent-primary); }

/* Specific colors for specific sub-pages */
nav a[href*="personal-favorites"]:hover, nav a.active-pink { color: var(--accent-secondary); }
nav a.active-pink { border-bottom: 2px solid var(--accent-secondary); }

nav a[href*="gallery"]:hover, nav a.active-yellow { color: var(--accent-yellow); }
nav a.active-yellow { border-bottom: 2px solid var(--accent-yellow); }

/* Classic Parallax sections: Background image stays fixed while content scrolls over it */
.parallax {
    min-height:100vh;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position:relative;
    display:flex;
    align-items:center;
    justify-content:center;
    color: var(--text-main);
    text-shadow:0 0 10px rgba(0,0,0,0.8);
}

/* Modern Parallax for Video/Special Content (e.g., Dolly Zoom) */
.parallax-window {
    position: relative;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
    z-index: 1; /* Establish a stacking context for overlaying content */
}

.parallax-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Clip-path ensures the fixed video only shows within the bounds of this container */
.parallax-window .parallax-background {
    clip-path: inset(0 0 0 0);
    -webkit-clip-path: inset(0 0 0 0);
}

/* Styling for the background video used in the Dolly Zoom effect */
.parallax-background video {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%); /* Centering the video */
    pointer-events: none; /* User cannot click the video directly */
    object-fit: cover;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Lightbox styles: Full-screen image pop-up triggered by JS */
.lightbox {
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.95);
    display: none; /* Hidden by default; toggled by JS */
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    cursor: default !important;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2.5rem;
    color: var(--text-main);
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.lightbox-close:hover {
    color: var(--accent-primary);
}

/* Static Hero/Content sections used on Home and Explanations pages */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-main);
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Background gradients for specific homepage sections */
#home {
    background: radial-gradient(circle at center, var(--bg-card) 0%, var(--bg-darker) 100%);
    border-bottom: 1px solid var(--border-color);
}

#explanations {
    background: linear-gradient(45deg, #2c3e50 0%, #000000 100%);
    border-top: 1px solid var(--border-color);
}

#explanations .content h2 {
    margin-bottom: 3rem;
    font-size: 3.5rem;
    line-height: 1.2;
    color: var(--accent-primary);
}

#explanations .content h3 {
    margin: 4rem 0 2rem;
    font-size: 2.2rem;
    color: var(--accent-secondary);
}

#explanations .content p {
    margin-bottom: 2.5rem;
    line-height: 1.8;
    font-size: 1.15rem;
    color: var(--text-muted);
}

#explanations .content ul, #explanations .content ol {
    list-style: none;
    margin-bottom: 4rem;
    padding: 0;
}

#explanations .content li {
    margin-bottom: 1.5rem;
    font-size: 1.15rem;
    border-left: 3px solid var(--accent-primary);
    padding-left: 1.5rem;
    text-align: left;
}

#explanations .content ol {
    counter-reset: my-counter;
}

#explanations .content ol li {
    counter-increment: my-counter;
    position: relative;
}

#explanations .content ol li::before {
    content: counter(my-counter) ".";
    position: absolute;
    left: -2rem;
    color: var(--accent-secondary);
    font-weight: bold;
}

#explanations .content table {
    margin: 3rem auto;
}

/* Overlay content container for parallax sections */
.content {
    text-align:center;
    max-width:900px;
    padding:3rem;
}
.content h1 { font-size:4rem; margin-bottom:1.5rem; letter-spacing: -0.02em; color: var(--accent-primary); }

/* Generic content sections with varying backgrounds */
.content-section {
    padding:8rem 2rem;
    text-align:center;
}
.bg-darker { background: var(--bg-darker); }
.bg-dark { background: var(--bg-dark); }
.bg-card { background: var(--bg-card); }

/* Centered containers for text alignment */
.container { max-width: 800px; margin: 0 auto; }
.container-wide { max-width: 900px; margin: 0 auto; }

/* Utility classes for spacing and typography */
.m-top-1 { margin-top: 1.5rem; }
.m-top-5 { margin-top: 5rem; }
.m-top-6 { margin-top: 6rem; }
.m-bottom-5 { margin-bottom: 5rem; }

.italic { font-style: italic; }
.opacity-8 { opacity: 0.8; }

.content-section h2 { margin-bottom:3rem; font-size:2.8rem; letter-spacing: -0.02em; color: var(--accent-primary); }

/* Tables used for technical comparisons or data */
table { margin:4rem auto; border-collapse:collapse; width:90%; background: var(--bg-dark); border-radius: 8px; overflow: hidden; }
th, td { border:1px solid var(--border-color); padding:1.2rem; text-align: left; }
th { background: var(--bg-card); color: var(--accent-primary); font-weight: 700; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.05em; }
td { color: var(--text-muted); }

/* Image and figure styling */
img { max-width:100%; height:auto; margin:2rem 0; cursor: zoom-in; transition: transform 0.3s ease; }
img:hover { transform: scale(1.02); }
.img-shadow { box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.img-border { border: 10px solid var(--bg-card); }
figure { margin:3rem auto; max-width:700px; }
figcaption { margin-top: 1rem; font-weight: 700; font-size: 1.2rem; color: var(--accent-secondary); }

/* Article wrappers for individual content pieces */
article {
    margin-bottom: 6rem;
    padding: 2rem;
    background: var(--bg-dark);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

article p {
    max-width: 700px;
    margin: 0 auto 2rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Contact Form Styling */
.form-group { margin-bottom: 0.5rem; }
form {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
}
label {
    display: block;
    margin: 1.2rem 0 0.5rem;
    font-weight: bold;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
input, textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-darker);
    color: var(--text-main);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
    outline: none;
}
input:focus, textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}
textarea {
    min-height: 120px;
    resize: vertical;
}
button {
    display: block;
    width: 100%;
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: var(--accent-primary);
    color: var(--bg-darker);
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s, transform 0.2s;
}
button:hover {
    background: #7dd3fc; /* Lighter sky blue */
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}
button:active {
    transform: translateY(2px);
}

/* Button Sent State (toggled via JS after successful form submission) */
button.sent {
    background: #10b981 !important; /* Modern Emerald green */
    color: white !important;
    cursor: default;
    pointer-events: none;
}
button.sent::after {
    content: " ✓"; /* Tick symbol */
}

/* Video wrapper for ensuring 16:9 aspect ratio in iframes */
.video-wrapper { position:relative; padding-bottom:56.25%; height:0; overflow:hidden; max-width:100%; }
.video-wrapper iframe { position:absolute; top:0; left:0; width:100%; height:100%; }

/* Mobile fallback - disable fixed background parallax on small screens for better performance/rendering */
@media (max-width: 768px) {
    .parallax { background-attachment: scroll; } /* iOS/mobile fix */
    .hero-section { min-height: auto; padding: 10rem 2rem; }
}