* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark light; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; top: -48px; left: 8px; background: var(--accent); color: var(--on-accent); padding: .6rem 1rem; border-radius: var(--radius-sm); z-index: 999; }
.skip-link:focus { top: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@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; }
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.eyebrow { color: var(--info-text); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; margin-bottom: .7rem; font-family: var(--font-mono); }
.section-title { font-size: clamp(1.6rem, 3.4vw, 2.2rem); margin-bottom: .8rem; }
.section-sub { color: var(--text-soft); max-width: 560px; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(13,15,20,.75); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; max-width: 1080px; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }
.brand { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--text); }
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 1.8rem; font-size: .86rem; font-family: var(--font-mono); }
.nav-links a { text-decoration: none; color: var(--text-soft); }
.nav-links a:hover, .nav-links a.active { color: var(--info-text); }
.scroll-progress { position: absolute; top: 0; left: 0; height: 2px; width: 0%; background: var(--accent); transition: width .1s linear; }
.scroll-top-btn {
  position: fixed; right: 1.6rem; bottom: 1.6rem; width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-elevated); border: none; cursor: pointer; display: grid; place-items: center;
  opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .25s ease, transform .25s ease;
  color: var(--text); z-index: 60;
}
.scroll-top-btn.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.scroll-top-btn svg.ring { transition: stroke-dashoffset .1s linear; }
.scroll-top-btn .arrow { position: absolute; inset: 0; margin: auto; }
.nav-actions { display: flex; align-items: center; gap: .8rem; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-soft); cursor: pointer; }
.icon-btn:hover { color: var(--info-text); border-color: var(--accent); }
.nav-toggle { display: none; background: none; border: none; color: var(--text); width: 40px; height: 40px; place-items: center; }
@media (max-width: 780px) {
  .nav-links { position: fixed; inset: 62px 0 0 0; background: var(--bg); flex-direction: column; padding: 2rem 1.5rem; gap: 1.4rem; font-size: 1.1rem; transform: translateY(-110%); transition: transform .25s ease; z-index: 40; }
  .nav-links.open { transform: translateY(0); }
  .nav-toggle { display: block; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.4rem; border-radius: 10px; font-weight: 700; font-size: .86rem; cursor: pointer; border: 1px solid transparent; font-family: var(--font-mono); }
.btn-primary { background: var(--accent); color: #0d0f14; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-outline { background: none; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--info-text); }
.btn-sm { padding: .55rem 1rem; font-size: .8rem; }

/* Hero */
.hero { padding: 6rem 0 3rem; position: relative; overflow: hidden; }
.hero .eyebrow { display: flex; align-items: center; gap: .5rem; }
.hero .container { position: relative; z-index: 1; }
.gradient-mesh {
  position: absolute; inset: -20%; z-index: 0; opacity: .35; filter: blur(60px); pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, var(--accent) 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, #5851db 0%, transparent 40%),
    radial-gradient(circle at 60% 80%, var(--accent-2, var(--accent)) 0%, transparent 45%);
  animation: meshShift 18s ease-in-out infinite alternate;
}
@keyframes meshShift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-3%, 2%) scale(1.08); }
  100% { transform: translate(2%, -3%) scale(1.03); }
}
@media (prefers-reduced-motion: reduce) { .gradient-mesh { animation: none; } }

.availability-badge { display: flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; color: var(--success, #22c55e); background: rgba(34,197,94,.12); padding: .35rem .7rem; border-radius: 999px; }
.availability-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success, #22c55e); }

.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .8rem; }
.tech-item { display: flex; flex-direction: column; align-items: center; gap: .4rem; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem .5rem; text-align: center; transition: transform .15s ease, border-color .15s ease; }
.tech-item:hover { transform: translateY(-3px); border-color: var(--accent); }
.tech-item span { font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.tech-item small { font-size: .68rem; color: var(--text-faint); }
.hero .eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.2); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.15; margin-bottom: 1rem; }
.hero h1 .grad { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.role-line { font-family: var(--font-mono); font-size: 1.1rem; color: var(--text-soft); margin-bottom: 1.4rem; height: 1.6em; }
.role-line .cursor { display: inline-block; width: 2px; background: var(--accent); margin-left: 2px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero p.desc { color: var(--text-soft); max-width: 560px; margin-bottom: 2rem; }
.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.4rem; }
.github-stats { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.github-stat { font-family: var(--font-mono); font-size: .82rem; color: var(--text-faint); }
.github-stat strong { color: var(--text); font-size: 1rem; }

/* Code block */
.code-block { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-md); }
.code-bar { display: flex; gap: 6px; padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.code-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.code-body { padding: 1.2rem 1.4rem; font-family: var(--font-mono); font-size: .8rem; line-height: 1.8; overflow-x: auto; }
.code-body .kw { color: #a78bfa; } .code-body .str { color: #5eead4; } .code-body .com { color: var(--text-faint); } .code-body .fn { color: #f4a340; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem 2.5rem; }
@media (max-width: 700px) { .skills-grid { grid-template-columns: 1fr; } }
.skill-row { margin-bottom: .3rem; }
.skill-head { display: flex; justify-content: space-between; font-size: .84rem; margin-bottom: .4rem; font-family: var(--font-mono); }
.skill-bar { height: 7px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; }
.skill-bar .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; transition: width 1.1s cubic-bezier(.2,.7,.3,1); }

/* Timeline */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 2rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -2rem; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg); }
.timeline-item .when { font-family: var(--font-mono); font-size: .76rem; color: var(--info-text); margin-bottom: .3rem; }
.timeline-item h4 { font-size: 1rem; margin-bottom: .3rem; }
.timeline-item p { color: var(--text-soft); font-size: .86rem; }

/* Projects */
.filter-row { display: flex; gap: .6rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.filter-chip { padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elevated); font-size: .8rem; font-family: var(--font-mono); cursor: pointer; color: var(--text-soft); }
.filter-chip.active { border-color: var(--accent); color: var(--info-text); background: var(--accent-soft); }
.project-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 900px) { .project-gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .project-gallery { grid-template-columns: 1fr; } }
.project-tile { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.project-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.project-thumb { aspect-ratio: 1.3; background: linear-gradient(135deg, var(--bg-alt), var(--border)); display: grid; place-items: center; font-size: 2rem; }
.project-body { padding: 1.1rem 1.2rem; }
.project-body h3 { font-size: .95rem; margin-bottom: .4rem; }
.project-body p { color: var(--text-soft); font-size: .82rem; margin-bottom: .8rem; }
.project-tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.project-tags span { font-family: var(--font-mono); font-size: .68rem; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 6px; padding: .15rem .5rem; color: var(--text-faint); }

/* Testimonials */
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 900px) { .testi-grid { grid-template-columns: 1fr; } }
.testi-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.4rem; }
.testi-quote { font-size: .88rem; margin-bottom: 1rem; }
.testi-person { display: flex; align-items: center; gap: .7rem; }
.testi-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .76rem; }
.testi-name { font-weight: 700; font-size: .82rem; }
.testi-role { font-size: .72rem; color: var(--text-faint); }

/* Blog */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 900px) { .blog-grid { grid-template-columns: 1fr; } }
.blog-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.3rem; }
.blog-date { font-family: var(--font-mono); font-size: .72rem; color: var(--info-text); margin-bottom: .6rem; }
.blog-card h3 { font-size: .95rem; margin-bottom: .5rem; }
.blog-card p { color: var(--text-soft); font-size: .82rem; }

/* Contact form */
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.field label { font-size: .8rem; font-weight: 700; font-family: var(--font-mono); }
.field input, .field textarea { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .9rem; color: var(--text); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-error { color: var(--danger-text); font-size: .76rem; display: none; }
.field.invalid input, .field.invalid textarea { border-color: var(--danger-text); }
.field.invalid .field-error { display: block; }

.foot { border-top: 1px solid var(--border); padding: 2.5rem 0; text-align: center; color: var(--text-faint); font-size: .82rem; font-family: var(--font-mono); }

/* reveal */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
