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

/* ===== CUSTOM PROPERTIES ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #0d1117;
    --bg-tertiary: #161b22;
    --accent-cyan: #00f5ff;
    --accent-green: #39ff14;
    --accent-purple: #bd00ff;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    --glass-bg: rgba(13, 17, 23, 0.6);
    --glass-border: rgba(0, 245, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --glow-cyan: 0 0 20px rgba(0, 245, 255, 0.3);
    --glow-green: 0 0 20px rgba(57, 255, 20, 0.3);
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-body: 'Inter', -apple-system, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
    --navbar-height: 70px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent-cyan); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-green); }

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--navbar-height);
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

::selection {
    background: rgba(0, 245, 255, 0.3);
    color: var(--text-primary);
}

a { color: var(--accent-cyan); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-green); }

/* ===== PARTICLES BACKGROUND ===== */
#tsparticles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== SECTION COMMON ===== */
.section {
    position: relative;
    padding: 100px 0;
    z-index: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title .prefix {
    color: var(--accent-green);
    -webkit-text-fill-color: var(--accent-green);
    margin-right: 8px;
}

.section-subtitle {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== GLASS CARD ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(0, 245, 255, 0.3);
    box-shadow: var(--glass-shadow), var(--glow-cyan);
    transform: translateY(-4px);
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: var(--navbar-height);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-logo .blink {
    animation: blink 1s step-end infinite;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    position: relative;
    padding: 4px 0;
    transition: var(--transition);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-cyan);
    transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-cyan);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--accent-cyan);
    transition: var(--transition);
    border-radius: 2px;
}

.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); }

/* ===== HERO ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

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

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
}

.hero-greeting {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent-green);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-greeting::before {
    content: '>';
    color: var(--accent-cyan);
}

.hero-name {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-cyan) 50%, var(--accent-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    cursor: default;
}

.hero-name:hover {
    animation: glitch 0.4s ease-in-out;
}

@keyframes glitch {
    0%   { transform: translate(0); }
    10%  { transform: translate(-3px, 2px); filter: hue-rotate(90deg); }
    20%  { transform: translate(3px, -2px); filter: hue-rotate(180deg); }
    30%  { transform: translate(-2px, -1px); filter: hue-rotate(270deg); }
    40%  { transform: translate(2px, 1px); filter: hue-rotate(0deg); }
    50%  { transform: translate(-1px, 2px); text-shadow: 3px 0 #00f5ff, -3px 0 #39ff14; }
    60%  { transform: translate(1px, -1px); text-shadow: -2px 0 #00f5ff, 2px 0 #39ff14; }
    70%  { transform: translate(0); text-shadow: none; }
    100% { transform: translate(0); text-shadow: none; }
}

.hero-typed-wrapper {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    min-height: 36px;
}

.hero-typed-wrapper .typed-cursor {
    color: var(--accent-cyan);
}

.hero-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 520px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.btn {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 12px 28px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), #0099cc);
    color: var(--bg-primary);
    font-weight: 600;
}

.btn-primary:hover {
    box-shadow: 0 0 30px rgba(0, 245, 255, 0.4);
    transform: translateY(-2px);
    color: var(--bg-primary);
}

.btn-outline {
    background: transparent;
    color: var(--accent-cyan);
    border: 1px solid var(--accent-cyan);
}

.btn-outline:hover {
    background: rgba(0, 245, 255, 0.1);
    box-shadow: var(--glow-cyan);
    transform: translateY(-2px);
    color: var(--accent-cyan);
}

.hero-socials {
    display: flex;
    gap: 20px;
}

.hero-socials a {
    font-size: 1.4rem;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
}

.hero-socials a:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
    transform: translateY(-3px);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    animation: float 2s ease-in-out infinite;
}

.scroll-indicator .mouse {
    width: 20px;
    height: 32px;
    border: 2px solid var(--text-muted);
    border-radius: 10px;
    position: relative;
}

.scroll-indicator .mouse::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 6px;
    background: var(--accent-cyan);
    border-radius: 2px;
    animation: scrollDown 1.5s ease-in-out infinite;
}

/* ===== ABOUT ===== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.about-bio { padding: 32px; }
.about-bio h3 {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--accent-cyan);
    margin-bottom: 16px;
}

.about-bio p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.8;
}

.about-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(57, 255, 20, 0.1);
    border: 1px solid rgba(57, 255, 20, 0.3);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-green);
    margin-top: 8px;
}

.about-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

.terminal-card {
    padding: 0;
    overflow: hidden;
    font-family: var(--font-mono);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--glass-border);
}

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

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 8px;
}

.terminal-body {
    padding: 20px;
}

.terminal-line {
    margin-bottom: 6px;
    font-size: 0.82rem;
    line-height: 1.7;
}

.terminal-line .prompt {
    color: var(--accent-green);
}

.terminal-line .command {
    color: var(--accent-cyan);
}

.terminal-line .key {
    color: var(--accent-purple);
}

.terminal-line .value {
    color: var(--text-secondary);
}

/* ===== SKILLS ===== */
.skills-section {
    position: relative;
}

#skills-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    opacity: 0.4;
}

.skills-content {
    position: relative;
    z-index: 1;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.skill-category {
    padding: 28px;
}

.skill-category h3 {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--accent-cyan);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-category h3::before {
    content: '//';
    color: var(--text-muted);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.skill-tag:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: rgba(0, 245, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.15);
    transform: translateY(-2px);
}

.skill-tag i {
    font-size: 1.2rem;
    color: var(--accent-cyan);
}

/* ===== EXPERIENCE TIMELINE ===== */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 60px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    height: 100%;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-green), transparent);
}

.timeline-line {
    position: absolute;
    left: 20px;
    top: 0;
    width: 2px;
    height: 0;
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-green));
    box-shadow: 0 0 10px var(--accent-cyan), 0 0 20px rgba(0, 245, 255, 0.2);
    transition: height 1.5s ease;
    z-index: 1;
}

.timeline-line.animate {
    height: 100%;
}

.timeline-item {
    position: relative;
    margin-bottom: 48px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -48px;
    top: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 3px solid var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.4);
    z-index: 2;
}

.timeline-card {
    padding: 28px;
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-green);
    margin-bottom: 8px;
}

.timeline-role {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-company {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-cyan);
    margin-bottom: 16px;
}

.timeline-list {
    list-style: none;
}

.timeline-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.timeline-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-cyan);
}

/* ===== PROJECTS ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

.project-card {
    padding: 32px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.project-icon {
    font-size: 2rem;
    margin-bottom: 16px;
    color: #00f5ff;
}

.project-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.project-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.7;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(0, 245, 255, 0.08);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 245, 255, 0.15);
}

/* ===== ACHIEVEMENTS ===== */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.stat-card {
    padding: 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
}

.stat-number {
    font-family: var(--font-mono);
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    color: #39ff14;
    opacity: 0.8;
}

/* ===== CONTACT ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: start;
}

.contact-form-card {
    padding: 0;
    overflow: hidden;
}

.form-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-green);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-label::before {
    content: '$';
    color: var(--accent-cyan);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    transition: var(--transition);
    outline: none;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent-cyan), #0099cc);
    color: var(--bg-primary);
    transition: var(--transition);
}

.btn-submit:hover {
    box-shadow: 0 0 30px rgba(0, 245, 255, 0.4);
    transform: translateY(-2px);
}

.contact-info-card {
    padding: 32px;
}

.contact-info-card h3 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent-cyan);
    margin-bottom: 24px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: var(--transition);
}

.contact-link:hover {
    color: var(--accent-cyan);
    padding-left: 8px;
}

.contact-link i,
.contact-link svg {
    font-size: 1.2rem;
    color: var(--accent-cyan);
    width: 20px;
    text-align: center;
}

/* ===== FOOTER ===== */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--glass-border);
}

.footer p {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

/* ===== CUSTOM CURSOR ===== */
.cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease;
    box-shadow: 0 0 12px var(--accent-cyan), 0 0 24px rgba(0, 245, 255, 0.3);
    mix-blend-mode: screen;
}

.cursor-trail {
    position: fixed;
    width: 4px;
    height: 4px;
    background: var(--accent-green);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
    box-shadow: 0 0 6px var(--accent-green);
    transition: opacity 0.3s ease;
}

/* ===== GRADIENT BORDER SWEEP ===== */
.glass-card {
    position: relative;
}

.glass-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, transparent 40%, var(--accent-cyan) 50%, transparent 60%);
    background-size: 300% 300%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.glass-card:hover::after {
    opacity: 0.3;
    animation: borderSweep 2s linear infinite;
}

@keyframes borderSweep {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

/* ===== TERMINAL SCANLINES ===== */
.terminal-body::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 245, 255, 0.02) 2px,
        rgba(0, 245, 255, 0.02) 4px
    );
    pointer-events: none;
    z-index: 1;
}

.terminal-body {
    position: relative;
}

/* ===== KEYFRAMES ===== */
@keyframes blink {
    50% { opacity: 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

@keyframes scrollDown {
    0% { transform: translateX(-50%) translateY(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(8px); opacity: 0; }
}

@keyframes glow-border {
    0%, 100% { border-color: rgba(0, 245, 255, 0.2); }
    50% { border-color: rgba(0, 245, 255, 0.5); }
}

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

/* ===== PRELOADER ===== */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.preloader.boot-fade-out {
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
}

.preloader-terminal {
    width: 100%;
    max-width: 820px;
    max-height: 85vh;
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid rgba(0, 245, 255, 0.15);
    border-radius: var(--border-radius);
    box-shadow:
        0 0 60px rgba(0, 245, 255, 0.08),
        0 0 120px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preloader-terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.preloader-terminal-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 8px;
    letter-spacing: 0.02em;
}

.preloader-terminal-body {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    scrollbar-width: none;
}

.preloader-terminal-body::-webkit-scrollbar {
    display: none;
}

/* Boot line animations */
.boot-line {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-all;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.boot-line.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Boot text color classes */
.boot-white { color: #e6edf3; }
.boot-muted { color: #6e7681; }
.boot-cyan { color: var(--accent-cyan); }
.boot-green { color: var(--accent-green); }
.boot-green-bold {
    color: var(--accent-green);
    font-weight: 700;
    text-shadow: 0 0 12px rgba(57, 255, 20, 0.4);
}
.boot-success {
    color: var(--accent-green);
    font-weight: 700;
    font-size: 0.88rem;
    text-shadow: 0 0 20px rgba(57, 255, 20, 0.5);
}

/* Badge highlights */
.boot-ok-badge {
    color: var(--accent-green);
    font-weight: 600;
}

.boot-info-badge {
    color: var(--accent-cyan);
    font-weight: 600;
}

.boot-ready-badge {
    color: var(--accent-green);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

.boot-warn-badge {
    color: #ffbd2e;
    font-weight: 600;
}

.boot-timestamp {
    color: #484f58;
}

.boot-checkmark {
    color: var(--accent-green);
    font-weight: 700;
}

.boot-progress-bar {
    color: var(--accent-green);
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.3);
    letter-spacing: -1px;
}

.boot-percent {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* Blinking cursor */
.boot-cursor {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent-green);
    animation: bootCursorBlink 0.7s step-end infinite;
    margin-left: 2px;
}

@keyframes bootCursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* CRT scanline overlay */
.preloader-scanlines {
    position: fixed;
    inset: 0;
    z-index: 10001;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 245, 255, 0.015) 2px,
        rgba(0, 245, 255, 0.015) 4px
    );
    opacity: 0.6;
    transition: opacity 0.6s ease;
}

/* Main content hidden state */
.main-content-hidden {
    opacity: 0;
    pointer-events: none;
}

.main-content-hidden.content-revealed {
    opacity: 1;
    pointer-events: auto;
    animation: contentReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes contentReveal {
    from {
        opacity: 0;
        filter: blur(4px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* Preloader responsive */
@media (max-width: 768px) {
    .preloader {
        padding: 16px;
    }

    .preloader-terminal {
        max-height: 75vh;
    }

    .preloader-terminal-body {
        padding: 14px 16px;
    }

    .boot-line {
        font-size: 0.68rem;
        line-height: 1.55;
    }
}

@media (max-width: 480px) {
    .boot-line {
        font-size: 0.62rem;
    }

    .preloader-terminal-body {
        padding: 12px 14px;
    }
}

/* ===== COMMAND PALETTE ===== */

/* Backdrop */
.cmd-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9990;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cmd-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

/* Palette Panel */
.cmd-palette {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%) scale(0.96);
    z-index: 9991;
    width: 580px;
    max-width: calc(100vw - 32px);
    max-height: 480px;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 245, 255, 0.18);
    border-radius: var(--border-radius);
    box-shadow:
        0 0 60px rgba(0, 245, 255, 0.1),
        0 24px 80px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s ease;
    overflow: hidden;
}

.cmd-palette.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* Search Bar */
.cmd-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 245, 255, 0.1);
    flex-shrink: 0;
}

.cmd-prompt {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-green);
    flex-shrink: 0;
}

.cmd-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    color: var(--text-primary);
    caret-color: var(--accent-cyan);
    letter-spacing: 0.01em;
}

.cmd-input::placeholder {
    color: var(--text-muted);
    font-style: normal;
}

.cmd-esc-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 3px 7px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    flex-shrink: 0;
    line-height: 1;
}

/* Command List */
.cmd-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 245, 255, 0.2) transparent;
}

.cmd-list::-webkit-scrollbar { width: 4px; }
.cmd-list::-webkit-scrollbar-track { background: transparent; }
.cmd-list::-webkit-scrollbar-thumb { background: rgba(0, 245, 255, 0.2); border-radius: 2px; }

/* Category Header */
.cmd-category {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 10px 20px 4px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    user-select: none;
}

/* Command Item */
.cmd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
    position: relative;
    border-left: 2px solid transparent;
}

.cmd-item:hover,
.cmd-item.active {
    background: rgba(0, 245, 255, 0.06);
    border-left-color: var(--accent-cyan);
}

.cmd-item.active {
    background: rgba(0, 245, 255, 0.1);
}

.cmd-item-icon {
    font-size: 0.85rem;
    color: var(--accent-cyan);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.cmd-item.active .cmd-item-icon,
.cmd-item:hover .cmd-item-icon {
    opacity: 1;
}

.cmd-item-label {
    font-family: var(--font-mono);
    font-size: 0.84rem;
    color: var(--text-secondary);
    transition: color 0.12s ease;
}

.cmd-item.active .cmd-item-label,
.cmd-item:hover .cmd-item-label {
    color: var(--text-primary);
}

.cmd-match {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* Recent dot indicator */
.cmd-recent-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    margin-left: auto;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(57, 255, 20, 0.5);
}

/* Empty state */
.cmd-empty {
    text-align: center;
    padding: 32px 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Footer Hints */
.cmd-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 10px 20px;
    border-top: 1px solid rgba(0, 245, 255, 0.08);
    flex-shrink: 0;
    user-select: none;
}

.cmd-footer span {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.cmd-footer kbd {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    line-height: 1;
}

/* Mobile FAB */
.cmd-fab {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 900;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(0, 245, 255, 0.3);
    background: rgba(13, 17, 23, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--accent-cyan);
    cursor: pointer;
    box-shadow:
        0 0 20px rgba(0, 245, 255, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
    align-items: center;
    justify-content: center;
}

.cmd-fab:hover {
    border-color: var(--accent-cyan);
    box-shadow:
        0 0 30px rgba(0, 245, 255, 0.35),
        0 4px 20px rgba(0, 0, 0, 0.5);
    transform: scale(1.08);
}

.cmd-fab:active {
    transform: scale(0.95);
}

.cmd-fab-icon {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

/* Toast (theme toggle message) */
.cmd-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 9992;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent-green);
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid rgba(57, 255, 20, 0.25);
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.1), 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
}

.cmd-toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.cmd-toast-prompt {
    color: var(--accent-cyan);
    font-weight: 700;
    margin-right: 6px;
}

.cmd-toast-blink {
    animation: bootCursorBlink 0.7s step-end infinite;
}

/* Ctrl+K badge in navbar */
.cmd-kbd-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(0, 245, 255, 0.06);
    border: 1px solid rgba(0, 245, 255, 0.15);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    flex-shrink: 0;
}

.cmd-kbd-hint:hover {
    border-color: rgba(0, 245, 255, 0.4);
    color: var(--accent-cyan);
    background: rgba(0, 245, 255, 0.1);
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.15);
}

.cmd-kbd-hint kbd {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    line-height: 1;
}

/* Command Palette responsive */
@media (max-width: 768px) {
    .cmd-fab {
        display: flex;
    }

    .cmd-kbd-hint {
        display: none;
    }

    .cmd-palette {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateY(20px);
        width: 100%;
        max-width: 100%;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
        border-bottom: none;
    }

    .cmd-palette.visible {
        transform: translateY(0);
    }

    .cmd-toast {
        bottom: 88px;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .about-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .hero-name { font-size: 2.8rem; }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0; right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(10, 10, 15, 0.97);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 24px;
        transition: right 0.4s ease;
        border-left: 1px solid var(--glass-border);
    }

    .nav-links.open { right: 0; }
    .nav-toggle { display: flex; }

    .hero-name { font-size: 2.2rem; }
    .hero-typed-wrapper { font-size: 1rem; }
    .section { padding: 60px 0; }
    .section-title { font-size: 1.7rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: 1fr; }

    #hero-canvas,
    #skills-canvas {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-name { font-size: 1.8rem; }
    .hero-cta { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
    .achievements-grid { grid-template-columns: 1fr 1fr; }
    .container { padding: 0 16px; }
}
