:root {
    /* Light Mode (Default for variable definitions, but we will default to dark via JS/HTML class if needed, 
       but here we define the 'base' as light and override for dark, or vice versa. 
       Given the design is primarily dark, let's strictly define variables. */

    /* Generic Color Palette */
    --bg-canvas: #ffffff;
    --bg-surface: #f3f4f6;
    --bg-surface-2: #e5e7eb;

    --text-primary: #020617;
    /* Slate 950 - Almost Black */
    --text-secondary: #334155;
    /* Slate 700 - Deep Gray */
    --text-muted: #52525b;
    /* Zinc 600 - Darker than Slate 500 */

    --border-default: #9ca3af;
    /* Gray 400 - Much stronger border */
    --border-light: #cbd5e1;
    /* Slate 300 */

    --accent-primary: #10b981;
    /* emerald-500 */
    --accent-glow: rgba(16, 185, 129, 0.2);

    /* Missing CTA Colors - Light Mode */
    --primary: #10b981;
    /* Emerald 500 - Matches accent-primary */
    --accent: #f97316;
    /* Orange 500 */
    --bg: #ffffff;
    /* White background for light mode */
    --surface-highlight: #e5e7eb;
    /* Gray for light mode */

    /* Semantic Pillars - Light Mode (Darker for contrast) */
    --accent-technical: #059669;
    /* Emerald 600 */
    --accent-engineering: #2563eb;
    /* Blue 600 */
    --accent-growth: #9333ea;
    /* Purple 600 */

    /* Soft Backgrounds */
    --bg-technical-soft: rgba(5, 150, 105, 0.1);
    --bg-engineering-soft: rgba(37, 99, 235, 0.1);
    --bg-growth-soft: rgba(147, 51, 234, 0.1);
}

[data-theme="dark"] {
    --bg-canvas: #0A0A0F;
    --bg-surface: rgba(255, 255, 255, 0.05);
    /* White with low opacity for glassmorphism */
    --bg-surface-2: rgba(255, 255, 255, 0.1);

    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    /* gray-400 */
    --text-muted: #6b7280;
    /* gray-500 */

    --border-default: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.05);

    --accent-primary: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.2);

    /* Missing CTA Colors - Dark Mode */
    --primary: #10b981;
    /* Emerald 500 - Matches accent-primary */
    --accent: #f97316;
    /* Orange 500 */
    --bg: #0A0A0F;
    /* Dark background */
    --surface-highlight: rgba(255, 255, 255, 0.1);
    /* Semi-transparent white */

    /* Semantic Pillars - Dark Mode (Bright/Neon) */
    --accent-technical: #10b981;
    /* Emerald 500 */
    --accent-engineering: #3b82f6;
    /* Blue 500 */
    --accent-growth: #a855f7;
    /* Purple 500 */

    /* Soft Backgrounds */
    --bg-technical-soft: rgba(16, 185, 129, 0.1);
    --bg-engineering-soft: rgba(59, 130, 246, 0.1);
    --bg-growth-soft: rgba(168, 85, 247, 0.1);
}

/* Semantic Utility Classes */
.text-technical {
    color: var(--accent-technical);
}

.bg-technical-soft {
    background-color: var(--bg-technical-soft);
}

.border-technical-soft {
    border-color: var(--bg-technical-soft);
}

.hover\:text-technical:hover {
    color: var(--accent-technical);
}

.hover\:border-technical-soft:hover {
    border-color: var(--bg-technical-soft);
}

.text-engineering {
    color: var(--accent-engineering);
}

.bg-engineering-soft {
    background-color: var(--bg-engineering-soft);
}

.border-engineering-soft {
    border-color: var(--bg-engineering-soft);
}

.hover\:text-engineering:hover {
    color: var(--accent-engineering);
}

.hover\:border-engineering-soft:hover {
    border-color: var(--bg-engineering-soft);
}

.text-growth {
    color: var(--accent-growth);
}

.bg-growth-soft {
    background-color: var(--bg-growth-soft);
}

.border-growth-soft {
    border-color: var(--bg-growth-soft);
}

.hover\:text-growth:hover {
    color: var(--accent-growth);
}

.hover\:border-growth-soft:hover {
    border-color: var(--bg-growth-soft);
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Semantic Utility Classes for Theming */
.bg-bg {
    background-color: var(--bg-canvas) !important;
}

.bg-surface {
    background-color: var(--bg-surface) !important;
}

.bg-surface-2 {
    background-color: var(--bg-surface-2) !important;
}

.glass-panel {
    background-color: var(--glass-bg) !important;
    border-color: var(--glass-border) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.glass-panel-strong {
    background-color: rgba(10, 10, 15, 0.85) !important;
    /* Darker, less transparent */
    border-color: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(20px);
    /* Stronger blur for readability */
    -webkit-backdrop-filter: blur(20px);
}

.text-primary {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.border-default {
    border-color: var(--border-default) !important;
}

.border-light {
    border-color: var(--border-light) !important;
}

/* CTA Button Utility Classes */
.bg-primary {
    background-color: var(--primary) !important;
}

.bg-accent {
    background-color: var(--accent) !important;
}

.text-bg {
    color: var(--bg) !important;
}

.bg-surface-highlight {
    background-color: var(--surface-highlight) !important;
}

.hover\:bg-accent:hover {
    background-color: var(--accent) !important;
}

.hover\:bg-surface-highlight:hover {
    background-color: var(--surface-highlight) !important;
}

/* Force specific elements to adapt */
.group:hover .group-hover\:bg-surface:hover {
    background-color: var(--bg-surface) !important;
}


/* Visionary Film Grain Texture */
.noise-overlay::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 50;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

[data-theme="light"] .noise-overlay::before {
    opacity: 0.15;
    mix-blend-mode: multiply;
}

.text-gradient {
    background: linear-gradient(135deg, #FCD34D 0%, #F59E0B 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Smooth Reveal Animation Classes */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Float Animation */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Marquee Animation */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.animate-marquee {
    animation: marquee 20s linear infinite;
}

/* FAQ Details Animation */
details>summary {
    list-style: none;
}

details>summary::-webkit-details-marker {
    display: none;
}

details[open] summary~* {
    animation: sweep .5s ease-in-out;
}

@keyframes sweep {
    0% {
        opacity: 0;
        transform: translateY(-10px)
    }

    100% {
        opacity: 1;
        transform: translateY(0)
    }
}

/* 3D Book Styles */
.book-card {
    background: #0E0E12;
    box-shadow: inset 3px 0 10px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.05), 10px 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease-out;
    transform-origin: center left;
}

.book-card:hover {
    transform: translateY(-6px) rotateY(-5deg) scale(1.02);
    box-shadow: inset 3px 0 10px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.1), 20px 20px 40px -10px rgba(0, 0, 0, 0.6);
    z-index: 20;
}

.book-binding-glow {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.05), transparent);
    pointer-events: none;
    z-index: 10;
}

/* Custom Prose Styles */
.prose p {
    margin-bottom: 1.5em;
    line-height: 1.8;
}

.prose h2 {
    font-size: 1.5rem;
    margin-top: 2.5em;
    margin-bottom: 1em;
    font-weight: 600;
}

.prose h3 {
    font-size: 1.25rem;
    margin-top: 2em;
    margin-bottom: 0.75em;
    font-weight: 500;
}

.prose ul {
    list-style-type: disc;
    padding-left: 1.5em;
    margin-bottom: 1.5em;
}

.prose li {
    margin-bottom: 0.5em;
}

/* 404 Glitch Animation */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(35px, 9999px, 11px, 0);
    }

    20% {
        clip: rect(66px, 9999px, 86px, 0);
    }

    40% {
        clip: rect(10px, 9999px, 96px, 0);
    }

    60% {
        clip: rect(54px, 9999px, 25px, 0);
    }

    80% {
        clip: rect(22px, 9999px, 6px, 0);
    }

    100% {
        clip: rect(89px, 9999px, 3px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(15px, 9999px, 61px, 0);
    }

    20% {
        clip: rect(86px, 9999px, 6px, 0);
    }

    40% {
        clip: rect(20px, 9999px, 36px, 0);
    }

    60% {
        clip: rect(4px, 9999px, 95px, 0);
    }

    80% {
        clip: rect(52px, 9999px, 16px, 0);
    }

    100% {
        clip: rect(9px, 9999px, 73px, 0);
    }
}

/* =========================================================================
   Bento Grid Fixes for Ecosystem Section (Imported from ayub.html)
   ========================================================================= */

/* Shared Transitions */
.eco-card-consultant-main,
.eco-card-author-main,
.eco-card-speaker-main,
.eco-card-clients-main,
.eco-card-reveal {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 500ms;
}

.eco-card-reveal {
    transition-delay: 75ms;
}

/* 1. Consultant Card */
.eco-card-consultant-main {
    transform: translateY(-220px);
}

@media (min-width: 768px) {
    .eco-card-consultant-main {
        transform: translateY(0);
    }

    .group:hover .eco-card-consultant-main {
        transform: translateY(-280px);
    }
}

/* 2. Author Card */
.eco-card-author-main {
    transform: translateY(-40px);
}

@media (min-width: 768px) {
    .eco-card-author-main {
        transform: translateY(0);
    }

    .group:hover .eco-card-author-main {
        transform: translateY(-60px);
    }
}

/* 3. Speaker Card */
.eco-card-speaker-main {
    transform: translateY(-80px);
}

@media (min-width: 768px) {
    .eco-card-speaker-main {
        transform: translateY(0);
    }

    .group:hover .eco-card-speaker-main {
        transform: translateY(-120px);
    }
}

/* 4. Clients Card */
.eco-card-clients-main {
    transform: translateY(-90px);
}

@media (min-width: 768px) {
    .eco-card-clients-main {
        transform: translateY(0);
    }

    .group:hover .eco-card-clients-main {
        transform: translateY(-130px);
    }
}

/* Reveal Content Logic (All Cards) */
.eco-card-reveal {
    opacity: 1;
    transform: translateY(0);
    /* Mobile shows content by default if space permits, or per original design */
}

@media (min-width: 768px) {
    .eco-card-reveal {
        opacity: 0;
        transform: translateY(1rem);
    }

    .group:hover .eco-card-reveal {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale and Opacity Hover Effects (Generic Helpers) */
.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

.group:hover .group-hover\:scale-110 {
    transform: scale(1.10);
}

.group:hover .group-hover\:opacity-40 {
    opacity: 0.4;
}

/* Ensure background image transition exists */
.group img.transition-all {
    transition-duration: 700ms;
}

/* =========================================================================
   Success Stories (Works Section) Fixes
   ========================================================================= */

/* UX Fix: Active Block Feedback */
.work-content-block.is-active {
    background-color: #13131F;
    /* surface color */
    border-color: rgba(255, 255, 255, 0.15);
    /* Add a subtle highlight or shadow to emphasize activity */
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.05);
}

/* Ensure image transitions are leveraged */
.work-bg-image {
    transition: opacity 700ms ease-out, transform 700ms ease-out;
}

/* =========================================
   Tailwind Polyfills for Success Stories 
   (Required because index.html likely lacks these JIT/Arbitrary values in its compiled styles)
   ========================================= */

/* Layout & Sizing */
.min-h-\[90vh\] {
    min-height: 90vh !important;
}

.h-screen {
    height: 100vh !important;
}

.sticky {
    position: sticky !important;
}

.top-0 {
    top: 0 !important;
}

/* Borders & Backgrounds (Arbitrary Values) */
.border-white\/5 {
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.border-white\/10 {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.border-white\/20 {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Hardcoded bg-bg matches #0A0A0F from variables */
.bg-bg\/95 {
    background-color: rgba(10, 10, 15, 0.95) !important;
}

.bg-bg\/80 {
    background-color: rgba(10, 10, 15, 0.8) !important;
}

.bg-bg\/20 {
    background-color: rgba(10, 10, 15, 0.2) !important;
}

/* State Utilities */
.opacity-0 {
    opacity: 0 !important;
}

.opacity-100 {
    opacity: 1 !important;
}

.scale-105 {
    transform: scale(1.05) !important;
}

.scale-100 {
    transform: scale(1) !important;
}

/* Responsive Overrides (Targeting specific breakages) */
@media (min-width: 768px) {
    .md\:flex-row {
        flex-direction: row !important;
    }

    .md\:items-end {
        align-items: flex-end !important;
    }
}

@media (min-width: 1024px) {
    .lg\:block {
        display: block !important;
    }

    .lg\:hidden {
        display: none !important;
    }

    .lg\:flex {
        display: flex !important;
    }

    .lg\:w-1\/2 {
        width: 50% !important;
    }

    .lg\:pt-32 {
        padding-top: 8rem !important;
    }

    .lg\:pb-10 {
        padding-bottom: 2.5rem !important;
    }

    .lg\:bg-transparent {
        background-color: transparent !important;
    }
}

/* Missing Positioning & Object Fit Refinements */
.object-cover {
    object-fit: cover !important;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    position: absolute !important;
}

.z-10 {
    z-index: 10 !important;
}

.pointer-events-none {
    pointer-events: none !important;
}

.relative {
    position: relative !important;
}

.aspect-video {
    aspect-ratio: 16/9 !important;
}

.overflow-hidden {
    overflow: hidden !important;
}

/* =========================================
   Stage & Media Section Polyfills
   ========================================= */

/* Play Button Pulse Animation */
.play-button-pulse {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    animation: pulse-white 2s infinite;
}

@keyframes pulse-white {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* Typography & Layout Polyfills */
.tracking-\[0\.2em\] {
    letter-spacing: 0.2em !important;
}

.gap-12 {
    gap: 3rem !important;
}

.gap-6 {
    gap: 1.5rem !important;
}

.space-y-4> :not([hidden])~ :not([hidden]) {
    --tw-space-y-reverse: 0;
    margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
    margin-bottom: calc(1rem * var(--tw-space-y-reverse));
}


.aspect-video {
    aspect-ratio: 16/9 !important;
}

.overflow-hidden {
    overflow: hidden !important;
}

/* =========================================
   Hover & Group State Polyfills
   ========================================= */

/* Ensure group-hover works for opacity and colors */
.group:hover .group-hover\:opacity-100 {
    opacity: 1 !important;
}

.group:hover .group-hover\:bg-white {
    background-color: #ffffff !important;
}

.group:hover .group-hover\:text-bg {
    color: var(--bg-canvas) !important;
    /* using variable or hardcoded black/dark */
}

/* Also ensure transition allows it to be seen */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Fix marquee hover if needed */
/* =========================================
   Methodology / Revenue Engine Polyfills
   ========================================= */

/* Sticky & Stacking Context */
.lg\:sticky {
    position: sticky !important;
}

.lg\:top-32 {
    top: 8rem !important;
}

.top-32 {
    top: 8rem !important;
}

.top-36 {
    top: 9rem !important;
}

.top-40 {
    top: 10rem !important;
}

.top-44 {
    top: 11rem !important;
}

/* Will Change optimization */
.will-change-transform {
    will-change: transform, opacity;
}

/* Active State Overrides for Protocol Steps */
.protocol-step[data-active="true"] {
    opacity: 1 !important;
    transform: scale(1) !important;
    border-color: rgba(139, 92, 246, 0.5);
    /* Violet default */
    box-shadow: 0 0 40px -10px rgba(139, 92, 246, 0.3) !important;
}

/* Specific color overrides based on data-color attribute if needed, 
   but the inline styles in HTML usually handle the border colors. 
   We just need to ensure the base transition works. */

/* Gradient Background Polyfill */
.bg-\[radial-gradient\(ellipse_at_top\,_var\(--tw-gradient-stops\)\)\] {
    background-image: radial-gradient(ellipse at top, var(--tw-gradient-stops));
}

.from-violet-900\/10 {
    --tw-gradient-from: rgba(76, 29, 149, 0.1);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(76, 29, 149, 0));
}

.via-bg {
    --tw-gradient-via: #0A0A0F;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-via), var(--tw-gradient-to, rgba(10, 10, 15, 0));
}

.to-bg {
    --tw-gradient-to: #0A0A0F;
}

/* Inactive State for Depth */
.protocol-step[data-active="false"] {
    /* These overlap with the inline styles but valid to reinforce */
}