/* ============================================
   GLOBAL STYLESHEET
   Shared styles, variables, and base components
   ============================================ */

/* ============================================
   FONT FACE DECLARATIONS
   Google Sans Flex loaded via Google Fonts
   ============================================ */

/* ============================================
   CSS VARIABLES (DESIGN TOKENS)
   ============================================ */
:root {
    /* Layout */
    --max-width: 1440px;
    --padding: 5vw;
    
    /* Typography */
    --font-primary: 'Google Sans Flex', sans-serif;
    --font-medium: 'Google Sans Flex', sans-serif;
    
    /* Google Sans Flex variation settings */
    --font-variation-default: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0;
    --font-size-h1: 48px;
    --font-size-h2: 48px;
    --font-size-body: 22px;
    --line-height-tight: 1.15;
    --line-height-normal: 1.6;
    --line-height-relaxed: 1.4;
    
    /* Colors - Dynamic (updated via JS) */
    --text-color: #000000;
    --card-bg: rgba(17, 24, 39, 0.74);
    --card-text: #ffffff;
    --cursor-color: #000000;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    
    /* Border Radius */
    --radius-sm: 24px;
    --radius-md: 50px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-smooth: 0.8s ease;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Google Sans Flex base settings for all elements using font-primary */
[class*="font-primary"],
body,
p,
.text-22,
h1,
h2 {
    font-optical-sizing: auto;
    font-variation-settings: var(--font-variation-default);
}

/* Google Sans Flex Medium settings for all elements using font-medium */
[class*="font-medium"],
h3 {
    font-weight: 500; /* Google Sans Flex Medium */
    font-optical-sizing: auto;
    font-variation-settings: var(--font-variation-default);
}

/* Google Sans Flex Regular settings for font-primary elements */
body,
p,
.text-22,
h1,
h2 {
    font-weight: 400; /* Google Sans Flex Regular */
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-primary);
    font-weight: 400; /* Google Sans Flex Regular */
    font-optical-sizing: auto;
    font-variation-settings:
        "slnt" 0,
        "wdth" 100,
        "GRAD" 0,
        "ROND" 0;
    line-height: var(--line-height-normal);
    color: #000000; /* Base color set to black */
    overflow-x: hidden;
    width: 100%;
    transition: background var(--transition-slow), color var(--transition-slow);
    /* Set initial background to prevent white flash on iOS Safari */
    /* Default to noon theme (most common viewing time) */
    /* First color matches theme-color exactly for seamless status bar blend */
    background: #ffffff;
    /* Solid color matches theme-color exactly for iOS Safari */
    background-color: #ffffff;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1 {
    font-size: var(--font-size-h1);
    /* font-weight: 400 set globally for Google Sans Flex Regular */
    letter-spacing: 0em;
    margin-bottom: var(--spacing-xs);
    line-height: var(--line-height-tight);
    color: #000000; /* Base color set to black */
}

h2 {
    font-size: var(--font-size-h2);
    /* font-weight: 400 set globally for Google Sans Flex Regular */
    letter-spacing: 0em;
    margin-bottom: 1.4rem;
    line-height: 2;
    color: #000000; /* Base color set to black */
}

h3 {
    font-family: var(--font-medium);
    font-size: var(--font-size-body);
    font-weight: 500; /* Google Sans Flex Medium */
    font-optical-sizing: auto;
    font-variation-settings:
        "slnt" 0,
        "wdth" 100,
        "GRAD" 0,
        "ROND" 0;
    margin-bottom: 0.56rem;
    line-height: var(--line-height-normal);
}

p,
.text-22 {
    font-size: var(--font-size-body);
    font-weight: 400; /* Google Sans Flex Regular */
    font-optical-sizing: auto;
    font-variation-settings:
        "slnt" 0,
        "wdth" 100,
        "GRAD" 0,
        "ROND" 0;
    line-height: var(--line-height-normal);
    margin-bottom: var(--spacing-sm);
    color: #000000; /* Base color set to black */
}

/* ============================================
   LAYOUT COMPONENTS
   ============================================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--padding);
    width: 100%;
    box-sizing: border-box;
}

section {
    padding: clamp(2rem, 5.6vw, 4.2rem) 0;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.content-section {
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(3rem, 8vw, 6rem) var(--padding);
}

/* ============================================
   TWO COLUMN LAYOUT
   ============================================ */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

/* ============================================
   INFO LIST
   ============================================ */
.info-list {
    list-style: none;
}

.info-list li {
    font-size: var(--font-size-body);
    font-weight: 400; /* Google Sans Flex Regular */
    line-height: var(--line-height-normal);
    margin-bottom: 0;
    padding-left: 1.5rem;
    position: relative;
    color: #000000; /* Base color set to black */
}

.info-list li::before {
    content: '→';
    position: absolute;
    left: 0;
}

/* ============================================
   BUTTONS & CTAs
   ============================================ */
.cta-button {
    display: inline-block;
    padding: var(--spacing-sm) 2.5rem;
    background: #000000;
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-body);
    font-weight: 400; /* Google Sans Flex Regular */
    transition: all var(--transition-normal);
}

.cta-button:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.cta-button.secondary {
    background: transparent;
    color: #000000;
    border: 1px solid #000000;
}

.cta-button.secondary:hover {
    background: #000000;
    color: white;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--spacing-md);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Disable fade-in animations on mobile to prevent jumping */
.fade-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

.fade-in.visible {
    opacity: 1 !important;
    transform: none !important;
}

/* ============================================
   TYPEWRITER EFFECT
   ============================================ */
.typewriter {
    display: inline-block;
    position: relative;
}

.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: currentColor;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

.typewriter-text {
    min-height: 1.2em;
}

.cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: text-top;
    transition: background-color var(--transition-slow);
}

/* Performance: pause blinking cursors while the drawer is open (mobile Safari stability). */
body.drawer-open .cursor {
    animation-play-state: paused !important;
}

/* ============================================
   CLICKABLE LINKS
   ============================================ */
.clickable-link {
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: rgba(37, 99, 235, 0.2);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.clickable-link:hover {
    color: #1d4ed8;
    text-decoration: none;
}

.clickable-link:active {
    opacity: 0.7;
    transform: scale(0.98);
}

/* ============================================
   QUOTE STYLES
   ============================================ */
.quote {
    font-size: var(--font-size-body);
    font-weight: 400; /* Google Sans Flex Regular */
    line-height: var(--line-height-normal);
    margin: var(--spacing-lg) 0;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: #000000; /* Base color set to black */
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    :root {
        /* Global mobile: keep h1/h2 legible and consistent */
        --font-size-h1: 38px;
        --font-size-h2: 38px;
        --font-size-body: 20px;
        /* Global mobile content well gutter */
        --padding: 30px;
    }

    section {
        padding: clamp(1.5rem, 4vw, 3rem) 0;
    }

    h1, h2 {
        line-height: var(--line-height-tight);
        margin-bottom: var(--spacing-xs);
    }

    h3, p, .text-22 {
        font-size: 20px;
        line-height: 1.5;
    }

    .info-list li {
        font-size: 18px;
    }

    .two-column {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .cta-button {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    :root {
        /* Smallest mobile: do NOT shrink below the requested minimum */
        --font-size-h1: 28px;
        --font-size-h2: 28px;
        --font-size-body: 18px;
        --padding: 30px;
    }

    section {
        padding: clamp(1.2rem, 3.5vw, 2.5rem) 0;
    }

    h1, h2 {
        line-height: var(--line-height-tight);
        margin-bottom: var(--spacing-xs);
    }

    h3, p, .text-22 {
        font-size: 18px;
        line-height: 1.5;
    }

    .info-list li {
        font-size: 16px;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .cta-button {
        width: 100%;
    }
}

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

