/* ─── Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background-color: #121212;
    color: #f1f5f9;
    font-family: 'DM Sans', sans-serif;
    overflow-x: hidden;
    cursor: none;
}

/* ─── Custom Cursor ─────────────────────────────── */
.cursor-dot {
    width: 8px; height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    position: fixed; top: 0; left: 0;
    pointer-events: none; z-index: 9999;
    transition: transform 0.1s ease;
}
.cursor-ring {
    width: 32px; height: 32px;
    border: 1.5px solid rgba(59,130,246,0.5);
    border-radius: 50%;
    position: fixed; top: 0; left: 0;
    pointer-events: none; z-index: 9998;
    transition: transform 0.18s ease, border-color 0.2s;
}
.cursor-ring.hovered { border-color: #3b82f6; }

/* ─── Noise overlay ─────────────────────────────── */
body::before {
    content:'';
    position: fixed; inset:0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 0; opacity: 0.4;
}

/* ─── Nav ───────────────────────────────────────── */
nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(18,18,18,0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(42,42,42,0.8);
}
.nav-link {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
    transition: color 0.25s;
    position: relative;
    padding-bottom: 2px;
}
.nav-link::after {
    content:''; position:absolute; bottom:0; left:0;
    width:0; height:1px; background:#3b82f6;
    transition: width 0.3s ease;
}
.nav-link:hover { color: #f1f5f9; }
.nav-link:hover::after { width: 100%; }

/* ─── Section headings ──────────────────────────── */
.section-tag {
    font-family: 'Space Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #3b82f6;
}
.section-title {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    line-height: 1.1;
}

@media (max-width: 640px) {
    .section-title { font-size: 1.8rem !important; }
}

/* ─── Hero ──────────────────────────────────────── */
.hero-name {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: clamp(2.2rem, 10vw, 7rem);
    line-height: 1.0; /* Slightly increased for better rendering clearance */
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #f1f5f9 30%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-right: 0.5em;
    padding-bottom: 0.1em; /* Safety space for bottom of glyphs */
    margin-right: -0.5em;
    display: block;
    overflow: visible;
    -webkit-font-smoothing: antialiased;
    will-change: transform, opacity;
    transform: translateZ(0); /* Force hardware acceleration to prevent stale clipping */
}
.hero-roles span {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.65rem, 1.5vw, 0.85rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #94a3b8;
}
.hero-roles .sep { color: #3b82f6; margin: 0 8px; }

/* ─── Typing cursor ─────────────────────────────── */
#typed-cursor { color: #3b82f6; animation: blink 1.1s step-end infinite; }

/* ─── Grid lines decoration ─────────────────────── */
.grid-deco {
    position:absolute; inset:0; pointer-events:none;
    background-image:
    linear-gradient(rgba(59,130,246,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ─── Cards ─────────────────────────────────────── */
.glass-card {
    background: rgba(31,31,31,0.7);
    border: 1px solid rgba(42,42,42,0.8);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
@media (max-width: 640px) {
    .glass-card { padding: 1.5rem !important; }
}
.glass-card:hover {
    border-color: rgba(59,130,246,0.4);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(59,130,246,0.1);
}

/* ─── Skill badge ───────────────────────────────── */
.skill-badge {
    font-family: 'Space Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.2);
    color: #93c5fd;
    border-radius: 4px;
    padding: 4px 10px;
    display: inline-block;
    transition: background 0.2s, border-color 0.2s;
}
.skill-badge:hover {
    background: rgba(59,130,246,0.18);
    border-color: rgba(59,130,246,0.5);
}

/* ─── Odoo section ──────────────────────────────── */
.odoo-accent { color: #3b82f6; }
.odoo-card {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, rgba(31,31,31,0.9) 0%, rgba(20,30,50,0.9) 100%);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 16px;
}
.odoo-card::before {
    content:'';
    position:absolute; top:-40%; right:-10%;
    width:400px; height:400px;
    background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%);
    pointer-events:none;
}
.capability-chip {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    border-radius: 20px;
    padding: 5px 14px;
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.25);
    color: #60a5fa;
    letter-spacing: 0.04em;
}

/* ─── Progress bars ─────────────────────────────── */
.prog-bar {
    height: 3px; background: #2a2a2a; border-radius: 2px; overflow: hidden;
}
.prog-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 2px;
    width: 0;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ─── Timeline dot ──────────────────────────────── */
.tl-dot {
    width: 10px; height: 10px;
    background: #3b82f6; border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
    flex-shrink: 0;
}

/* ─── Contact form ──────────────────────────────── */
.form-input {
    width:100%;
    background: rgba(26,26,26,0.8);
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 14px 18px;
    color: #f1f5f9;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.form-input::placeholder { color: #4a5568; }
.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.form-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
    display: block;
    margin-bottom: 8px;
}
.btn-primary {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 32px;
    cursor: none;
    transition: background 0.25s, box-shadow 0.25s, transform 0.2s;
}
.btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 8px 30px rgba(59,130,246,0.35);
    transform: translateY(-2px);
}
.btn-secondary {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: transparent;
    color: #3b82f6;
    border: 1px solid rgba(59,130,246,0.4);
    border-radius: 8px;
    padding: 12px 28px;
    cursor: none;
    transition: all 0.25s;
}
.btn-secondary:hover {
    background: rgba(59,130,246,0.08);
    border-color: #3b82f6;
}

/* ─── Toast ─────────────────────────────────────── */
#toast {
    position: fixed; bottom: 32px; right: 32px;
    background: #1f1f1f; border: 1px solid rgba(59,130,246,0.4);
    border-radius: 10px; padding: 14px 22px;
    font-family: 'Space Mono', monospace; font-size: 0.72rem;
    color: #60a5fa; letter-spacing: 0.06em;
    z-index: 9999; opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
#toast.show { opacity:1; transform:translateY(0); }

/* ─── Mobile nav ────────────────────────────────── */
#mobile-menu { display: none; }
#mobile-menu.open { display: flex; }

/* ─── Scroll reveal ─────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #121212; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

/* ─── Divider line ──────────────────────────────── */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59,130,246,0.3), transparent);
    margin: 0 auto;
}

/* ─── Footer ────────────────────────────────────── */
footer {
    border-top: 1px solid #1f1f1f;
}

@media (max-width: 768px) {
    body { cursor: auto; }
    .cursor-dot, .cursor-ring { display: none; }
    .btn-primary, .btn-secondary { cursor: pointer; }
}

/* ════════════════════════════════════════════════════════
   Developer Animations & Enhanced Transitions
════════════════════════════════════════════════════════ */

/* ─── Canvas Code Rain ──────────────────────────── */
#codeCanvas {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ─── Boot Loader ───────────────────────────────── */
#bootLoader {
    position: fixed; inset: 0;
    background: #060606;
    display: flex; align-items: center; justify-content: center;
    z-index: 99999;
    transition: opacity 0.75s ease, transform 0.65s ease;
}
#bootLoader.hiding {
    opacity: 0;
    transform: scale(1.04);
    pointer-events: none;
}
.boot-window {
    background: #0f0f0f;
    border: 1px solid rgba(59,130,246,0.35);
    border-radius: 14px;
    padding: 28px 32px;
    width: min(520px, 92vw);
    min-height: 220px;
    box-shadow: 0 0 80px rgba(59,130,246,0.12), inset 0 1px 0 rgba(255,255,255,0.03);
}
.boot-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(40,40,40,0.9);
}
#bootLines p {
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    line-height: 2;
    color: #64748b;
}
.boot-cursor {
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    color: #3b82f6;
    animation: blink 0.85s step-end infinite;
    display: inline-block;
    margin-top: 4px;
}

/* ─── Scroll Progress Bar ───────────────────────── */
#scrollProgress {
    position: fixed; top: 0; left: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #a78bfa);
    box-shadow: 0 0 10px rgba(59,130,246,0.7);
    z-index: 9999;
    width: 0%;
    transition: width 0.06s linear;
}

/* ─── Tech Marquee ──────────────────────────────── */
.tech-marquee {
    overflow: hidden;
    border-top: 1px solid rgba(59,130,246,0.07);
    border-bottom: 1px solid rgba(59,130,246,0.07);
    padding: 13px 0;
    background: rgba(12,12,12,0.5);
}
.marquee-track {
    display: flex;
    width: max-content;
    animation: marqueeScroll 50s linear infinite;
}
.marquee-track > span {
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: #242424;
    text-transform: uppercase;
    padding: 0 22px;
    white-space: nowrap;
    cursor: default;
    transition: color 0.3s ease;
}
.marquee-track > span:hover { color: #3b82f6; }
.marquee-track .mdot {
    color: rgba(59,130,246,0.18) !important;
    padding: 0 2px !important;
    letter-spacing: 0 !important;
}
@keyframes marqueeScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ─── Hero Name Glitch ──────────────────────────── */
@keyframes glitchAnim {
    0%, 100% { filter: none; transform: skewX(0deg) translateZ(0); }
    10% { filter: hue-rotate(90deg) brightness(1.6) saturate(2); transform: skewX(-2.5deg) translateZ(0); }
    22% { filter: hue-rotate(220deg) brightness(1.2); transform: skewX(2.5deg) translateZ(0); }
    36% { filter: hue-rotate(320deg) brightness(1.4) saturate(1.8); transform: skewX(-1.5deg) translateZ(0); }
    55% { filter: hue-rotate(40deg) brightness(1.1); transform: skewX(1deg) translateZ(0); }
    75% { filter: hue-rotate(10deg) brightness(1.05); transform: skewX(-0.5deg) translateZ(0); }
    90% { filter: none; transform: skewX(0deg) translateZ(0); }
}
#heroName.glitching {
    animation: glitchAnim 0.6s steps(3) forwards;
}

/* ─── Terminal Scanline ─────────────────────────── */
.terminal-scanline {
    position: relative;
    overflow: hidden;
}
.terminal-scanline::after {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px, transparent 3px,
        rgba(0,0,0,0.07) 3px, rgba(0,0,0,0.07) 4px
    );
    pointer-events: none;
    z-index: 5;
    border-radius: 12px;
}

/* ─── Terminal Line Reveal ──────────────────────── */
.t-line {
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.t-line.show {
    opacity: 1;
    transform: translateX(0);
}

/* ─── Pulsing Availability Dot ──────────────────── */
@keyframes availGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.7); transform: scale(1); }
    50%       { box-shadow: 0 0 0 5px rgba(59,130,246,0); transform: scale(1.4); }
}
.avail-dot {
    animation: availGlow 2s ease-in-out infinite !important;
}

/* ─── Odoo Card Border Glow Pulse ───────────────── */
@keyframes odooBorderPulse {
    0%, 100% { box-shadow: 0 4px 24px rgba(0,0,0,0.3); }
    50%       { box-shadow: 0 0 40px rgba(59,130,246,0.12), 0 4px 24px rgba(0,0,0,0.3); }
}
.odoo-card {
    animation: odooBorderPulse 4s ease-in-out infinite;
}

/* ─── Enhanced Skill Badge Hover ────────────────── */
.skill-badge:hover {
    box-shadow: 0 0 16px rgba(59,130,246,0.3);
    color: #bfdbfe;
}
.capability-chip:hover {
    background: rgba(59,130,246,0.18);
    box-shadow: 0 0 12px rgba(59,130,246,0.2);
    color: #93c5fd;
    cursor: default;
}

/* ─── Nav link active glow ──────────────────────── */
.nav-link.active {
    color: #f1f5f9 !important;
    text-shadow: 0 0 12px rgba(59,130,246,0.4);
}
.nav-link.active::after { width: 100%; }

/* ─── Floating badge glow ───────────────────────── */
@keyframes badgeFloat {
    0%, 100% { transform: translateY(0px); box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
    50%       { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(59,130,246,0.15), 0 8px 32px rgba(0,0,0,0.4); }
}
.hero-badge {
    animation: badgeFloat 4s ease-in-out infinite;
}

/* ─── Glass card reveal shimmer ─────────────────── */
.glass-card {
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s, background 0.3s;
}

/* ─── Magnetic button base ──────────────────────── */
.btn-primary, .btn-secondary {
    will-change: transform;
}

/* ─── Section reveal stagger delay helpers ──────── */
.reveal:nth-child(1) { transition-delay: 0s; }
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }

/* ─── Scrollbar glow ────────────────────────────── */
::-webkit-scrollbar-thumb:hover { background: #3b82f6; box-shadow: 0 0 6px rgba(59,130,246,0.5); }