/* =========================================
   Base Styles & Variables
   ========================================= */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --card-bg: #f9f9f9;
    --font-main: 'Helvetica', 'Helvetica Neue', Arial, sans-serif;
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --max-width: 1300px; /* Widened to give 4-column grids more room to form good rectangles */
}

html {
    scroll-behavior: smooth; /* Native buttery smooth scrolling */
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    font-weight: 500; /* Medium for body text */
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   Structured Particle Vortex Canvas
   ========================================= */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
}

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

/* =========================================
   Typography & Utilities
   ========================================= */
h1, h2, .logo-large {
    margin: 0;
    font-weight: 900; /* Helvetica Black */
    letter-spacing: -0.04em;
    color: var(--text-color);
}

h3, h4, h5, h6 {
    margin: 0;
    font-weight: 900; /* Helvetica Black */
    letter-spacing: -0.02em;
    color: var(--text-color);
}

p {
    margin: 0 0 1.5rem 0;
    color: #333;
    font-size: 1.125rem;
    max-width: 650px;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

.section-title {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.section-subtitle {
    font-size: 1.5rem;
    text-align: center;
    margin: 0 auto 5rem auto; /* Increased to give elements room to breathe */
    font-weight: 900; /* Helvetica Black */
    color: #444; 
}

section {
    padding: 12rem 5%; /* Increased spacing to guarantee one section fills the screen without bleeding */
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* =========================================
   Navigation
   ========================================= */
.navbar {
    padding: 2rem 5%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute; /* Floats at the very top */
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 100;
}

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

.nav-links a {
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    color: #333;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--text-color);
    transition: var(--transition-smooth);
}

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

.nav-links a:hover::after {
    width: 100%;
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
    min-height: 100dvh; /* Uses dynamic viewport height for perfect mobile edge-to-edge */
    width: 100%;
    max-width: none; /* Crucial fix: overrides the 1200px max-width so it perfectly centers horizontally on large screens */
    margin: 0 auto;
    padding: 0 5%; 
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Forces everything strictly into the mathematical middle vertically */
    align-items: center; 
    text-align: center;
}

.logo-large {
    font-size: 8rem;
    letter-spacing: -0.06em;
    line-height: 1;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 2.5rem;
    font-weight: 900; /* Helvetica Black */
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.hero-description {
    font-size: 1.25rem;
    color: #444;
    max-width: 800px;
    margin: 0 auto;
}

/* =========================================
   Portfolio Section
   ========================================= */
.portfolio {
    padding-top: 4rem; /* Drastically reduced spacing coming from the hero section */
}

.portfolio-tabs {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.tab-btn {
    background: transparent;
    border: 2px solid #eaeaea;
    color: #666;
    padding: 0.75rem 2.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: var(--font-main);
}

.tab-btn:hover {
    border-color: var(--text-color);
    color: var(--text-color);
}

.tab-btn.active {
    background: var(--text-color);
    border-color: var(--text-color);
    color: var(--bg-color);
}

.portfolio-grid {
    display: none; /* Hidden by default */
    grid-template-columns: repeat(2, 1fr);
    gap: 5rem; /* Increased for premium airy feel */
    width: 100%;
}

.portfolio-grid.active {
    display: grid;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#portfolio-reels.portfolio-grid {
    grid-template-columns: repeat(4, 1fr); /* 4 columns for narrow reels */
    gap: 2rem;
}

.portfolio-item {
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid #eaeaea;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

#portfolio-intros .portfolio-item {
    aspect-ratio: 16/9;
}

#portfolio-reels .portfolio-item {
    aspect-ratio: 9/16;
}

.thumbnail-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative; /* For absolute positioning of play button */
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    opacity: 0.9;
}

.thumbnail-link:hover .play-overlay {
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
}

.reel-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crucial fix for blurriness/stretching */
    border-radius: 8px;
    display: block;
    transition: transform 0.4s ease;
}

.thumbnail-link:hover .reel-thumbnail {
    transform: scale(1.05); /* Adds a nice hover effect since it's an image now */
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.placeholder-img {
    width: 100%;
    aspect-ratio: 16/9;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: #111;
}

.placeholder-img.reel-ratio {
    aspect-ratio: 9/16;
}

/* =========================================
   Our Edge Section
   ========================================= */
.edge-description-wrapper {
    display: flex;
    justify-content: center;
    padding: 3rem 0; /* Added padding */
    margin-top: 1rem;
}

.edge-description {
    font-size: 1.75rem; /* Slightly larger for impact */
    line-height: 1.6;
    color: #111;
    max-width: 900px;
}

/* =========================================
   What We Offer Section
   ========================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 items in one single line */
    gap: 2rem;
    width: 100%;
    max-width: 1300px; /* Widened significantly so the 4 cards can be wider horizontal rectangles */
    margin: 4rem auto 0;
}

.service-card {
    background: var(--card-bg);
    padding: 2.5rem 2rem; /* Balanced padding so they don't stretch too tall */
    border-radius: 16px;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    text-align: left; 
    justify-content: flex-start;
}

.service-icon {
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #eaeaea; /* Light grey */
    color: var(--text-color);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s ease;
}

.service-card:hover {
    background: #fff;
    border-color: #eaeaea;
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.service-card:hover .service-icon {
    background: var(--text-color);
    color: #fff;
    transform: scale(1.15) rotate(5deg);
}

.service-icon svg {
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon svg {
    animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
    75% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.service-card p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 0;
}

/* =========================================
   CTA Section
   ========================================= */
.cta-section {
    /* Inherits standard section padding for perfect consistency */
}

.contact-page-section {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.btn-primary {
    display: inline-block;
    background: var(--text-color);
    color: var(--bg-color);
    padding: 1.2rem 3.5rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 1px;
    transition: var(--transition-smooth);
    border: 2px solid var(--text-color);
}

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

/* =========================================
   Footer
   ========================================= */
.footer {
    background: var(--text-color);
    color: var(--bg-color);
    padding: 4rem 5%;
}

/* Restoring the well-organized left-right layout for the footer */
.footer-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
    gap: 2rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Left aligned */
}

.footer-brand p {
    color: #999;
    font-size: 0.9rem;
}

.footer-logo {
    font-size: 3rem;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.footer-links {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 4rem;
}

.link-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.link-column h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: #fff;
}

.link-column a {
    color: #999;
    font-size: 0.9rem;
}

.link-column a:hover {
    color: #fff;
}

.get-started-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
}

.get-started-icon svg {
    transition: transform var(--transition-smooth);
    stroke: #fff; /* Ensure SVG is white */
}

.get-started-icon:hover svg {
    transform: translateX(5px);
}

/* =========================================
   Custom Cursor
   ========================================= */
@media (any-pointer: fine) {
    body, a, button, .portfolio-item, .service-card {
        cursor: none !important;
    }
}

@media (any-pointer: coarse) {
    .cursor-dot, .cursor-ring {
        display: none !important;
    }
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--text-color);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: background-color 0.3s ease;
    will-change: transform;
}

.cursor-ring {
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--text-color);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, transform 0.1s ease-out;
    will-change: transform, width, height;
}

.cursor-ring.hovering {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.04);
    border-color: transparent;
}

/* Explicit Light Mode for dark sections like Footer */
.cursor-dot.cursor-light {
    background: #ffffff;
}

.cursor-ring.cursor-light {
    border-color: #ffffff;
}

.cursor-ring.hovering.cursor-light {
    background: rgba(255, 255, 255, 0.15);
    border-color: transparent;
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .logo-large {
        font-size: 6rem;
    }
}

@media (max-width: 768px) {
    .section-title, .cta-section .section-title {
        font-size: 2.5rem !important;
    }
    .logo-large {
        font-size: 15vw; /* Fluid scaling */
    }
    .hero-subtitle {
        font-size: 1.5rem;
    }
    .hero-description {
        font-size: 1rem;
    }
    .portfolio-grid, #portfolio-reels.portfolio-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .navbar {
        padding: 1rem 0; /* Remove side padding so scroll bleeds to edges */
    }
    .nav-links {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 5%; /* Inner padding so text doesn't touch the very edge */
        gap: 2rem;
        scrollbar-width: none; /* Firefox */
    }
    .nav-links::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Safari/Chrome */
    }
    .hero {
        justify-content: flex-start; /* Stop flex from strictly centering */
        padding-top: 25dvh; /* Place content optically in upper-center */
    }
    .footer-grid {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-brand, .link-column {
        align-items: center;
    }
    .footer-links {
        justify-content: center;
        gap: 2.5rem;
        flex-direction: column;
    }
    .edge-description {
        font-size: 1.15rem !important;
    }
    .cta-section a {
        font-size: 8vw !important; /* Scales down the big email */
    }
}

@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem; /* Tighter gap on mobile */
    }
    .service-card {
        padding: 2rem; /* Less padding to give text room to breathe on small screens */
    }
    .nav-links {
        gap: 1rem;
        font-size: 0.85rem;
    }
    .section-title {
        font-size: 2rem !important;
    }
    .cta-section a {
        font-size: 1.5rem !important;
    }
}

/* =========================================
   Social Icons Hover Effects
   ========================================= */
.social-icon {
    color: var(--text-color) !important;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.social-icon:hover {
    transform: scale(1.3) translateY(-5px);
    opacity: 0.6;
}

/* =========================================
   Scroll Animations
   ========================================= */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

body.scrolling-down .animate-on-scroll:not(.is-visible) {
    transform: translateY(30px); /* Slide UP into view when scrolling down */
}

body.scrolling-up .animate-on-scroll:not(.is-visible) {
    transform: translateY(-30px); /* Slide DOWN into view when scrolling up */
}

/* Default state before any scroll event fires */
body:not(.scrolling-down):not(.scrolling-up) .animate-on-scroll:not(.is-visible) {
    transform: translateY(30px); 
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) !important;
}
