/* ==========================================================================
   LAYERS — MAIN CSS
   Design System, Variables, Reset, Typography, Common Elements
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-color: #faf9f6;
    /* Ivory / Off-white premium */
    --text-primary: #111111;
    --text-secondary: #555555;
    --text-light: #999999;
    --accent-color: #d4af37;
    /* Subtle Gold */
    --accent-dark: #b8962e;
    --border-color: rgba(17, 17, 17, 0.1);

    /* Dark Theme Variants */
    --bg-dark: #0a0a0a;
    --text-dark-primary: #f5f5f5;
    --text-dark-secondary: #a0a0a0;
    --border-dark: rgba(255, 255, 255, 0.15);

    /* Typography */
    /* Headers & Display: Playfair Display for elegance */
    --font-heading: 'Playfair Display', 'Cormorant Garamond', serif;
    /* Body text: Inter for modern readability and accessibility */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing System */
    --space-2: 0.5rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* Transitions */
    --transition-fast: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);

    /* Containers */
    --container-width: 1400px;
    --container-padding: 5vw;
}

/* Base Reset & Accessibility */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
    /* Handled by GSAP/Lenis usually, but we keep auto for standard */
    font-size: 16px;
    /* Accessible base size */
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent scroll and interaction during page load */
body.loading {
    overflow: hidden;
    pointer-events: none;
}

/* Focus States for Accessibility */
*:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 4px;
}

/* Typography Base */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(3rem, 6vw, 6rem);
}

h2 {
    font-size: clamp(2.5rem, 4vw, 4rem);
}

h3 {
    font-size: clamp(1.5rem, 2.5vw, 2.5rem);
}

p {
    margin-bottom: var(--space-4);
    font-size: clamp(1rem, 1.1vw, 1.25rem);
    /* Minimum 16px, scales gracefully */
    color: var(--text-secondary);
    max-width: 65ch;
    /* Optimal reading length */
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

em,
i {
    font-style: italic;
    font-family: var(--font-heading);
    font-weight: 300;
}

/* Common Layout Components */
.section-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: var(--space-24) var(--container-padding);
}

/* Header & Navigation */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: var(--space-6) var(--container-padding);
    mix-blend-mode: difference;
    /* Creates stunning contrast against any background (white/black) */
    color: #fff;
    /* Base color for mix-blend-mode */
    transition: padding var(--transition-fast);
}

.main-header.scrolled {
    padding: var(--space-4) var(--container-padding);
    background: rgba(250, 249, 246, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    mix-blend-mode: normal;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.04);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nav-logo-img {
    height: 36px;
    width: auto;
    transition: opacity var(--transition-fast);
    filter: invert(1);
}

.nav-logo:hover .nav-logo-img {
    opacity: 0.8;
}

.nav-logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
}

.logo-sub {
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    margin-top: 2px;
}

.nav-links {
    display: flex;
    gap: var(--space-8);
    list-style: none;
}

.nav-link {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    padding-bottom: 4px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background-color: currentColor;
    transition: width var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
    z-index: 105;
    color: inherit;
}

.toggle-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: currentColor;
    transition: var(--transition-fast);
}

.toggle-line:nth-child(1) {
    top: 4px;
}

.toggle-line:nth-child(2) {
    bottom: 4px;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-8);
    background-color: var(--text-primary);
    color: var(--bg-color);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    border: 1px solid var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: 4px;
    /* Subtle softening */
}

.btn-primary svg {
    transition: transform var(--transition-fast);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--text-primary);
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

/* Full Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    color: var(--text-dark-primary);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.loader-inner {
    text-align: center;
    width: 200px;
}

.loader-logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-8);
}

.loader-bar {
    width: 100%;
    height: 1px;
    background-color: var(--border-dark);
    position: relative;
    margin-bottom: var(--space-4);
    overflow: hidden;
}

.loader-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: var(--text-dark-primary);
    transition: width 0.3s ease;
}

.loader-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dark-secondary);
}

/* Footer */
.main-footer {
    background-color: var(--text-primary);
    color: var(--bg-color);
    padding: var(--space-16) var(--container-padding) var(--space-6);
    margin-top: var(--space-24);
}

.footer-container {
    max-width: var(--container-width);
    margin: 0 auto;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: var(--space-12);
    margin-bottom: var(--space-6);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo-img {
    height: 48px;
    width: auto;
    margin-bottom: 8px;
    filter: invert(1);
}

.footer-logo-main {
    font-family: var(--font-heading);
    font-size: 2rem;
    line-height: 1;
    letter-spacing: 0.1em;
}

.footer-logo-sub {
    font-family: var(--font-body);
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    text-align: right;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Utility Animations */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
}

/* Responsive Core */
@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: block;
    }

    .footer-top {
        flex-direction: column;
        gap: var(--space-8);
        text-align: center;
        align-items: center;
    }

    .footer-links {
        text-align: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
}

/* Mobile Menu Overlay Styles */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-dark);
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-slow);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-links {
    list-style: none;
    text-align: center;
}

.mobile-nav-links li {
    margin-bottom: var(--space-8);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease;
}

.mobile-menu-overlay.active .mobile-nav-links li {
    transform: translateY(0);
    opacity: 1;
}

.mobile-menu-overlay.active .mobile-nav-links li:nth-child(1) {
    transition-delay: 0.2s;
}

.mobile-menu-overlay.active .mobile-nav-links li:nth-child(2) {
    transition-delay: 0.3s;
}

.mobile-menu-overlay.active .mobile-nav-links li:nth-child(3) {
    transition-delay: 0.4s;
}

.mobile-menu-overlay.active .mobile-nav-links li:nth-child(4) {
    transition-delay: 0.5s;
}

.mobile-nav-link {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--text-dark-secondary);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--text-dark-primary);
    font-style: italic;
}