/* --- 1. RESET & VARIABLES --- */
:root {
    --bg: #080808;
    /* Void Black */
    --text: #E0E0E0;
    /* Off White */
    --accent: #CCFF00;
    /* Acid Lime - The "Pop" color */
    --card-bg: #121212;
    --font-display: 'Clash Display', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --font-body: 'Space Grotesk', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: none;
    /* Custom cursor */
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-display);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- 2. CUSTOM CURSOR --- */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    /* Crucial for the "Sophisticated" look */
    transition: transform 0.1s;
    transform: translate(-50%, -50%);
}

/* --- 3. FRAME NAVIGATION (4 Corners) --- */
.frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    /* Let clicks pass through */
    z-index: 100;
    padding: 2rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.corner {
    position: absolute;
    pointer-events: auto;
}

.tl {
    top: 1.5rem;
    left: 2rem;
    font-weight: 700;
    font-size: 1rem;
}

.tr {
    top: 2rem;
    right: 2rem;
}

.bl {
    bottom: 2rem;
    left: 2rem;
}

.br {
    bottom: 2rem;
    right: 2rem;
}

.nav-link {
    position: relative;
    text-transform: uppercase;
}

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

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

.blink {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
    margin-right: 8px;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* --- 4. HERO SECTION --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.mega-text {
    font-size: 9vw;
    line-height: 0.85;
    text-align: center;
    text-transform: uppercase;
}

.line {
    overflow: hidden;
}

.italic {
    font-family: var(--font-display);
    font-weight: 200;
    font-style: italic;
    color: var(--accent);
}

.scroll-prompt {
    position: absolute;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: var(--text);
    opacity: 0.3;
}

/* --- 5. STICKY STACK (The Core Feature) --- */
.work-stack {
    padding-bottom: 10vh;
}

.card {
    position: sticky;
    /* THIS MAKES THEM STACK */
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    /* Needs bg to cover card behind it */
    border-top: 1px solid #222;
}

.card-content {
    width: 90vw;
    max-width: 1400px;
    height: 80vh;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 4vw;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform 0.5s;
}

/* Slight rotation for visual flair on scroll could be added via JS, 
   but let's keep CSS simple */

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-family: var(--font-mono);
    border-bottom: 1px solid #333;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.card-header h2 {
    font-family: var(--font-display);
    font-size: 4vw;
    line-height: 1;
}

.card-body {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    height: 100%;
}

.visual-box {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #000;
}

.visual-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s ease;
}

/* Hover Effect Removed as requested */
.card:hover .visual-box img {
    transform: none;
}

.details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.desc {
    font-size: 1.5rem;
    line-height: 1.4;
    margin-bottom: 3rem;
    max-width: 400px;
}

.magnetic-btn {
    display: inline-block;
    padding: 1.5rem 3rem;
    border: 1px solid var(--text);
    border-radius: 100px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: all 0.3s;
    align-self: flex-start;
}

.magnetic-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* --- 6. MARQUEE --- */
.marquee-container {
    padding: 4rem 0;
    background: var(--accent);
    color: #000;
    overflow: hidden;
    white-space: nowrap;
}

.marquee {
    display: inline-block;
    animation: scroll 20s linear infinite;
}

.marquee span {
    font-size: 3rem;
    font-weight: 700;
    margin-right: 4rem;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* --- 7. ABOUT SPLIT --- */
.about-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 10vw 5vw;
    border-top: 1px solid #222;
}

.about-left img {
    width: 80%;
    border-radius: 4px;
    filter: grayscale(100%) contrast(1.2);
}

.about-right h3 {
    font-size: 3rem;
    margin-bottom: 2rem;
}

.highlight {
    color: var(--accent);
}

.about-right p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #888;
    margin-bottom: 3rem;
    max-width: 500px;
}

.specs {
    list-style: none;
    font-family: var(--font-mono);
    border-top: 1px solid #333;
    padding-top: 2rem;
}

.specs li {
    margin-bottom: 1rem;
    color: var(--accent);
}

.specs strong {
    color: var(--text);
    margin-right: 1rem;
}

/* --- 8. FOOTER --- */
footer {
    padding: 10vw 2rem 2rem;
    background: var(--bg);
    border-top: 1px solid #222;
}

.giant-link {
    font-size: 5.5vw;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
    border-bottom: 2px solid #333;
    transition: color 0.3s;
}

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

.footer-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin-top: 5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px),
(hover: none) and (pointer: coarse) {
    * {
        cursor: auto !important;
    }

    .cursor {
        display: none !important;
    }

    /* Restore pointer events for interactive elements if needed, 
       though cursor: auto usually handles it. 
       Ensuring links/buttons get the pointer cursor. */
    a,
    button,
    .magnetic-btn,
    .nav-link,
    .corner,
    .card {
        cursor: pointer !important;
    }

    /* Disable sticky header on landing page only */
    .landing-page .frame {
        position: absolute;
    }
}

@media (max-width: 768px) {
    .mega-text {
        font-size: 12vw;
    }

    .card-body {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .visual-box {
        height: 300px;
    }

    .about-split {
        grid-template-columns: 1fr;
    }

    .frame {
        display: block;
        padding: 1rem;
        font-size: 0.7rem;
    }

    .tl,
    .tr,
    .bl,
    .br {
        top: auto;
        bottom: auto;
        left: auto;
        right: auto;
    }

    .tl {
        top: 1.5rem;
        left: 5vw;
    }

    .tr {
        top: 2rem;
        right: 5vw;
    }

    .bl {
        bottom: 1rem;
        left: 5vw;
    }

    .br {
        bottom: 1rem;
        right: 5vw;
    }

    /* Hide corner nav on mobile, replace with hamburger if needed */
    .card {
        position: relative;
        height: auto;
        top: auto;
        padding: 4rem 0;
    }

    .work-stack {
        padding-bottom: 0;
    }
}

/* --- 9. CASE STUDY STYLES --- */
.case-hero {
    padding: 15vh 5vw 5vh;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid #222;
}

.mega-text-case {
    font-size: 6vw;
    line-height: 0.9;
    text-transform: uppercase;
    margin: 2rem 0;
    max-width: 90%;
}

.hero-sub {
    font-size: 1.5rem;
    max-width: 800px;
    color: #888;
    margin-bottom: 4rem;
    line-height: 1.4;
}

.hero-stats {
    display: flex;
    gap: 4rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-display);
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Snapshot Section */
.snapshot-section {
    padding: 5vw;
    border-bottom: 1px solid #222;
    background: var(--card-bg);
}

.snapshot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid #333;
}

.snap-col h4 {
    font-family: var(--font-mono);
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.snap-col p {
    font-size: 1.2rem;
    line-height: 1.4;
}

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

.metric-box {
    display: flex;
    flex-direction: column;
}

.m-val {
    font-size: 2.5rem;
    color: var(--accent);
    font-weight: 700;
}

.m-lbl {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #888;
}

/* Content Blocks */
.case-content {
    max-width: 1400px;
    margin: 0 auto;
    border-right: 1px solid #222;
    border-left: 1px solid #222;
}

.content-block {
    padding: 8vw 5vw;
    border-bottom: 1px solid #222;
    position: relative;
}

.section-label {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 2rem;
}

.content-block h3 {
    font-size: 3rem;
    margin-bottom: 2rem;
    max-width: 800px;
}

.content-block p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #bbb;
    max-width: 700px;
    margin-bottom: 2rem;
}

.case-list {
    list-style: none;
    max-width: 800px;
}

.case-list li {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--accent);
    line-height: 1.6;
    color: #bbb;
}

.case-list strong {
    color: var(--text);
    display: block;
    margin-bottom: 0.5rem;
}

/* Users Grid */
.users-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.user-card {
    background: #1a1a1a;
    padding: 2rem;
    border-radius: 8px;
}

.user-card h4 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-family: var(--font-mono);
}

.user-card p {
    font-size: 1rem;
    margin-bottom: 0;
}

/* Research & Placeholders */
.research-subsection {
    margin-top: 4rem;
}

.placeholder-img {
    width: 100%;
    height: auto;
    background: #1a1a1a;
    border: 1px solid #333;
    display: block;
    margin-top: 2rem;
    border-radius: 8px;
    overflow: hidden;
}

.placeholder-img span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #666;
    font-family: var(--font-mono);
}

.placeholder-img.small {
    height: auto;
}

/* Pillars Grid */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.pillar-card {
    background: #1a1a1a;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #333;
}

.pillar-card h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.highlight-pillar {
    grid-column: span 2;
    background: linear-gradient(45deg, #1a1a1a, #252525);
    border-color: var(--accent);
}

/* Responsive Case Study */
@media (max-width: 768px) {
    .mega-text-case {
        font-size: 10vw;
    }

    .snapshot-grid,
    .metrics-row,
    .users-grid,
    .pillars-grid {
        grid-template-columns: 1fr;
    }

    .highlight-pillar {
        grid-column: span 1;
    }

    .hero-stats {
        flex-direction: column;
        gap: 2rem;
    }
}

/* Image styling for case study */
.placeholder-img img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.case-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

@media (max-width: 768px) {
    .case-images {
        grid-template-columns: 1fr;
    }
}

/* Hero Split Layout */
.hero-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-left {
    display: flex;
    flex-direction: column;
}

.hero-right .placeholder-img {
    height: 100%;
    min-height: 500px;
    background: transparent;
    border: none;
}

/* User Icon Styles */
.user-icon {
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.user-icon svg {
    color: #000;
}

/* Split Layout for Research */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.split-left {
    flex: 1;
}

.split-right {
    flex: 1;
}

.split-right .placeholder-img {
    margin-top: 0;
    height: 100%;
    min-height: 300px;
}

/* Bigger subsection headings */
.research-subsection h4 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

/* Full width text for content */
.content-block p,
.content-block .case-list,
.split-left p,
.split-left .case-list {
    max-width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {

    .hero-split,
    .split-layout {
        grid-template-columns: 1fr;
    }

    .hero-right {
        order: -1;
    }

    .split-right .placeholder-img {
        min-height: 200px;
    }
}

/* Plus Jakarta Sans for all paragraphs */
p,
.desc,
.hero-sub,
.case-list li,
.user-card p,
.outcome-summary {
    font-family: var(--font-body);
}

/* Impact section padding */
.outcome-metrics {
    margin-bottom: 3rem;
}

.outcome-summary {
    margin-top: 2rem;
}

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    opacity: 0.7;
    transition: opacity 0.3s, color 0.3s;
}

.back-btn:hover {
    opacity: 1;
    color: var(--accent);
}

/* Sticky Section Navigation */
.section-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 8, 8, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #222;
    padding: 0 2rem;
}

.section-nav-inner {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 1.5rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.section-nav-inner::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    color: #666;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    white-space: nowrap;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.nav-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(204, 255, 0, 0.1);
}

/* Landing page card image overlay - scale only, no gradient */
.visual-box {
    position: relative;
    overflow: hidden;
}

.visual-box::after {
    display: none;
}

.overlay-tech {
    display: none;
}

/* Smooth scroll offset for sticky nav */
section[id] {
    scroll-margin-top: 80px;
}

/* Combined Header with Logo and Tabs */
.section-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
}

.nav-logo:hover {
    color: var(--accent);
}

.nav-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {
    .section-nav-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .nav-tabs {
        width: 100%;
    }
}

/* Nav logo and CTA hidden by default, shown when sticking */
.nav-logo.hidden,
.nav-cta.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.section-nav.is-sticky .nav-logo.hidden,
.section-nav.is-sticky .nav-cta.hidden {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Centered tabs layout */
.section-nav-inner {
    justify-content: center;
}

.section-nav.is-sticky .section-nav-inner {
    justify-content: space-between;
}

/* Nav CTA button */
.nav-cta {
    color: var(--accent);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent);
    border-radius: 100px;
    white-space: nowrap;
    transition: all 0.3s;
}

.nav-cta:hover {
    background: var(--accent);
    color: #000;
}

/* Ensure logo has proper width when hidden for layout */
.nav-logo {
    min-width: 140px;
}

.nav-cta {
    min-width: 100px;
    text-align: center;
}

/* Phone Grid Layouts for Niraxx */
.phone-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.phone-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Web Screenshots Stack */
.web-screens-stack {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.web-screens-stack .placeholder-img {
    margin-top: 0;
}

/* Responsive for phone grids */
@media (max-width: 1024px) {
    .phone-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .phone-grid-3,
    .phone-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Remove background and border from Niraxx case study images */
.case-content .placeholder-img,
.phone-grid-3 .placeholder-img,
.phone-grid-4 .placeholder-img,
.web-screens-stack .placeholder-img {
    background: transparent;
    border: none;
}

/* 2-column image grid */
.image-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .image-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Step sequence for URL unfurling */
.step-sequence {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.step-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    align-items: center;
}

.step-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.step-number {
    font-family: var(--font-mono);
    font-size: 2rem;
    color: var(--accent);
    font-weight: 700;
}

.step-item p {
    font-size: 1rem;
    color: #999;
}

@media (max-width: 768px) {
    .step-item {
        grid-template-columns: 1fr;
    }
}

/* Testimonial cards */
.testimonial-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #222;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.testimonial-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.testimonial-quote {
    font-size: 1.2rem;
    font-style: italic;
    color: #ccc;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.testimonial-author {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
}

.testimonial-img {
    max-height: 200px;
}

@media (max-width: 768px) {
    .testimonial-card {
        grid-template-columns: 1fr;
    }
}

/* Increased section spacing for Niraxx and ACLC case studies */
.case-content .content-block {
    padding-top: 6rem;
    padding-bottom: 6rem;
    min-height: 80vh;
}

.case-content .research-subsection {
    padding-top: 4rem;
    padding-bottom: 4rem;
    min-height: 60vh;
}

.case-content .research-subsection.split-layout {
    min-height: 70vh;
    display: flex;
    align-items: center;
}

/* Users grid and phone grids get breathing room */
.case-content .users-grid {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.case-content .phone-grid-3,
.case-content .phone-grid-4,
.case-content .web-screens-stack,
.case-content .image-grid-2 {
    margin-top: 3rem;
}

/* Step sequence items spacing */
.step-sequence {
    gap: 4rem;
}

.step-item {
    min-height: 30vh;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .case-content .content-block {
        padding-top: 4rem;
        padding-bottom: 4rem;
        min-height: auto;
    }

    .case-content .research-subsection {
        padding-top: 2rem;
        padding-bottom: 2rem;
        min-height: auto;
    }

    .case-content .research-subsection.split-layout {
        min-height: auto;
    }

    .step-item {
        min-height: auto;
    }
}

/* --- LIGHT MODE THEME --- */
[data-theme="light"] {
    --bg: #F5F5F5;
    --text: #1a1a1a;
    --accent: #6DBA02;
    --card-bg: #FFFFFF;
}

/* Light mode specific overrides */
[data-theme="light"] body {
    background-color: var(--bg);
    color: var(--text);
}

[data-theme="light"] .cursor {
    background: #6DBA02 !important;
}

[data-theme="light"] .frame .corner {
    color: var(--text);
}

[data-theme="light"] .frame .logo img {
    filter: invert(0) !important;
}

[data-theme="light"] .card {
    background: var(--card-bg);
    border-color: #e0e0e0;
}

[data-theme="light"] .card-header h2 {
    color: var(--text);
}

[data-theme="light"] .id-number,
[data-theme="light"] .section-label {
    color: var(--accent);
}

[data-theme="light"] .details .desc {
    color: #555;
}

[data-theme="light"] .magnetic-btn {
    color: var(--text);
    border-color: var(--text);
}

[data-theme="light"] .magnetic-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

[data-theme="light"] footer {
    background: #1a1a1a;
    color: #fff;
}

[data-theme="light"] .section-nav {
    background: rgba(245, 245, 245, 0.9);
    border-bottom-color: #e0e0e0;
}

[data-theme="light"] .nav-tab {
    color: #666;
}

[data-theme="light"] .nav-tab.active,
[data-theme="light"] .nav-tab:hover {
    color: var(--text);
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .case-hero {
    background: #fff;
}

[data-theme="light"] .snapshot-section {
    background: #fff;
    border-color: #e0e0e0;
}

[data-theme="light"] .metric-box {
    background: #fff;
    border-color: #e0e0e0;
}

[data-theme="light"] .m-val {
    color: var(--accent);
}

[data-theme="light"] .content-block {
    border-color: #e0e0e0;
}

[data-theme="light"] h3,
[data-theme="light"] h4 {
    color: var(--text);
}

[data-theme="light"] .case-list li {
    color: #444;
}

[data-theme="light"] .user-card {
    background: #fff;
    border-color: #e0e0e0;
}

[data-theme="light"] .user-icon {
    color: var(--accent);
}

[data-theme="light"] .placeholder-img {
    background: transparent;
    border-color: #e0e0e0;
}

[data-theme="light"] .testimonial-card {
    background: rgba(154, 205, 50, 0.08);
    border-color: #e0e0e0;
}

[data-theme="light"] .testimonial-quote {
    color: #333;
}

[data-theme="light"] .step-number {
    color: var(--accent);
}

[data-theme="light"] .back-btn {
    color: #666;
}

[data-theme="light"] .back-btn:hover {
    color: var(--accent);
}

[data-theme="light"] .marquee span {
    color: rgba(0, 0, 0, 0.1);
    -webkit-text-stroke-color: rgba(0, 0, 0, 0.15);
}

/* --- PERSONAL PROJECTS SECTION --- */
.personal-projects-section {
    padding: 2rem 5%;
    background: var(--bg);
}

.personal-projects-section .section-header {
    margin-bottom: 4rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.personal-projects-section .section-subtitle {
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: #888;
    margin-top: 1rem;
}

/* Grid Layout - Bento Style */
.personal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Card Base Styles */
.personal-card {
    background: var(--card-bg);
    border: 1px solid #222;
    border-radius: 20px;
    /* Rounded corners like case study cards */
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.personal-card:hover {
    border-color: #444;
    transform: translateY(-5px);
}

/* Wide cards span full width on desktop */
.wide-card {
    grid-column: span 2;
}

/* Card Header */
.p-card-header {
    margin-bottom: 2rem;
}

.p-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.personal-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text);
    margin: 0;
}

.p-desc {
    font-family: var(--font-body);
    font-size: 1rem;
    color: #888;
    line-height: 1.5;
    margin: 0;
}

/* Status Badge */
.status-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    letter-spacing: 0.05em;
}

/* Phone Grid 2x2 */
.phone-grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: auto;
    /* Push to bottom */
}

.phone-grid-2x2 img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    background: transparent;
    /* Remove background */
    aspect-ratio: 9/19.5;
    object-fit: cover;
}

/* Media Content (Video/Images) */
.media-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.video-block video {
    width: 100%;
    border-radius: 4px;
    aspect-ratio: 16/9;
    background: #000;
}

.split-media {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.static-img img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.prototype-link-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.prototype-link {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 1rem;
    text-decoration: none;
    padding: 1rem 2rem;
    border: 1px solid var(--accent);
    transition: all 0.3s ease;
}

.prototype-link:hover {
    background: var(--accent);
    color: #000;
}

/* Workshop Grid */
.hero-visual img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.workshop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.workshop-grid video {
    width: 100%;
    border-radius: 4px;
    aspect-ratio: 16/9;
    background: #000;
}

/* Light Mode Overrides for Personal Projects */
[data-theme="light"] .personal-projects-section {
    background: var(--bg);
}

[data-theme="light"] .personal-card {
    background: #fff;
    border-color: #e0e0e0;
}

[data-theme="light"] .personal-card:hover {
    border-color: #ccc;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .phone-grid-2x2 img {
    background: #f0f0f0;
}

[data-theme="light"] .prototype-link-container {
    background: #f9f9f9;
}

/* Responsive */
@media (max-width: 768px) {
    .personal-grid {
        grid-template-columns: 1fr;
    }

    .wide-card {
        grid-column: span 1;
    }

    .split-media {
        grid-template-columns: 1fr;
    }

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

    .personal-projects-section {
        padding: 4rem 5%;
    }
}

/* Stacked Web Images */
.stacked-web-images {
    position: relative;
    width: 100%;
    height: 300px;
    /* Adjust based on aspect ratio */
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stacked-web-images img {
    position: absolute;
    width: 90%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    border: 1px solid #333;
}

.stack-back {
    top: 0;
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    z-index: 1;
    opacity: 0.6;
}

.stack-front {
    top: 20px;
    /* Offset */
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.personal-card:hover .stack-front {
    transform: translateX(-50%) translateY(-5px);
}

.personal-card:hover .stack-back {
    transform: translateX(-50%) translateY(5px) scale(0.92);
    opacity: 0.4;
}

/* Light mode overrides for stacked images */
[data-theme="light"] .stacked-web-images img {
    border-color: #e0e0e0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* --- Refinements v2 --- */

/* Header Anoop Bhat - Clash Display */
.frame .logo {
    font-family: var(--font-display) !important;
    font-weight: 600;
}

/* Remove grey background from prototype link */
.prototype-link-container {
    background: transparent !important;
}

.prototype-link {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.prototype-link:hover {
    background: var(--accent);
    color: #000;
}

/* Padding after Starlink section */
.personal-projects-section {
    padding-bottom: 12rem;
    /* Increased padding */
}

/* Full width marquee */
.marquee-container {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    overflow: hidden;
}

/* Stacked images refinements */
.stacked-web-images img {
    background: transparent !important;
    /* Remove background */
    border: none !important;
    /* Remove border */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    /* Enhanced shadow for depth */
}

/* Light mode overrides for stacked images */
[data-theme="light"] .stacked-web-images img {
    background: transparent !important;
    border: none !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* Ensure marquee has padding above it */
.marquee-container {
    margin-top: 4rem;
}

/* --- Refinements v3 --- */

/* Vertical stacking for Verbavie & Pilroom */
.stacked-web-images {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: auto;
    /* Allow natural height */
    margin-top: 3rem;
}

.stacked-web-images img {
    position: relative;
    /* Reset from absolute */
    width: 100%;
    transform: none !important;
    /* Reset transforms */
    top: auto;
    left: auto;
    opacity: 1;
}

/* Remove hover effects for stacking */
.personal-card:hover .stack-front,
.personal-card:hover .stack-back {
    transform: none;
    opacity: 1;
}

/* Center prototype link in Starlink */
.prototype-link-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 2rem;
}

/* --- Refinements v4 --- */

/* Header Logo Alignment */
.frame .logo {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* Center Starlink Button */
.split-media {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    grid-template-columns: none !important;
    /* Override grid */
}

.prototype-link-container {
    width: auto !important;
    /* Let it shrink to content */
    margin-top: 2rem;
}

/* --- Refinements v5 --- */

/* Fix header alignment for Case Studies (where logo is a link) */
.frame .logo a {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-decoration: none;
    color: inherit;
}

/* Ensure the image doesn't have extra margins */
.frame .logo img {
    margin: 0 !important;
    vertical-align: middle;
}

/* Toast Notification */
.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: var(--accent);
    color: #000;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
}

.toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
}

/* --- Refinements v6 --- */

/* Restore hand cursor for interactive elements */
a,
button,
input,
textarea,
select,
.nav-link,
.magnetic-btn,
.giant-link,
.prototype-link,
.back-btn,
.video-thumb,
.corner {
    cursor: pointer !important;
}

/* Footer Links Hover Color */
.footer-grid a {
    transition: color 0.3s ease;
}

.footer-grid a:hover {
    color: var(--accent) !important;
}

/* --- Refinements v7 --- */

/* Mobile: Add padding to bottom of case study card */
@media (max-width: 768px) {
    .card-content {
        padding-bottom: 4rem !important;
    }
}

/* --- Refinements v8 --- */

/* Make 01/02/03 numbers green */
.id-number {
    color: var(--accent) !important;
}

/* Fix Mobile Card Spacing */
@media (max-width: 768px) {
    .card-content {
        height: auto !important;
        /* Allow content to grow */
        min-height: 70vh;
        padding: 2.5rem 1.5rem 4rem 1.5rem !important;
        /* Top: 2.5rem, Bottom: 4rem (reduced from 6rem) */
        justify-content: flex-start !important;
        /* Stack from top */
        gap: 2rem;
    }

    .card-body {
        height: auto !important;
        display: flex !important;
        flex-direction: column;
        gap: 2rem;
    }

    .details {
        margin-top: 2rem;
    }
}

/* --- Refinements v9 --- */

/* Video Play Button Overlay */
.video-wrapper {
    position: relative;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, opacity 0.3s ease;
    z-index: 2;
}

.video-wrapper:hover .play-overlay {
    background: rgba(0, 0, 0, 0.1);
}

.play-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease;
}

.play-icon::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent #fff;
    margin-left: 4px;
    /* Optical centering */
}

.video-wrapper:hover .play-icon {
    transform: scale(1.1);
    background: var(--accent);
    border-color: var(--accent);
}

.video-wrapper:hover .play-icon::before {
    border-color: transparent transparent transparent #000;
}

/* Hide overlay when playing */
.video-wrapper.playing .play-overlay {
    opacity: 0;
    pointer-events: none;
}

/* --- Refinements v10 --- */

/* Mobile: Stack images on top in split layout */
@media (max-width: 768px) {
    .split-layout .split-right {
        order: -1;
        margin-bottom: 2rem;
    }

    /* Reduce footer spacing on mobile */
    .footer-grid {
        margin-top: 2rem !important;
        gap: 1.5rem !important;
        flex-direction: column;
        /* Stack links vertically if needed, or keep row but tighter */
    }

    /* If user wants them in a row but tighter, keep flex-direction row but reduce gap. 
       "push it up" implies reducing margin-top. */
    .footer-grid {
        flex-direction: row;
    }
}

/* --- Refinements v11 --- */

/* Force stacking for split layout on mobile/tablet */
@media (max-width: 1024px) {
    .split-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
    }

    .split-layout .split-right {
        order: -1 !important;
        width: 100% !important;
        margin-bottom: 1rem;
    }

    .split-layout .split-left {
        width: 100% !important;
    }

    /* Ensure image takes full width */
    .split-right .placeholder-img {
        width: 100% !important;
        min-height: auto !important;
        /* Let content define height or aspect ratio */
    }

    .split-right img {
        width: 100% !important;
        height: auto !important;
    }
}

/* --- Refinements v12 --- */

/* Case Study Footer Padding (More space for sticky corners) */
.case-study-page footer {
    padding-bottom: 8rem !important;
}

/* Landing Page Footer Padding (Less space) */
.landing-page footer {
    padding-bottom: 4rem !important;
}

/* Mobile Landing Page Footer Alignment */
@media (max-width: 768px) {
    .landing-page footer {
        padding-bottom: 6rem !important;
        /* Ensure space for sticky corners on mobile too */
        text-align: center;
    }

    .landing-page .call-to-action {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .landing-page .footer-grid {
        justify-content: center;
    }
}

/* --- Refinements v13 --- */

/* Ensure footer content is centered on desktop for all pages */
footer {
    text-align: center;
}

.call-to-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* --- Refinements v14 --- */

/* Remove background and shadow from ALL personal project images */
.personal-projects-section img,
.stacked-web-images img,
.phone-grid-2x2 img,
.static-img img,
.hero-visual img {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* Ensure no hover effects add them back */
.personal-card:hover .stacked-web-images img,
.personal-card:hover .phone-grid-2x2 img {
    box-shadow: none !important;
    transform: none !important;
    /* Disable hover movement if desired, or keep movement but no shadow */
}

/* Keep hover movement for cards, but ensure images stay clean */
.personal-card:hover {
    /* transform: translateY(-5px); - This is fine for the card itself */
}

/* --- Refinements v15: Subtle Animations --- */

/* 1. Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    /* Smooth ease-out */
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* 2. Hero Text Staggered Load */
@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.mega-text .line {
    opacity: 0;
    /* Start hidden */
    animation: slideUpFade 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.mega-text .line:nth-child(1) {
    animation-delay: 0.2s;
}

.mega-text .line:nth-child(2) {
    animation-delay: 0.4s;
}

.mega-text .line:nth-child(3) {
    animation-delay: 0.6s;
}

/* 3. Subtle Image Parallax on Hover (Optional, if not already present) */
.visual-box img,
.personal-card img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ensure metrics row in snapshot section has a top border/divider if needed, matching ECIF */
.snapshot-section .metrics-row {
    margin-top: 4rem;
    padding-top: 2rem;
    /* border-top: 1px solid #333; Removed per user request */
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

/* Responsive for snapshot metrics */
@media (max-width: 768px) {
    .snapshot-section .metrics-row {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Main Header Logo Spacing */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}