/* --- Variables & Core --- */
:root {
    /* Colors - Light Theme */
    --bg-primary: #CCE6CC;
    /* Pastel Green to match Shader */
    /* Slate 50 */
    --bg-secondary: #e2e8f0;
    /* Slate 200 */
    --text-primary: #000000;
    /* Pitch Black for maximum contrast */
    --text-secondary: #0f172a;
    /* Slate 900 - Nearly black for high visibility */
    --accent-color: #2d8f45;
    /* Warmer green — bridging shader blob (#66BF59) and legibility */
    --accent-hover: #237a38;
    /* Darker hover state */
    --card-bg: #ffffff;
    /* White */

    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Roboto', sans-serif;

    /* Spacing */
    --spacing-sm: 0.6rem;
    --spacing-md: 1.1rem;
    --spacing-lg: 2.2rem;
    --spacing-xl: 4.5rem;

    /* Container Theme Variables — derived from shader palette */
    --container-bg: rgb(214, 237, 214);
    --container-border-color: #99D391;
    --container-border: 1px solid var(--container-border-color);
    --container-shadow: none;

    /* Layout */
    --card-gap: 1rem;
    --layout-gap: 2rem;
    --radius-lg: 8px;     /* Large containers, cards, sidebar panels */
    --radius-md: 6px;     /* Medium elements: inputs, video, gallery items */
    --radius-sm: 4px;     /* Small UI: badges, capsules, copy buttons */
    --card-radius: 8px;  /* Cards & main containers */
    --btn-radius: 6px;    /* Buttons — compact square corners */
    --input-bg: #DFEFDF;
    --input-bg-focus: #E8F4E8;

    /* Transitions */
    --transition-speed: 0.3s;
}

/* --- Dark Theme Overrides — Ash --- */
[data-theme="dark"] {
    --bg-primary: #2d2d30;              /* medium warm gray — not harsh */
    --bg-secondary: #383839;
    --text-primary: #efefef;            /* near-white, sharp headings */
    --text-secondary: #b8b8c2;          /* brighter mid-gray — readable on card surfaces */
    --accent-color: #8ba4d4;            /* soft periwinkle — not green, calm on ash */
    --accent-hover: #a8bde0;             /* lighter periwinkle hover */
    --card-bg: #363639;
    --container-bg: rgba(54, 54, 57, 0.92);
    --container-border-color: #505055;
    --container-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --input-bg: #404043;
    --input-bg-focus: #4a4a4e;
}

/* Theme switching is handled via CSS custom property swaps on :root.
   No global * transition — avoids conflicts with view fades, hover-bouncy, and carousel. */


/* Feature Card / Theme Container */
.theme-card {
    background: var(--container-bg);
    border: var(--container-border);
    box-shadow: var(--container-shadow);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    /* Remove blue highlight on touch */
}

html {
    font-size: 18px;    /* Base scale — all rem values inherit from here */
    background-color: var(--bg-primary);
    /* Matches WebGL noise background */
    height: 100%;
    overscroll-behavior: none;
    /* Prevent rubber-banding on scroll */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

body {
    font-family: var(--font-body);
    background-color: transparent;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100dvh;
    padding: 0 var(--spacing-md);

    /* Prevent text selection globally - looks cleaner */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Typography Utilities */
.text-lead {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.75;
}

/* Global Link Style */
a {
    text-decoration: underline;
}

/* --- Custom Scrollbar (Hidden) --- */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* --- Allow text selection for contact info container --- */
.contact-sidebar .resources-card,
.contact-sidebar .resources-card *,
.contact-text,
.contact-links-group,
.contact-links-group a,
.contact-details,
.contact-details *,
.header-extras .contact-text {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    cursor: text;
    pointer-events: auto !important;
}

/* Inline Text Link */
.text-link {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: 700;
    transition: color var(--transition-speed);
}

.flag-icon {
    vertical-align: middle;
}

.text-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}