/* --- FONT DECLARATIONS --- */
@font-face {
    font-family: 'Editorial New';
    src: url('EditorialNew-Ultralight.woff2') format('woff2'),
         url('EditorialNew-Ultralight.woff') format('woff');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Editorial New';
    src: url('EditorialNew-Light.woff2') format('woff2'),
         url('EditorialNew-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Editorial New';
    src: url('EditorialNew-Regular.woff2') format('woff2'),
         url('EditorialNew-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Editorial New';
    src: url('EditorialNew-Medium.woff2') format('woff2'),
         url('EditorialNew-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Editorial New';
    src: url('EditorialNew-Bold.woff2') format('woff2'),
         url('EditorialNew-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Editorial New';
    src: url('EditorialNew-Heavy.woff2') format('woff2'),
         url('EditorialNew-Heavy.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* --- CORE VARIABLES --- */
:root {
    --black: #000000;
    --white: #ffffff;
    --gray-dark: #1a1a1a;
    --gray-medium: #666666;
    --gray-light: #f5f5f5;
    --accent: #FF6B1C;
    --teal: #009CA6;
    --blue: #00E054;
    --text-muted: rgba(255, 255, 255, 0.7);
    
    /* Typography - CHANGE SANS TO EDITORIAL */
    --font-editorial: 'Editorial New', Georgia, serif;
    --font-sans: 'Editorial New', Georgia, serif; /* CHANGED */
    --font-mono: 'SF Mono', Monaco, 'Courier New', monospace;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
    --space-2xl: 8rem;
    --space-3xl: 12rem;
    
    /* Layout */
    --max-width: 1440px;
    --gutter: 5vw;
    
    /* Transitions */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-in-out-expo: cubic-bezier(0.87, 0, 0.13, 1);
    --duration: 0.8s;
    --duration-long: 1.2s;
}

/* --- RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-editorial);
    background-color: var(--black);
    color: var(--white);
    overflow-x: hidden;
    width: 100%;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1, "liga" 1;
}

/* --- LOCOMOTIVE-STYLE TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-editorial);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 0.9;
    margin: 0;
}

h1 {
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 200;
    margin-bottom: var(--space-lg);
    letter-spacing: -0.03em;
}

h2 {
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 300;
    margin-bottom: var(--space-lg);
}

h3 {
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 400;
    margin-bottom: var(--space-md);
}

h4 {
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 500;
    margin-bottom: var(--space-md);
}

/* CHANGE PARAGRAPHS TO EDITORIAL NEW */
p {
    font-family: 'Editorial New', Georgia, serif; /* CHANGED */
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    font-weight: 400; /* ADDED */
    line-height: 1.7;
    margin-bottom: var(--space-md);
    color: var(--text-muted);
    max-width: 70ch;
}

.large-text {
    font-family: var(--font-editorial);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 300;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 500;
}

/* FIX OUTLINE TEXT FOR LEGIBILITY */
.outline-text {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3); /* CHANGED */
    color: transparent;
    opacity: 0.8; /* CHANGED */
}

/* --- LAYOUT --- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
    position: relative;
    z-index: 2; /* ADDED */
}

.section-padding {
    padding: var(--space-3xl) 0;
    position: relative;
}

@media (max-width: 768px) {
    .section-padding {
        padding: var(--space-2xl) 0;
    }
}

/* --- HERO SECTION --- */
#hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: var(--space-xl) var(--gutter);
}

/* FIX HERO IMAGE Z-INDEX */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0; /* CHANGED from -2 to 0 */
    filter: none;
    transform: scale(1.1);
    transition: transform 10s var(--ease-out-expo);
}

/* Dark overlay for text legibility */
#hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, 
        rgba(0,0,0,0.4) 0%, /* CHANGED - darker */
        rgba(0,0,0,0.6) 50%, /* CHANGED - darker */
        rgba(0,0,0,0.8) 100%); /* CHANGED - darker */
    z-index: 1; /* CHANGED from -1 to 1 */
}

#hero:hover .hero-bg {
    transform: scale(1.05);
}

#hero h1 {
    color: var(--white);
    text-shadow: 0 2px 40px rgba(0,0,0,0.5);
    position: relative; /* ADDED */
    z-index: 2; /* ADDED */
}

#hero p {
    color: rgba(255,255,255,0.9);
    position: relative; /* ADDED */
    z-index: 2; /* ADDED */
}

/* --- IMAGES - CRISP, TALL, FULL WIDTH --- */
.content-image {
    width: 100%;
    height: 80vh;
    object-fit: cover;
    display: block;
    margin: var(--space-2xl) 0;
    position: relative;
    overflow: hidden;
    /* Crisp images - no filters */
    filter: none;
}

/* Full bleed images */
.content-image.full-bleed {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    height: 90vh;
}

@media (max-width: 768px) {
    .content-image {
        height: 60vh;
    }
    
    .content-image.full-bleed {
        height: 70vh;
    }
}

/* Image reveal with mask animation */
.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black);
    transform-origin: bottom;
    transition: transform 1.2s var(--ease-out-expo);
}

.image-reveal.revealed::after {
    transform: scaleY(0);
}

/* Parallax wrapper for images */
.parallax-wrapper {
    position: relative;
    overflow: hidden;
    height: 80vh;
}

.parallax-image {
    position: absolute;
    top: -10%;
    left: 0;
    width: 100%;
    height: 120%;
    object-fit: cover;
    will-change: transform;
}

/* --- CODE BLOCK ENHANCED STYLING --- */
.code-wrapper {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    padding: var(--space-lg);
    margin: var(--space-xl) 0;
    overflow: hidden;
    position: relative;
    border-radius: 2px;
}

/* Animated accent line */
.code-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        var(--accent) 0%, 
        var(--teal) 50%, 
        var(--blue) 100%);
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.code-block {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    overflow-x: auto;
    padding-bottom: 1rem;
    /* Custom scrollbar for code blocks */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

.code-block::-webkit-scrollbar {
    height: 4px;
}

.code-block::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 2px;
}

/* Syntax highlighting with better colors */
.k { color: #79c0ff; font-weight: 500; }
.f { color: #d2a8ff; }
.s { color: #a5d6ff; }
.c { color: #8b949e; font-style: italic; }
.n { color: #7ee787; }

/* --- STATS SECTION ENHANCED --- */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 600px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1000px) {
    .stat-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-xl);
    }
}

.stat-item {
    position: relative;
    padding: var(--space-md) 0;
}

.stat-item h3 {
    font-family: var(--font-editorial);
    font-size: clamp(3rem, 7vw, 5rem);
    font-weight: 200;
    line-height: 1;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
    /* For animated counters */
    transition: all 0.3s var(--ease-out-expo);
}

.stat-item h3.counting {
    transform: scale(1.05);
    color: var(--accent);
}

.stat-item p {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    margin-bottom: var(--space-sm);
}

/* ADDITIONAL STAT PARAGRAPH IN EDITORIAL */
.stat-item p:last-child:not(.mono) {
    font-family: 'Editorial New', Georgia, serif; /* ADDED */
    font-size: 0.9rem;
    text-transform: none;
    font-weight: 400;
}

/* --- SPLIT LAYOUTS --- */
.split-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    align-items: center;
    margin: var(--space-2xl) 0;
}

@media (min-width: 900px) {
    .split-layout {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-2xl);
    }
}

/* --- NAVIGATION ISLAND ENHANCED --- */
.nav-island {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--black);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.4s var(--ease-out-expo);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-island:hover {
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 1);
}

.nav-icon {
    width: 8px;
    height: 8px;
    background: var(--black);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.nav-island:hover .nav-icon {
    transform: scale(1.2);
    background: var(--accent);
}

.nav-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* --- FULLSCREEN MENU ENHANCED --- */
.fullscreen-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gutter);
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s var(--ease-out-expo);
}

.fullscreen-menu.active {
    opacity: 1;
    visibility: visible;
}

.menu-list {
    list-style: none;
}

.menu-item {
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.menu-link {
    display: inline-block;
    text-decoration: none;
    color: var(--white);
    font-family: var(--font-editorial);
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 200;
    line-height: 1.1;
    letter-spacing: -0.02em;
    transform: translateY(120%);
    transition: all 0.6s var(--ease-out-expo);
}

.fullscreen-menu.active .menu-link {
    transform: translateY(0);
}

.menu-link:hover {
    color: var(--accent);
    transform: translateX(20px);
}

.menu-link.sub {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.5;
}

.menu-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--ease-out-expo);
    font-family: var(--font-mono);
    font-size: 1.2rem;
}

.menu-close:hover {
    border-color: var(--white);
    transform: rotate(90deg);
    background: rgba(255, 255, 255, 0.1);
}

/* --- PRELOADER ENHANCED --- */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 1s var(--ease-in-out-expo);
    transform-origin: top;
}

.preloader.hidden {
    transform: scaleY(0);
}

.preloader p {
    color: var(--black);
    animation: pulse-fade 1s ease infinite;
}

@keyframes pulse-fade {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* --- REVEAL ANIMATIONS --- */
.reveal {
    opacity: 0;
    transform: translateY(60px);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
    transition: all 1.2s var(--ease-out-expo);
}

/* Staggered reveals */
.reveal-stagger {
    opacity: 0;
    transform: translateY(40px);
}

.reveal-stagger.active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s var(--ease-out-expo);
}

.reveal-stagger:nth-child(1) { transition-delay: 0s; }
.reveal-stagger:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger:nth-child(4) { transition-delay: 0.3s; }
.reveal-stagger:nth-child(5) { transition-delay: 0.4s; }

/* Scale reveal */
.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
    transition: all 1s var(--ease-out-expo);
}

/* --- MODULE STYLING --- */
.module-header {
    margin-bottom: var(--space-xl);
    position: relative;
    padding-bottom: var(--space-md);
}

.module-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 2px;
    background: var(--accent);
    transition: width 0.8s var(--ease-out-expo);
}

.module-header.active::after {
    width: 200px;
}

.module-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: var(--space-sm);
    opacity: 0.8;
}

/* --- UTILITY CLASSES --- */
.bg-white {
    background-color: var(--white);
    color: var(--black);
}

.bg-white p {
    color: rgba(0, 0, 0, 0.7);
}

.bg-black {
    background-color: var(--black);
    color: var(--white);
}

.accent { color: var(--accent); }
.teal { color: var(--teal); }
.blue { color: var(--blue); }

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
    :root {
        --gutter: 1.5rem;
    }
    
    h1 {
        line-height: 0.95;
    }
    
    .section-padding {
        padding: var(--space-xl) 0;
    }
}

/* --- SMOOTH SCROLLBAR --- */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--gray-medium);
    border-radius: 5px;
    transition: background 0.3s ease;
}

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