/* --- CORE VARIABLES --- */
:root {
    /* Color Palette */
    --sys-bg: #0a0a0c;
    /* Deep space charcoal */
    --sys-cyan: #00f0ff;
    /* Cyan-blue accent */
    --sys-violet: #b28dff;
    /* Soft violet accent */
    --sys-text: #f3f4f6;
    /* Primary reading text */
    --sys-text-muted: #9ca3af;
    /* Neutral muted */
    --sys-panel: rgba(20, 20, 25, 0.4);
    /* Subtle glass */
    --sys-border: rgba(255, 255, 255, 0.05);

    /* Easing */
    --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

    /* Depths */
    --z-ambient: -10;
    --z-flat: 0;
    --z-interactive: 10;
    --z-nav: 50;
    --z-cursor: 100;
}

/* --- RESET & FOUNDATION --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    background-color: var(--sys-bg);
    color: var(--sys-text);
    overflow-x: hidden;
    /* Smooth scrolling managed by GSAP, but fallback here */
    scroll-behavior: auto;
    cursor: none;
    /* Hide default native pointer */
}

/* Also hide cursor over links to force custom pointer */
a,
button,
.interactive-card,
.interactive-row {
    cursor: none !important;
}

/* --- SYSTEM PRE-LOADER --- */
#system-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #050505;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s var(--ease-standard);
    pointer-events: all;
}

body.loading,
html.loading {
    overflow: hidden !important;
    /* Lock scroll while loading */
}

.preloader-terminal {
    width: 90%;
    max-width: 600px;
    color: var(--sys-text);
    font-size: 0.9rem;
    line-height: 1.6;
}

#preloader-logs {
    margin-bottom: 1.5rem;
    min-height: 80px;
}

#preloader-logs .log-line {
    display: block;
    opacity: 0;
    animation: fadeInLine 0.1s forwards;
}

.progress-bar-container {
    margin-bottom: 1rem;
    color: var(--sys-cyan);
    letter-spacing: 0.1em;
}

.access-msg {
    min-height: 24px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    opacity: 0;
}

.access-msg.visible {
    opacity: 1;
}

body.loading .system-interface,
body.loading .global-nav {
    opacity: 0;
    pointer-events: none;
}

body:not(.loading) .system-interface,
body:not(.loading) .global-nav {
    opacity: 1;
    pointer-events: all;
    transition: opacity 1s var(--ease-standard);
}

/* Typography Classes */
.font-outfit {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.font-syncopate {
    font-family: 'Syncopate', sans-serif;
}

.font-inter {
    font-family: 'Inter', sans-serif;
}

.font-jet {
    font-family: 'JetBrains Mono', monospace;
}

.text-white {
    color: var(--sys-text);
}

.text-muted {
    color: var(--sys-text-muted);
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.accent-color {
    color: var(--sys-cyan);
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-8 {
    margin-top: 2rem;
}

/* Readability defaults */
.body-text {
    line-height: clamp(1.5, 2vw, 1.8);
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    /* Compress text slightly on mobile */
    color: var(--sys-text);
}

.flat-text {
    /* Z=0 enforcement */
    transform: translateZ(var(--z-flat));
}

/* --- AMBIENT LAYER (Negative Z) --- */
.ambient-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--z-ambient);
    pointer-events: none;
}

.particle-canvas {
    width: 100%;
    height: 100%;
    opacity: 0.6;
    /* Reduced baseline noise */
}

.glow-field {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.03) 0%, transparent 60%);
    transform: translate(-50%, -50%);
}

/* --- NAVIGATION (High Z) --- */
.global-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    z-index: var(--z-nav);
    background: linear-gradient(to bottom, var(--sys-bg) 0%, transparent 100%);
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: bold;
    letter-spacing: 0.1em;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--sys-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    font-weight: 400;
    transition: color 0.4s var(--ease-standard), letter-spacing 0.4s var(--ease-standard), font-weight 0.4s var(--ease-standard);
    position: relative;
    padding-bottom: 4px;
    display: inline-block;
    /* Required for transform animation */
}

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

/* System Awareness Navigation Focus State */
.nav-links a.active {
    color: var(--sys-text);
    /* Slight color lift */
    letter-spacing: 0.15em;
    /* Minimal expansion */
    font-weight: 700;
    /* Single-step weight increase */
    animation: navMicroSettle 0.5s var(--ease-standard) forwards;
}

/* Thin restrained light trace below active item */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--sys-cyan);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: opacity 0.5s var(--ease-standard), transform 0.5s var(--ease-standard);
}

.nav-links a.active::after {
    opacity: 0.5;
    /* Restrained, no aggressive glow */
    transform: scaleX(1);
}

/* One-time settle motion */
@keyframes navMicroSettle {
    0% {
        transform: translateY(3px);
    }

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

/* Mobile Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: calc(var(--z-nav) + 1);
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background-color: var(--sys-text);
    transition: all 0.3s var(--ease-standard);
    border-radius: 2px;
}

/* Mobile Navigation Adjustments (< 768px) */
@media (max-width: 768px) {
    .global-nav {
        padding: 1.5rem 5%;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        /* Hidden off-screen by default */
        width: 100vw;
        height: 100vh;
        background: rgba(10, 10, 12, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;
        transition: right 0.5s var(--ease-standard);
        z-index: var(--z-nav);
    }

    .nav-links.active {
        right: 0;
        /* Slide in */
    }

    .nav-links a {
        font-size: 1.5rem;
        /* Much larger for mobile tap targets */
    }

    /* Transform hamburger into an 'X' when active */
    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* --- LAYOUT PIPELINE --- */
.golden-ratio-container {
    width: 100%;
    max-width: 62vw;
    /* ~62% of viewport width */
    margin: 0 auto;
    position: relative;
    z-index: var(--z-flat);
}

.panel-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(3rem, 10vh, 6rem) clamp(1.5rem, 5vw, 5%);
    position: relative;
    /* Prevent GSAP pinSpacing from creating massive horizontal or vertical gaps */
    overflow: hidden;
    scroll-margin-top: 80px;
}

/* Hierarchy specific panels */
.dense-info-panel {
    /* Less intense visual background */
    background: linear-gradient(to bottom, transparent, rgba(10, 10, 12, 0.9), transparent);
}

.resolution-panel {
    /* Calm finish */
    background: var(--sys-bg);
}

/* --- SECTION TYPOGRAPHY --- */
.section-identifier {
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    color: var(--sys-violet);
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.section-heading {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: -0.02em;
}

.hero-content {
    position: relative;
    z-index: 10;
}

.hero-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    height: 100%;
}

@media (max-width: 1024px) {
    .hero-grid-layout {
        grid-template-columns: 1fr;
    }

    .hero-terminal-col {
        display: none;
    }
}

.hero-title {
    font-size: clamp(3rem, 8vw, 8rem);
    line-height: 1.0;
    letter-spacing: -0.04em;
    margin: 1rem 0;
}

.sub-title {
    font-size: clamp(1rem, 2vw, 2rem);
    letter-spacing: 0.2em;
    color: var(--sys-text-muted);
    margin-bottom: 2rem;
}

.intro-text {
    max-width: 600px;
}

.hero-ctas {
    display: flex;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    border-radius: 4px;
    transition: all 0.4s var(--ease-standard);
    background: transparent;
    cursor: pointer;
}

.btn-primary {
    border: 1px solid var(--sys-cyan);
    color: var(--sys-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1) inset;
}

.btn-primary:hover {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2) inset, 0 0 10px rgba(0, 240, 255, 0.2);
}

.btn-outline {
    border: 1px solid var(--sys-text);
    color: var(--sys-text);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* --- GLOBAL NETWORK CANVAS --- */
#global-network-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

#global-network-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: 1;
    opacity: 0.5;
}

/* --- LIVE FEED TERMINAL --- */
.live-feed-terminal {
    width: 100%;
    max-width: 500px;
    height: 400px;
    background: rgba(10, 10, 12, 0.5);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 6px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 240, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 5;
    pointer-events: auto;
    /* allow text selection and scrolling if needed */
    margin-left: auto;
    /* push to right if needed */
}

/* Responsive: Hide terminal on mobile to save space */
@media (max-width: 1024px) {
    .live-feed-terminal {
        display: none;
    }
}

.terminal-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.close {
    background: #ff5f56;
}

.dot.minimize {
    background: #ffbd2e;
}

.dot.maximize {
    background: #27c93f;
}

.terminal-title {
    margin-left: 15px;
    font-size: 0.75rem;
    color: var(--sys-text-muted);
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.terminal-body {
    flex: 1;
    padding: 15px;
    font-size: 0.8rem;
    color: #e6e6e6;
    line-height: 1.5;
    overflow-y: hidden;
    /* Hide overflow to make typing scroll naturally */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Smooth mask to fade text out at the top */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 100%);
}

.terminal-body .code-line {
    display: block;
    margin-top: 2px;
    word-break: break-all;
    white-space: pre-wrap;
    opacity: 0;
    animation: fadeInLine 0.1s forwards;
}

@keyframes fadeInLine {
    to {
        opacity: 1;
    }
}

/* Syntax Highlighting for JS injected text */
.terminal-body .keyword {
    color: #ff7b72;
}

.terminal-body .builtin {
    color: #79c0ff;
}

.terminal-body .function {
    color: #d2a8ff;
}

.terminal-body .string {
    color: #a5d6ff;
}

.terminal-body .number {
    color: #79c0ff;
}

.terminal-body .comment {
    color: #8b949e;
    font-style: italic;
}

.terminal-body .sys-log {
    color: var(--sys-cyan);
    font-weight: bold;
}

.terminal-body .sys-success {
    color: #3fb950;
    font-weight: bold;
}

.terminal-body .sys-warn {
    color: #d29922;
    font-weight: bold;
}

/* --- ABOUT SECTION --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    /* Slightly tone down the width dominance to prevent extreme cropping */
    gap: 4rem;
    align-items: stretch;
    /* Ensure text and image card are exactly the same height */
    position: relative;
    perspective: 1200px;
}

.about-visual-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.identity-connector {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    position: relative;
    width: 100%;
}

.identity-connector .section-heading {
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.connector-line {
    height: 1px;
    background: linear-gradient(90deg, var(--sys-violet), transparent);
    flex-grow: 1;
    box-shadow: 0 0 10px rgba(178, 141, 255, 0.5);
    opacity: 0.6;
}

.focal-card {
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 16px;
    position: relative;
    transition: transform 0.6s var(--ease-standard), box-shadow 0.6s var(--ease-standard);
    transform: translateZ(var(--z-interactive));
    transform-style: preserve-3d;
    overflow: hidden;
    width: 100%;
    /* Dynamically match the height of the text block */
    height: 100%;
    min-height: 450px;
    /* Ensure it doesn't compress too much on tiny screens */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 240, 255, 0.05);
    /* Faint cyan glow */
    display: flex;
    align-items: center;
    justify-content: center;
}

.focal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.1;
    /* Reduced grid opacity behind portrait */
    pointer-events: none;
    z-index: 0;
}

.focal-card::after {
    /* Premium dark gradient overlay blending image into background */
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(10, 10, 12, 1) 0%, rgba(10, 10, 12, 0) 100%);
    pointer-events: none;
    z-index: 3;
}

.focal-card>* {
    position: relative;
    z-index: 2;
}

.focal-interactive:hover {
    transform: translateY(-5px) translateZ(calc(var(--z-interactive) + 20px));
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 240, 255, 0.15);
    /* Enhanced cyan presence on hover */
    /* Removed heavy border-color */
}

.focal-image {
    width: 100%;
    height: 100%;
    max-width: none;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: center 15%;
    /* Ensure face/upper torso is always visible without cutting off top of head */
    border-radius: 16px;
    display: block;
    border: none;
    margin: 0;
    filter: grayscale(10%) contrast(1.05) brightness(0.95);
    /* Refined, serious aesthetic */
}

.focal-image-placeholder {
    width: 100%;
    aspect-ratio: 4/5;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--sys-border);
    margin-bottom: 2rem;
}

.focal-image-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.skills-container {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.skills-orbit {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-label {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    transition: all 0.3s var(--ease-standard);
}

.premium-label {
    background: rgba(178, 141, 255, 0.05);
    border: 1px solid rgba(178, 141, 255, 0.3);
    color: var(--sys-violet);
    box-shadow: 0 0 10px rgba(178, 141, 255, 0.1) inset;
}

.standard-label {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--sys-border);
    color: var(--sys-text-muted);
}

.skill-label:hover {
    transform: translateY(-2px);
}



/* --- EXPERIENCE SECTION --- */
.terminal-panel {
    background: var(--sys-panel);
    border: 1px solid var(--sys-border);
    border-radius: 8px;
    overflow: hidden;
}

.terminal-header {
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--sys-border);
}

.terminal-body {
    padding: 2rem;
}

.terminal-list {
    list-style: none;
    color: var(--sys-text-muted);
}

.terminal-list li {
    margin-bottom: 0.75rem;
}

/* --- PROJECTS SECTION --- */
.full-width {
    max-width: 80vw;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.project-card {
    border: 1px solid var(--sys-border);
    cursor: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    padding: 2.5rem;
    /* Larger internal padding */
    min-height: 280px;
    /* Force cards to be physically bigger vertically */
}

.project-status {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--sys-text-muted);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--sys-cyan);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--sys-cyan);
    animation: pulse 2s infinite;
}

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

    50% {
        opacity: 1;
        box-shadow: 0 0 10px var(--sys-cyan);
    }

    100% {
        opacity: 0.5;
    }
}

.project-card h4 {
    margin-top: 1.5rem;
}

.project-tags {
    margin-top: auto;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tags span {
    color: var(--sys-violet);
    opacity: 0.8;
}

.project-links {
    display: flex;
    justify-content: center;
    /* Center horizontally */
    align-items: center;
    /* Center vertically within this container if needed */
    gap: 1.5rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
    /* Add some space at the very bottom */
}

.project-link {
    color: var(--sys-cyan);
    text-decoration: none;
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

/* Text glitch animation on hover specifically for links */
.project-link:hover {
    color: #fff;
    text-shadow: 2px 0 var(--sys-violet), -2px 0 var(--sys-cyan);
    animation: text-glitch 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

@keyframes text-glitch {
    0% {
        transform: translate(0)
    }

    20% {
        transform: translate(-2px, 1px)
    }

    40% {
        transform: translate(-2px, -1px)
    }

    60% {
        transform: translate(2px, 1px)
    }

    80% {
        transform: translate(2px, -1px)
    }

    100% {
        transform: translate(0)
    }
}

/* Scanner effect on hover for card */
.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--sys-cyan), transparent);
    box-shadow: 0 0 15px var(--sys-cyan);
    opacity: 0;
    transform: translateY(-100px);
    transition: opacity 0.3s;
    pointer-events: none;
}

.project-card:hover {
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.05) inset;
    transform: translateY(-5px) translateZ(var(--z-interactive));
}

.project-card:hover::after {
    opacity: 1;
    animation: scan-line 2.5s linear infinite;
}

@keyframes scan-line {
    0% {
        transform: translateY(-50px);
    }

    100% {
        transform: translateY(350px);
    }
}

/* --- BLOGS SECTION --- */
.blog-archive {
    display: flex;
    flex-direction: column;
}

.interactive-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 0;
    /* Tighter padding for 7 articles */
    border-bottom: 1px solid var(--sys-border);
    text-decoration: none;
    transition: padding-left 0.4s var(--ease-standard), background 0.4s var(--ease-standard);
}

.interactive-row h4 {
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    /* Refined sizing for legibility */
}

.interactive-row:hover {
    padding-left: 1rem;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent);
}

.interactive-row:hover h4 {
    color: var(--sys-cyan);
}

/* Dim inactive rows on archive hover */
.blog-archive:hover .interactive-row {
    opacity: 0.4;
}

.blog-archive .interactive-row:hover {
    opacity: 1;
}

/* Hover Preview Image Follower */
.blog-hover-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 200px;
    pointer-events: none;
    opacity: 0;
    z-index: var(--z-super);
    transform: translate(-50%, -50%) scale(0.8);
    transition: opacity 0.4s var(--ease-standard), transform 0.4s var(--ease-standard);
    border-radius: 8px;
    border: 1px solid var(--sys-cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.blog-hover-preview.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.blog-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.blog-hover-arrow {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    color: var(--sys-cyan);
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
}

/* --- CONTACT SECTION --- */
.contact-title {
    font-size: clamp(3rem, 6vw, 6rem);
    line-height: 1;
}

.content-center {
    text-align: center;
    max-width: 800px;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.contact-link {
    color: var(--sys-text);
    text-decoration: none;
    letter-spacing: 0.1em;
    position: relative;
    transition: color 0.4s var(--ease-standard);
}

.terminal-button {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    border-radius: 4px;
    transition: all 0.3s var(--ease-standard);
    font-size: 0.9rem;
}

.terminal-button:hover {
    color: var(--sys-cyan);
    border-color: var(--sys-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2) inset;
    background: rgba(0, 240, 255, 0.05);
}

.blinking-cursor {
    display: inline-block;
    width: 1ch;
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.terminal-prompt {
    margin-top: 1.5rem;
    margin-left: auto;
    margin-right: auto;
    display: block;
    clear: both;
}


/* --- CURSORGLOW --- */
.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.05) 0%, transparent 60%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: var(--z-cursor);
    transition: opacity 0.4s var(--ease-standard);
}

/* --- CUSTOM SYSTEM POINTER --- */
.cursor-main,
.cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    /* Max possible z-index */
    opacity: 0;
    /* Hidden until mouse enters window */
    transition: opacity 0.3s ease;
    font-size: 1.25rem;
    font-weight: bold;
    /* GSAP provides x/y, we remove translate(-50%,-50%) so it aligns top-left, meaning the > is the click target */
    line-height: 1;
}

.cursor-main {
    color: var(--sys-cyan);
    text-shadow: 0 0 8px var(--sys-cyan);
}

.cursor-trail {
    color: var(--sys-violet);
    text-shadow: 0 0 12px var(--sys-violet);
    filter: drop-shadow(0 0 2px var(--sys-violet));
    transition: font-size 0.2s ease, opacity 0.3s ease, letter-spacing 0.2s ease;
}

/* Hover state scale for trail */
.cursor-trail.cursor-hoverState {
    font-size: 1.75rem;
    color: var(--sys-cyan);
    letter-spacing: 0.1em;
}

/* --- AMBIENT INTELLIGENT COMPANION (ORB) --- */
.ambient-orb {
    position: fixed;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.8));
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2), inset 0 0 10px rgba(178, 141, 255, 0.3);
    backdrop-filter: blur(4px);
    z-index: 9998;
    /* Just below cursor */
    pointer-events: none;
    /* Do not block hover states of things below it */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    transform: translate(-50%, -50%);
    /* Base centering, JS handles physics positioning */
    opacity: 0;
    transition: opacity 1s ease;
}

.ambient-orb.visible {
    opacity: 1;
}

.orb-eye {
    width: 4px;
    height: 6px;
    background: var(--sys-cyan);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--sys-cyan);
    transition: height 0.3s ease, transform 0.3s ease, background 0.5s ease, box-shadow 0.5s ease;
}

.orb-dialogue {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(10, 10, 12, 0.8);
    border: 1px solid rgba(0, 240, 255, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--sys-text);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    /* Text shouldn't block */
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.orb-dialogue.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- REDUCED MOTION SUPPORT --- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .cursor-glow,
    .particle-canvas {
        display: none !important;
    }

    .focal-interactive:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    .interactive-card:hover {
        transform: none !important;
    }
}

/* --- RESPONSIVE DEGRADATION --- */
@media (max-width: 1024px) {
    .golden-ratio-container {
        max-width: 90vw;
    }

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

    .cursor-glow {
        display: none;
    }
}

@media (max-width: 768px) {

    /* Release hard bounds on images for mobile */
    .focal-card {
        min-height: 250px;
        aspect-ratio: auto;
    }

    /* Stack projects securely */
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        padding: 1.5rem;
    }

    /* Prevent squishing in blogs */
    .interactive-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1rem 0;
    }

    .interactive-row .row-meta {
        font-size: 0.75rem;
    }

    /* Stack footer buttons */
    .contact-endpoints {
        flex-direction: column;
        width: 100%;
    }

    .endpoint-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}