@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;500;800&family=Space+Mono:wght@400;700&display=swap');

:root {
    --bg-dark: #050505;
    --surface: #0f0f11;
    --border: rgba(255, 255, 255, 0.08);
    --accent: #00e6ff;
    --accent-2: #7000ff;
    --text-primary: #ffffff;
    --text-secondary: #888888;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none !important; /* Will use custom cursor */
}

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

html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    /* Content Protection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.tag, .bento-item p, .bento-item h3, a {
    /* Allow user to interact if strictly necessary or just whitelist selectable details */
    user-select: none; 
}

.logo, .hero-desc {
    user-select: none;
}

/* Custom Cursor */
#cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s;
    mix-blend-mode: difference;
}

#cursor-blur {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999998;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease-out;
    mix-blend-mode: difference;
}

/* Interactive Background */
#canvas-bg {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    opacity: 0.6;
}

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

/* Huge Background Clock */
#bg-big-clock {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(10rem, 30vw, 50rem);
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.05em;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    z-index: -2; /* Behind content but maybe overlaying some mesh features */
    opacity: 0.04;
    color: transparent;
    -webkit-text-stroke: 2px #fff;
    user-select: none;
}

/* Layout Wrapper */
.wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Ultimate Bulletproof Lens System */
#lens-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 999995;
    pointer-events: none;
    display: none;
    background: var(--bg-dark); 
    border: 2px solid var(--accent);
    box-shadow: 0 0 30px rgba(0, 230, 255, 0.4), inset 0 0 20px rgba(0, 230, 255, 0.2);
    margin-top: -180px;
    margin-left: -180px;
    filter: saturate(1.2) contrast(1.1); /* Purged buggy displacement refraction map */
}

/* The Glass Top Reflection / Refraction layer */
#lens-overlay::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 40%, rgba(0,230,255,0.05) 50%, transparent 100%);
    z-index: 10;
    pointer-events: none;
}

/* Inner darkness to simulate spherical lens depth edge falloff */
#lens-overlay::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.8);
    z-index: 9;
    pointer-events: none;
    border-radius: 50%;
}

#lens-overlay.active {
    display: block;
}

#lens-clone {
    width: 100vw; /* Lock width to real screen viewport width inside portal */
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
}

/* FORCE COMPLETE VISIBILITY OF DYNAMICALLY LOADED ITEMS INSIDE LENS */
#lens-clone .reveal-item,
#lens-clone .animated-char,
#lens-clone [style*="opacity: 0"] {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
}

/* X-RAY Spectral Secret reveal logic */
.xray-ghost {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    font-family: 'Space Mono', monospace;
    font-weight: 800;
    color: #ff00aa;
    text-shadow: 0 0 15px rgba(255, 0, 170, 0.8);
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: opacity 0.3s;
    z-index: 20;
}

#lens-clone .xray-ghost {
    opacity: 1 !important;
    display: block !important;
}

/* Specific X-RAY Visual overrides when active */
body.xray-active #lens-overlay {
    border-color: #ff00aa !important;
    box-shadow: 0 0 40px rgba(255, 0, 170, 0.6), inset 0 0 20px rgba(255, 0, 170, 0.3) !important;
}

body.xray-active #lens-overlay::before {
    box-shadow: inset 0 0 40px rgba(50,0,30,0.8);
}

/* Header */
header {
    height: 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

/* Hide magnifier button on mobile since touch interface and tiny screens don't fit the metaphor well */
@media (max-width: 768px) {
    #magnifier-btn {
        display: none !important;
    }
}

.logo {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
}

/* Hero */
.hero {
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    padding: 40px 0 20px 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: 100px;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 1rem;
    width: fit-content;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -2px;
    margin-bottom: 0.75rem;
}

.hero h1 span {
    display: block;
}

.text-gradient {
    background: linear-gradient(to right, #fff, #666);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 1.2rem;
    line-height: 1.4;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 1rem;
    margin-bottom: 100px;
}

.bento-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
    --x: 0px;
    --y: 0px;
}

/* Spotlight effect */
.bento-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        600px circle at var(--x) var(--y),
        rgba(0, 230, 255, 0.06),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1;
}

.bento-item:hover::before {
    opacity: 1;
}

.bento-item.large { grid-column: span 2; grid-row: span 2; }
.bento-item.wide { grid-column: span 2; }
.bento-item.tall { grid-row: span 2; }
.bento-item.full-width { grid-column: 1 / -1; }

.bento-item h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.bento-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Interactive Icon Glow */
.icon-glow {
    position: absolute;
    bottom: -20px;
    right: -20px;
    font-size: 5rem;
    opacity: 0.1;
    transition: 0.3s;
    filter: blur(2px);
}

.bento-item:hover .icon-glow {
    opacity: 0.3;
    transform: rotate(-10deg) scale(1.1);
}

/* Skill Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 1.5rem;
}

.tag {
    padding: 6px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #ccc;
}

/* Custom Button Magnet Effect Concept in JS */
.modern-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1.2rem 2.5rem;
    background: #fff;
    color: #000;
    border-radius: 100px;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    overflow: visible !important;
    transition: 0.3s;
    z-index: 9999 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

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

.modern-btn.secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: #fff;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-flex !important;
}

/* YT Banner Inside Bento */
.yt-banner {
    background: linear-gradient(135deg, #ff0000 0%, #990000 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border: none;
}

/* Deprecated ::after, now using proper child div for 900+ background text */

/* Social Text Contrast Improvements */
.bento-item h3, .bento-item p {
    position: relative;
    z-index: 5;
}

a.bento-item h3 {
    color: #fff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

a.bento-item p {
    color: rgba(255,255,255,0.9) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Footer */
footer {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .bento-grid {
        grid-template-columns: 1fr 1fr;
    }
    .bento-item.large, .bento-item.wide {
        grid-column: span 2;
    }
    * { cursor: auto !important; }
    #cursor, #cursor-blur { display: none; }
}

@media (max-width: 600px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-item.large, .bento-item.wide, .bento-item.tall {
        grid-column: span 1;
        grid-row: auto;
    }
    .hero h1 { font-size: 3rem; }
}

/* Projects Section */
.projects-section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 40px;
    letter-spacing: 2px;
    color: var(--text-primary);
    position: relative;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.project-card:hover {
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.project-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.project-card:hover .project-glow {
    opacity: 1;
}

.project-logo-box {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.02);
    border-radius: 16px;
    margin-bottom: 25px;
}

.project-img {
    max-height: 80px;
    max-width: 80%;
    object-fit: contain;
}

.project-card h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #fff;
}

.project-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    flex-grow: 1;
}

.project-link-tag {
    margin-top: 20px;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    color: var(--accent);
    font-size: 0.9rem;
}

.project-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #a855f7;
    color: white;
    font-size: 0.75rem;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-family: 'Space Mono';
    letter-spacing: 1px;
}

/* Bento-Styled Notifications (User Reference) */
#toast-notifier {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 350px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    z-index: 9999999;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    transform: translateX(0) translateY(0);
    opacity: 1;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

#toast-notifier.toast-hidden {
    transform: translateX(120%) scale(0.95);
    opacity: 0;
    pointer-events: none;
}

/* Subtle Hover Effect matching parent grid system */
#toast-notifier:hover {
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 30px 70px rgba(0,0,0,0.6);
}

@media (max-width: 600px) {
    #toast-notifier {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        bottom: 20px;
    }
}

/* 3. CRT Scanline Retro Shader */
#crt-screen-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 99999999;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 4px, 6px 100%;
}

.crt-active #crt-screen-overlay {
    opacity: 1;
}

/* Dynamic analog tube scanline flicker */
@keyframes crt-flicker {
    0% { opacity: 0.99; }
    50% { opacity: 0.97; }
    100% { opacity: 0.99; }
}

.crt-active body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: rgba(18, 16, 16, 0.08);
    opacity: 1;
    z-index: 99999998;
    pointer-events: none;
    animation: crt-flicker 0.15s infinite;
}

/* 5. Cyberpunk Glitch Typography */
.logo {
    position: relative;
    cursor: pointer;
}

.logo::before, .logo::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-dark); /* Ensure perfect coverage behind pixel shift */
    clip-path: inset(0 0 0 0);
    display: none;
}

.logo:hover::before {
    display: block;
    left: -2px;
    text-shadow: -2px 0 var(--accent);
    animation: glitch-anim-1 1s infinite linear alternate-reverse;
}

.logo:hover::after {
    display: block;
    left: 2px;
    text-shadow: 2px 0 var(--accent-2);
    animation: glitch-anim-2 1s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(40% 0 61% 0); }
    20% { clip-path: inset(92% 0 1% 0); }
    40% { clip-path: inset(25% 0 58% 0); }
    60% { clip-path: inset(80% 0 5% 0); }
    80% { clip-path: inset(11% 0 75% 0); }
    100% { clip-path: inset(50% 0 30% 0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(20% 0 80% 0); }
    20% { clip-path: inset(50% 0 10% 0); }
    40% { clip-path: inset(85% 0 5% 0); }
    60% { clip-path: inset(15% 0 70% 0); }
    80% { clip-path: inset(60% 0 25% 0); }
    100% { clip-path: inset(30% 0 60% 0); }
}

/* 4. Premium Cyberpunk Contact Panel */
.cyber-contact-panel {
    background: linear-gradient(135deg, rgba(10, 10, 15, 0.75) 0%, rgba(5, 5, 8, 0.95) 100%) !important;
    border: 1px solid rgba(0, 230, 255, 0.15) !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6), inset 0 0 30px rgba(0, 230, 255, 0.03);
    padding: 40px !important;
}

/* Sci-fi glowing corner brackets */
.cyber-contact-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 24px; height: 24px;
    border-top: 3px solid var(--accent);
    border-left: 3px solid var(--accent);
    pointer-events: none;
}
.cyber-contact-panel::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 24px; height: 24px;
    border-bottom: 3px solid var(--accent);
    border-right: 3px solid var(--accent);
    pointer-events: none;
}

/* Panel Header Info Details */
.panel-header-details {
    display: flex;
    justify-content: space-between;
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    color: #444;
    text-transform: uppercase;
    border-bottom: 1px dashed rgba(255,255,255,0.06);
    padding-bottom: 18px;
    margin-bottom: 30px;
}

.panel-header-details span {
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 1px;
}

.panel-header-details .status-glow {
    width: 7px; height: 7px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
    animation: statusPulse 1.5s infinite alternate;
}

@keyframes statusPulse {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Premium Sci-Fi Input Fields */
.cyber-input-group {
    position: relative;
    margin-bottom: 5px;
}

.cyber-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.015);
    border: none !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 4px 4px 0 0;
    width: 100%;
}

.cyber-input-prefix {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: #555;
    padding-left: 15px;
    user-select: none;
    transition: color 0.3s;
}

.cyber-input-group input, 
.cyber-input-group textarea {
    flex: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #fff !important;
    font-family: inherit;
    font-size: 1rem;
    padding: 18px;
    transition: all 0.3s ease;
}

.cyber-input-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* Neon Focus State */
.cyber-input-wrapper:focus-within {
    border-bottom-color: var(--accent) !important;
    background: rgba(0, 230, 255, 0.025);
    box-shadow: 0 8px 24px rgba(0, 230, 255, 0.04);
}

.cyber-input-wrapper:focus-within .cyber-input-prefix {
    color: var(--accent);
}

/* Double Clip-Path Complete Neon Angled Border Button */
.cyber-submit-btn-wrapper.tag {
    position: relative;
    display: inline-flex;
    background: rgba(0, 230, 255, 0.3) !important; /* Border color */
    padding: 1px !important; /* Border thickness */
    clip-path: polygon(0 0, 92% 0, 100% 30%, 100% 100%, 8% 100%, 0 70%);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none !important;
    border-radius: 0 !important;
}

.cyber-submit-btn-wrapper.tag:hover {
    background: var(--accent) !important; /* Glow border on hover */
    box-shadow: 0 0 30px rgba(0, 230, 255, 0.4);
}

.cyber-submit-btn {
    position: relative;
    background: #0d0d11 !important; /* Button background */
    color: var(--accent) !important;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    padding: 15px 38px;
    border: none !important;
    cursor: pointer;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    clip-path: polygon(0 0, 92% 0, 100% 30%, 100% 100%, 8% 100%, 0 70%);
    width: 100%;
    transition: all 0.3s ease;
}

.cyber-submit-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 230, 255, 0.25), transparent);
    transition: all 0.5s ease;
}

.cyber-submit-btn:hover {
    background: var(--accent) !important;
    color: #000 !important;
}

.cyber-submit-btn:hover::before {
    left: 100%;
}

.cyber-submit-btn:active {
    transform: translateY(1px);
}

@media (max-width: 768px) {
    .cyber-contact-panel {
        padding: 24px !important;
    }
    .panel-header-details {
        flex-direction: column;
        gap: 10px;
    }
}
