/* ==========================================================================
   TechNode HQ — Design System
   CSS Custom Properties, Reset, Base Typography, Utility Classes
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Local Self-Hosted Fonts
   -------------------------------------------------------------------------- */
@font-face {
    font-family: 'Space Grotesk';
    src: url('../fonts/space-grotesk-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Space Grotesk';
    src: url('../fonts/space-grotesk-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Space Grotesk';
    src: url('../fonts/space-grotesk-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'JetBrains Mono';
    src: url('../fonts/jetbrains-mono-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}


/* --------------------------------------------------------------------------
   1. CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
    /* Colors — Dark Mode (Default) */
    --tnhq-bg-primary: #0A0A0F;
    --tnhq-bg-secondary: #0E0E16;
    --tnhq-bg-surface: #12121A;
    --tnhq-bg-surface-hover: #1A1A2E;
    --tnhq-bg-surface-active: #222240;
    --tnhq-bg-elevated: #16162A;

    --tnhq-border: #2A2A3E;
    --tnhq-border-light: #1E1E30;
    --tnhq-border-focus: #00D4FF;

    --tnhq-text-primary: #E8E8ED;
    --tnhq-text-secondary: #B0B0C4;
    --tnhq-text-tertiary: #82829C;
    --tnhq-text-inverse: #0A0A0F;

    --tnhq-accent: #00D4FF;
    --tnhq-accent-hover: #33DDFF;
    --tnhq-accent-muted: rgba(0, 212, 255, 0.12);
    --tnhq-accent-subtle: rgba(0, 212, 255, 0.06);
    --tnhq-accent-gradient: linear-gradient(135deg, #00D4FF 0%, #7B61FF 100%);

    --tnhq-alert: #FF3366;
    --tnhq-alert-muted: rgba(255, 51, 102, 0.12);
    --tnhq-success: #00FF88;
    --tnhq-success-muted: rgba(0, 255, 136, 0.12);
    --tnhq-warning: #FFB800;
    --tnhq-warning-muted: rgba(255, 184, 0, 0.12);
    --tnhq-sponsored: #FFB800;

    /* Typography */
    --tnhq-font-heading: 'Space Grotesk', sans-serif;
    --tnhq-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --tnhq-font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    --tnhq-text-xs: 0.75rem;     /* 12px */
    --tnhq-text-sm: 0.875rem;    /* 14px */
    --tnhq-text-base: 1rem;      /* 16px */
    --tnhq-text-lg: 1.125rem;    /* 18px */
    --tnhq-text-xl: 1.25rem;     /* 20px */
    --tnhq-text-2xl: 1.5rem;     /* 24px */
    --tnhq-text-3xl: 2rem;       /* 32px */
    --tnhq-text-4xl: 2.5rem;     /* 40px */
    --tnhq-text-5xl: 3.5rem;     /* 56px */

    --tnhq-leading-tight: 1.2;
    --tnhq-leading-snug: 1.4;
    --tnhq-leading-normal: 1.7;
    --tnhq-leading-relaxed: 1.85;

    --tnhq-tracking-tight: -0.02em;
    --tnhq-tracking-normal: 0;
    --tnhq-tracking-wide: 0.05em;
    --tnhq-tracking-wider: 0.1em;

    /* Spacing */
    --tnhq-space-1: 0.25rem;     /* 4px */
    --tnhq-space-2: 0.5rem;      /* 8px */
    --tnhq-space-3: 0.75rem;     /* 12px */
    --tnhq-space-4: 1rem;        /* 16px */
    --tnhq-space-5: 1.25rem;     /* 20px */
    --tnhq-space-6: 1.5rem;      /* 24px */
    --tnhq-space-8: 2rem;        /* 32px */
    --tnhq-space-10: 2.5rem;     /* 40px */
    --tnhq-space-12: 3rem;       /* 48px */
    --tnhq-space-16: 4rem;       /* 64px */
    --tnhq-space-20: 5rem;       /* 80px */
    --tnhq-space-24: 6rem;       /* 96px */

    /* Layout */
    --tnhq-content-width: 800px;
    --tnhq-wide-width: 1200px;
    --tnhq-max-width: 1400px;
    --tnhq-sidebar-width: 320px;
    --tnhq-header-height: 64px;
    --tnhq-topbar-height: 36px;

    /* Borders */
    --tnhq-radius-sm: 6px;
    --tnhq-radius-md: 10px;
    --tnhq-radius-lg: 16px;
    --tnhq-radius-xl: 24px;
    --tnhq-radius-full: 9999px;

    /* Shadows */
    --tnhq-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --tnhq-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --tnhq-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --tnhq-shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.6);
    --tnhq-shadow-glow: 0 0 20px rgba(0, 212, 255, 0.15);
    --tnhq-shadow-glow-strong: 0 0 40px rgba(0, 212, 255, 0.25);

    /* Glass Effect */
    --tnhq-glass-bg: rgba(18, 18, 26, 0.8);
    --tnhq-glass-border: rgba(42, 42, 62, 0.5);
    --tnhq-glass-blur: 20px;

    /* Transitions */
    --tnhq-ease-fast: 150ms ease;
    --tnhq-ease-base: 250ms ease;
    --tnhq-ease-slow: 400ms ease;
    --tnhq-ease-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Z-Index Scale */
    --tnhq-z-base: 1;
    --tnhq-z-dropdown: 100;
    --tnhq-z-sticky: 200;
    --tnhq-z-header: 300;
    --tnhq-z-overlay: 400;
    --tnhq-z-modal: 500;
    --tnhq-z-toast: 600;
}

/* --------------------------------------------------------------------------
   1b. Light Mode Overrides
   -------------------------------------------------------------------------- */
[data-theme="light"] {
    --tnhq-bg-primary: #F5F5F8;
    --tnhq-bg-secondary: #EEEEF2;
    --tnhq-bg-surface: #FFFFFF;
    --tnhq-bg-surface-hover: #F0F0F5;
    --tnhq-bg-surface-active: #E8E8F0;
    --tnhq-bg-elevated: #FFFFFF;

    --tnhq-border: #D8D8E0;
    --tnhq-border-light: #E5E5EC;
    --tnhq-border-focus: #007DA6;

    --tnhq-text-primary: #1A1A2E;
    --tnhq-text-secondary: #5C5C74;
    --tnhq-text-tertiary: #6D6D86;
    --tnhq-text-inverse: #FFFFFF;

    --tnhq-accent: #007DA6;
    --tnhq-accent-hover: #006B8F;
    --tnhq-accent-muted: rgba(0, 125, 166, 0.12);
    --tnhq-accent-subtle: rgba(0, 125, 166, 0.06);

    --tnhq-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --tnhq-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10);
    --tnhq-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --tnhq-shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.15);
    --tnhq-shadow-glow: 0 0 20px rgba(0, 125, 166, 0.12);
    --tnhq-shadow-glow-strong: 0 0 40px rgba(0, 125, 166, 0.18);

    --tnhq-glass-bg: rgba(255, 255, 255, 0.85);
    --tnhq-glass-border: rgba(216, 216, 224, 0.6);
}

/* --------------------------------------------------------------------------
   2. CSS Reset (Modern Minimal)
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--tnhq-font-body);
    font-size: var(--tnhq-text-base);
    line-height: var(--tnhq-leading-normal);
    color: var(--tnhq-text-primary);
    background-color: var(--tnhq-bg-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

a {
    color: var(--tnhq-accent);
    text-decoration: none;
    transition: color var(--tnhq-ease-fast);
}

a:hover {
    color: var(--tnhq-accent-hover);
}

ul,
ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    width: 100%;
}

/* Remove animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------------
   3. Base Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--tnhq-font-heading);
    font-weight: 700;
    line-height: var(--tnhq-leading-tight);
    letter-spacing: var(--tnhq-tracking-tight);
    color: var(--tnhq-text-primary);
}

h1 {
    font-size: clamp(var(--tnhq-text-3xl), 5vw, var(--tnhq-text-5xl));
    letter-spacing: -0.03em;
}

h2 {
    font-size: clamp(var(--tnhq-text-2xl), 4vw, var(--tnhq-text-4xl));
}

h3 {
    font-size: clamp(var(--tnhq-text-xl), 3vw, var(--tnhq-text-3xl));
}

h4 {
    font-size: var(--tnhq-text-2xl);
}

h5 {
    font-size: var(--tnhq-text-xl);
}

h6 {
    font-size: var(--tnhq-text-lg);
}

p {
    margin-bottom: var(--tnhq-space-4);
    color: var(--tnhq-text-secondary);
    line-height: var(--tnhq-leading-relaxed);
}

strong, b {
    font-weight: 600;
    color: var(--tnhq-text-primary);
}

em, i {
    font-style: italic;
}

small {
    font-size: var(--tnhq-text-sm);
    color: var(--tnhq-text-tertiary);
}

blockquote {
    border-left: 3px solid var(--tnhq-accent);
    padding: var(--tnhq-space-4) var(--tnhq-space-6);
    margin: var(--tnhq-space-6) 0;
    background: var(--tnhq-accent-subtle);
    border-radius: 0 var(--tnhq-radius-md) var(--tnhq-radius-md) 0;
    font-style: italic;
    color: var(--tnhq-text-secondary);
}

blockquote p:last-child {
    margin-bottom: 0;
}

code, kbd, samp {
    font-family: var(--tnhq-font-mono);
    font-size: 0.9em;
    background: var(--tnhq-bg-surface);
    border: 1px solid var(--tnhq-border);
    border-radius: var(--tnhq-radius-sm);
    padding: 0.15em 0.4em;
}

pre {
    font-family: var(--tnhq-font-mono);
    font-size: var(--tnhq-text-sm);
    background: var(--tnhq-bg-surface);
    border: 1px solid var(--tnhq-border);
    border-radius: var(--tnhq-radius-md);
    padding: var(--tnhq-space-6);
    overflow-x: auto;
    margin: var(--tnhq-space-6) 0;
    line-height: 1.6;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
}

hr {
    border: none;
    height: 1px;
    background: var(--tnhq-border);
    margin: var(--tnhq-space-8) 0;
}

::selection {
    background: var(--tnhq-accent);
    color: var(--tnhq-text-inverse);
}

/* --------------------------------------------------------------------------
   4. Scrollbar Styling
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--tnhq-bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--tnhq-border);
    border-radius: var(--tnhq-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--tnhq-text-tertiary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--tnhq-border) var(--tnhq-bg-primary);
}

/* --------------------------------------------------------------------------
   5. Focus & Accessibility
   -------------------------------------------------------------------------- */
:focus-visible {
    outline: 2px solid var(--tnhq-accent);
    outline-offset: 2px;
    border-radius: var(--tnhq-radius-sm);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip-to-content link — visible on focus for keyboard navigation */
.tnhq-skip-link {
    position: absolute;
    top: -100%;
    left: var(--tnhq-space-4);
    z-index: calc(var(--tnhq-z-toast) + 1);
    padding: var(--tnhq-space-3) var(--tnhq-space-6);
    background: var(--tnhq-accent);
    color: var(--tnhq-text-inverse);
    font-family: var(--tnhq-font-heading);
    font-weight: 600;
    font-size: var(--tnhq-text-sm);
    border-radius: 0 0 var(--tnhq-radius-md) var(--tnhq-radius-md);
    text-decoration: none;
    transition: top var(--tnhq-ease-fast);
    outline: none;
}

.tnhq-skip-link:focus {
    top: 0;
    color: var(--tnhq-text-inverse);
}

/* --------------------------------------------------------------------------
   6. Container & Layout Utilities
   -------------------------------------------------------------------------- */
.tnhq-container {
    width: 100%;
    max-width: var(--tnhq-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--tnhq-space-6);
    padding-right: var(--tnhq-space-6);
}

.tnhq-container--narrow {
    max-width: var(--tnhq-content-width);
}

.tnhq-container--wide {
    max-width: var(--tnhq-wide-width);
}

.tnhq-section {
    padding-top: var(--tnhq-space-16);
    padding-bottom: var(--tnhq-space-16);
}

.tnhq-section--sm {
    padding-top: var(--tnhq-space-8);
    padding-bottom: var(--tnhq-space-8);
}

/* --------------------------------------------------------------------------
   7. Utility Classes
   -------------------------------------------------------------------------- */

/* Text Alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Display */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-inline-flex { display: inline-flex; }

/* Flex Utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-1 { gap: var(--tnhq-space-1); }
.gap-2 { gap: var(--tnhq-space-2); }
.gap-3 { gap: var(--tnhq-space-3); }
.gap-4 { gap: var(--tnhq-space-4); }
.gap-6 { gap: var(--tnhq-space-6); }
.gap-8 { gap: var(--tnhq-space-8); }

/* Text Colors */
.text-primary { color: var(--tnhq-text-primary); }
.text-secondary { color: var(--tnhq-text-secondary); }
.text-tertiary { color: var(--tnhq-text-tertiary); }
.text-accent { color: var(--tnhq-accent); }
.text-alert { color: var(--tnhq-alert); }
.text-success { color: var(--tnhq-success); }

/* Font Weights */
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* --------------------------------------------------------------------------
   8. Animations (Keyframes)
   -------------------------------------------------------------------------- */
@keyframes tnhq-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes tnhq-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tnhq-fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tnhq-slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes tnhq-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes tnhq-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes tnhq-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
    }
}

/* Animation utility classes */
.animate-fadeIn {
    animation: tnhq-fadeIn var(--tnhq-ease-base) forwards;
}

.animate-fadeInUp {
    animation: tnhq-fadeInUp var(--tnhq-ease-slow) forwards;
}

.animate-fadeInDown {
    animation: tnhq-fadeInDown var(--tnhq-ease-base) forwards;
}

/* Staggered animation delays */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* ==========================================================================
   9. Accessibility Floating Widget & Overrides
   ========================================================================== */

/* Floating Toggle Button */
.tnhq-accessibility-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: var(--tnhq-z-sticky);
    width: 48px;
    height: 48px;
    border-radius: var(--tnhq-radius-full);
    background: var(--tnhq-accent);
    color: var(--tnhq-text-inverse);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--tnhq-shadow-lg);
    cursor: pointer;
    transition: background var(--tnhq-ease-fast), transform var(--tnhq-ease-fast);
}

.tnhq-accessibility-toggle:hover {
    background: var(--tnhq-accent-hover);
    transform: scale(1.05);
}

.tnhq-accessibility-toggle:active {
    transform: scale(0.95);
}

/* Accessibility Panel Container */
.tnhq-accessibility-panel {
    position: fixed;
    bottom: 84px;
    right: 24px;
    z-index: var(--tnhq-z-sticky);
    width: 320px;
    background: var(--tnhq-bg-surface);
    border: 1px solid var(--tnhq-border);
    border-radius: var(--tnhq-radius-lg);
    box-shadow: var(--tnhq-shadow-xl);
    padding: var(--tnhq-space-5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity var(--tnhq-ease-base), transform var(--tnhq-ease-base), visibility var(--tnhq-ease-base);
}

.tnhq-accessibility-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header */
.tnhq-accessibility-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--tnhq-space-4);
    border-bottom: 1px solid var(--tnhq-border-light);
    margin-bottom: var(--tnhq-space-4);
}

.tnhq-accessibility-panel__title {
    font-size: var(--tnhq-text-base);
    font-weight: 700;
    color: var(--tnhq-text-primary);
    display: flex;
    align-items: center;
    gap: var(--tnhq-space-2);
}

.tnhq-accessibility-panel__close {
    background: none;
    border: none;
    color: var(--tnhq-text-secondary);
    cursor: pointer;
    transition: color var(--tnhq-ease-fast);
}

.tnhq-accessibility-panel__close:hover {
    color: var(--tnhq-accent);
}

/* Body Options */
.tnhq-accessibility-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--tnhq-space-3) 0;
}

.tnhq-accessibility-option__label {
    font-size: var(--tnhq-text-sm);
    color: var(--tnhq-text-secondary);
    font-weight: 500;
}

.tnhq-accessibility-option__actions {
    display: flex;
    gap: var(--tnhq-space-1);
}

/* Button sizing controls */
.tnhq-accessibility-btn {
    background: var(--tnhq-bg-primary);
    border: 1px solid var(--tnhq-border);
    color: var(--tnhq-text-primary);
    padding: var(--tnhq-space-1) var(--tnhq-space-3);
    font-size: var(--tnhq-text-xs);
    font-weight: 600;
    border-radius: var(--tnhq-radius-sm);
    cursor: pointer;
    transition: all var(--tnhq-ease-fast);
}

.tnhq-accessibility-btn:hover:not(:disabled) {
    background: var(--tnhq-accent-muted);
    border-color: var(--tnhq-accent);
    color: var(--tnhq-accent);
}

.tnhq-accessibility-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Switch styling */
.tnhq-accessibility-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--tnhq-bg-primary);
    border: 1px solid var(--tnhq-border);
    border-radius: var(--tnhq-radius-full);
    cursor: pointer;
    transition: background var(--tnhq-ease-fast), border-color var(--tnhq-ease-fast);
    outline: none;
}

.tnhq-accessibility-switch__toggle {
    position: absolute;
    top: 3px;
    left: 4px;
    width: 16px;
    height: 16px;
    background: var(--tnhq-text-secondary);
    border-radius: var(--tnhq-radius-full);
    transition: transform var(--tnhq-ease-fast), background var(--tnhq-ease-fast);
}

.tnhq-accessibility-switch[aria-checked="true"] {
    background: var(--tnhq-accent-muted);
    border-color: var(--tnhq-accent);
}

.tnhq-accessibility-switch[aria-checked="true"] .tnhq-accessibility-switch__toggle {
    transform: translateX(18px);
    background: var(--tnhq-accent);
}

/* --------------------------------------------------------------------------
   Accessibility Override Classes (Toggled on Body)
   -------------------------------------------------------------------------- */

/* Text Scale Overrides */
body.acc-text-sm {
    font-size: 0.875rem !important; /* Scale down slightly */
}
body.acc-text-lg {
    font-size: 1.15rem !important; /* Scale up */
}
body.acc-text-lg h1 { font-size: clamp(var(--tnhq-text-4xl), 6vw, var(--tnhq-text-5xl)) !important; }
body.acc-text-lg h2 { font-size: clamp(var(--tnhq-text-3xl), 5vw, var(--tnhq-text-4xl)) !important; }
body.acc-text-lg h3 { font-size: clamp(var(--tnhq-text-2xl), 4vw, var(--tnhq-text-3xl)) !important; }
body.acc-text-lg p { line-height: 1.95 !important; }

/* Contrast Overrides (WCAG AAA compliant dark scheme) */
body.acc-contrast {
    --tnhq-bg-primary: #000000 !important;
    --tnhq-bg-secondary: #000000 !important;
    --tnhq-bg-surface: #000000 !important;
    --tnhq-bg-surface-hover: #111111 !important;
    --tnhq-bg-elevated: #000000 !important;
    
    --tnhq-border: #ffffff !important;
    --tnhq-border-light: #888888 !important;
    
    --tnhq-text-primary: #ffffff !important;
    --tnhq-text-secondary: #ffffff !important;
    --tnhq-text-tertiary: #dddddd !important;
    
    --tnhq-accent: #ffff00 !important; /* High contrast yellow */
    --tnhq-accent-hover: #ffff55 !important;
    --tnhq-accent-muted: rgba(255, 255, 0, 0.2) !important;
}

body.acc-contrast a {
    color: var(--tnhq-accent) !important;
    text-decoration: underline !important;
}

body.acc-contrast a:hover {
    color: var(--tnhq-accent-hover) !important;
}

body.acc-contrast .tnhq-btn {
    border-color: #ffffff !important;
}

body.acc-contrast .tnhq-btn--primary {
    background: #ffff00 !important;
    color: #000000 !important;
    border-color: #ffff00 !important;
}

body.acc-contrast .tnhq-btn--primary:hover {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #ffffff !important;
}

/* Monochrome Overrides */
body.acc-monochrome {
    filter: grayscale(100%) !important;
}

/* Dyslexic Font Overrides */
@font-face {
    font-family: 'OpenDyslexic';
    src: url('https://cdn.jsdelivr.net/npm/opendyslexic@1.0.3/OpenDyslexic-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body.acc-dyslexic {
    font-family: 'OpenDyslexic', -apple-system, sans-serif !important;
    --tnhq-font-body: 'OpenDyslexic', -apple-system, sans-serif !important;
    --tnhq-font-heading: 'OpenDyslexic', -apple-system, sans-serif !important;
    letter-spacing: 0.05em !important;
    word-spacing: 0.1em !important;
}

body.acc-dyslexic p, 
body.acc-dyslexic a, 
body.acc-dyslexic h1, 
body.acc-dyslexic h2, 
body.acc-dyslexic h3, 
body.acc-dyslexic h4, 
body.acc-dyslexic h5, 
body.acc-dyslexic h6, 
body.acc-dyslexic span,
body.acc-dyslexic li {
    font-family: 'OpenDyslexic', -apple-system, sans-serif !important;
}
