/* 
 * TARAND INVESTMENTS
 * Master Design Tokens & Core Styles
 */

:root {
    /* 1. Core Palette */
    --color-dark: #0a0a0a;
    --color-light: #f4f4f4;
    --color-glass: rgba(255, 255, 255, 0.05);
    --color-border: rgba(255, 255, 255, 0.1);

    /* 2. Sector Themes */
    --theme-energy: #E5B946;
    /* Industrial Gold */
    --theme-agro: #569D03;
    /* Ecomatt Green */
    --theme-mining: #C69C6D;
    /* Earth/Copper */
    --theme-logistics: #2B4C7E;
    /* Deep Blue */
    --theme-retail: #E63946;
    /* Retail Red */
    --theme-creative: #9D4EDD;
    /* Vibrant Purple */
    --theme-manufacturing: #D66853;
    /* Brick/Industrial */

    /* 3. Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* 4. Motion */
    --ease-smooth: cubic-bezier(0.62, 0.05, 0.01, 0.99);
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-dark);
    color: var(--color-light);
    font-family: var(--font-body);
    overflow-x: hidden;
    /* Lenis handles scroll */
    -webkit-font-smoothing: antialiased;
}

/* WebGL Container */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.6;
    /* Slight dim for text readability */
    pointer-events: none;
}

/* Header & Tools */
/* Command Interface Styles */
#command-nav {
    background-color: #ffffff !important;
    backdrop-filter: none;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
    transform-origin: top center;
}

#command-nav[data-state="idle"] {
    height: 80px;
}

#command-nav[data-state="scrolled"] {
    height: 64px;
    margin-top: 10px;
    /* Slight compression top margin if desired, or just height */
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15);
}

/* Ensure no transparency bleed */
.sector-hover-bar {
    box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.15);
    transform-origin: top center;
}

/* Active State for Sector Triggers */
.sector-trigger.active {
    background-color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    /* Soft shadow */
    color: var(--theme-agro);
    /* Or Tarand Color */
}

.sector-trigger.active i {
    opacity: 1;
    color: var(--theme-agro);
}

/* Panel Visibility */
.sector-panel.opacity-100 {
    pointer-events: auto;
}

.sector-panel.opacity-0 {
    pointer-events: none;
}

/* Menu Open Override */
#command-nav[data-state="menu-open"] {
    background: transparent !important;
    box-shadow: none;
    color: white !important;
}

/* Invers colors for menu open */
#command-nav[data-state="menu-open"] .nav-item,
#command-nav[data-state="menu-open"] i,
#command-nav[data-state="menu-open"] span.block {
    color: white !important;
    background-color: white !important;
    /* For hamburger lines */
}

#command-nav[data-state="menu-open"] .logo-container img {
    filter: brightness(0) invert(1);
    opacity: 0.5;
    /* Dim logo in menu mode */
}

/* Ticker Animations */
@keyframes ticker-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

#status-ticker .animate-pulse {
    animation: ticker-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Bento Grid Transitions */
#command-menu {
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.5s step-end;
    /* Delay visibility hidden until opacity is 0 */
}

#command-menu.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0s step-start;
}

/* Sector Focus States */
body[data-sector-context="energy"] #command-nav {
    border-bottom-color: var(--theme-energy);
}

body[data-sector-context="agro"] #command-nav {
    border-bottom-color: var(--theme-agro);
}

/* Menu Trigger (Mac Pro Grater Style) */
.menu-btn {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    padding: 10px;
    height: 40px;
    width: 40px;
    justify-content: center;
    align-items: center;
}

.menu-btn .dot {
    width: 4px;
    height: 4px;
    background-color: currentColor;
    border-radius: 50%;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 3rem;
    position: relative;
}

h1 {
    font-family: var(--font-heading);
    font-size: 5vw;
    line-height: 1.1;
    font-weight: 300;
    text-transform: uppercase;
}

.reveal-text {
    display: block;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
}

/* Live Ticker */
.live-ticker {
    font-family: 'Space Grotesk', monospace;
    /* Monospace-ish feel */
    font-size: 0.9rem;
    margin-bottom: 2rem;
    color: var(--theme-agro);
    /* Default highlight */
    display: flex;
    gap: 1rem;
    opacity: 0.8;
}

.ticker-separator {
    color: var(--color-border);
}

/* Bento Overlay */
.bento-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 5, 0.98);
    /* Update to darker */
    z-index: 200;
    display: none;
    opacity: 0;
    padding: 6rem 4rem 4rem 4rem;
    /* Top padding for header clearance */
}

/* Close Button Position */
.close-bento {
    position: absolute;
    top: 2.5rem;
    right: 3rem;
    background: none;
    border: none;
    color: var(--color-light);
    font-family: var(--font-heading);
    cursor: pointer;
    font-size: 1rem;
    letter-spacing: 0.1em;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.close-bento:hover {
    opacity: 1;
}

/* The Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, minmax(150px, 1fr));
    /* 3 rows */
    gap: 1.5rem;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Bento Items */
.bento-item {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    overflow: hidden;
    text-decoration: none;
    color: var(--color-light);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    transition: transform 0.3s var(--ease-smooth), border-color 0.3s;
}

.bento-item:hover {
    border-color: var(--item-color);
    transform: scale(0.98);
}

.bento-bg {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--item-color) 0%, transparent 40%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: screen;
}

.bento-item:hover .bento-bg {
    opacity: 0.15;
}

.bento-content {
    position: relative;
    z-index: 1;
}

.bento-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.bento-label {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 500;
}

/* Grid Spans */
.bento-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-item.medium {
    grid-column: span 1;
    grid-row: span 2;
}

.bento-item.wide {
    grid-column: span 2;
    grid-row: span 1;
}

.bento-item.small {
    grid-column: span 1;
    grid-row: span 1;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }

    .bento-item.large,
    .bento-item.wide {
        grid-column: span 2;
    }

    .bento-item.medium,
    .bento-item.small {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .bento-overlay {
        padding: 6rem 1.5rem 2rem 1.5rem;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Sector Sections */
    .sector-section {
        min-height: 100vh;
        padding: 10rem 3rem 5rem 3rem;
        position: relative;
        z-index: 10;
    }

    .sector-header {
        margin-bottom: 5rem;
        max-width: 800px;
    }

    .sector-label {
        display: block;
        font-family: var(--font-body);
        font-size: 0.9rem;
        letter-spacing: 0.1em;
        opacity: 0.6;
        margin-bottom: 1rem;
        text-transform: uppercase;
    }

    .sector-title {
        font-family: var(--font-heading);
        font-size: 4rem;
        line-height: 1;
        font-weight: 700;
        text-transform: uppercase;
        margin-bottom: 2rem;
        color: var(--color-light);
        /* Will be overridden by JS interaction potentially */
    }

    /* Specific Sector Theme Overrides */
    [data-sector="energy"] .sector-title {
        color: var(--theme-energy);
        text-shadow: 0 0 30px rgba(229, 185, 70, 0.3);
    }

    .sector-desc {
        font-size: 1.5rem;
        line-height: 1.4;
        max-width: 600px;
        opacity: 0.9;
        font-weight: 300;
    }

    /* Subsidiary Grid */
    .subsidiary-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
        margin-top: 4rem;
    }

    .subsidiary-card {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 1rem;
        overflow: hidden;
        transition: transform 0.3s var(--ease-smooth), border-color 0.3s;
        cursor: pointer;
        min-height: 400px;
        display: flex;
        flex-direction: column;
    }

    .subsidiary-card:hover {
        border-color: var(--theme-energy);
        /* Dynamic based on parent sector? For now hardcoded or use JS */
        transform: translateY(-10px);
    }

    [data-sector="energy"] .subsidiary-card:hover {
        /* CSS-only theme aware hover */
        border-color: var(--theme-energy);
    }

    .card-visual {
        flex: 1;
        background: #000;
        position: relative;
        overflow: hidden;
    }

    /* Visual Placeholders - In real build, these would be images/video */
    .visual-fuel {
        background: linear-gradient(45deg, #111, #333);
    }

    .visual-gas {
        background: radial-gradient(circle, #222, #000);
    }

    .visual-solar {
        background: repeating-linear-gradient(45deg, #1a1a1a, #1a1a1a 10px, #222 10px, #222 20px);
    }

    .card-content {
        padding: 2rem;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(5px);
    }

    .card-content h3 {
        font-family: var(--font-heading);
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .card-content p {
        font-size: 0.9rem;
        opacity: 0.7;
        margin-bottom: 1.5rem;
    }

    .card-link {
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: inherit;
        opacity: 0.5;
        transition: opacity 0.3s;
    }

    .subsidiary-card:hover .card-link {
        opacity: 1;
        color: var(--theme-energy);
    }
}

/* Closing brace for @media (max-width: 768px) or previous block */