/* === Custom Properties === */
:root {
    --bg: #090e1a;
    --bg-nav: rgba(9, 14, 26, 0.95);
    --bg-card: #0f1629;
    --bg-card-hover: #141d33;
    --border: #1a2540;
    --border-bright: #243355;
    --text: #e2e8f0;
    --text-muted: #8892a4;
    --text-dim: #4a5568;
    --accent: #00d4ff;
    --accent-dim: rgba(0, 212, 255, 0.08);
    --accent-glow: rgba(0, 212, 255, 0.3);
    --accent2: #6366f1;
    --green: #3fb950;
    --yellow: #f0b429;
    --radius: 8px;
    --radius-lg: 12px;
    --nav-height: 64px;
    --transition: 0.2s ease;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }
ul { list-style: none; }

/* === Typography === */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; }
p + p { margin-top: 1rem; }

/* === Navbar === */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
}
.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: 0.05em;
}
.nav-logo .accent { color: var(--accent); }
.nav-links {
    display: flex;
    gap: 0.25rem;
}
.nav-links a {
    color: var(--text-muted);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
}
.nav-links a:hover { color: var(--text); background: var(--accent-dim); }
.nav-links a.active { color: var(--accent); background: var(--accent-dim); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: all var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* === Layout === */
main { padding-top: var(--nav-height); }
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
.section { padding: 3.5rem 0; }

/* === Section Titles === */
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 0.5rem; }
.section-title span { color: var(--accent); }
.section-divider {
    width: 48px;
    height: 3px;
    background: linear-gradient(to right, var(--accent), var(--accent2));
    border-radius: 2px;
    margin: 0.75rem 0 2rem;
}
.section-subtitle { color: var(--text-muted); margin-bottom: 2rem; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    font-family: inherit;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: #33ddff; color: #000; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border-bright); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.card:hover {
    border-color: var(--border-bright);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* === Hero === */
.hero {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 4rem 2rem;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(0, 212, 255, 0.07) 1px, transparent 0);
    background-size: 40px 40px;
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 200px;
    background: linear-gradient(to top, var(--bg), transparent);
    pointer-events: none;
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 820px;
    margin: 0 auto;
}
.hero-label {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    margin-bottom: 1.25rem;
    display: block;
}
.hero h1 {
    font-size: clamp(2.2rem, 6vw, 4rem);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
.hero-typing {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    color: var(--accent);
    margin-bottom: 1.75rem;
    min-height: 2em;
    display: flex;
    align-items: center;
    gap: 2px;
}
.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--accent);
    animation: blink 1s step-end infinite;
    margin-left: 2px;
    vertical-align: middle;
    flex-shrink: 0;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.hero-bio {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.85;
    max-width: 660px;
    margin-bottom: 2.5rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* === About Section === */
.about-text { max-width: 820px; }
.about-text p { color: var(--text-muted); line-height: 1.85; font-size: 1rem; }

/* === Interests Grid === */
.interests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}
.interest-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition);
}
.interest-card:hover {
    border-color: var(--border-bright);
    transform: translateY(-2px);
}
.interest-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.interest-card h3 { font-size: 0.95rem; color: var(--accent); font-weight: 600; margin-bottom: 0.4rem; }
.interest-card p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }

/* === Timeline === */
.timeline { position: relative; padding-left: 2.5rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--accent2), transparent);
    border-radius: 2px;
}
.timeline-item { position: relative; margin-bottom: 3rem; }
.timeline-dot {
    position: absolute;
    left: -2.85rem;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border-bright);
    transition: border-color var(--transition);
}
.timeline-item.current .timeline-dot {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
    animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(0, 212, 255, 0.08); }
}
.timeline-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}
.timeline-company { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.timeline-location { font-size: 0.8rem; color: var(--text-dim); font-family: var(--font-mono); margin-top: 0.15rem; }
.timeline-role { font-size: 1rem; color: var(--accent); font-weight: 500; margin-bottom: 0.85rem; }
.timeline-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.timeline-badge.current { color: #000; background: var(--accent); }
.timeline-badge.dates { color: var(--text-muted); background: var(--bg-card); border: 1px solid var(--border); font-weight: 400; }
.timeline-body {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.5rem 1.5rem 1.75rem;
}
.timeline-body ul { display: flex; flex-direction: column; gap: 0.65rem; }
.timeline-body li {
    color: var(--text-muted);
    padding-left: 1.25rem;
    position: relative;
    font-size: 0.93rem;
    line-height: 1.65;
}
.timeline-body li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 0.72rem;
    top: 0.22em;
}

/* === Education / Patent Cards === */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
    transition: border-color var(--transition);
}
.info-card:hover { border-color: var(--border-bright); }
.info-card-icon { font-size: 2rem; flex-shrink: 0; line-height: 1; }
.info-card-title { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.info-card-sub { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.3rem; }
.info-card-detail { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); margin-top: 0.3rem; }

/* === Skills === */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}
.skill-category-title {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-tag {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    transition: all var(--transition);
    cursor: default;
}
.skill-tag:hover { transform: translateY(-1px); }
.skill-tag.lang { color: #a78bfa; background: rgba(167, 139, 250, 0.08); border: 1px solid rgba(167, 139, 250, 0.2); }
.skill-tag.lang:hover { background: rgba(167, 139, 250, 0.15); border-color: #a78bfa; }
.skill-tag.cloud { color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(0, 212, 255, 0.2); }
.skill-tag.cloud:hover { background: rgba(0, 212, 255, 0.15); border-color: var(--accent); }
.skill-tag.tool { color: var(--green); background: rgba(63, 185, 80, 0.08); border: 1px solid rgba(63, 185, 80, 0.2); }
.skill-tag.tool:hover { background: rgba(63, 185, 80, 0.15); border-color: var(--green); }
.skill-tag.concept { color: var(--yellow); background: rgba(240, 180, 41, 0.08); border: 1px solid rgba(240, 180, 41, 0.2); }
.skill-tag.concept:hover { background: rgba(240, 180, 41, 0.15); border-color: var(--yellow); }

/* === Projects === */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    transition: all var(--transition);
}
.project-card:hover {
    border-color: var(--border-bright);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.project-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.project-name { font-size: 0.98rem; font-weight: 600; color: var(--text); font-family: var(--font-mono); }
.project-link {
    color: var(--text-dim);
    transition: color var(--transition);
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
    padding: 2px;
}
.project-link:hover { color: var(--accent); }
.project-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.65; flex: 1; }
.project-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: auto; }
.project-lang {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.lang-python  { background: #3572a5; }
.lang-cpp     { background: #f34b7d; }
.lang-arduino { background: #00979c; }
.lang-html    { background: #e34c26; }
.lang-c       { background: #555555; }
.lang-js      { background: #f1e05a; }
.lang-csharp  { background: #178600; }
.lang-other   { background: #8892a4; }
.project-stars { font-size: 0.8rem; color: var(--yellow); display: flex; align-items: center; gap: 0.3rem; }
.project-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    background: rgba(240, 180, 41, 0.1);
    color: var(--yellow);
    border: 1px solid rgba(240, 180, 41, 0.25);
}

/* === Contact === */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.25rem;
    max-width: 860px;
}
.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all var(--transition);
    color: var(--text);
}
.contact-card:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--text);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.contact-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    flex-shrink: 0;
    font-size: 1.4rem;
    transition: border-color var(--transition);
    color: var(--text-muted);
}
.contact-card:hover .contact-icon { border-color: var(--accent); color: var(--accent); }
.contact-label { font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.3rem; }
.contact-value { font-size: 0.95rem; font-weight: 500; }
.contact-static { cursor: default; }
.contact-static:hover { border-color: var(--border-bright); background: var(--bg-card); transform: none; box-shadow: none; }
.contact-static:hover .contact-icon { border-color: var(--border); color: var(--text-muted); }

/* === Footer === */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.82rem;
    font-family: var(--font-mono);
    margin-top: 2rem;
}
footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent); }
footer p + p { margin-top: 0.5rem; }

/* === Animations === */
.fade-in { opacity: 0; transform: translateY(18px); transition: opacity 0.55s ease, transform 0.55s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* === Utilities === */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-mono { font-family: var(--font-mono); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* === Responsive === */
@media (max-width: 768px) {
    .navbar { padding: 0 1.25rem; }
    .nav-toggle { display: flex; }
    .nav-links {
        position: absolute;
        top: var(--nav-height);
        left: 0; right: 0;
        background: var(--bg-nav);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.15rem;
        display: none;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 0.65rem 1rem; }

    .hero { padding: 3rem 1.25rem; min-height: auto; padding-top: 5rem; padding-bottom: 4rem; }
    .container { padding: 0 1.25rem; }
    .section { padding: 2.5rem 0; }

    .timeline { padding-left: 1.5rem; }
    .timeline-dot { left: -1.85rem; }
    .timeline-header { flex-direction: column; gap: 0.4rem; }

    .skills-grid { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .interests-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .interests-grid { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; }
    .btn { justify-content: center; }
}
