/* * GLOBAL CSS: Variables, Reset, and Core Typography
 * Defines the color palette and typography for the entire site.
 */

:root {
    /* --- SOPHISTICATED PALETTE (HSL BASED) --- */
    --h-primary: 207;
    --s-primary: 71%;
    --l-primary: 16%;
    --color-primary: hsl(var(--h-primary), var(--s-primary), var(--l-primary));
    /* #0c2d48 */

    --h-accent: 198;
    --s-accent: 93%;
    --l-accent: 60%;
    --color-accent: hsl(var(--h-accent), var(--s-accent), var(--l-accent));
    /* #3ABEF9 */

    --color-accent-rgb: 58, 190, 249;
    --color-primary-rgb: 12, 45, 72;

    /* Dynamic Backgrounds */
    --bg-body: #ffffff;
    --bg-light: #f8f9fa;
    --bg-card: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.7);

    /* Dynamic Text */
    --text-main: #1a1a1a;
    --text-muted: #555555;
    --text-heading: var(--color-primary);

    /* Borders & Shadows */
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 15px 45px rgba(0, 0, 0, 0.12);

    /* PWA Safe Areas */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);

    /* Animation Tokens */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-in-out-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-snappy: 0.2s var(--ease-out-expo);
    --transition-smooth: 0.35s var(--ease-in-out-smooth);

    /* Typography Config */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --max-width: 1200px;
    --section-padding: 80px 0;
    --border-radius: 12px;
}

/* --- DARK THEME OVERRIDES --- */
[data-theme="dark"] {
    --bg-body: #051a2d;
    --bg-light: #082032;
    --bg-card: #0c2d48;
    --bg-nav: rgba(5, 26, 45, 0.85);
    --bg-glass: rgba(12, 45, 72, 0.7);

    --text-main: #e6e6e6;
    --text-muted: #b0c4de;
    --text-heading: #ffffff;

    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* BASIC RESET */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: auto;
    /* Allow JS to handle smooth scroll with custom easing */
    scroll-padding-top: 100px;
    /* Offset for sticky navbar */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* Prevent any child element (e.g. off-canvas drawer) from
       creating a horizontal scroll bar at the document root.
       body also has overflow-x:hidden but <html> is the scroll root. */
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/*
  Snappy transitions for interactive elements.
  We exclude background-color/border-color from the expo ease to avoid
  harsh flashes during theme switching; those use 'transition-smooth'.
*/
*,
*::before,
*::after {
    transition:
        transform var(--transition-snappy),
        opacity var(--transition-snappy),
        box-shadow var(--transition-snappy),
        background-color var(--transition-smooth),
        border-color var(--transition-smooth),
        color var(--transition-smooth);
}

/* TEXT STYLES */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--text-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    /* Tighter headings for modern look */
    line-height: 1.15;
}

p {
    margin-bottom: 1.25rem;
    opacity: 0.94;
}

/* LINK STYLES */
a {
    text-decoration: none;
    color: var(--color-accent);
    transition: var(--transition-snappy);
}

a:hover {
    filter: brightness(1.1);
}

/* CONTAINER (Global Centering) */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* SECTION CLASS (Global Spacing) */
.section {
    padding: var(--section-padding);
}

/* INPUT STYLES (Global Reset for Forms) */
input,
textarea,
button {
    font-family: var(--font-body);
}

/* Images shouldn't overflow their containers */
img {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   RESPONSIVE SYSTEM
   Breakpoints:
   - 1024px: Tablet / Small Laptop
   - 768px:  Mobile landscape / Large phone
   - 480px:  Standard mobile phone
   - 375px:  Small mobile (SE, etc.)
   ============================================================ */

/* --- TABLET (≤ 1024px) --- */
@media (max-width: 1024px) {
    :root {
        --section-padding: 70px 0;
    }
}

/* --- MOBILE (≤ 768px) --- */
@media (max-width: 768px) {
    :root {
        --section-padding: 56px 0;
    }

    .container {
        padding: 0 16px;
    }

    h1 {
        font-size: clamp(1.6rem, 8vw, 2rem);
    }

    h2 {
        font-size: clamp(1.4rem, 6vw, 1.7rem);
    }

    h3 {
        font-size: clamp(1.1rem, 4.5vw, 1.35rem);
    }

    .hero-title {
        font-size: clamp(1.8rem, 9vw, 2.4rem) !important;
    }

    .title-main {
        font-size: clamp(1.4rem, 7vw, 1.8rem);
    }
}

/* --- SMALL MOBILE (≤ 480px) --- */
@media (max-width: 480px) {
    :root {
        --section-padding: 44px 0;
    }

    .container {
        padding: 0 14px;
    }

    h1 {
        font-size: clamp(1.4rem, 6vw, 1.85rem);
    }

    h2 {
        font-size: clamp(1.25rem, 5vw, 1.6rem);
    }

    .hero-title {
        font-size: clamp(1.6rem, 7.5vw, 2.2rem) !important;
    }

    .title-main {
        font-size: clamp(1.25rem, 5.5vw, 1.65rem);
    }
}

/* --- EXTRA SMALL (≤ 375px) --- */
@media (max-width: 375px) {
    .container {
        padding: 0 12px;
    }

    h1 {
        font-size: clamp(1.4rem, 8vw, 1.75rem);
    }

    h2 {
        font-size: clamp(1.2rem, 7vw, 1.5rem);
    }

    .hero-title {
        font-size: clamp(1.6rem, 10vw, 2.1rem) !important;
    }
}

/* --- ULTRA SMALL (≤ 320px) --- */
@media (max-width: 320px) {
    .container {
        padding: 0 10px;
    }

    .nav-logo {
        font-size: 1.1rem;
    }

    .nav-logo img {
        height: 28px;
    }
}