/* Shared Critical CSS - Above-Fold Only */
/* Manually curated for optimal performance (~7-8KB) */

/* Fonts - Inter 400 & 600 only */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/inter/inter-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/inter/inter-600.woff2') format('woff2');
}

/* Brandon Grotesque for Headings */
@font-face {
    font-family: 'Brandon Grotesque';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/Brandon-Grotesque-Web-Regular.woff2') format('woff2');
}

/* CSS Variables - Essential for preventing FOUC */
:root {
    --color-primary: #1B5E20;
    --color-primary-light: #2E7D32;
    --color-primary-dark: #0D3D10;
    --color-secondary: #2E7D32;
    --color-text: #212121;
    --color-text-light: #666666;
    --color-bg: #FFFFFF;
    --color-bg-light: #F8F9FA;
    --color-border: #E0E0E0;
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family-headings: 'Brandon Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-base: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --max-width: 1200px;
    --max-width-content: 800px;
    --container-padding: 1rem;
    --border-radius-sm: 4px;
    --border-radius-base: 8px;
    --border-radius-lg: 12px;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
html[data-theme="dark"] {
    /* Background Colors */
    --color-bg: #121212;
    --color-bg-light: #1E1E1E;
    --color-bg-section: #1A1A1A;

    /* Text Colors */
    --color-text: #E0E0E0;
    --color-text-light: #B0B0B0;
    --color-text-lighter: #808080;

    /* Primary Colors - Slightly lighter for dark mode */
    --color-primary: #4CAF50;
    --color-primary-light: #66BB6A;
    --color-primary-dark: #388E3C;

    /* Border Colors */
    --color-border: #333333;
    --color-border-light: #2A2A2A;
}

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

html {
    font-size: 16px;
    line-height: var(--line-height-normal);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    padding: var(--spacing-xl) 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-headings);
    font-weight: 600;
    line-height: var(--line-height-tight);
    color: var(--color-text);
    margin-bottom: var(--spacing-base);
}

h1 { font-size: var(--font-size-4xl); font-weight: 700; }
h2 { font-size: var(--font-size-3xl); }
p { margin-bottom: var(--spacing-base); }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-secondary); }

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

/* Header - Complete above-fold styling */
body > header {
    position: relative;
    background: linear-gradient(to right, #0f1410, #1a1d1f);
    height: 70px;
}

body > header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.28;
    pointer-events: none;
}

body > header .logo,
body > header .logo:hover,
body > header .nav-menu a,
body > header .nav-menu a:hover,
body > header .nav-menu a.active,
body > header .search-link,
body > header .search-link:hover,
body > header .mobile-menu-toggle,
body > header .mobile-menu-toggle:hover,
body > header .theme-toggle,
body > header .theme-toggle:hover {
    color: #ffffff !important;
}

body > header .logo:hover,
body > header .nav-menu a:hover,
body > header .nav-menu a.active,
body > header .search-link:hover,
body > header .mobile-menu-toggle:hover,
body > header .theme-toggle:hover {
    color: #66BB6A !important;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: var(--font-family-headings);
    font-size: var(--font-size-xl);
    font-weight: 700;
    text-decoration: none;
}

.logo-image {
    height: 32px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-menu-desktop {
    display: flex;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    font-family: var(--font-family-headings);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-base);
}

.search-link {
    padding: var(--spacing-sm);
    display: inline-flex;
    align-items: center;
}

.search-link svg {
    width: 24px;
    height: 24px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    width: 44px;
    height: 44px;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 18px;
    height: 22px;
    gap: 5px;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background-color: currentColor;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.hamburger-line:nth-child(1),
.hamburger-line:nth-child(3) {
    width: 90%;
}

.nav-actions {
    display: none;
}

.search-link-mobile {
    display: none;
}

/* Mobile Menu Overlay - Glassmorphism Backdrop */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Mobile Menu Drawer - Slide-in from Right */
.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 85vw);
    background: linear-gradient(165deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(248, 249, 250, 0.98) 50%,
            rgba(245, 247, 248, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 3px solid var(--color-primary);
    box-shadow:
        -8px 0 32px rgba(0, 0, 0, 0.15),
        -4px 0 16px rgba(46, 125, 50, 0.08);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Noise texture overlay for premium feel */
.mobile-menu-drawer::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.015) 2px, rgba(0, 0, 0, 0.015) 4px);
    pointer-events: none;
    z-index: 1;
}

.mobile-menu-drawer.active {
    transform: translateX(0);
}

/* Mobile Menu Close Button */
.mobile-menu-close {
    position: absolute;
    top: var(--spacing-base);
    right: var(--spacing-base);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: var(--border-radius-sm);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    opacity: 0;
    transform: scale(0.8) rotate(-90deg);
}

.mobile-menu-drawer.active .mobile-menu-close {
    animation: closeButtonAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
}

@keyframes closeButtonAppear {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-90deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.mobile-menu-close:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    transform: rotate(90deg) scale(1.1);
}

.mobile-menu-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* Mobile Menu Content Layout */
.mobile-menu-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: clamp(4rem, 15vh, 6rem) var(--spacing-xl) var(--spacing-xl);
    position: relative;
    z-index: 2;
}

/* Mobile Menu Navigation */
.mobile-menu-nav {
    flex: 1;
}

.mobile-menu-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.mobile-menu-links li {
    margin: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Staggered animation delays */
.mobile-menu-drawer.active .mobile-menu-links li:nth-child(1) {
    animation: menuItemFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
}

.mobile-menu-drawer.active .mobile-menu-links li:nth-child(2) {
    animation: menuItemFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s forwards;
}

.mobile-menu-drawer.active .mobile-menu-links li:nth-child(3) {
    animation: menuItemFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
}

.mobile-menu-drawer.active .mobile-menu-links li:nth-child(4) {
    animation: menuItemFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s forwards;
}

@keyframes menuItemFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    font-family: var(--font-family-headings);
    font-size: clamp(1.125rem, 3vw, 1.25rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text);
    text-decoration: none;
    padding: var(--spacing-base) var(--spacing-base);
    border-radius: var(--border-radius-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Hover effect with background highlight */
.mobile-menu-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-primary);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
    border-radius: var(--border-radius-sm);
}

.mobile-menu-link:hover,
.mobile-menu-link:focus-visible {
    color: white;
    transform: translateX(8px);
    text-decoration: none;
}

.mobile-menu-link:hover::before,
.mobile-menu-link:focus-visible::before {
    opacity: 1;
    transform: scaleX(1);
}

.mobile-menu-link.active {
    color: var(--color-primary);
    background: rgba(76, 175, 80, 0.1);
}

/* Mobile Menu Divider */
.mobile-menu-divider {
    height: 1px;
    background: linear-gradient(90deg,
            var(--color-primary) 0%,
            var(--color-border) 20%,
            var(--color-border) 80%,
            transparent 100%);
    margin: var(--spacing-lg) 0;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-menu-drawer.active .mobile-menu-divider {
    animation: dividerExpand 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
}

@keyframes dividerExpand {
    from {
        opacity: 0;
        transform: scaleX(0);
    }

    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* Mobile Menu Footer - Theme Toggle */
.mobile-menu-footer {
    padding-top: var(--spacing-base);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-menu-drawer.active .mobile-menu-footer {
    animation: menuItemFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s forwards;
}

.theme-toggle-mobile {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-base);
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: var(--border-radius-base);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-mobile:hover {
    background: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.3);
    transform: translateY(-2px);
}

.theme-toggle-label {
    font-family: var(--font-family-headings);
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Dark Mode Mobile Menu Overrides */
html[data-theme="dark"] .mobile-menu-drawer {
    background: linear-gradient(165deg,
        rgba(30, 30, 30, 0.98) 0%,
        rgba(24, 24, 24, 0.98) 50%,
        rgba(18, 18, 18, 0.98) 100%);
    border-left: 3px solid var(--color-primary-light);
    box-shadow:
        -8px 0 32px rgba(0, 0, 0, 0.5),
        -4px 0 16px rgba(76, 175, 80, 0.15);
}

html[data-theme="dark"] .mobile-menu-drawer::before {
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 255, 255, 0.02) 2px, rgba(255, 255, 255, 0.02) 4px);
}

html[data-theme="dark"] .mobile-menu-link {
    color: rgba(255, 255, 255, 0.95);
}

html[data-theme="dark"] .mobile-menu-link:hover,
html[data-theme="dark"] .mobile-menu-link:focus-visible {
    color: white;
}

html[data-theme="dark"] .mobile-menu-link.active {
    color: var(--color-primary-light);
    background: rgba(76, 175, 80, 0.15);
}

html[data-theme="dark"] .mobile-menu-divider {
    background: linear-gradient(90deg,
        var(--color-primary-light) 0%,
        rgba(255, 255, 255, 0.15) 20%,
        rgba(255, 255, 255, 0.15) 80%,
        transparent 100%);
}

html[data-theme="dark"] .theme-toggle-label {
    color: rgba(255, 255, 255, 0.95);
}

html[data-theme="dark"] .mobile-menu-close {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(76, 175, 80, 0.4);
}

html[data-theme="dark"] .mobile-menu-close:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* Desktop: Hide mobile menu elements */
@media (min-width: 769px) {

    .mobile-menu-overlay,
    .mobile-menu-drawer {
        display: none;
    }
}

/* Mobile responsive header */
@media (max-width: 768px) {
    body > header {
        height: 50px;
    }

    .nav-container {
        height: 50px;
    }

    .nav-actions {
        display: flex;
        align-items: center;
        gap: var(--spacing-xs);
    }

    .search-link-mobile {
        display: inline-flex;
    }

    .nav-menu-desktop {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: var(--spacing-xs);
        margin-right: -8px;
    }
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    display: inline-flex;
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
}

.theme-icon {
    display: none;
}

html[data-theme="light"] .theme-icon-sun,
html:not([data-theme]) .theme-icon-sun {
    display: block;
}

html[data-theme="dark"] .theme-icon-moon {
    display: block;
}

/* Main Layout */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    padding: var(--spacing-xl) 0;
}

/* Privacy Page Styles - Above-fold Only */

/* 8px Grid System Variables */
:root {
    --grid-unit: 8px;
    --space-1: calc(var(--grid-unit) * 1);
    --space-2: calc(var(--grid-unit) * 2);
    --space-3: calc(var(--grid-unit) * 3);
    --space-4: calc(var(--grid-unit) * 4);
    --space-5: calc(var(--grid-unit) * 5);
    --space-6: calc(var(--grid-unit) * 6);
    --space-8: calc(var(--grid-unit) * 8);
    --space-10: calc(var(--grid-unit) * 10);
    --space-12: calc(var(--grid-unit) * 12);
}

/* Main Container */
.privacy-container {
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(var(--space-4), 5vw, var(--space-8)) clamp(var(--space-3), 4vw, var(--space-4));
}

/* Hero Section - Glassmorphism Card (Above-fold) */
.hero-section {
    margin-bottom: clamp(var(--space-6), 8vw, var(--space-10));
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-card {
    position: relative;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(248, 249, 250, 0.85) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: clamp(var(--space-4), 6vw, var(--space-8));
    overflow: hidden;
    box-shadow:
        0 20px 60px rgba(33, 150, 243, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.06);
}

/* Gradient Border Effect */
.hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(135deg,
            #2196F3,
            #4CAF50,
            #2196F3);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Noise Texture Overlay */
.hero-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px,
            rgba(0, 0, 0, 0.02) 2px, rgba(0, 0, 0, 0.02) 4px);
    pointer-events: none;
    border-radius: 24px;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-3);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,
            rgba(33, 150, 243, 0.1) 0%,
            rgba(33, 150, 243, 0.2) 100%);
    border-radius: 16px;
}

.hero-icon svg {
    width: 36px;
    height: 36px;
    stroke: #2196F3;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: var(--space-2);
    color: var(--color-text);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--color-text-light);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto var(--space-2);
}

.last-updated {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-size-sm);
    color: var(--color-text-lighter);
    background: rgba(33, 150, 243, 0.1);
    padding: var(--space-1) var(--space-2);
    border-radius: 20px;
    margin-top: var(--space-2);
}

.last-updated svg {
    width: 16px;
    height: 16px;
    stroke: #2196F3;
}

/* Dark Mode - Above-fold only */
html[data-theme="dark"] .hero-card {
    background: rgba(30, 30, 30, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .hero-subtitle {
    color: var(--color-text-light);
}

html[data-theme="dark"] .hero-title {
    color: var(--color-text);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-section {
        opacity: 1;
        transform: none;
    }
}
