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

:root {
    --bg: #050507;
    --bg-card: #0c0c10;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --text: #ffffff;
    --text-2: rgba(255,255,255,0.4);
    --text-3: rgba(255,255,255,0.2);
    --accent: #6366f1;
    --radius: 14px;
    --max-w: 1100px;
}

html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg); color: var(--text);
    line-height: 1.6; overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ===== Preloader ===== */
.preloader {
    position: fixed; inset: 0; z-index: 9999; background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-logo { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.02em; }
.preloader-bar { margin-top: 24px; width: 200px; height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; }
.preloader-bar-fill { height: 100%; width: 0%; background: var(--text); transition: width 0.1s linear; }

/* ===== Custom Cursor ===== */
.cursor {
    position: fixed; width: 20px; height: 20px;
    border: 1.5px solid rgba(255,255,255,0.3); border-radius: 50%;
    pointer-events: none; z-index: 9998;
    transform: translate(-50%, -50%); opacity: 0;
    transition: transform 0.15s ease, opacity 0.3s ease;
}
.cursor.visible { opacity: 1; }
.cursor.hover { transform: translate(-50%, -50%) scale(1.5); border-color: rgba(255,255,255,0.5); }
@media (max-width: 768px) { .cursor { display: none; } }

/* ===== Container ===== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ===== Header ===== */
.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 16px 0;
    background: rgba(5,5,7,0.8); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
}
.logo { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; }
.nav { display: flex; gap: 32px; }
.nav-link { font-size: 0.875rem; color: var(--text-2); transition: color 0.2s; }
.nav-link:hover { color: var(--text); }
.btn-telegram {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.875rem; font-weight: 500; padding: 8px 16px;
    border: 1px solid var(--border); border-radius: 8px; transition: border-color 0.2s, background 0.2s;
}
.btn-telegram:hover { border-color: var(--border-hover); background: rgba(255,255,255,0.03); }

.burger { display: none; background: none; border: none; cursor: pointer; width: 32px; height: 32px; position: relative; }
.burger span { display: block; width: 18px; height: 1.5px; background: var(--text); position: absolute; left: 7px; transition: all 0.3s; }
.burger span:first-child { top: 11px; }
.burger span:last-child { top: 19px; }
.burger.active span:first-child { transform: rotate(45deg); top: 15px; }
.burger.active span:last-child { transform: rotate(-45deg); top: 15px; }

@media (max-width: 768px) {
    .burger { display: block; }
    .nav {
        position: fixed; inset: 0; background: rgba(5,5,7,0.95); backdrop-filter: blur(20px);
        flex-direction: column; align-items: center; justify-content: center;
        gap: 32px; opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 99;
    }
    .nav.open { opacity: 1; visibility: visible; }
    .nav-link { font-size: 1.2rem; }
    .btn-telegram svg { display: none; }
}

/* ===== Hero ===== */
.hero {
    position: relative; min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    text-align: center; padding: 120px 24px 80px; overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.4; }
.hero-gradient {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(99,102,241,0.05), transparent);
    pointer-events: none;
}
.hero-orb { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; animation: orbFloat 8s ease-in-out infinite; }
.hero-orb--1 { width: 400px; height: 400px; top: 10%; left: -5%; background: rgba(99,102,241,0.07); }
.hero-orb--2 { width: 300px; height: 300px; bottom: 10%; right: -5%; background: rgba(236,72,153,0.05); animation-delay: -4s; }
@keyframes orbFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }

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

/* Hero items appear via CSS animation — no JS needed */
.hero-anim { opacity: 0; transform: translateY(20px); animation: heroIn 0.7s ease forwards; animation-delay: var(--d, 0s); }
@keyframes heroIn { to { opacity: 1; transform: none; } }

.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.78rem; font-weight: 500; color: var(--text-2);
    padding: 8px 16px; border: 1px solid var(--border); border-radius: 20px; margin-bottom: 28px;
}
.hero-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero-title { font-size: clamp(3.5rem, 10vw, 7rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin-bottom: 20px; }
.hero-subtitle { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text-2); max-width: 500px; margin: 0 auto 36px; line-height: 1.7; }
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-cta {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 30px; background: var(--text); color: var(--bg);
    font-size: 0.9rem; font-weight: 600; border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(255,255,255,0.1); }
.hero-cta-ghost {
    display: inline-flex; align-items: center; padding: 14px 28px;
    border: 1px solid var(--border); font-size: 0.9rem; font-weight: 500;
    color: var(--text-2); border-radius: 10px; transition: all 0.2s;
}
.hero-cta-ghost:hover { border-color: var(--border-hover); color: var(--text); }

.hero-stats { display: flex; justify-content: center; gap: 48px; margin-top: 56px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-number { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-label { font-size: 0.8rem; color: var(--text-2); }

.hero-scroll { position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%); }
.hero-scroll-line { width: 1px; height: 40px; background: var(--border); position: relative; overflow: hidden; }
.hero-scroll-line::after { content: ''; position: absolute; top: -100%; left: 0; width: 1px; height: 100%; background: var(--text); animation: scrollDown 2s linear infinite; }
@keyframes scrollDown { 0% { top: -100%; } 100% { top: 100%; } }

/* ===== Sections ===== */
.section { padding: 100px 0; }
.section-header { margin-bottom: 48px; }
.section-label { display: block; font-size: 0.72rem; font-weight: 600; color: var(--accent); letter-spacing: 0.08em; margin-bottom: 8px; }
.section-title { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 8px; }
.section-desc { font-size: 0.92rem; color: var(--text-2); }

/* ===== Featured Card ===== */
.featured-card {
    display: grid; grid-template-columns: 1fr 1fr;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; position: relative;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.featured-card:hover { border-color: var(--border-hover); box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.featured-card-glow {
    position: absolute; top: -50%; left: -20%; width: 60%; height: 200%;
    background: radial-gradient(ellipse, rgba(99,102,241,0.08), transparent 70%);
    pointer-events: none; opacity: 0; transition: opacity 0.5s;
}
.featured-card:hover .featured-card-glow { opacity: 1; }
.featured-card-left { padding: 36px; display: flex; flex-direction: column; }
.featured-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.7rem; font-weight: 600; color: #34d399; margin-bottom: 16px; }
.featured-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; animation: pulse 2s infinite; }
.featured-icon { font-size: 1.6rem; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 16px; }
.featured-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; }
.featured-desc { font-size: 0.85rem; color: var(--text-2); line-height: 1.6; margin-bottom: 20px; }
.featured-features { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; }
.featured-feat { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: rgba(255,255,255,0.5); }
.featured-feat span { color: #34d399; font-weight: 700; font-size: 0.75rem; }
.featured-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary { padding: 10px 22px; background: #fff; color: #000; font-size: 0.8rem; font-weight: 700; border-radius: 8px; transition: transform 0.2s, box-shadow 0.2s; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,255,255,0.1); }
.btn-ghost { padding: 10px 22px; border: 1px solid var(--border); color: var(--text-2); font-size: 0.8rem; font-weight: 600; border-radius: 8px; transition: all 0.2s; }
.btn-ghost:hover { border-color: rgba(255,255,255,0.2); color: #fff; }

/* Featured screen mock */
.featured-card-right { position: relative; display: flex; align-items: center; justify-content: center; background: #080810; overflow: hidden; }
.featured-screen { width: 85%; border-radius: 10px; border: 1px solid rgba(255,255,255,0.06); background: #0a0a12; overflow: hidden; }
.featured-screen-bar { display: flex; gap: 4px; padding: 8px 10px; background: rgba(255,255,255,0.03); }
.featured-screen-bar span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.1); }
.featured-screen-body { display: flex; min-height: 180px; }
.featured-sidebar { width: 36px; background: rgba(255,255,255,0.02); border-right: 1px solid rgba(255,255,255,0.04); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 6px; }
.fs-nav { width: 16px; height: 16px; border-radius: 4px; background: rgba(255,255,255,0.06); }
.fs-nav.active { background: rgba(99,102,241,0.3); }
.featured-screen-main { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.fs-row { height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; width: 70%; }
.fs-row.short { width: 45%; }
.fs-files { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.fs-file { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 6px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04); }
.fs-thumb { width: 24px; height: 24px; border-radius: 4px; background: rgba(99,102,241,0.15); }
.fs-thumb.t2 { background: rgba(236,72,153,0.12); }
.fs-thumb.t3 { background: rgba(16,185,129,0.12); }
.fs-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.fs-info div { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.06); }
.fs-info div:last-child { width: 55%; }
.fs-prog { height: 3px; width: 50px; border-radius: 2px; background: rgba(255,255,255,0.04); overflow: hidden; }
.fs-prog div { height: 100%; background: rgba(99,102,241,0.5); border-radius: 2px; }

/* Floating tags */
.floating-tag { position: absolute; z-index: 2; padding: 6px 12px; font-size: 0.68rem; font-weight: 600; background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 6px; color: var(--text-2); animation: tagFloat 3s ease-in-out infinite; }
.ft-1 { top: 20%; right: 8%; }
.ft-2 { bottom: 25%; right: 5%; animation-delay: 1s; }
.ft-3 { bottom: 15%; left: 5%; animation-delay: 2s; }
@keyframes tagFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ===== Projects Grid ===== */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.project-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; display: flex; flex-direction: column; gap: 12px;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.project-card:hover { transform: translateY(-4px); border-color: var(--border-hover); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.project-icon { font-size: 1.5rem; }
.project-title { font-size: 1.05rem; font-weight: 600; }
.project-desc { font-size: 0.85rem; color: var(--text-2); line-height: 1.5; flex: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 0.7rem; padding: 4px 10px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 6px; color: var(--text-2); }

/* ===== Marquee ===== */
.marquee-section { padding: 40px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow: hidden; }
.marquee-track { display: flex; gap: 32px; align-items: center; animation: marquee 30s linear infinite; white-space: nowrap; }
.marquee-track span { font-size: 1.1rem; font-weight: 600; color: var(--text-3); flex-shrink: 0; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ===== About ===== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.about-text p { font-size: 0.95rem; color: var(--text-2); margin-bottom: 16px; line-height: 1.7; }
.about-text p:last-child { margin-bottom: 0; }
.about-skills { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.skill-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; transition: border-color 0.3s, transform 0.3s; }
.skill-card:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.skill-card-icon { font-size: 1.2rem; margin-bottom: 10px; }
.skill-card h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 10px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.skill-tags span { font-size: 0.7rem; padding: 3px 8px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 5px; color: var(--text-3); }

/* ===== Process ===== */
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.process-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: border-color 0.3s, transform 0.3s; }
.process-card:hover { border-color: var(--border-hover); transform: translateY(-4px); }
.process-number { font-size: 2rem; font-weight: 900; color: var(--text-3); margin-bottom: 16px; }
.process-card h4 { font-size: 0.92rem; font-weight: 700; margin-bottom: 8px; }
.process-card p { font-size: 0.82rem; color: var(--text-2); line-height: 1.6; }

/* ===== Contact ===== */
.contact-block { text-align: center; padding: 80px 40px; position: relative; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.contact-glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 400px; height: 250px; background: radial-gradient(ellipse, rgba(99,102,241,0.06), transparent 70%); pointer-events: none; }
.contact-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.04em; margin-bottom: 16px; position: relative; }
.contact-desc { font-size: 0.95rem; color: var(--text-2); margin-bottom: 32px; position: relative; }
.btn-contact { display: inline-flex; align-items: center; gap: 10px; padding: 14px 32px; background: var(--text); color: var(--bg); font-size: 0.9rem; font-weight: 600; border-radius: 10px; transition: transform 0.2s, box-shadow 0.2s; position: relative; }
.btn-contact:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(255,255,255,0.1); }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); padding: 24px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
.footer-copy { font-size: 0.8rem; color: var(--text-3); }
.footer-link { font-size: 0.8rem; color: var(--text-2); transition: color 0.2s; }
.footer-link:hover { color: var(--text); }

/* ===== Reveal (scroll animation) ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .process-grid { grid-template-columns: repeat(2, 1fr); }
    .featured-card { grid-template-columns: 1fr; }
    .featured-card-right { min-height: 220px; padding: 24px; }
}
@media (max-width: 768px) {
    .projects-grid { grid-template-columns: 1fr; }
    .process-grid { grid-template-columns: 1fr; }
    .about-grid { grid-template-columns: 1fr; gap: 32px; }
    .about-skills { grid-template-columns: 1fr 1fr; }
    .hero-stats { gap: 32px; }
    .section { padding: 80px 0; }
}
@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero { padding: 100px 16px 60px; }
    .hero-stats { flex-direction: column; gap: 16px; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .about-skills { grid-template-columns: 1fr; }
}
