/* ============================================
   COPPERCLOUD - PREMIUM DARK MODE DESIGN SYSTEM
   Aesthetic: High-End, Sovereign, Data-Driven, Glassmorphism
   ============================================ */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Smooth page transitions */
body {
    opacity: 0;
    animation: fadeIn 0.6s ease-in forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Typography */
@import url('https://fonts.googleapis.com/css2?family=Charter:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    background-color: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* CSS Custom Properties */
:root {
    /* Colors */
    --bg-color: #0a0a0a;
    --card-bg: #141414;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;

    /* Accents */
    --accent-gold: #c7a064;
    /* Copper Gold */
    --accent-gold-hover: #e0b878;
    --accent-green: #2C6E63;
    /* Emerald */
    --accent-green-bright: #059669;

    /* Glassmorphism */
    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.05);

    /* Spacing */
    --container-width: 1200px;
    --section-spacing: 8rem;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s ease;
}

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon {
    color: var(--accent-gold);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* --- Hero Section --- */
.hero-section {
    padding-top: 180px;
    padding-bottom: 100px;
    position: relative;
    overflow: hidden;
}

/* Abstract Background with Animation */
.hero-section::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 60%;
    height: 120%;
    background: radial-gradient(circle, rgba(199, 160, 100, 0.1) 0%, rgba(10, 10, 10, 0) 70%);
    z-index: -1;
    pointer-events: none;
    animation: pulse-glow 8s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.05);
    }
}

/* Scroll Indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.6;
    animation: bounce 2s infinite;
    cursor: pointer;
    z-index: 10;
}

.hero-scroll-indicator span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hero-scroll-indicator svg {
    width: 24px;
    height: 24px;
    color: var(--accent-gold);
}

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

.hero-scroll-indicator:hover {
    opacity: 1;
}

/* Hero Background Image - Subtle Copper Pipes */
.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background-image: url('/assets/images/copper-pipes.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.25;
    z-index: -1;
    pointer-events: none;
    filter: grayscale(100%) brightness(0.4);
}

@media (max-width: 1024px) {
    .hero-section::after {
        width: 100%;
        opacity: 0.15;
    }
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(199, 160, 100, 0.1);
    border: 1px solid rgba(199, 160, 100, 0.3);
    border-radius: 20px;
    color: var(--accent-gold);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.hero-title {
    font-family: 'Charter', serif;
    font-size: clamp(3rem, 5vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    max-width: 900px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out 0.3s forwards;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin-bottom: 2.5rem;
    font-weight: 300;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

.hero-cta {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.8rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.btn-primary {
    background: var(--accent-gold);
    color: #000;
    border: 1px solid var(--accent-gold);
}

.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    background: var(--accent-gold-hover);
    border-color: var(--accent-gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(199, 160, 100, 0.3);
}

.btn-outline-green {
    background: transparent;
    color: var(--accent-green-bright);
    border: 1px solid var(--accent-green-bright);
}

.btn-outline-green:hover {
    background: rgba(5, 150, 105, 0.1);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* --- Metrics Section --- */
.metrics-section {
    padding: 4rem 0;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
}

.metric-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.metric-item.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.metrics-header {
    margin-bottom: 3rem;
}

.metrics-header h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.metric-item {
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    transition: transform var(--transition-fast), opacity 0.6s ease, transform 0.6s ease;
    opacity: 1;
    transform: translateY(0);
}

.metric-item:not(.animate-in) {
    opacity: 0;
    transform: translateY(20px);
}

.metric-item:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--accent-gold);
    box-shadow: 0 10px 25px rgba(199, 160, 100, 0.2);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.metric-unit {
    font-size: 1.2rem;
    color: var(--accent-gold);
}

.metric-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.metric-sublabel {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* --- General Section Styles --- */
.section {
    padding: var(--section-spacing) 0;
    position: relative;
    min-height: auto;
}

/* Ensure sections have content visible */
.section .container {
    min-height: 200px;
}

/* Subtle background for Research section */
#research {
    background-image: url('/assets/images/grid.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

#research::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.85);
    z-index: 0;
    pointer-events: none;
}

#research > .container {
    position: relative;
    z-index: 1;
}

/* Map Container */
.map-container {
    margin-top: 2rem;
    position: relative;
}

#zambia-map {
    background: var(--card-bg);
}

/* Leaflet Dark Theme Overrides */
.leaflet-container {
    background: var(--card-bg) !important;
}

.leaflet-popup-content-wrapper {
    background: var(--card-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
}

.leaflet-popup-tip {
    background: var(--card-bg) !important;
    border: 1px solid var(--glass-border) !important;
}

.leaflet-control-zoom a {
    background: var(--card-bg) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--accent-gold) !important;
}

.section-header {
    margin-bottom: 4rem;
    max-width: 800px;
}

.section-title {
    font-family: 'Charter', serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

/* --- Roadmap Timeline --- */
.roadmap-timeline {
    margin: 3rem 0 4rem;
    padding: 0 2rem;
}

.timeline-track {
    position: relative;
    height: 4px;
    background: var(--glass-border);
    border-radius: 2px;
    margin: 2rem 0;
}

.timeline-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold) 0%, var(--accent-green-bright) 100%);
    border-radius: 2px;
    width: 0%;
    transition: width 1s ease;
}

.timeline-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    z-index: 10;
}

.marker-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 3px solid var(--glass-border);
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.timeline-marker:hover .marker-dot,
.timeline-marker.active .marker-dot {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(199, 160, 100, 0.5);
    transform: scale(1.3);
}

.marker-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.timeline-marker:hover .marker-label,
.timeline-marker.active .marker-label {
    color: var(--accent-gold);
}

/* --- Cards Grid --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.premium-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2.5rem;
    transition: all var(--transition-medium);
    position: relative;
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
}

.premium-card:not(.animate-in) {
    opacity: 0;
    transform: translateY(30px);
}

.premium-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.premium-card.timeline-highlight {
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px rgba(199, 160, 100, 0.3);
    transform: translateY(-8px) scale(1.02);
}

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

/* Fallback: if JS fails, show cards */
.no-js .premium-card,
.no-js .metric-item,
.no-js .stack-card {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.premium-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--glass-highlight);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(199, 160, 100, 0.1);
}

.premium-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.premium-card:hover::after {
    opacity: 1;
}

.card-number {
    font-size: 3rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.05);
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-family: 'Charter', serif;
}

.card-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--accent-gold);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.card-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.card-stats {
    display: flex;
    gap: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Value Stack Visualization (Dark Mode) --- */
.infrastructure-visual {
    padding: 3rem 0;
    position: relative;
}

/* Subtle glow effect on value stack cards */
.value-stack-horizontal:hover .stack-card {
    filter: brightness(1.05);
}

.value-stack-horizontal .stack-card:hover {
    filter: brightness(1.1);
    z-index: 10;
}

.value-stack-horizontal {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.stack-card {
    background: #1a1a1a;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    flex: 1 1 0;
    min-width: 0;
    max-width: 240px;
    text-align: center;
    position: relative;
    transition: transform var(--transition-fast), opacity 0.6s ease, transform 0.6s ease;
    opacity: 1;
    transform: translateY(0);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stack-card:not(.animate-in) {
    opacity: 0;
    transform: translateY(20px);
}

.stack-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

@media (min-width: 1200px) {
    .value-stack-horizontal {
        max-width: 1400px;
        gap: 1.5rem;
    }
    
    .stack-card {
        max-width: 260px;
        padding: 2.5rem 1.75rem;
    }
    
    .arrow-connector {
        width: 40px;
        margin: 0 0.75rem;
    }
    
    .arrow-connector svg {
        width: 40px;
        height: 24px;
    }
}

.arrow-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    flex-shrink: 0;
    width: 32px;
    margin: 0 0.5rem;
}

.arrow-connector svg {
    width: 32px;
    height: 20px;
}

.stack-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: var(--accent-gold);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(199, 160, 100, 0.2);
}

.stack-card h4 {
    color: var(--text-primary);
    margin: 1rem 0 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
}

.stack-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.card-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.layer-energy .card-icon-wrapper {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
}

.layer-telecom .card-icon-wrapper {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

.layer-compute .card-icon-wrapper {
    background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
}

.layer-services .card-icon-wrapper {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
}

.card-ports {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.port-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #333;
}

.stack-card:hover .port-dot {
    background: var(--accent-green-bright);
    box-shadow: 0 0 5px var(--accent-green-bright);
}

.arrow-connector svg path {
    stroke: var(--text-tertiary);
}

/* --- Footer --- */
.footer {
    background: #050505;
    padding: 4rem 0;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-cta {
        flex-direction: column;
    }

    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--glass-bg);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--glass-border);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-medium);
        z-index: 999;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links a {
        font-size: 1.1rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--glass-border);
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .section {
        padding: 4rem 0;
    }

    .section-title {
        font-size: 2rem;
    }

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

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

    .value-stack-horizontal {
        flex-direction: column;
        gap: 1rem;
    }

    .stack-card {
        width: 100%;
        max-width: 100%;
    }

    .arrow-connector {
        transform: rotate(90deg);
        margin: 0.5rem 0;
    }

    .container {
        padding: 0 1.5rem;
    }

    .premium-card {
        padding: 1.5rem;
    }

    #zambia-map {
        height: 350px !important;
    }

    .hero-scroll-indicator {
        bottom: 1rem;
    }

    .roadmap-timeline {
        margin: 2rem 0 3rem;
        padding: 0 1rem;
    }

    .timeline-marker {
        transform: translate(-50%, -50%) scale(0.9);
    }

    .marker-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding-top: 140px;
        padding-bottom: 60px;
    }

    .hero-title {
        font-size: 2rem;
    }

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

    .metric-value {
        font-size: 2rem;
    }
}