:root {
    --primary: #050505;
    --secondary: #ffffff;
    --accent: #ccff00;
    /* Electric Green Accent */
    --text: #e0e0e0;
    --text-muted: #888888;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --grid-line: rgba(255, 255, 255, 0.05);

    /* Spacing Rhythm */
    --space-unit: 8px;
    --space-xs: calc(var(--space-unit) * 1);
    /* 8px */
    --space-s: calc(var(--space-unit) * 2);
    /* 16px */
    --space-m: calc(var(--space-unit) * 4);
    /* 32px */
    --space-l: calc(var(--space-unit) * 8);
    /* 64px */
    --space-xl: calc(var(--space-unit) * 15);
    /* 120px */
    --space-xxl: calc(var(--space-unit) * 20);
    /* 160px */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Hide default cursor for custom one */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--primary);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Texture / Grid */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3,
h4,
.logo {
    font-family: var(--font-heading);
    color: var(--secondary);
    line-height: 1.1;
    font-weight: 700;
}

h2 {
    line-height: 1.2;
}

h3 {
    line-height: 1.3;
}

p {
    line-height: 1.7;
    margin-bottom: var(--space-s);
}

.container {
    max-width: 1400px;
    /* Same as header */
    margin: 0 auto;
    padding: 0 50px;
    /* Same as header */
}

/* Preloader */
/* Preloader */
/* Preloader */
.preloader {
    position: fixed;
    inset: 0;
    background: var(--primary);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform-origin: top;
    will-change: transform;
}

.loader {
    /* Revert to default block/start alignment for 'from left' feel, 
       but center the text specifically */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Align bar to start (left) of this container */
    position: relative;
}

.loader-text {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 20px;
    letter-spacing: 5px;
    /* Keep logo centered relative to the group */
}

.loader-bar {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.loader-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: var(--accent);
    animation: load 1s ease-out forwards;
}

@keyframes load {
    to {
        width: 100%;
    }
}

/* Custom Cursor */
#cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: normal;
    transition: transform 0.1s ease, width 0.3s, height 0.3s, background 0.3s;
}

#cursor.active {
    transform: translate(-50%, -50%) scale(2);
    background: rgba(204, 255, 0, 0.05);
    border-color: var(--accent);
}

.cursor-ball {
    display: none;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    padding: 30px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    mix-blend-mode: normal;
    background: transparent;
    width: 100%;
    max-width: 1400px;
    transition: transform 0.4s ease, background 0.4s ease, padding 0.4s ease;
}

/* Smart Reveal: Hide Header */
header.hide {
    transform: translateY(-100%);
}

/* Scrolled State */
header.scrolled {
    padding: 20px 50px;
    background: rgba(5, 5, 5, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Remove Dynamic Notch specific overrides */

.logo {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
    transition: font-size 0.3s ease;
    text-decoration: none;
    color: var(--text-main);
}

nav ul {
    display: flex;
    gap: 50px;
    list-style: none;
}

nav a {
    color: var(--secondary);
    text-decoration: none;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    display: inline-block;
}

nav a::before {
    content: attr(data-hover);
    position: absolute;
    top: 100%;
    left: 0;
    color: var(--accent);
    transition: top 0.3s cubic-bezier(0.7, 0, 0.3, 1);
}

nav a:hover::before {
    top: 0;
}

nav a:hover span {
    transform: translateY(-100%);
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.7, 0, 0.3, 1);
}

/* New Active Indicator: Neon Text */
nav a.active {
    color: var(--accent);
    text-shadow: 0 0 15px rgba(204, 255, 0, 0.4);
}

nav a.active span {
    transform: none;
    /* Disable slide effect for active */
}

nav a.active::before {
    display: none;
    /* Hide the duplicate text */
}

/* Optional: Add a small dot below */
nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    position: relative;
}

/* Shift hero content to the left */
.hero .container {
    padding-left: 50px;
    margin-left: 0;
    margin-right: auto;
    width: 100%;
}

.hero h1 {
    font-size: clamp(60px, 12vw, 180px);
    line-height: 0.95;
    text-transform: uppercase;
    margin-bottom: var(--space-m);
}

.hero p {
    font-size: 20px;
    max-width: 600px;
    color: var(--text-muted);
    margin-right: 40px;
    line-height: 1.6;
}

.hero-intro-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 40px;
    margin-bottom: 50px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 45px;
    background: var(--secondary);
    color: var(--primary);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 1;
}

.btn:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.btn span,
.btn {
    position: relative;
    z-index: 2;
}

.btn:hover {
    color: var(--primary);
}

.scroll-indicator {
    position: absolute;
    bottom: 50px;
    right: 50px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    writing-mode: vertical-rl;
}

#expertise {
    padding: var(--space-xl) 0;
    border-bottom: 1px solid var(--grid-line);
}

.section-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 80px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.service-card {
    padding: 40px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--grid-line);
    transition: transform 0.5s;
}

.service-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
}

.service-card h3 {
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 20px;
}

.service-card h4 {
    font-size: 24px;
    margin-bottom: 15px;
}

.service-card p {
    font-size: 16px;
    color: var(--text-muted);
}

/* Portfolio */
#work {
    padding: var(--space-xl) 0;
}

.swiper-container {
    width: 100%;
    padding-bottom: var(--space-l);
    overflow: hidden;
}

.portfolio-item {
    position: relative;
    cursor: pointer;
}

/* Image Reveal Mask */
.item-image {
    aspect-ratio: 16/9;
    overflow: hidden;
    margin-bottom: var(--space-s);
    background: #111;
    position: relative;
    clip-path: inset(100% 0 0 0);
    /* Initial state for mask animation */
    transition: clip-path 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.item-image.revealed {
    clip-path: inset(0% 0 0 0);
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.2);
    transition: transform 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.item-image.revealed img {
    transform: scale(1);
}

.item-info {
    position: relative;
}

.item-info h3 {
    font-size: 32px;
    margin-bottom: var(--space-xs);
    transition: color 0.3s;
}

.item-info span {
    color: var(--accent);
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 14px;
    display: block;
    margin-bottom: var(--space-s);
}

.view-project {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--secondary);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.portfolio-item:hover .view-project {
    opacity: 1;
    transform: translateX(0);
}

.portfolio-item:hover h3 {
    color: var(--accent);
}

.portfolio-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.slider-controls {
    display: flex;
    gap: var(--space-s);
    margin-top: var(--space-m);
    justify-content: flex-end;
}

.swiper-button-prev,
.swiper-button-next {
    position: static;
    width: 50px;
    height: 50px;
    border: 1px solid var(--grid-line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    cursor: pointer;
    transition: 0.3s;
}

.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 18px;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
}

/* Contact */
#contact {
    padding: var(--space-xl) 0;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.contact-info {
    text-align: center;
    width: 100%;
}

.email-link {
    display: block;
    font-family: var(--font-heading);
    font-size: clamp(40px, 8vw, 100px);
    color: var(--secondary);
    text-decoration: none;
    margin: var(--space-m) 0;
    transition: color 0.3s;
}

.email-link:hover {
    color: var(--accent);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: var(--space-l);
    flex-wrap: wrap;
}

.social-links a {
    color: var(--text-muted);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--secondary);
}

/* Footer */
footer {
    padding: var(--space-l) 0;
    border-top: 1px solid var(--grid-line);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-muted);
}

.back-to-top {
    background: none;
    border: none;
    color: var(--secondary);
    text-transform: uppercase;
    cursor: pointer;
    font-size: 12px;
    letter-spacing: 1px;
}

/* Tablet Responsive (iPad) */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: 1fr;
    }

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

    .hero h1 {
        font-size: clamp(50px, 10vw, 120px);
    }
}

/* Mobile Responsive (Smartphones) */
@media (max-width: 768px) {
    .hero {
        padding-top: 120px;
    }

    header {
        padding: 20px;
    }

    nav {
        display: none;
    }

    .container {
        padding: 0 20px;
    }

    #cursor {
        display: none;
    }

    .process-steps {
        grid-template-columns: 1fr;
    }

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

    .hero h1 {
        font-size: clamp(40px, 12vw, 80px);
    }

    .hero p {
        font-size: 16px;
    }

    .section-title {
        font-size: 12px;
    }

    .code-overlay {
        display: none;
    }
}

/* Small Phones */
@media (max-width: 480px) {
    header {
        padding: 15px;
    }

    .container {
        padding: 0 15px;
    }

    .hero h1 {
        font-size: clamp(36px, 14vw, 60px);
    }

    .service-card,
    .blog-card,
    .step {
        padding: 25px;
    }
}

/* Process Section */
.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.step {
    padding: 30px;
    border-left: 1px solid var(--grid-line);
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
}

.step:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
}

.step-number {
    display: block;
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 20px;
    font-family: var(--font-heading);
}

.step h3 {
    font-size: 20px;
    margin-bottom: 15px;
}

.step p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Blog Section */
#blog {
    padding: var(--space-xl) 0;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.blog-card {
    padding: 40px;
    border: 1px solid var(--grid-line);
    transition: all 0.3s;
    background: var(--primary);
}

.blog-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

.blog-meta {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.blog-card h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.blog-card p {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 30px;
}

.read-more {
    color: var(--secondary);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.read-more:hover {
    color: var(--accent);
}

/* Hero Code Overlay */
.code-overlay {
    position: absolute;
    top: 50%;
    right: 0;
    /* Shifted to right edge */
    transform: translateY(-50%);
    width: 40%;
    height: 70%;
    opacity: 0.15;
    z-index: -1;
    overflow: hidden;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
    color: var(--accent);
    pointer-events: none;
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

/* Premium Noise Overlay */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

@media (max-width: 1024px) {
    .code-overlay {
        display: none;
    }
}

/* Project Navigation (Hero Image Corners) */
/* Project Navigation (Bottom of Page) */
/* Project Navigation (Bottom of Page) */
.project-nav {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    /* Minimal gap */
    border-top: none;
    margin-top: 0;
    padding-left: 0;
    padding-right: 0;
}

.nav-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    pointer-events: auto;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    /* Remove padding to align exactly with edges */
    padding: 0;
}

.nav-link span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-weight: 500;
}

.nav-link h2 {
    font-size: 24px;
    margin: 0;
    font-weight: 600;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-link.prev:hover h2 {
    transform: translateX(-10px);
    color: var(--accent);
}

.nav-link.next:hover h2 {
    transform: translateX(10px);
    color: var(--accent);
}


.nav-link.next {
    text-align: right;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .project-nav {
        padding: var(--space-s);
        height: 80px;
    }

    .nav-link h2 {
        font-size: 13px;
    }
}