/* ============================================
   KAIG GROUP — Base Styles & Global Reset
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    font-size: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-secondary);
}

html::-webkit-scrollbar {
    width: 8px;
}

html::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

html::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: var(--radius-full, 9999px);
}

html::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark, var(--primary));
}

body {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: var(--text-base, 1rem);
    line-height: var(--leading-normal, 1.5);
    color: var(--text-primary, #ffffff);
    background-color: var(--bg-primary, #121212);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background-color var(--duration-slow, 0.3s) var(--ease-smooth, ease),
        color var(--duration-slow, 0.3s) var(--ease-smooth, ease);
}

body.no-scroll {
    overflow: hidden;
}

/* ── Links ── */
a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-colors, color 0.2s ease);
}

a:hover {
    color: var(--primary);
}

/* ── Images & Media ── */
img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Lists ── */
ul,
ol {
    list-style: none;
}

/* ── Form Elements ── */
button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    outline: none;
}

/* ── Typography ── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display, 'Outfit', sans-serif);
    font-weight: var(--weight-bold, 700);
    line-height: var(--leading-tight, 1.2);
    color: var(--text-primary);
    letter-spacing: var(--tracking-tight, -0.02em);
}

h1 {
    font-size: clamp(2.5rem, 5vw, var(--text-7xl, 4.5rem));
}

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

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

h4 {
    font-size: clamp(1.25rem, 2.5vw, var(--text-2xl, 1.5rem));
}

h5 {
    font-size: var(--text-xl, 1.25rem);
}

h6 {
    font-size: var(--text-lg, 1.125rem);
}

p {
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    line-height: var(--leading-relaxed, 1.625);
    max-width: 75ch;
}

strong,
b {
    font-weight: var(--weight-semibold, 600);
}

/* ── Selection & Focus ── */
::selection {
    background-color: var(--primary);
    color: #FFFFFF;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ── Layout Containers ── */
.container {
    width: 100%;
    max-width: var(--container-xl, 1280px);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--content-padding, 1.5rem);
    padding-right: var(--content-padding, 1.5rem);
}

.container-narrow {
    max-width: var(--container-lg, 1024px);
}

.container-wide {
    max-width: var(--container-2xl, 1440px);
}

.container-full {
    max-width: var(--container-max, 100%);
}

/* ── Sections ── */
.section {
    padding-top: var(--space-10, 4rem);
    padding-bottom: var(--space-10, 4rem);
    position: relative;
    overflow: hidden;
}

.section--dark {
    background-color: var(--bg-secondary, #1a1a1a);
}

.section--darker {
    background-color: var(--secondary-dark, #0d0d0d);
}

.section--accent {
    background-color: var(--primary);
}

.section--accent .text-secondary,
.section--accent p {
    color: rgba(255, 255, 255, 0.85);
}

/* ── Section Header ── */
.section-header {
    text-align: center;
    margin-bottom: var(--space-16, 4rem);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-label {
    display: inline-block;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: var(--text-sm, 0.875rem);
    font-weight: var(--weight-medium, 500);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest, 0.1em);
    margin-bottom: var(--space-4, 1rem);
    position: relative;
    padding-left: 40px;
}

.section-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 2px;
    background: var(--primary);
}

.section-title {
    margin-bottom: var(--space-4, 1rem);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-lg, 1.125rem);
    line-height: var(--leading-relaxed, 1.625);
    margin-left: auto;
    margin-right: auto;
}

/* ── Flex & Grid Utilities ── */
.flex {
    display: flex;
}

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

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

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-start {
    justify-content: flex-start;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: var(--space-1, 0.25rem);
}

.gap-2 {
    gap: var(--space-2, 0.5rem);
}

.gap-3 {
    gap: var(--space-3, 0.75rem);
}

.gap-4 {
    gap: var(--space-4, 1rem);
}

.gap-6 {
    gap: var(--space-6, 1.5rem);
}

.gap-8 {
    gap: var(--space-8, 2rem);
}

.gap-10 {
    gap: var(--space-10, 2.5rem);
}

.gap-12 {
    gap: var(--space-12, 3rem);
}

.grid {
    display: grid;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ── Typography Utilities ── */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-primary-color {
    color: var(--primary) !important;
}

.text-white {
    color: #FFFFFF !important;
}

.text-muted {
    color: var(--text-muted, rgba(255, 255, 255, 0.5)) !important;
}

.text-uppercase {
    text-transform: uppercase;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--primary-light, #ff4d4d));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Spacing Utilities ── */
.mt-auto {
    margin-top: auto;
}

.mb-4 {
    margin-bottom: var(--space-4, 1rem);
}

.mb-6 {
    margin-bottom: var(--space-6, 1.5rem);
}

.mb-8 {
    margin-bottom: var(--space-8, 2rem);
}

.mb-12 {
    margin-bottom: var(--space-12, 3rem);
}

.mb-16 {
    margin-bottom: var(--space-16, 4rem);
}

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

/* ── Custom Cursor (Graceful Enhancement) ── */
.cursor-dot,
.cursor-ring {
    display: none;
}

@media (hover: hover) and (pointer: fine) {

    /* Hide native cursor only when custom cursor script is active */
    body.custom-cursor-active,
    body.custom-cursor-active a,
    body.custom-cursor-active button,
    body.custom-cursor-active [role="button"],
    body.custom-cursor-active input,
    body.custom-cursor-active textarea,
    body.custom-cursor-active select,
    body.custom-cursor-active label {
        cursor: none;
    }

    .cursor-dot {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 8px;
        height: 8px;
        background-color: var(--primary);
        border-radius: 50%;
        pointer-events: none;
        z-index: var(--z-cursor, 9999);
        transition: width 0.2s ease, height 0.2s ease, background-color 0.2s ease;
    }

    .cursor-ring {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 36px;
        height: 36px;
        border: 2px solid var(--primary);
        border-radius: 50%;
        pointer-events: none;
        z-index: calc(var(--z-cursor, 9999) - 1);
        transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    }

    .cursor-dot.cursor-hover {
        background-color: transparent;
    }

    .cursor-ring.cursor-hover {
        width: 60px;
        height: 60px;
        background-color: rgba(220, 38, 38, 0.1);
        border-color: rgba(220, 38, 38, 0.3);
    }

    .cursor-dot.cursor-click {
        width: 4px;
        height: 4px;
    }

    .cursor-ring.cursor-click {
        width: 24px;
        height: 24px;
        background-color: rgba(220, 38, 38, 0.2);
    }
}

/* ── Mouse Glow ── */
.mouse-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.06) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.mouse-glow.active {
    opacity: 1;
}

/* =========================================
   Desktop Dropdown (Multi-Level)
========================================= */
.nav-item-dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 240px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.nav-item-dropdown:hover>.dropdown-menu {
    display: block;
}

.dropdown-item {
    position: relative;
}

.dropdown-item .dropdown-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    color: #333333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dropdown-item .dropdown-link:hover {
    background-color: #f8f9fa;
    color: var(--primary-color, #0056b3);
    /* Update to match your brand color */
}

.dropdown-arrow {
    font-size: 18px;
    color: #999;
    line-height: 1;
}

/* Sub-submenu (e.g. Leadership -> GM's) pops out to the right */
.dropdown-item.has-submenu>.dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -10px;
    margin-left: 2px;
}

.dropdown-item.has-submenu:hover>.dropdown-menu {
    display: block;
}

/* =========================================
   Mobile Dropdown Improvements (Theme Adaptive)
========================================= */
.nav-mobile-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-primary, #ffffff);
    transition: color 0.3s ease;
}

[data-theme="light"] .nav-mobile-dropdown-toggle {
    color: #1a1a1a;
}

.mobile-toggle-icon {
    font-size: 20px;
    font-weight: 300;
    color: var(--text-secondary, #a0a0a0);
    transition: color 0.3s ease, transform 0.3s ease;
}

[data-theme="light"] .mobile-toggle-icon {
    color: #666666;
}

.nav-mobile-dropdown-toggle.open .mobile-toggle-icon {
    color: var(--primary, #c09f53);
    transform: rotate(180deg);
}

.nav-mobile-subitem-link {
    display: block;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.05));
    transition: color 0.3s ease, background-color 0.3s ease;
}

[data-theme="light"] .nav-mobile-subitem-link {
    color: #000;
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

.nav-mobile-subitem-link:hover,
.nav-mobile-dropdown-toggle.open {
    color: var(--primary, #c09f53);
}

[data-theme="light"] .nav-mobile-subitem-link:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .nav-mobile-subitem-link:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Hide mobile submenus by default */
.nav-mobile-submenu {
    display: none;
    background-color: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .nav-mobile-submenu {
    background-color: rgba(0, 0, 0, 0.02);
}

.nav-mobile-submenu.open {
    display: block;
}

/* =========================================
   Consolidated Responsive Breakpoints
   ========================================= */
@media (max-width: 1024px) {
    .section {
        padding-top: var(--space-12, 3rem);
        padding-bottom: var(--space-12, 3rem);
    }

    .grid-4,
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --content-padding: var(--space-4, 1rem);
    }

    .section {
        padding-top: var(--space-8, 2rem);
        padding-bottom: var(--space-8, 2rem);
    }

    .section-header {
        margin-bottom: var(--space-10, 2.5rem);
    }

    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .hide-mobile {
        display: none !important;
    }

    /* Clean Mobile Overrides (No Negative Margin Hacks) */
    #history .about-grid,
    #about .about-grid,
    #chairman-detail .leader-section {
        text-align: left;
    }

    #contact-content .grid-2>div {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    #contact-form {
        width: 100%;
        text-align: left;
    }

    .contact-info-card {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .map-embed {
        width: 100%;
        margin-top: var(--space-6, 1.5rem);
    }

    #careers-highlight {
        padding-bottom: var(--space-16, 4rem);
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
}