@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg: #0B1220;
    --bg-elevated: #101A2C;
    --bg-card: #131D30;
    --line: rgba(148, 178, 214, 0.14);
    --line-strong: rgba(148, 178, 214, 0.28);
    --text: #E7EEF7;
    --text-dim: #93A2B8;
    --text-faint: #5C6A81;
    --accent: #5EEAD4;
    --accent-2: #F5B942;
    --accent-danger: #F26D6D;
    --accent-rgb: 94, 234, 212;
    --shadow: 0 20px 60px rgba(0,0,0,0.45);
    --radius: 14px;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

html[data-theme="light"] {
    --bg: #F3F5F9;
    --bg-elevated: #FFFFFF;
    --bg-card: #FFFFFF;
    --line: rgba(20, 30, 50, 0.10);
    --line-strong: rgba(20, 30, 50, 0.18);
    --text: #101724;
    --text-dim: #4B5A70;
    --text-faint: #8493A8;
    --accent: #0F9E8C;
    --accent-2: #B7791F;
    --accent-danger: #D64545;
    --accent-rgb: 15, 158, 140;
    --shadow: 0 20px 50px rgba(30,40,60,0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background .35s ease, color .35s ease;
    overflow-x: hidden;
}

::selection { background: rgba(var(--accent-rgb), 0.3); color: var(--text); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 32px;
}

.grid-backdrop {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 75%);
    opacity: .55;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.eyebrow {
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.eyebrow::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
    animation: pulse-dot 2.2s infinite ease-in-out;
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2); }
    50% { box-shadow: 0 0 0 7px rgba(var(--accent-rgb), 0.05); }
}

.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); }
.section-head p { color: var(--text-dim); margin-top: 14px; font-size: 16.5px; }

section { padding: 120px 0; position: relative; }
section.tight { padding: 90px 0; }

header.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    backdrop-filter: blur(14px) saturate(140%);
    background: linear-gradient(180deg, rgba(11,18,32,0.82), rgba(11,18,32,0.55));
    border-bottom: 1px solid transparent;
    transition: border-color .3s, background .3s;
}
html[data-theme="light"] header.nav { background: linear-gradient(180deg, rgba(243,245,249,0.88), rgba(243,245,249,0.6)); }
header.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 32px; max-width: 1180px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-weight: 500; font-size: 15px; }
.brand .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.7); transform: rotate(45deg); }
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a {
    font-size: 14px; color: var(--text-dim); padding: 8px 14px; border-radius: 8px;
    transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--line); }
.nav-links a.active { color: var(--accent); }

.theme-toggle {
    width: 42px; height: 42px; border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: var(--bg-card);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text);
    transition: border-color .2s, transform .2s;
}
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }
.icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: block; }

.nav-toggle-btn { display: none; }

.btn {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 13px 24px; border-radius: 10px;
    font-family: var(--font-body); font-weight: 600; font-size: 14.5px;
    border: 1px solid transparent; cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s, background .2s;
}
.btn-primary { background: var(--accent); color: #06131A; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(var(--accent-rgb), 0.35); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 9px 16px; font-size: 13px; }

.hero {
    min-height: 100vh;
    display: flex; align-items: center;
    padding-top: 120px; padding-bottom: 80px;
    position: relative;
}
.hero-grid {
    display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center;
}
.hero-greeting { font-family: var(--font-mono); color: var(--text-dim); font-size: 15px; margin-bottom: 10px; }
.hero h1 {
    font-size: clamp(38px, 5.4vw, 66px);
    line-height: 1.04;
    margin-bottom: 22px;
}
.hero h1 .accent-text { color: var(--accent); }
.role-line {
    font-family: var(--font-mono); font-size: 17px; color: var(--accent-2);
    height: 26px; margin-bottom: 22px; display: flex; align-items: center;
}
.role-line .caret { display: inline-block; width: 2px; height: 18px; background: var(--accent-2); margin-left: 3px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero p.summary { color: var(--text-dim); font-size: 17px; max-width: 520px; margin-bottom: 34px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 44px; }
.hero-meta { display: flex; gap: 28px; flex-wrap: wrap; }
.hero-meta div { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; }
.hero-meta strong { display: block; font-family: var(--font-display); font-size: 20px; color: var(--text); font-weight: 600; letter-spacing: 0; text-transform: none; margin-top: 4px; }

.node-panel {
    position: relative;
    aspect-ratio: 1/1;
    max-width: 480px;
    justify-self: center;
}
.node-panel svg { width: 100%; height: 100%; overflow: visible; }
.node-panel .avatar-ring {
    position: absolute; inset: 32%;
    border-radius: 26px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background: var(--bg-card);
    box-shadow: var(--shadow);
}
.node-panel .avatar-ring img { width: 100%; height: 100%; object-fit: cover; }
.node-panel .avatar-ring .avatar-fallback {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 15px; color: var(--text-faint); text-align: center; padding: 12px;
}

.link-path { stroke: var(--line-strong); stroke-width: 1.5; fill: none; stroke-dasharray: 4 5; }
.link-flow { stroke: var(--accent); stroke-width: 2; fill: none; stroke-dasharray: 6 260; stroke-dashoffset: 0; animation: flow 3.6s linear infinite; opacity: .9; }
@keyframes flow { to { stroke-dashoffset: -266; } }

.node {
    fill: var(--bg-card); stroke: var(--line-strong); stroke-width: 1.4;
}
.node-dot { fill: var(--accent); }
.node-label {
    font-family: var(--font-mono); font-size: 10.5px; fill: var(--text-dim);
}

.about-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 70px; align-items: start; }
.about-card {
    background: var(--bg-card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 28px;
}
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 22px; }
.stat-cell { background: var(--bg-card); padding: 20px; }
.stat-cell strong { display: block; font-family: var(--font-display); font-size: 30px; color: var(--accent); }
.stat-cell span { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; }

.about-body p { color: var(--text-dim); margin-bottom: 16px; font-size: 16px; }
.about-body strong { color: var(--text); font-weight: 600; }

.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 56px; }
.value-card {
    background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px; transition: transform .25s ease, border-color .25s ease;
}
.value-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.value-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: rgba(var(--accent-rgb), 0.12); color: var(--accent);
    display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.value-icon svg { width: 20px; height: 20px; }
.value-card h4 { font-size: 16.5px; margin-bottom: 8px; }
.value-card p { color: var(--text-dim); font-size: 14.5px; margin: 0; }

.skills-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px 56px; }
.skill-cat-title { font-family: var(--font-mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-2); margin-bottom: 18px; }
.skill-row { margin-bottom: 18px; }
.skill-row-top { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14.5px; }
.skill-row-top span:last-child { font-family: var(--font-mono); color: var(--text-faint); font-size: 12.5px; }
.skill-bar { height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.skill-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0%; transition: width 1.1s cubic-bezier(.2,.8,.2,1); }

.timeline { position: relative; padding-left: 34px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: var(--line-strong); }
.tl-item { position: relative; padding-bottom: 44px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -34px; top: 4px; width: 13px; height: 13px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.tl-item.current .tl-dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.2); }
.tl-date { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.tl-role { font-size: 19px; font-weight: 600; font-family: var(--font-display); margin-bottom: 2px; }
.tl-company { color: var(--accent); font-size: 14.5px; margin-bottom: 10px; }
.tl-desc { color: var(--text-dim); font-size: 15px; max-width: 640px; }
.badge-current {
    display: inline-block; margin-left: 10px; font-family: var(--font-mono); font-size: 10.5px;
    padding: 3px 8px; border-radius: 100px; background: rgba(var(--accent-rgb), 0.15); color: var(--accent); text-transform: uppercase;
}

.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.mini-block { margin-bottom: 30px; }
.mini-block h4 { font-size: 15px; margin-bottom: 3px; }
.mini-block .sub { color: var(--text-dim); font-size: 14px; }
.mini-block .yr { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }
.cert-list li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.cert-list li:last-child { border-bottom: none; }
.cert-year { font-family: var(--font-mono); color: var(--accent-2); font-size: 12.5px; min-width: 40px; }
.lang-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.lang-row .lang-name { min-width: 120px; font-size: 14.5px; font-weight: 500; }
.lang-row .skill-bar { flex: 1; }
.lang-row .lang-level { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); min-width: 130px; text-align: right; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.project-card {
    background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
    transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.project-card:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.project-thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card)); position: relative; overflow: hidden; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-thumb .no-image { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-faint); }
.project-thumb .no-image svg { width: 34px; height: 34px; opacity: .5; }
.project-status {
    position: absolute; top: 12px; left: 12px; font-family: var(--font-mono); font-size: 10.5px;
    padding: 4px 9px; border-radius: 100px; background: rgba(11,18,32,0.75); color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), 0.3); backdrop-filter: blur(6px); text-transform: uppercase;
}
.project-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.project-body h4 { font-size: 17.5px; margin-bottom: 8px; }
.project-body p { color: var(--text-dim); font-size: 14.5px; margin-bottom: 16px; flex: 1; }
.tech-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tech-pills span { font-family: var(--font-mono); font-size: 11px; padding: 4px 9px; border-radius: 6px; background: var(--line); color: var(--text-dim); }
.project-links { display: flex; gap: 16px; font-size: 13.5px; }
.project-links a { color: var(--accent); display: inline-flex; align-items: center; gap: 5px; }
.project-links a:hover { text-decoration: underline; }

.contact-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 60px; }
.contact-info-list li { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.contact-info-list .ci-icon { width: 38px; height: 38px; border-radius: 9px; background: var(--bg-card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--accent); flex-shrink: 0; }
.contact-info-list .ci-icon svg { width: 17px; height: 17px; }
.contact-info-list .ci-label { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.contact-info-list .ci-value { font-size: 15px; margin-top: 2px; }
.social-row { display: flex; gap: 10px; margin-top: 28px; }
.social-row a {
    width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line-strong);
    display: flex; align-items: center; justify-content: center; color: var(--text-dim);
    transition: border-color .2s, color .2s, transform .2s;
}
.social-row a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.social-row a svg { width: 18px; height: 18px; }

.form-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.field label { display: block; font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-bottom: 8px; }
.field input, .field textarea {
    width: 100%; padding: 12px 14px; border-radius: 9px; border: 1px solid var(--line-strong);
    background: var(--bg-elevated); color: var(--text); font-family: var(--font-body); font-size: 14.5px;
    transition: border-color .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 13px; color: var(--text-faint); margin-top: 14px; }
#form-status { margin-top: 14px; font-size: 14px; display: none; }
#form-status.ok { color: var(--accent); display: block; }
#form-status.err { color: var(--accent-danger); display: block; }

footer.site-footer { padding: 44px 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.footer-inner p { font-size: 13.5px; color: var(--text-faint); margin: 0; }
.footer-inner .fmono { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

#scroll-progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--accent); z-index: 200; width: 0%; box-shadow: 0 0 10px rgba(var(--accent-rgb), .6); }

@media (max-width: 980px) {
    .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
    .node-panel { max-width: 320px; margin-top: 20px; }
    .values-grid { grid-template-columns: repeat(2, 1fr); }
    .skills-cols { grid-template-columns: 1fr; }
    .edu-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .container { padding: 0 20px; }
    section { padding: 80px 0; }
    .nav-links { position: fixed; top: 74px; left: 0; right: 0; background: var(--bg-elevated); flex-direction: column; align-items: stretch; padding: 12px; border-bottom: 1px solid var(--line); transform: translateY(-140%); transition: transform .3s ease; gap: 2px; }
    .nav-links.open { transform: translateY(0); }
    .nav-links a { padding: 12px 14px; }
    .nav-toggle-btn { display: flex; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg-card); align-items: center; justify-content: center; cursor: pointer; color: var(--text); }
    .values-grid { grid-template-columns: 1fr; }
    .hero-meta { gap: 20px; }
    .form-row { grid-template-columns: 1fr; }
}
