/* ============================
   CSS CUSTOM PROPERTIES
   ============================ */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #0f1520;
    --bg-tertiary: #141c2b;
    --bg-card: #161e2e;
    --bg-card-hover: #1a2438;

    --text-primary: #e8edf5;
    --text-secondary: #8a9bb5;
    --text-muted: #5a6a82;

    --accent-primary: #5ba8f5;
    --accent-secondary: #3d8fe0;
    --accent-glow: rgba(91, 168, 245, 0.3);
    --accent-ice: #7ec8f0;
    --accent-frost: #a8dff0;
    --accent-orange: #f0923d;

    --gradient-primary: linear-gradient(135deg, #5ba8f5 0%, #a8dff0 50%, #7ec8f0 100%);
    --gradient-hero: linear-gradient(180deg, rgba(10, 14, 23, 0) 0%, #0a0e17 100%);
    --gradient-card: linear-gradient(145deg, rgba(91, 168, 245, 0.08), rgba(168, 223, 240, 0.03));

    --border: rgba(91, 168, 245, 0.12);
    --border-hover: rgba(91, 168, 245, 0.25);

    --nav-height: 72px;
    --container-width: 1200px;

    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(91, 168, 245, 0.15);
}

/* ============================
   RESET & BASE
   ============================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s;
}

img {
    max-width: 100%;
    display: block;
}

/* ============================
   PAGE LOADER
   ============================ */
.page-loader {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-logo {
    font-size: 2.5rem;
    font-weight: 900;
    font-family: var(--font-primary);
    animation: loader-pulse 1.2s ease-in-out infinite;
}

.loader-logo .logo-bracket {
    color: var(--accent-primary);
    font-family: var(--font-mono);
}

@keyframes loader-pulse {
    0%, 100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 0 transparent); }
    50% { opacity: 0.6; transform: scale(0.96); filter: drop-shadow(0 0 30px var(--accent-glow)); }
}

/* ============================
   SNOWFALL CANVAS
   ============================ */
#snowCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ============================
   AURORA BACKGROUND
   ============================ */
.aurora {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.aurora-beam {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    animation: aurora-drift 20s ease-in-out infinite;
}

.aurora-beam:nth-child(1) {
    background: #5ba8f5;
    top: -20%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 18s;
}

.aurora-beam:nth-child(2) {
    background: #a8dff0;
    top: 20%;
    right: -10%;
    animation-delay: -6s;
    animation-duration: 22s;
}

.aurora-beam:nth-child(3) {
    background: #3d8fe0;
    bottom: -10%;
    left: 30%;
    animation-delay: -12s;
    animation-duration: 25s;
}

@keyframes aurora-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(80px, -60px) scale(1.15); }
    50% { transform: translate(-40px, 40px) scale(0.9); }
    75% { transform: translate(60px, 80px) scale(1.1); }
}

/* ============================
   CURSOR EFFECT
   ============================ */
.cursor-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(91, 168, 245, 0.05) 0%, rgba(126, 200, 240, 0.02) 35%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    will-change: left, top;
}

#cursorTrailCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

body { cursor: none !important; }
a, button, .btn, input, textarea, select, [role="button"] { cursor: none !important; }

/* ============================
   CONTAINER
   ============================ */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================
   NAVIGATION
   ============================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(0px);
}

.navbar.scrolled {
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    transition: transform 0.3s;
}

.nav-logo:hover {
    transform: scale(1.05);
    color: var(--text-primary);
}

.logo-bracket {
    color: var(--accent-primary);
    font-family: var(--font-mono);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(-50%);
}

.nav-links a:hover::after {
    width: 60%;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-cta {
    background: var(--accent-primary) !important;
    color: var(--bg-primary) !important;
    font-weight: 600 !important;
    padding: 8px 20px !important;
    border-radius: var(--radius-xl) !important;
}

.nav-cta::after {
    display: none !important;
}

.nav-cta:hover {
    background: var(--accent-secondary) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
    transform-origin: center;
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================
   BUTTONS
   ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-xl);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-secondary);
    color: var(--bg-primary);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px var(--accent-glow);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-hover);
    backdrop-filter: blur(8px);
}

.btn-outline:hover {
    background: rgba(91, 168, 245, 0.08);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-3px) scale(1.02);
}

.magnetic {
    transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ============================
   HERO SECTION
   ============================ */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: calc(var(--nav-height) + 40px) 24px 60px;
    overflow: hidden;
}

.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(91, 168, 245, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91, 168, 245, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 100%);
    animation: grid-move 30s linear infinite;
}

@keyframes grid-move {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 60px 60px, 60px 60px; }
}

.hero-content {
    max-width: var(--container-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(91, 168, 245, 0.08);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    color: var(--accent-ice);
    font-weight: 500;
    margin-bottom: 24px;
    width: fit-content;
    animation: badge-shimmer 3s ease-in-out infinite;
}

@keyframes badge-shimmer {
    0%, 100% { border-color: var(--border); box-shadow: none; }
    50% { border-color: var(--accent-primary); box-shadow: 0 0 20px rgba(91, 168, 245, 0.1); }
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
}

.hero-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
}

.hero-title span:first-child {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.hero-name {
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    letter-spacing: -2px;
    position: relative;
    width: fit-content;
}

.hero-name::before,
.hero-name::after {
    content: 'Devmo';
    position: absolute;
    top: 0;
    left: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
}

.hero-name:hover::before { animation: glitch-1 0.3s linear; opacity: 0.8; }
.hero-name:hover::after { animation: glitch-2 0.3s linear; opacity: 0.8; }

@keyframes glitch-1 {
    0% { transform: translate(0); }
    20% { transform: translate(-3px, 3px); }
    40% { transform: translate(3px, -3px); }
    60% { transform: translate(-2px, -2px); }
    80% { transform: translate(2px, 2px); }
    100% { transform: translate(0); }
}

@keyframes glitch-2 {
    0% { transform: translate(0); }
    20% { transform: translate(3px, -3px); }
    40% { transform: translate(-3px, 3px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(-2px, -2px); }
    100% { transform: translate(0); }
}

.hero-role {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 4px;
}

.typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--accent-primary);
    margin-left: 4px;
    animation: blink-cursor 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink-cursor { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin-bottom: 32px;
    line-height: 1.8;
}

.hero-desc strong { color: var(--text-primary); }

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.hero-stats { display: flex; gap: 40px; }

.stat {
    display: flex;
    flex-direction: column;
    position: relative;
}

.stat::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat:hover::before { transform: scaleX(1); }

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.stat-plus { font-size: 1.5rem; font-weight: 700; color: var(--accent-primary); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* Avatar */
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.avatar-wrapper {
    position: relative;
    width: 340px;
    height: 340px;
    animation: avatar-float 6s ease-in-out infinite;
}

@keyframes avatar-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-16px); }
}

.avatar-glow {
    position: absolute;
    inset: -30px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    border-radius: 50%;
    animation: glow-pulse 4s ease-in-out infinite;
    filter: blur(30px);
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.avatar-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-frost), var(--accent-primary)) border-box;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    animation: ring-rotate 8s linear infinite;
}

.avatar-ring-2 {
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    border: 1px dashed rgba(91, 168, 245, 0.2);
    animation: ring-rotate-reverse 12s linear infinite;
}

@keyframes ring-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes ring-rotate-reverse { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }

.orbit-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-glow);
    top: 50%;
    left: 50%;
}

.orbit-dot:nth-child(4) { animation: orbit 8s linear infinite; }
.orbit-dot:nth-child(5) { animation: orbit 8s linear infinite -4s; }

@keyframes orbit {
    from { transform: rotate(0deg) translateX(185px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(185px) rotate(-360deg); }
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar-wrapper:hover .avatar-img { transform: scale(1.05); }

.floating-badge {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    z-index: 3;
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    animation: float 6s ease-in-out infinite;
    transition: transform 0.3s, box-shadow 0.3s;
}

.floating-badge:hover {
    transform: scale(1.2) !important;
    box-shadow: 0 0 24px var(--accent-glow);
}

.badge-js { top: 10%; right: -10%; background: rgba(247, 223, 30, 0.15); color: #f7df1e; animation-delay: 0s; }
.badge-py { bottom: 10%; left: -10%; background: rgba(55, 118, 171, 0.15); color: #3776ab; animation-delay: 1.5s; }
.badge-java { top: 60%; right: -15%; background: rgba(240, 146, 61, 0.15); color: var(--accent-orange); animation-delay: 3s; font-size: 1.2rem; }
.badge-html { top: -5%; left: 5%; background: rgba(227, 76, 38, 0.15); color: #e34c26; animation-delay: 4.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-14px) rotate(5deg); }
    66% { transform: translateY(8px) rotate(-3deg); }
}

.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 2;
    animation: scroll-fade 2s ease-in-out infinite;
}

@keyframes scroll-fade {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) translateY(0); }
    50% { opacity: 1; transform: translateX(-50%) translateY(-4px); }
}

.mouse {
    width: 24px;
    height: 38px;
    border: 2px solid var(--text-muted);
    border-radius: 12px;
    position: relative;
}

.mouse-wheel {
    width: 3px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll-wheel 2s infinite;
}

@keyframes scroll-wheel {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(14px); }
}

/* ============================
   SECTIONS
   ============================ */
.section {
    padding: 120px 0;
    position: relative;
    z-index: 2;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-primary);
    margin-bottom: 16px;
    font-weight: 500;
    letter-spacing: 1px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 16px;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    margin-bottom: 24px;
}

.section-divider {
    width: 80px;
    height: 3px;
    background: var(--gradient-primary);
    margin: 0 auto;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.section-divider::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, white, transparent);
    animation: divider-shine 3s ease-in-out infinite;
}

@keyframes divider-shine {
    0% { transform: translateX(-100%); }
    50%, 100% { transform: translateX(100%); }
}

/* ============================
   ABOUT
   ============================ */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.about-lead {
    font-size: 1.15rem;
    line-height: 1.8;
    margin-bottom: 16px;
}

.about-lead strong { color: var(--accent-ice); }
.about-text p { color: var(--text-secondary); margin-bottom: 16px; }
.about-text p strong { color: var(--text-primary); }

.about-highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 32px;
}

.highlight {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.highlight::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(91, 168, 245, 0.06), transparent);
    opacity: 0;
    transition: opacity 0.4s;
}

.highlight:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), var(--shadow-glow);
}

.highlight:hover::before { opacity: 1; }

.highlight-icon { font-size: 1.5rem; line-height: 1; position: relative; z-index: 1; }
.highlight div { position: relative; z-index: 1; }
.highlight strong { display: block; font-size: 0.9rem; margin-bottom: 2px; }
.highlight span { font-size: 0.8rem; color: var(--text-muted); }

/* Terminal */
.terminal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: calc(var(--nav-height) + 24px);
    transition: all 0.4s;
}

.terminal:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--border-hover);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.terminal-dots { display: flex; gap: 7px; }

.terminal-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: transform 0.3s;
    cursor: pointer;
}

.terminal-dots span:hover { transform: scale(1.3); }

.terminal-dots span:nth-child(1) { background: #ff5f57; }
.terminal-dots span:nth-child(2) { background: #febc2e; }
.terminal-dots span:nth-child(3) { background: #28c840; }

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.terminal-body { padding: 24px; overflow-x: auto; }

.terminal-body pre {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
}

.terminal-body .code-line {
    display: block;
    opacity: 0;
    animation: type-in 0.4s forwards;
}

@keyframes type-in {
    from { opacity: 0; transform: translateX(-8px); filter: blur(2px); }
    to { opacity: 1; transform: translateX(0); filter: blur(0); }
}

.code-keyword { color: #c678dd; }
.code-var { color: #e5c07b; }
.code-prop { color: #e06c75; }
.code-string { color: #98c379; }
.code-number { color: #d19a66; }
.code-method { color: #61afef; }

/* ============================
   SKILLS
   ============================ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.skill-card {
    padding: 28px 24px;
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, var(--accent-glow), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.skill-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(91, 168, 245, 0.04) 40%, rgba(168, 223, 240, 0.06) 50%, rgba(91, 168, 245, 0.04) 60%, transparent 70%);
    transform: rotate(0deg);
    transition: transform 0.8s;
    pointer-events: none;
}

.skill-card:hover::after { transform: rotate(180deg); }

.skill-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), var(--shadow-glow);
}

.skill-card:hover::before { opacity: 1; }

.skill-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--accent-primary);
    position: relative;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s;
}

.skill-card:hover .skill-icon {
    transform: scale(1.15) rotateY(180deg);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.skill-icon svg { width: 100%; height: 100%; }

.skill-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
    position: relative;
}

.skill-bar {
    height: 4px;
    background: rgba(91, 168, 245, 0.12);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.skill-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.skill-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    width: 8px;
    height: 8px;
    background: var(--accent-frost);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent-glow);
    opacity: 0;
    transition: opacity 0.3s;
}

.skill-fill.animated { width: var(--fill-width); }

.skill-fill.animated::after {
    opacity: 1;
    animation: skill-glow 1.5s ease-in-out infinite;
}

@keyframes skill-glow {
    0%, 100% { box-shadow: 0 0 8px var(--accent-glow); }
    50% { box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(91, 168, 245, 0.1); }
}

/* ============================
   PORTFOLIO
   ============================ */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(91, 168, 245, 0.06), transparent 60%);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s;
    border-radius: var(--radius-lg);
}

.project-card:hover::before { opacity: 1; }

.project-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-8px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), 0 0 40px rgba(91, 168, 245, 0.08);
}

.project-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
    filter: brightness(0.7);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 23, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s;
    backdrop-filter: blur(4px);
}

.project-card:hover .project-overlay { opacity: 1; }

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-radius: var(--radius-xl);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    transform: translateY(10px);
    opacity: 0;
}

.project-card:hover .project-link {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.project-link:hover {
    background: var(--accent-secondary);
    color: var(--bg-primary);
    transform: scale(1.05) !important;
}

.project-link.no-link {
    background: rgba(91, 168, 245, 0.15);
    color: var(--text-secondary);
    cursor: default;
}

.project-link.no-link:hover { transform: translateY(0) !important; }

.project-info { padding: 24px; position: relative; z-index: 2; }

.project-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    transition: color 0.3s;
}

.project-card:hover .project-info h3 { color: var(--accent-ice); }

.project-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.project-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.project-tags span {
    padding: 4px 12px;
    background: rgba(91, 168, 245, 0.08);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    color: var(--accent-ice);
    font-weight: 500;
    transition: all 0.3s;
}

.project-tags span:hover {
    background: rgba(91, 168, 245, 0.15);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

/* More Projects */
.portfolio-more { margin-top: 48px; }

.more-card {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 48px;
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.4s;
    position: relative;
    overflow: hidden;
}

.more-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(91, 168, 245, 0.05), transparent, rgba(168, 223, 240, 0.03));
    opacity: 0;
    transition: opacity 0.4s;
}

.more-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-glow); }
.more-card:hover::before { opacity: 1; }

.more-icon {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(91, 168, 245, 0.1);
    border: 2px solid var(--border-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent-primary);
    position: relative;
    z-index: 1;
    animation: more-pulse 3s ease-in-out infinite;
}

@keyframes more-pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50% { box-shadow: 0 0 0 12px rgba(91, 168, 245, 0); }
}

.more-text { position: relative; z-index: 1; }
.more-text h3 { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; }
.more-text p { color: var(--text-secondary); margin-bottom: 20px; line-height: 1.7; }
.more-text p strong { color: var(--text-primary); }

/* ============================
   TESTIMONIALS
   ============================ */
.testimonials-track-wrapper {
    overflow: hidden;
    margin: 0 -24px;
    padding: 20px 0;
    mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
}

.testimonials-track {
    display: flex;
    gap: 24px;
    animation: scroll-track 40s linear infinite;
    width: fit-content;
}

.testimonials-track:hover { animation-play-state: paused; }

@keyframes scroll-track {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.testimonial-card {
    padding: 32px;
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.4s;
    position: relative;
    min-width: 380px;
    max-width: 420px;
    flex-shrink: 0;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 4rem;
    font-weight: 900;
    color: rgba(91, 168, 245, 0.08);
    line-height: 1;
    font-family: Georgia, serif;
}

.testimonial-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.testimonial-stars {
    color: #fbbf24;
    font-size: 1.1rem;
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.testimonial-card > p {
    color: var(--text-secondary);
    font-size: 0.93rem;
    line-height: 1.7;
    margin-bottom: 20px;
    font-style: italic;
}

.testimonial-author { display: flex; align-items: center; gap: 12px; }

.author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.author-avatar img { width: 100%; height: 100%; object-fit: cover; }

.testimonial-author strong { display: block; font-size: 0.9rem; }
.testimonial-author span { font-size: 0.8rem; color: var(--text-muted); }

.testimonials-cta { text-align: center; margin-top: 40px; }

/* ============================
   CONTACT
   ============================ */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.contact-card {
    padding: 36px 32px;
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-primary);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: conic-gradient(from 0deg, var(--accent-primary), var(--accent-frost), var(--accent-primary), transparent, var(--accent-primary));
    border-radius: calc(var(--radius-lg) + 2px);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s;
    animation: border-spin 4s linear infinite;
}

@keyframes border-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.contact-card::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: var(--bg-card);
    border-radius: calc(var(--radius-lg) - 1px);
    z-index: -1;
}

.contact-card:hover::before { opacity: 1; }

.contact-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3), 0 0 40px rgba(91, 168, 245, 0.1);
    color: var(--text-primary);
}

.contact-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: transform 0.4s;
}

.contact-card:hover .contact-icon { transform: scale(1.15) rotate(8deg); }

.contact-icon svg { width: 32px; height: 32px; }

.fiverr-icon { background: rgba(27, 190, 66, 0.12); color: #1bbe42; }
.discord-icon { background: rgba(88, 101, 242, 0.12); color: #5865f2; }
.dm-icon { background: rgba(91, 168, 245, 0.12); color: var(--accent-primary); }

.contact-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }

.contact-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.contact-action {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-primary);
    transition: all 0.3s;
}

.contact-card:hover .contact-action { letter-spacing: 1px; }

.discord-username {
    font-family: var(--font-mono);
    padding: 6px 16px;
    background: rgba(91, 168, 245, 0.08);
    border-radius: var(--radius-xl);
    font-size: 0.95rem;
    user-select: all;
}

/* ============================
   FOOTER
   ============================ */
.footer {
    padding: 48px 0;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 2;
}

.footer-content { text-align: center; }

.footer-logo {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 12px;
    display: inline-block;
}

.footer-content > p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }

.footer-links { display: flex; gap: 24px; justify-content: center; margin-bottom: 24px; }

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
}

.footer-links a:hover { color: var(--accent-primary); }

.footer-copy { font-size: 0.8rem; color: var(--text-muted); }

/* ============================
   MINI GAME
   ============================ */
.game-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.game-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 7;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #0b1628 0%, #0f1e36 60%, #15293e 100%);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(91, 168, 245, 0.06);
    transition: border-color 0.4s, box-shadow 0.4s;
}

.game-container:hover,
.game-container:focus-within {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.game-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 14, 23, 0.75);
    backdrop-filter: blur(8px);
    z-index: 5;
    transition: opacity 0.5s, visibility 0.5s;
}

.game-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.game-overlay-content {
    text-align: center;
}

.game-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: avatar-float 3s ease-in-out infinite;
}

.game-overlay-content h3 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-overlay-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.game-best {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(91, 168, 245, 0.08);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.game-best strong {
    color: var(--accent-ice);
    font-family: var(--font-mono);
}

.game-hud {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    z-index: 4;
    pointer-events: none;
}

.game-hud-item {
    display: flex;
    flex-direction: column;
    padding: 6px 14px;
    background: rgba(10, 14, 23, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.game-hud-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.game-hud-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-frost);
    font-family: var(--font-mono);
}

.game-controls-hint {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.game-controls-hint kbd {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0 2px;
}

@media (max-width: 768px) {
    .game-container { aspect-ratio: 16 / 9; }
    .game-icon { font-size: 2.5rem; }
    .game-overlay-content h3 { font-size: 1.3rem; }
    .game-controls-hint { flex-direction: column; align-items: center; gap: 8px; }
}

/* ============================
   REVEAL ANIMATIONS
   ============================ */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--delay, 0s);
}

.reveal-up.visible { opacity: 1; transform: translateY(0); }

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--delay, 0s);
}

.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--delay, 0s);
}

.reveal-right.visible { opacity: 1; transform: translateX(0); }

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--delay, 0s);
}

.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* ============================
   RESPONSIVE - TABLET
   ============================ */
@media (max-width: 1024px) {
    .hero-content { grid-template-columns: 1fr; text-align: center; gap: 40px; }
    .hero-text { order: 2; }
    .hero-image { order: 1; }
    .hero-badge { margin: 0 auto 24px; }
    .hero-desc { margin: 0 auto 32px; }
    .hero-buttons { justify-content: center; }
    .hero-stats { justify-content: center; }
    .avatar-wrapper { width: 260px; height: 260px; }
    .about-grid { grid-template-columns: 1fr; }
    .terminal { position: static; }
    .more-card { flex-direction: column; text-align: center; padding: 36px; }
    .portfolio-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .testimonial-card { min-width: 320px; }
}

/* ============================
   RESPONSIVE - MOBILE
   ============================ */
@media (max-width: 768px) {
    :root { --nav-height: 64px; }
    .cursor-glow, #cursorTrailCanvas { display: none; }
    body, a, button, .btn, input, textarea, select, [role="button"] { cursor: auto !important; }
    .nav-toggle { display: flex; }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        flex-direction: column;
        background: var(--bg-secondary);
        border-left: 1px solid var(--border);
        padding: 100px 32px 32px;
        gap: 4px;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 999;
        box-shadow: var(--shadow-lg);
    }

    .nav-links.open { right: 0; }
    .nav-links a { padding: 12px 16px; font-size: 1rem; width: 100%; }
    .nav-links a::after { display: none; }

    .section { padding: 80px 0; }
    .section-title { font-size: clamp(1.8rem, 5vw, 2.5rem); }
    .hero { padding-top: calc(var(--nav-height) + 20px); }
    .hero-name { font-size: clamp(2.5rem, 8vw, 3.5rem); }
    .hero-stats { gap: 24px; flex-wrap: wrap; }
    .stat-number { font-size: 1.6rem; }
    .avatar-wrapper { width: 200px; height: 200px; }
    .floating-badge { width: 38px; height: 38px; font-size: 0.7rem; }
    .about-highlights { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .skill-card { padding: 20px 16px; }
    .portfolio-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .project-image { height: 180px; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .btn { width: 100%; justify-content: center; max-width: 280px; }
    .testimonial-card { min-width: 300px; }
    .aurora-beam { width: 300px; height: 300px; }
}

@media (max-width: 400px) {
    .container { padding: 0 16px; }
    .hero-stats { flex-direction: column; align-items: center; gap: 16px; }
    .stat { align-items: center; }
    .skills-grid { grid-template-columns: repeat(2, 1fr); }
    .testimonial-card { min-width: 260px; padding: 24px; }
}

/* ============================
   SCROLLBAR
   ============================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }