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

:root {
    --bg-primary: #0a0f0e;
    --bg-secondary: #0f1614;
    --bg-card: #121c19;
    --bg-card-hover: #182622;
    --border: #1e332d;
    --border-hover: #2d4f45;
    --text-primary: #e0f2ed;
    --text-secondary: #8faba3;
    --text-muted: #5e7d73;
    --accent: #00ab99;
    --accent-dark: #008073;
    --accent-light: #33c4b5;
    --accent-glow: rgba(0, 171, 153, 0.12);
    --accent-bg: #043c33;
    --mint: #b9fff7;
    --success: #34d399;
    --warning: #fbbf24;
    --gradient: linear-gradient(135deg, #008073, #00ab99, #33c4b5);
    --gradient-subtle: linear-gradient(135deg, rgba(0,171,153,0.08), rgba(0,128,115,0.04));
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1200px;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html { scroll-behavior: smooth; scroll-padding-top: 64px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::selection { background: var(--accent); color: #000; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent-dark); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== NAVIGATION ===== */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}
.nav.scrolled { box-shadow: 0 1px 0 var(--accent-dark); }

.nav-inner {
    max-width: var(--max-width); margin: 0 auto;
    padding: 0 2.5rem; height: 64px;
    display: flex; align-items: center; justify-content: space-between;
}

.nav-logo {
    font-family: var(--mono);
    font-size: 1rem; font-weight: 700;
    color: var(--accent); text-decoration: none;
    letter-spacing: 0.04em;
    display: flex; align-items: center; gap: 0.5rem;
}
.nav-logo::before {
    content: '~$'; color: var(--text-muted); font-weight: 400;
}

.nav-links { display: flex; gap: 0; list-style: none; }
.nav-links a {
    color: var(--text-muted); text-decoration: none;
    padding: 0.5rem 1.25rem; font-size: 0.8rem; font-weight: 500;
    letter-spacing: 0.06em; text-transform: uppercase;
    transition: var(--transition); position: relative;
    font-family: var(--mono);
}
.nav-links a::after {
    content: ''; position: absolute; bottom: 0; left: 1.25rem; right: 1.25rem;
    height: 2px; background: var(--accent);
    transform: scaleX(0); transform-origin: left;
    transition: transform var(--transition);
}
.nav-links a:hover,
.nav-links a.active { color: var(--text-primary); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.nav-toggle {
    display: none; background: none; border: 1px solid var(--border);
    color: var(--text-primary); cursor: pointer;
    padding: 0.4rem; width: 36px; height: 36px;
    align-items: center; justify-content: center;
}
.nav-toggle svg { width: 18px; height: 18px; }

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

.hero-bg {
    position: absolute; inset: 0; z-index: 0;
    background: radial-gradient(ellipse 60% 80% at 100% 50%, rgba(0,128,115,0.07), transparent);
}

.hero-grid {
    position: absolute; inset: 0; z-index: 0;
    background-image:
        linear-gradient(rgba(0,171,153,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,171,153,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

.hero-content {
    max-width: var(--max-width); margin: 0 auto;
    padding: 4rem 2.5rem; position: relative; z-index: 1;
    display: grid; grid-template-columns: 1fr auto;
    gap: 6rem; align-items: center;
    width: 100%;
}

.hero-text { max-width: 680px; }

.hero-eyebrow {
    font-family: var(--mono);
    font-size: 0.8rem; color: var(--accent);
    letter-spacing: 0.1em; margin-bottom: 1.5rem;
    display: flex; align-items: center; gap: 0.75rem;
}
.hero-eyebrow::before {
    content: ''; display: block; width: 32px; height: 1px; background: var(--accent);
}

.hero h1 {
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 900; line-height: 1.0;
    letter-spacing: -0.04em; margin-bottom: 0.5rem;
}
.hero h1 .name-line {
    display: block; color: var(--text-primary);
}
.hero h1 .gradient {
    display: block;
    background: var(--gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1.05rem; color: var(--text-secondary);
    line-height: 1.9; margin: 1.75rem 0 2.25rem;
    max-width: 540px;
    padding-left: 1.25rem;
    border-left: 2px solid var(--border);
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
    display: inline-flex; align-items: center; gap: 0.6rem;
    padding: 0.7rem 1.5rem;
    font-size: 0.8rem; font-weight: 700; text-decoration: none;
    transition: var(--transition); cursor: pointer;
    font-family: var(--mono); letter-spacing: 0.04em;
    text-transform: uppercase; border: none;
}
.btn-primary {
    background: var(--accent); color: #000;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}
.btn-primary:hover {
    background: var(--accent-light);
    box-shadow: 4px 4px 0 var(--accent-dark);
    transform: translate(-2px, -2px);
}

.btn-secondary {
    background: transparent; color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--accent); color: var(--accent-light);
    box-shadow: 4px 4px 0 var(--border);
    transform: translate(-2px, -2px);
}

.btn svg { width: 15px; height: 15px; }

/* Hero visual */
.hero-visual {
    display: flex; justify-content: center; align-items: center;
}
.hero-avatar-wrapper {
    position: relative; width: 280px; height: 280px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    padding: 4px;
    flex-shrink: 0;
}
.hero-avatar-wrapper::before { display: none; }
.hero-avatar-wrapper::after { display: none; }
.hero-avatar {
    width: 100%; height: 100%;
    object-fit: cover; border-radius: 50%;
    border: 4px solid var(--bg-primary);
    box-sizing: border-box;
}

.hero-stats {
    display: flex; gap: 2rem; margin-top: 2.5rem;
    padding-top: 2rem; border-top: 1px solid var(--border);
}
.stat-item { text-align: left; }
.stat-value {
    font-size: 2rem; font-weight: 900; font-family: var(--mono);
    color: var(--accent); letter-spacing: -0.03em;
}
.stat-label {
    font-size: 0.7rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.12em;
    font-family: var(--mono);
}

/* ===== SECTIONS ===== */
section { padding: 6rem 2rem; position: relative; }

.section-inner { max-width: var(--max-width); margin: 0 auto; }

.section-header {
    text-align: center; margin-bottom: 4rem;
}
.section-label {
    display: inline-block; font-size: 0.8rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--accent-light); margin-bottom: 0.75rem;
}
.section-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 800; letter-spacing: -0.02em;
    margin-bottom: 1rem;
}
.section-subtitle {
    font-size: 1.05rem; color: var(--text-secondary);
    max-width: 600px; margin: 0 auto;
}

/* ===== ABOUT ===== */
.about-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 4rem; align-items: start;
}
.about-text p {
    color: var(--text-secondary); margin-bottom: 1.25rem;
    font-size: 1.05rem; line-height: 1.8;
}
.about-text p:first-child::first-letter {
    font-size: 3rem; font-weight: 800; float: left;
    line-height: 1; margin-right: 0.5rem; margin-top: 0.1rem;
    background: var(--gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.about-details { display: flex; flex-direction: column; gap: 1.5rem; }

.detail-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem;
    transition: var(--transition);
}
.detail-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }

.detail-card-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--accent-glow); display: flex;
    align-items: center; justify-content: center;
    margin-bottom: 0.75rem; font-size: 1.25rem;
}
.detail-card h4 {
    font-size: 0.95rem; font-weight: 700; margin-bottom: 0.25rem;
}
.detail-card p {
    font-size: 0.85rem; color: var(--text-muted); line-height: 1.5;
}

/* ===== SKILLS ===== */
.skills-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.skill-category {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 2rem;
    transition: var(--transition);
}
.skill-category:hover { border-color: var(--border-hover); transform: translateY(-2px); }

.skill-category-header {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.skill-category-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.skill-category-icon.infra { background: rgba(0,171,153,0.12); }
.skill-category-icon.dev { background: rgba(34,211,238,0.12); }
.skill-category-icon.sec { background: rgba(244,63,94,0.12); }
.skill-category-icon.tools { background: rgba(251,191,36,0.12); }

.skill-category h3 { font-size: 1rem; font-weight: 700; }

.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-tag {
    padding: 0.35rem 0.75rem; border-radius: 6px;
    font-size: 0.8rem; font-weight: 500;
    background: var(--bg-secondary); border: 1px solid var(--border);
    color: var(--text-secondary); transition: var(--transition);
}
.skill-tag:hover { border-color: var(--accent); color: var(--accent-light); }

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

.project-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    transition: var(--transition); position: relative;
    cursor: pointer;
    display: flex; flex-direction: column;
}
.project-card:hover {
    border-color: var(--border-hover); transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    width: 100%; height: 200px; object-fit: cover;
    border-bottom: 1px solid var(--border);
}

.project-body {
    padding: 1.5rem;
    display: flex; flex-direction: column; flex: 1;
}

.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
.project-tag {
    padding: 0.25rem 0.625rem; border-radius: 6px;
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.04em;
}
.project-tag.infra { background: rgba(0,171,153,0.12); color: var(--accent-light); }
.project-tag.security { background: rgba(244,63,94,0.12); color: #f87171; }
.project-tag.iot { background: rgba(34,211,238,0.12); color: #22d3ee; }
.project-tag.dev { background: rgba(52,211,153,0.12); color: var(--success); }
.project-tag.hardware { background: rgba(251,191,36,0.12); color: var(--warning); }
.project-tag.k8s { background: rgba(139,92,246,0.12); color: #a78bfa; }

.project-card h3 {
    font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem;
}
.project-summary {
    font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7;
    margin-bottom: 1rem;
}
.project-read-more {
    font-size: 0.8rem; font-weight: 600; color: var(--accent);
    margin-bottom: 1rem;
    display: flex; align-items: center; gap: 0.35rem;
    transition: var(--transition);
}
.project-card:hover .project-read-more { color: var(--accent-light); gap: 0.5rem; }

.project-meta {
    display: flex; align-items: center; gap: 1rem;
    padding-top: 1rem; border-top: 1px solid var(--border);
    font-size: 0.8rem; color: var(--text-muted);
    margin-top: auto;
}
.project-meta span { display: flex; align-items: center; gap: 0.35rem; }

/* ===== PROJECT MODAL ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 2000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    align-items: center; justify-content: center;
    padding: 2rem;
    opacity: 0; transition: opacity 0.3s ease;
}
.modal-overlay.active { display: flex; opacity: 1; }

.modal {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 720px; width: 100%;
    max-height: 85vh; overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal { transform: translateY(0); }

.modal-close {
    position: sticky; top: 0; float: right;
    margin: 1rem; z-index: 10;
    background: var(--bg-primary); border: 1px solid var(--border);
    color: var(--text-secondary); cursor: pointer;
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    font-size: 1.1rem; line-height: 1;
}
.modal-close:hover { background: var(--accent-glow); color: var(--text-primary); border-color: var(--accent); }

.modal-image {
    width: 100%; height: 240px; object-fit: cover;
    border-bottom: 1px solid var(--border);
    cursor: zoom-in; transition: filter 0.2s ease;
}
.modal-image:hover { filter: brightness(1.1); }

.modal-body { padding: 2rem; }
.modal-body h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.75rem; }
.modal-body .project-tags { margin-bottom: 1.25rem; }
.modal-body p {
    font-size: 0.95rem; color: var(--text-secondary);
    line-height: 1.8; margin-bottom: 1rem;
}
.modal-body .project-meta {
    margin-top: 1.5rem;
}

/* Modal scrollbar */
.modal::-webkit-scrollbar { width: 6px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== LIGHTBOX ===== */
.lightbox-overlay {
    display: none; position: fixed; inset: 0; z-index: 3000;
    background: rgba(0, 0, 0, 0.92);
    align-items: center; justify-content: center;
    padding: 2rem; cursor: zoom-out;
    opacity: 0; transition: opacity 0.3s ease;
}
.lightbox-overlay.active { display: flex; opacity: 1; }

.lightbox-close {
    position: fixed; top: 1.25rem; right: 1.5rem; z-index: 3001;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    color: #fff; cursor: pointer;
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; line-height: 1;
    transition: var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

.lightbox-img {
    max-width: 90vw; max-height: 90vh;
    object-fit: contain; border-radius: 8px;
    cursor: default;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* ===== EXPERIENCE / TIMELINE ===== */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
    content: ''; position: absolute; left: 0; top: 0;
    bottom: 0; width: 2px; background: var(--border);
}
.timeline-item {
    position: relative; padding-bottom: 3rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: ''; position: absolute; left: -2rem;
    top: 6px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--accent);
    border: 3px solid var(--bg-primary);
    transform: translateX(-5px);
}
.timeline-date {
    font-size: 0.8rem; font-weight: 600; color: var(--accent-light);
    margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.timeline-item h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.25rem; }
.timeline-item h4 { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); margin-bottom: 0.75rem; }
.timeline-item p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; }

/* ===== CONTACT ===== */
.contact-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 3rem; align-items: start;
}

.contact-links { display: flex; flex-direction: column; gap: 1rem; }
.contact-link {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.5rem; border-radius: var(--radius);
    background: var(--bg-card); border: 1px solid var(--border);
    text-decoration: none; color: var(--text-primary);
    transition: var(--transition);
}
.contact-link:hover {
    border-color: var(--accent); transform: translateX(4px);
}
.contact-link-icon {
    width: 44px; height: 44px; border-radius: 10px;
    background: var(--accent-glow); display: flex;
    align-items: center; justify-content: center;
    font-size: 1.25rem; flex-shrink: 0;
}
.contact-link-text { font-weight: 600; font-size: 0.95rem; }
.contact-link-sub { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }

.contact-cta {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 2.5rem;
    text-align: center;
}
.contact-cta h4 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; }
.contact-cta p { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 0.95rem; }

/* ===== FOOTER ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
}
.footer-inner {
    max-width: var(--max-width); margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
}
.footer-text { font-size: 0.8rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a {
    color: var(--text-muted); text-decoration: none;
    font-size: 0.8rem; transition: var(--transition);
}
.footer-links a:hover { color: var(--accent-light); }

/* ===== DIVIDER ===== */
.section-divider {
    max-width: var(--max-width); margin: 0 auto;
    height: 1px; background: var(--border);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .hero-content { grid-template-columns: 1fr; gap: 3rem; }
    .hero-visual { display: none; }
    .hero-description { border-left: none; padding-left: 0; }
    .about-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nav-links {
        display: none; position: fixed; top: 64px; left: 0; right: 0;
        background: var(--bg-primary);
        flex-direction: column; padding: 1rem;
        border-bottom: 1px solid var(--border);
    }
    .nav-links.open { display: flex; }
    .nav-toggle { display: flex; }

    section { padding: 4rem 1.25rem; }
    .hero-content { padding: 3rem 1.25rem; }
    .hero-stats { gap: 1.5rem; flex-wrap: wrap; }

    .projects-grid { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: 1fr; }

    .modal { max-height: 90vh; }
    .modal-body { padding: 1.5rem; }
}

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

.stagger-1 { transition-delay: 0.08s; }
.stagger-2 { transition-delay: 0.16s; }
.stagger-3 { transition-delay: 0.24s; }
.stagger-4 { transition-delay: 0.32s; }
