:root {
    /* Light Mode Variables (Apple / Instagram Style) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #000000;
    --text-secondary: #666666;
    --accent: #000000;
    --accent-hover: #333333;
    --border-color: #e5e5e5;
    --surface: #ffffff;

    --cursor-color: #000000;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --transition-fast: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* System Dark Mode Fallback (Before JS Loads) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #000000;
        --bg-secondary: #111111;
        --text-primary: #ffffff;
        --text-secondary: #a0a0a0;
        --accent: #ffffff;
        --accent-hover: #cccccc;
        --border-color: #333333;
        --surface: #1a1a1a;
        --cursor-color: #ffffff;
    }
}

/* Explicit Themes (Set by JS) */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #111111;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #ffffff;
    --accent-hover: #cccccc;
    --border-color: #333333;
    --surface: #1a1a1a;
    --cursor-color: #ffffff;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #000000;
    --text-secondary: #666666;
    --accent: #000000;
    --accent-hover: #333333;
    --border-color: #e5e5e5;
    --surface: #ffffff;
    --cursor-color: #000000;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: clamp(0.95rem, 0.4vw + 0.8rem, 1.1rem);
    overflow-x: hidden;
    cursor: none;
}

/* Links and buttons hide native cursor too */
a,
button,
input,
textarea,
select {
    cursor: none;
}

::selection {
    background: var(--text-primary);
    color: var(--bg-primary);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.section-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-bottom: clamp(1.5rem, 4vw, 3rem);
    position: relative;
    display: inline-block;
}

/* Custom Cursor */
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--cursor-color);
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 300001;
    /* Above overlays */
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid var(--cursor-color);
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 300000;
    /* Above overlays */
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Header & Nav */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(var(--bg-primary), 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: all var(--transition-fast);
}

.header.scrolled {
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(var(--bg-primary), 0.95);
}

.logo {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    white-space: nowrap;
}

.dot {
    color: #888;
}

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

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

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

.controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Language Selector */
.lang-selector {
    position: relative;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.9rem;
}

.lang-dropdown {
    position: absolute;
    top: 150%;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.lang-selector:hover .lang-dropdown,
.lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown button {
    background: none;
    border: none;
    padding: 0.8rem 1rem;
    text-align: left;
    color: var(--text-secondary);
    font-family: var(--font-main);
    transition: all var(--transition-fast);
}

.lang-dropdown button:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 40px;
    font-weight: 500;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

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

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

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

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

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

/* Sections */
.section {
    padding: clamp(3rem, 10vh, 8rem) clamp(1rem, 5vw, 4rem);
    max-width: 1400px;
    margin: 0 auto;
}

.box-bg {
    background-color: var(--bg-secondary);
    max-width: 100%;
}

/* Hero */
/* Hero Hybrid Layout (Desktop Side-by-Side + Centered Text) */
.hero {
    min-height: 100vh;
    display: flex;
    flex-wrap: wrap;
    /* Allows wrapping on smaller desktops */
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    padding: clamp(80px, 15vh, 120px) 5% 80px;
    gap: clamp(1rem, 5vw, 4rem);
    text-align: center;
}

.hero-visual {
    flex: 0 1 450px;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInScale 1s ease-out;
}

.profile-pic {
    width: 100%;
    max-width: clamp(150px, 30vw, 450px);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    padding: clamp(8px, 1.5vw, 15px);
    background: var(--surface);
    transition: transform var(--transition-slow);
}

.profile-pic:hover {
    transform: translateY(-10px) rotate(2deg);
}

.hero-content {
    flex: 1;
    min-width: 400px;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

.hero-greeting {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.hero-name {
    font-size: clamp(2rem, 8vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
    margin: 0.5rem auto;
    letter-spacing: -0.02em;
    max-width: 12ch;
    /* Professional wrapping */
}

.hero-role {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

/* Button Refinement */
.btn-outline {
    background: transparent;
    border: 2px solid var(--text-primary);
    color: var(--text-primary);
}

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

.hero-socials {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
}

.social-icon {
    color: var(--text-primary);
    transition: all var(--transition-fast);
    opacity: 0.8;
}

.social-icon:hover {
    transform: translateY(-5px);
    opacity: 1;
    color: var(--accent);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* About Bento Grid */
/* Unified Apple Dashboard Styling */
.glass-card {
    background: rgba(var(--surface-rgb, 20, 20, 20), 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 40px;
    /* Real Apple-style circular corners */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
}

.apple-dashboard {
    width: 100%;
    max-width: 1100px;
    height: 600px;
    margin: 4rem auto 0;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 40px;
    overflow: hidden;
}

/* Window Header */
.window-header {
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

[data-theme="light"] .window-header {
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.traffic-lights {
    display: flex;
    gap: 8px;
    position: absolute;
    left: 1.5rem;
}

.light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.light.red {
    background: #ff5f56;
}

.light.yellow {
    background: #ffbd2e;
}

.light.green {
    background: #27c93f;
}

.window-title {
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    font-family: monospace;
    opacity: 0.5;
    letter-spacing: 0.05em;
}

/* Window Body */
.window-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.window-sidebar {
    width: 220px;
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem 0.8rem;
}

[data-theme="light"] .window-sidebar {
    background: rgba(0, 0, 0, 0.01);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    background: none;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

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

.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .nav-item.active {
    background: rgba(0, 0, 0, 0.05);
}

/* Content Area */
.window-content {
    flex: 1;
    position: relative;
    padding: 3rem;
    overflow-y: auto;
}

.tab-pane {
    position: absolute;
    inset: 0;
    padding: 3rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

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

/* Internal Component Fixes (Signature Dashboard) */
.decrypt-text {
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1.6;
    max-width: 650px;
    margin: 0 auto 2rem;
    color: var(--text-primary);
    font-family: var(--font-main);
    text-align: center;
}

.code-flicker {
    font-family: monospace;
    font-size: 1rem;
    color: var(--accent);
    opacity: 0.6;
    animation: textFlicker 3s infinite;
    text-align: center;
}

@keyframes textFlicker {

    0%,
    100% {
        opacity: 0.6;
    }

    5%,
    10% {
        opacity: 0.3;
    }

    7% {
        opacity: 1;
        text-shadow: 0 0 10px var(--accent);
    }

    50% {
        opacity: 0.7;
    }
}

/* Nexus Content (Nebula) */
#pane-nexus {
    padding: 0;
    justify-content: flex-end;
}

#synapse-nebula {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.nebula-label {
    position: relative;
    z-index: 10;
    background: rgba(var(--surface-rgb, 10, 10, 10), 0.6);
    backdrop-filter: blur(15px);
    width: 100%;
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Schematic Education (System Node Layout) */
.schematic-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 600px;
}

.schematic-node {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    width: 100%;
    position: relative;
    transition: all 0.3s ease;
}

.schematic-node:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
    transform: translateY(-5px);
}

.schematic-node.highlight {
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.05);
}

.node-id {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--bg-primary);
    padding: 2px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--accent);
}

.node-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.node-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.node-unis {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.uni-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.schematic-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 40px;
}

.connector-line {
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent), transparent);
    opacity: 0.3;
}

.connector-arrow {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--accent);
    opacity: 0.5;
}

/* Mouse Glow */
.apple-dashboard::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.04), transparent 40%);
    z-index: 0;
    pointer-events: none;
}

/* Responsive Dashboard */
@media (max-width: 850px) {
    .apple-dashboard {
        height: auto;
        flex-direction: column;
    }

    .window-body {
        flex-direction: column;
    }

    .window-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding: 1rem;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .nav-item {
        white-space: nowrap;
        width: auto;
        padding: 0.6rem 1rem;
    }

    .window-content {
        padding: 2rem 1rem;
        min-height: 400px;
    }

    .tab-pane {
        position: relative;
        padding: 2rem 0;
        opacity: 1;
        visibility: visible;
        display: none;
    }

    .tab-pane.active {
        display: flex;
    }

    .stats-grid {
        gap: 2rem;
    }
}




/* Experience */
.experience-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 2rem;
    border-left: 2px solid var(--border-color);
}

/* =========================================
   THE SYNAPSE JOURNEY (EXPERIENCE REDESIGN)
   ========================================= */
.synapse-container {
    position: relative;
    max-width: 1100px;
    margin: 4rem auto;
    padding: 2rem 0;
}

/* Central Path SVG */
.synapse-path-wrapper {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 5px;
    transform: translateX(-50%);
    z-index: 1;
}

.synapse-svg {
    width: 100%;
    height: 100%;
}

.path-bg {
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 4px;
    fill: none;
}

.path-active {
    stroke: var(--accent);
    stroke-width: 4px;
    fill: none;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px var(--accent));
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.synapse-journey {
    position: relative;
    z-index: 2;
}

.journey-step {
    position: relative;
    width: 50%;
    margin-bottom: 5rem;
    display: flex;
}

.journey-step.left {
    left: 0;
    justify-content: flex-end;
    padding-right: 3rem;
}

.journey-step.right {
    left: 50%;
    justify-content: flex-start;
    padding-left: 3rem;
}

/* Journey Dot */
.journey-dot {
    position: absolute;
    top: 2rem;
    width: 20px;
    height: 20px;
    background: var(--bg-primary);
    border: 3px solid var(--accent);
    border-radius: 50%;
    z-index: 3;
    box-shadow: 0 0 15px var(--accent);
    transition: transform 0.3s ease, background 0.3s ease;
}

.journey-step.left .journey-dot {
    right: -10px;
}

.journey-step.right .journey-dot {
    left: -10px;
}

/* Journey Card */
.journey-card {
    position: relative;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    overflow: hidden;
}

.journey-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.5;
}

.journey-date {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.8rem;
}

.journey-title {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.journey-company {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    opacity: 0.8;
}

.journey-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Tech Tags */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.tech-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.tech-tag:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

/* Responsive Experience */
@media screen and (max-width: 850px) {
    .synapse-path-wrapper {
        left: 30px;
        transform: none;
    }

    .journey-step {
        width: 100%;
        left: 0 !important;
        padding-left: 4.5rem !important;
        padding-right: 0 !important;
        justify-content: flex-start !important;
    }

    .journey-step .journey-dot {
        left: 20px !important;
        right: auto !important;
    }

    .journey-card {
        max-width: none;
    }
}

/* Skills */
/* Skills V2 */
.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

.about-containers {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
}

.details-container {
    flex: 1;
    min-width: 300px;
}

.experience-sub-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.article-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    background: var(--surface);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.article {
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon {
    width: 4rem;
    height: 4rem;
    object-fit: contain;
    transition: transform var(--transition-fast);
}

.icon:hover {
    transform: translateY(-5px) scale(1.1);
}

/* =========================================
   PROJECT MOSAIC & CASE STUDY OVERLAY
   =========================================/* PROJECTS V3: APPLE SHOWCASE GRID */
.projects-v3-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
    gap: 2.5rem;
    padding: 2rem 0;
}

.v3-card {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.v3-card.primary {
    grid-row: span 2;
}

.v3-card.wide {
    grid-column: span 2;
}

.v3-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.v3-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #0a0a0a;
}

.v3-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.v3-card:hover .v3-img {
    transform: scale(1.05);
}

.v3-card-overlay {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 2;
}

.v3-badge {
    padding: 0.6rem 1.2rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
}

.v3-card-content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.primary .v3-card-content {
    padding: 3rem;
}

.v3-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}

.v3-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.5);
    max-width: 90%;
}

.v3-btn {
    align-self: flex-start;
    margin-top: auto;
    padding: 1rem 2.5rem;
    background: #fff;
    color: #000;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.v3-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

@media screen and (max-width: 1100px) {
    .v3-title {
        font-size: 1.5rem;
    }
}

@media screen and (max-width: 900px) {
    .projects-v3-grid {
        grid-template-columns: 1fr;
    }

    .v3-card.primary,
    .v3-card.wide {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* CASE STUDY OVERLAY */
.case-study-overlay {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200000;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.4s, opacity 0.4s;
    pointer-events: none;
}

.case-study-overlay.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.overlay-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background: transparent;
}

.case-study-container {
    position: relative;
    width: 90%;
    max-width: 1100px;
    height: 85vh;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 40px;
    overflow: hidden;
    transform: scale(0.95);
    display: flex;
    flex-direction: column;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.9);
}

.close-overlay {
    position: absolute;
    top: 2.5rem;
    right: 2.5rem;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 1);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 1.4rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.close-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.close-overlay:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(90deg);
    border-color: rgba(255, 255, 255, 0.3);
}

.close-overlay:hover::after {
    opacity: 1;
}

.case-study-content {
    flex: 1;
    overflow-y: auto;
    padding: 4rem;
    scrollbar-width: none;
}

.case-study-content::-webkit-scrollbar {
    display: none;
}

.case-study-header {
    margin-bottom: 3rem;
}

.case-study-header h2 {
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 1rem;
}

.cs-tags {
    display: flex;
    gap: 1rem;
}

.cs-tag {
    padding: 0.5rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    font-size: 0.85rem;
    color: var(--accent, #fff);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.case-study-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
}

.cs-image-panel img {
    width: 100%;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.cs-details-panel {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.cs-section h4 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 1rem;
}

.cs-section p {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
}

.cs-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.cs-tech-pill {
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: monospace;
}

.cs-footer {
    margin-top: 2rem;
}

@media screen and (max-width: 1000px) {
    .projects-mosaic {
        grid-template-columns: 1fr;
    }

    .case-study-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .case-study-content {
        padding: 2rem;
    }

    .case-study-header h2 {
        font-size: 2rem;
    }
}

/* Contact */
.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-desc {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.social-links {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.social-link:hover {
    color: var(--text-primary);
}

/* Footer */
.footer {
    padding: 3rem 4rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    font-weight: 600;
}

.footer-copy {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Media Queries (Responsive) */
@media (max-width: 1024px) {
    .hero-title {
        font-size: clamp(2.5rem, 5vw, 4rem);
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .section {
        padding: 4rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1.2rem 2rem;
    }

    .header.scrolled {
        padding: 1rem 2rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--bg-primary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s ease;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.5rem;
    }

    .mobile-menu-btn {
        display: flex;
        z-index: 1001;
    }

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

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

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

    .hero {
        padding-top: 100px;
        justify-content: center;
        text-align: center;
        min-height: auto;
    }

    .hero-content {
        align-items: center;
        text-align: center;
        min-width: 100%;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-visual {
        min-width: 100%;
        order: -1;
    }

    /* Disable custom cursor on mobile to use touch */
    .cursor-dot,
    .cursor-outline {
        display: none;
    }

    body,
    a,
    button {
        cursor: auto !important;
    }

    .footer {
        flex-direction: column;
        gap: 1rem;
        padding: 2rem;
        text-align: center;
    }
}

/* =========================================
   VIEW TRANSITIONS (Circular Wave)
   ========================================= */

::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

::view-transition-old(root) {
    z-index: 1;
}

::view-transition-new(root) {
    z-index: 9999;
}

/* The "Wave" Animation */
[data-transition="theme"]::view-transition-new(root) {
    animation: 0.7s cubic-bezier(0.4, 0, 0.2, 1) both wave-reveal;
}

@keyframes wave-reveal {
    from {
        clip-path: circle(0% at var(--x) var(--y));
    }

    to {
        clip-path: circle(150% at var(--x) var(--y));
    }
}

/* =========================================
   DIGITAL ID CONCEPT CARD STYLES
   ========================================= */
.hero-visual {
    perspective: 2000px;
    flex: 0 1 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: fadeInScale 1s ease-out;
}

.id-card-wrapper {
    width: 320px;
    aspect-ratio: 1 / 1.58;
    /* PVC Card Ratio */
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    z-index: 10;
}

.id-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.id-card-wrapper.flipped .id-card-inner {
    transform: rotateY(180deg);
}

.id-card-front,
.id-card-back {
    position: absolute;
    inset: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 24px;
    overflow: hidden;
    background: #1a0e2b;
    /* Premium Dark Purple */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    color: #ffffff;
}

.id-card-back {
    transform: rotateY(180deg);
    background: #12091f;
}

/* Glossy Shine Effect */
.card-gloss {
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(115deg,
            transparent 0%,
            rgba(255, 255, 255, 0) 30%,
            rgba(255, 255, 255, 0.05) 45%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 55%,
            rgba(255, 255, 255, 0) 70%,
            transparent 100%);
    transition: left 0s;
    pointer-events: none;
    z-index: 10;
}

.id-card-wrapper:hover .card-gloss {
    left: 150%;
    transition: left 1s ease-in-out;
}

/* Header */
.card-header {
    margin-bottom: 2.5rem;
}

.brand-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin: 0;
    line-height: 1;
}

.brand-sub {
    font-size: 0.7rem;
    font-weight: 300;
    opacity: 0.9;
    margin: 2px 0 0 0;
    letter-spacing: 0.05em;
}

/* Body (Portrait & Info) */
.card-pvc-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.portrait-ring {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px;
    position: relative;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
}

.portrait-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.id-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-line {
    position: absolute;
    top: 50%;
    left: -5%;
    width: 110%;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    animation: scan 4s infinite ease-in-out;
    pointer-events: none;
    z-index: 5;
}

@keyframes scan {

    0%,
    100% {
        top: 15%;
        opacity: 0;
    }

    50% {
        top: 85%;
        opacity: 1;
    }
}

.id-info {
    text-align: left;
    width: 100%;
    padding-left: 0.5rem;
}

.role-badge {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    opacity: 0.9;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 0.2rem;
}

.id-name {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
}

/* Back Side Content */
.back-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.brand-logo-small {
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 2px;
}

.back-title {
    font-size: 0.6rem;
    opacity: 0.7;
    letter-spacing: 0.05em;
    font-weight: 300;
}

.back-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.back-content.minimal {
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.back-name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}

.data-field label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.9;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

.data-field span {
    font-size: 0.95rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
}

.disclaimer {
    font-size: 0.6rem;
    line-height: 1.5;
    opacity: 0.5;
    margin-top: auto;
    font-weight: 300;
}

.back-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 2rem;
}

.qr-code {
    opacity: 0.8;
}

.serial-no {
    font-size: 0.7rem;
    opacity: 0.8;
    font-weight: 400;
}

.id-hint {
    font-size: 0.8rem;
    opacity: 0.4;
    margin-top: 1rem;
    letter-spacing: 0.05em;
    animation: breathe 3s infinite ease-in-out;
}

@keyframes breathe {

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

    50% {
        opacity: 0.5;
        transform: translateY(-3px);
    }
}

@media (max-width: 768px) {
    .hero-visual {
        flex: 1 1 100%;
        order: -1;
        margin-bottom: 2rem;
    }
}