/* ═══════════════════════════════════════════════════════════
   KOLLATI GROUP — VISION 2047
   Custom CSS  |  60/30/10 Color System
   Primary: Forest Green  |  Secondary: Gold  |  Accent: Teal
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────── */
:root {
    /* Primary — 60% */
    --forest-green:       #1a3d2b;
    --forest-green-light: #2d5a40;

    /* Secondary — 30% */
    --gold:               #d4af37;
    --light-gold:         #f0d060;
    --warm-gold:          #b8942e;

    /* Accent — 10% */
    --teal:               #2ec4b6;
    --teal-dark:          #1a7a6f;

    /* Neutral Canvas */
    --cream:              #faf7f0;
    --dark-navy:          #0d1b2a;
    --navy-mid:           #152238;
    --footer-dark:        #061210;

    /* Text */
    --white:              #ffffff;
    --text-dark:          #111111;
    --text-muted:         #8896a7;
    --text-light:         #c2cad6;

    /* Glass */
    --glass-bg:           rgba(255, 255, 255, 0.06);
    --glass-border:       rgba(255, 255, 255, 0.12);
    --glass-hover:        rgba(255, 255, 255, 0.15);

    /* Status */
    --success:            #34d399;
    --error:              #f87171;

    /* Gradients */
    --gold-gradient:      linear-gradient(135deg, #b8942e 0%, #d4af37 30%, #f0d060 60%, #d4af37 100%);
    --forest-depth:       linear-gradient(180deg, #1a3d2b 0%, #152238 50%, #0d1b2a 100%);
    --forest-to-navy:     linear-gradient(160deg, #1a3d2b 0%, #0d1b2a 100%);
    --teal-gradient:      linear-gradient(135deg, #1a7a6f, #2ec4b6);

    /* Layout */
    --navbar-height:      72px;
    --navbar-height-sm:   60px;
}

/* ── Base ──────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--navbar-height);
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--gold);
    color: var(--forest-green);
}

/* ── Fluid Typography ──────────────────────────────────── */
.fluid-h1 { font-size: clamp(2rem, 5vw, 4.5rem); }
.fluid-h2 { font-size: clamp(1.5rem, 3.5vw, 3rem); }
.fluid-h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
.fluid-body { font-size: clamp(0.9rem, 1.5vw, 1.125rem); }

/* ── Gold Gradient Utilities ───────────────────────────── */
.gold-gradient-text {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gold-gradient-bg {
    background: var(--gold-gradient);
}

.gold-underline {
    position: relative;
    display: inline-block;
}
.gold-underline::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gold-gradient);
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.gold-underline.is-visible::after {
    width: 100%;
}

/* ── Glassmorphism ─────────────────────────────────────── */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

.glass-hover:hover {
    background: var(--glass-hover);
    border-color: var(--gold);
}

/* ── Navbar ────────────────────────────────────────────── */
.navbar {
    height: var(--navbar-height);
    transition: height 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
    height: var(--navbar-height-sm);
    background: rgba(13, 27, 42, 0.95) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
    position: relative;
    padding: 4px 0;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--gold);
}

/* Mobile Menu */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-menu.open {
    max-height: 100vh;
}

/* ── Hero Section ──────────────────────────────────────── */
.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

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

.outline-text {
    -webkit-text-stroke: 2px var(--forest-green-light);
    color: transparent;
    font-weight: 700;
}

@media (min-width: 768px) {
    .outline-text {
        -webkit-text-stroke: 3px var(--forest-green-light);
    }
}

/* Typewriter */
.typewriter {
    display: inline;
    border-right: 3px solid var(--gold);
    animation: typewriterBlink 0.8s step-end infinite;
}

@keyframes typewriterBlink {
    0%, 100% { border-color: var(--gold); }
    50% { border-color: transparent; }
}

/* Scroll Indicator */
.scroll-indicator {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-12px); }
    60% { transform: translateY(-6px); }
}

/* 3D Card Tilt */
.card-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.15s ease-out;
}

/* ── 3D Flip Cards (Pillars) ──────────────────────────── */
.flip-card {
    perspective: 1000px;
    min-height: 320px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 320px;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* ── Animations ────────────────────────────────────────── */
[data-animate] {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate="fade-up"] {
    transform: translateY(40px);
}

[data-animate="fade-left"] {
    transform: translateX(-40px);
}

[data-animate="fade-right"] {
    transform: translateX(40px);
}

[data-animate="scale-in"] {
    transform: scale(0.85);
}

[data-animate].is-visible {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

/* Stagger children */
.stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger.is-visible > *:nth-child(2) { transition-delay: 0.15s; }
.stagger.is-visible > *:nth-child(3) { transition-delay: 0.25s; }
.stagger.is-visible > *:nth-child(4) { transition-delay: 0.35s; }
.stagger.is-visible > *:nth-child(5) { transition-delay: 0.45s; }
.stagger.is-visible > *:nth-child(6) { transition-delay: 0.55s; }
.stagger.is-visible > *:nth-child(7) { transition-delay: 0.65s; }
.stagger.is-visible > *:nth-child(8) { transition-delay: 0.75s; }

.stagger.is-visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Keyframes */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.8; }
}

@keyframes draw {
    to { stroke-dashoffset: 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

/* ── Timeline ──────────────────────────────────────────── */
.timeline-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 0.1s linear;
}

.timeline-line.drawn {
    stroke-dashoffset: 0;
}

.timeline-node {
    transition: all 0.4s ease;
}

.timeline-node.active {
    filter: drop-shadow(0 0 12px var(--gold));
}

.timeline-node.active .node-dot {
    animation: pulse 2s ease-in-out infinite;
}

.timeline-card {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-card.from-right {
    transform: translateX(30px);
}

.timeline-card.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Mobile horizontal timeline */
@media (max-width: 425px) {
    .timeline-horizontal {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .timeline-horizontal > * {
        scroll-snap-align: center;
    }
}

/* ── Technology Tabs ───────────────────────────────────── */
.tech-tab {
    position: relative;
    padding: 12px 24px;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

.tech-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gold-gradient);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.tech-tab.active {
    color: var(--gold);
}

.tech-tab.active::after {
    width: 100%;
}

.tech-tab:hover {
    color: var(--light-gold);
}

.tab-panel {
    display: none;
    animation: fadeUp 0.4s ease;
}

.tab-panel.active {
    display: block;
}

/* ── Counters ──────────────────────────────────────────── */
.counter-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}

/* ── Percentage Bars ───────────────────────────────────── */
.progress-bar {
    height: 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 6px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-fill.animated {
    /* width set by data attribute via JS */
}

/* ── Pipeline Flow ─────────────────────────────────────── */
.pipeline-arrow {
    animation: flowPulse 2s ease-in-out infinite;
}

@keyframes flowPulse {
    0%, 100% { opacity: 0.6; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(4px); }
}

/* ── Stamp Badge ───────────────────────────────────────── */
.stamp-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: 3px solid var(--gold);
    border-radius: 8px;
    color: var(--gold);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    transform: rotate(-3deg);
    box-shadow: 0 0 0 4px transparent, inset 0 0 0 2px var(--gold);
}

/* ── Toast Notifications ───────────────────────────────── */
.toast {
    pointer-events: auto;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: toastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    max-width: 380px;
}

.toast.success {
    background: var(--forest-green);
    border: 1px solid var(--success);
    color: var(--success);
}

.toast.error {
    background: #2d1a1a;
    border: 1px solid var(--error);
    color: var(--error);
}

.toast.info {
    background: var(--navy-mid);
    border: 1px solid var(--teal);
    color: var(--teal);
}

.toast.hiding {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}

/* ── Loading Spinner ───────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--forest-green);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Form Styles ───────────────────────────────────────── */
.form-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--white);
    font-size: 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    min-height: 44px;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.15);
}

.form-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

.form-input.valid {
    border-color: var(--success);
}

/* Native select dropdown options render on a light OS panel in many browsers.
   Force dark text so Subject options are always visible. */
select.form-input option {
    color: var(--text-dark);
    background-color: #ffffff;
}

select.form-input option:checked {
    color: #ffffff;
    background-color: var(--teal-dark);
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
}

/* ── Section Dividers (Wave SVGs) ──────────────────────── */
.wave-divider {
    position: relative;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.wave-divider svg {
    display: block;
    width: 100%;
    height: auto;
}

.wave-divider-top {
    margin-bottom: -1px;
}

.wave-divider-bottom {
    margin-top: -1px;
}

/* ── Subtle Texture Overlay ────────────────────────────── */
.texture-overlay {
    position: relative;
}

.texture-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ── Layered Box Shadows ───────────────────────────────── */
.shadow-layered {
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.06),
        0 4px 8px rgba(0, 0, 0, 0.06),
        0 12px 24px rgba(0, 0, 0, 0.08),
        0 24px 48px rgba(0, 0, 0, 0.06);
}

.shadow-layered-hover:hover {
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.08),
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 32px 64px rgba(0, 0, 0, 0.08);
}

/* ── Custom Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-navy);
}

::-webkit-scrollbar-thumb {
    background: var(--forest-green-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--forest-green-light) var(--dark-navy);
}

/* ── Focus Styles (a11y) ───────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* ── Button Micro-interactions ─────────────────────────── */
.btn-gold {
    background: var(--gold-gradient);
    color: var(--forest-green);
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 9999px;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.25s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    min-height: 44px;
}

.btn-gold:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.3);
}

.btn-gold:active {
    transform: translateY(0) scale(0.98);
}

.btn-ghost {
    background: transparent;
    color: var(--white);
    font-weight: 500;
    padding: 12px 28px;
    border-radius: 9999px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
}

.btn-ghost:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(212, 175, 55, 0.08);
}

/* ── Safe Area Padding (notched devices) ───────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
    .safe-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ── Reduced Motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .hero-canvas {
        display: none !important;
    }

    [data-animate] {
        opacity: 1 !important;
        transform: none !important;
    }

    .stagger > * {
        opacity: 1 !important;
        transform: none !important;
    }

    .typewriter {
        border-right: none;
    }

    .scroll-indicator {
        animation: none;
    }
}

/* ── Print Styles ──────────────────────────────────────── */
@media print {
    .navbar,
    #backToTop,
    .hero-canvas,
    .scroll-indicator,
    #toastContainer {
        display: none !important;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    section {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    a[href]::after {
        content: ' (' attr(href) ')';
        font-size: 0.8em;
        color: #666;
    }
}

/* ── Responsive Section Padding ────────────────────────── */
.section-padding {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

@media (min-width: 768px) {
    .section-padding {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

@media (min-width: 1280px) {
    .section-padding {
        padding-top: 7rem;
        padding-bottom: 7rem;
    }
}

/* ── Responsive Navbar Height ──────────────────────────── */
@media (max-width: 768px) {
    :root {
        --navbar-height: 64px;
        --navbar-height-sm: 56px;
    }
}

/* ── Card Hover Lift ───────────────────────────────────── */
.card-lift {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.4s ease;
}

.card-lift:hover {
    transform: translateY(-8px);
}

/* ── Radio as Pills ────────────────────────────────────── */
.radio-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-pill label {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    border: 1px solid var(--glass-border);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    min-height: 44px;
}

.radio-pill input[type="radio"]:checked + label {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--forest-green);
    font-weight: 600;
}

/* ── Ensure touch targets on mobile ────────────────────── */
@media (max-width: 768px) {
    a, button, [role="button"], input, select, textarea {
        min-height: 44px;
    }

    .flip-card:active .flip-card-inner {
        transform: rotateY(180deg);
    }
}
