:root{
  --bg:        #F7F8FC;
  --bg-2:      #FFFFFF;
  --panel:     #FFFFFF;
  --panel-2:   #F1F3F9;
  --line:      #E3E7F0;
  --text:      #12162B;
  --muted:     #6B7280;
  --indigo:    #4F46E5;
  --violet:    #7C3AED;
  --glow:      rgba(79,70,229,0.18);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --sidebar-w: 280px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior:auto !important; }
}

*{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; }
body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a{ color: var(--indigo); text-decoration:none; }
a:hover{ text-decoration:underline; }
a.disabled-link{ pointer-events:none; opacity:0.5; cursor:default; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible{
  outline: 2px solid var(--indigo);
  outline-offset: 3px;
}

.wrap{ max-width: 880px; margin:0 auto; padding:0 32px; position:relative; z-index:1; }
section{ padding: 88px 0; position:relative; }
.section-inner{ position:relative; z-index:1; }

.eyebrow{
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--indigo);
  margin-bottom: 16px;
}
.eyebrow::before{ content:"◆ "; color: var(--violet); }

h1,h2,h3{ font-family: var(--font-display); font-weight:600; letter-spacing:-0.01em; }
h2{ font-size: clamp(24px, 3vw, 34px); margin-bottom: 30px; }
.section-lede{ color:#4B5266; max-width:600px; font-size:15.5px; margin-bottom:36px; }

/* ---------------- Custom cursor ---------------- */
#cursor-dot, #cursor-ring{
  position: fixed; top:0; left:0; pointer-events:none; z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%,-50%);
}
#cursor-dot{ width:6px; height:6px; background: var(--indigo); }
#cursor-ring{
  width:32px; height:32px; border:1px solid rgba(79,70,229,0.4);
  transition: width .18s, height .18s, border-color .18s, background .18s;
}
#cursor-ring.hover{ width:52px; height:52px; background: rgba(79,70,229,0.06); border-color: var(--violet); }
@media (hover:none), (pointer:coarse){
  #cursor-dot, #cursor-ring{ display:none; }
}

/* ---------------- Page shell: sidebar layout ---------------- */
.page-shell{ display:flex; min-height:100vh; }

.sidebar{
  width: var(--sidebar-w);
  flex-shrink:0;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  position: fixed; top:0; left:0; bottom:0;
  padding: 40px 28px;
  overflow-y: auto;
  display:flex; flex-direction:column;
  z-index: 100;
}
.sidebar-brand{ font-family: var(--font-display); font-weight:700; font-size:19px; margin-bottom:4px; }
.sidebar-brand span{ color: var(--indigo); }
.sidebar-role{ font-family: var(--font-mono); font-size:11.5px; color: var(--muted); margin-bottom:30px; }

.sidebar-links{ list-style:none; display:flex; flex-direction:column; gap:4px; margin-bottom:auto; }
.sidebar-links a{
  font-family: var(--font-mono); font-size:12.5px; letter-spacing:0.04em; text-transform:uppercase;
  color: var(--muted); padding:9px 10px; border-radius:6px; display:block;
}
.sidebar-links a:hover{ color: var(--text); background: var(--panel-2); text-decoration:none; }
.sidebar-links a.active{ color: var(--indigo); background: rgba(79,70,229,0.07); }

.sidebar-cta{
  font-family: var(--font-mono); font-size:12px; letter-spacing:0.04em; text-transform:uppercase;
  border:1px solid var(--indigo); color:var(--indigo); padding:10px 14px; border-radius:6px;
  text-align:center; margin-top:28px;
}
.sidebar-cta:hover{ background: rgba(79,70,229,0.06); text-decoration:none; }

.sidebar-socials{ display:flex; gap:10px; margin-top:20px; flex-wrap:wrap; }
.sidebar-socials a{ font-family: var(--font-mono); font-size:11px; color:var(--muted); border:1px solid var(--line); padding:6px 10px; border-radius:4px; }
.sidebar-socials a:hover{ color:var(--indigo); border-color:var(--indigo); text-decoration:none; }

.nav-toggle{
  display:none; position:fixed; top:16px; right:16px; z-index:110;
  background: var(--bg-2); border:1px solid var(--line); border-radius:6px;
  width:40px; height:40px; font-size:19px; color:var(--text);
}

.main-content{
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width:0;
}

@media (max-width: 900px){
  .sidebar{
    transform: translateX(-100%);
    transition: transform .25s ease;
    width: 260px;
  }
  .sidebar.open{ transform: translateX(0); box-shadow: 8px 0 30px rgba(0,0,0,0.08); }
  .nav-toggle{ display:block; }
  .main-content{ margin-left:0; }
}

/* ---------------- Hero (split layout) ---------------- */
.hero{ padding: 90px 0 60px; }
.hero-split{ display:grid; grid-template-columns: 1.15fr 0.85fr; gap:48px; align-items:center; }
@media (max-width: 820px){ .hero-split{ grid-template-columns:1fr; } }

.hero-name{ font-size: clamp(32px, 5vw, 50px); line-height:1.08; }
.hero-role{
  font-family: var(--font-mono); color: var(--violet); font-size: clamp(13px,1.6vw,16px);
  margin-top:12px; letter-spacing:0.02em;
}
.hero-statement{ font-size:17px; color:#3A4055; margin-top:20px; max-width:480px; }
.hero-sub{ font-family: var(--font-mono); color: var(--muted); font-size:12.5px; margin-top:14px; }

.hud-tags{ display:flex; gap:9px; flex-wrap:wrap; margin-top:24px; }
.hud-tag{
  font-family: var(--font-mono); font-size:11px; letter-spacing:0.04em;
  border:1px solid var(--line); background: var(--panel-2); color: var(--muted); padding:5px 11px; border-radius:20px;
}

.hero-ctas{ display:flex; gap:14px; margin-top:30px; flex-wrap:wrap; }
.btn{
  font-family: var(--font-mono); font-size:12.5px; letter-spacing:0.04em; text-transform:uppercase;
  padding:12px 24px; border-radius:6px; cursor:pointer; border:1px solid transparent;
}
.btn-primary{ background: linear-gradient(135deg, var(--indigo), var(--violet)); color:#fff; font-weight:600; }
.btn-primary:hover{ text-decoration:none; filter:brightness(1.06); }
.btn-outline{ border-color: var(--line); color: var(--text); background: var(--panel-2); }
.btn-outline:hover{ text-decoration:none; border-color: var(--indigo); color: var(--indigo); }

.hero-visual{
  background: var(--bg-2); border:1px solid var(--line); border-radius:16px;
  aspect-ratio: 1/1; position:relative; overflow:hidden;
  box-shadow: 0 20px 50px -30px rgba(79,70,229,0.35);
}
#hero-canvas{ position:absolute; inset:0; width:100%; height:100%; }
.hud-ring{
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:70px; height:70px; border:1px solid rgba(79,70,229,0.35); border-radius:50%;
  display:flex; align-items:center; justify-content:center; pointer-events:none;
}
.hud-ring::before{
  content:""; position:absolute; inset:-8px; border-radius:50%;
  border:1px dashed rgba(124,58,237,0.3);
  animation: spin 24s linear infinite;
}
.hud-ring .core{ width:10px; height:10px; border-radius:50%; background: var(--indigo); box-shadow: 0 0 18px 4px var(--glow); }
@keyframes spin{ to{ transform: rotate(360deg); } }

/* ---------------- Reveal on scroll (progressive enhancement) ----------------
   Default: fully visible. Only hidden-then-fades-in once JS confirms it's
   running (via the .js-ready class on <html>). This way, if the script
   fails to load for any reason, content never gets stuck invisible. */
.reveal{ opacity:1; transform:none; }
.js-ready .reveal{ opacity:0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.js-ready .reveal.in{ opacity:1; transform:none; }

/* ---------------- About ---------------- */
.about-grid{ display:grid; grid-template-columns: 1.1fr 0.9fr; gap:48px; align-items:center; }
@media (max-width:820px){ .about-grid{ grid-template-columns:1fr; } }
.about-text p{ color:#3A4055; font-size:15.5px; margin-bottom:15px; }
#ai-core-canvas{ width:100%; aspect-ratio:1/1; max-width:300px; margin:0 auto; }

.profile-cards{ display:grid; grid-template-columns:repeat(2,1fr); gap:14px; margin-top:40px; }
.p-card{
  background: var(--panel); border:1px solid var(--line); border-radius:10px; padding:18px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.p-card:hover{ border-color: rgba(79,70,229,0.4); transform: translateY(-2px); box-shadow: 0 12px 30px -20px rgba(79,70,229,0.4); }
.p-card .label{ font-family: var(--font-mono); font-size:10.5px; letter-spacing:0.08em; color:var(--indigo); text-transform:uppercase; margin-bottom:9px; }
.p-card .val{ font-size:14px; color:#2A2F44; }
.p-card .val small{ display:block; color:var(--muted); font-size:12px; margin-top:4px; }

/* ---------------- Skills ---------------- */
.skill-matrix{ display:grid; grid-template-columns:repeat(2,1fr); gap:16px; }
.skill-cat{ background: var(--panel); border:1px solid var(--line); border-radius:10px; padding:20px; }
.skill-cat .cat-label{ font-family: var(--font-mono); font-size:10.5px; color:var(--muted); text-transform:uppercase; letter-spacing:0.08em; margin-bottom:13px; }
.skill-tag{
  display:block; font-family: var(--font-mono); font-size:13px; padding:9px 12px; margin-bottom:8px;
  border:1px solid var(--line); border-radius:6px; color:#2A2F44; cursor:default; background: var(--panel-2);
  transition: background .2s, border-color .2s, box-shadow .2s, color .2s;
}
.skill-tag:hover{ border-color: var(--indigo); color:var(--indigo); box-shadow: 0 0 0 3px var(--glow); background: #fff; }

.skill-diagram{ margin-top:52px; }
.skill-diagram svg{ width:100%; height:auto; }
.node-label{ font-family: var(--font-mono); font-size:11px; fill: var(--muted); }
.node-label.core{ fill: var(--indigo); font-size:12px; }
.node-circle{ fill: #fff; stroke: var(--line); stroke-width:1.2; transition: stroke .2s, filter .2s; }
.node-group:hover .node-circle{ stroke: var(--indigo); filter: drop-shadow(0 0 6px var(--glow)); }
.node-group:hover .node-label{ fill: var(--text); }
.edge{ stroke: var(--line); stroke-width:1.2; }

/* ---------------- Projects ---------------- */
.project-card{
  background: var(--panel); border:1px solid var(--line); border-radius:12px; padding:0; overflow:hidden;
  margin-bottom:22px; cursor:pointer; transition: border-color .25s, transform .25s, box-shadow .25s;
}
.project-card:hover{ border-color: rgba(79,70,229,0.4); transform: translateY(-2px); box-shadow: 0 16px 36px -24px rgba(79,70,229,0.4); }
.project-visual{
  height:140px; position:relative; overflow:hidden;
  background: linear-gradient(135deg, #F0F1FC, #FAFAFF);
  display:flex; align-items:center; justify-content:center;
  border-bottom: 1px solid var(--line);
}
.pipeline{ display:flex; align-items:center; gap:9px; font-family: var(--font-mono); font-size:10.5px; color:var(--muted); flex-wrap:wrap; justify-content:center; padding: 0 20px;}
.pipeline .stage{ border:1px solid var(--line); padding:5px 9px; border-radius:5px; background: #fff; }
.pipeline .stage.active{ color: var(--indigo); border-color: var(--indigo); box-shadow: 0 0 0 3px var(--glow); }
.pipeline .sep{ color: var(--violet); }
.project-body{ padding:20px 22px 24px; }
.project-title{ font-family: var(--font-display); font-size:17.5px; font-weight:600; margin-bottom:9px; }
.project-desc{ color:#3A4055; font-size:14px; margin-bottom:13px; }
.tech-row{ display:flex; gap:7px; flex-wrap:wrap; margin-bottom:13px; }
.tech-pill{ font-family: var(--font-mono); font-size:11px; color:var(--violet); background: rgba(124,58,237,0.07); border:1px solid rgba(124,58,237,0.25); padding:3px 9px; border-radius:4px; }
.project-links{ font-family: var(--font-mono); font-size:12px; color:var(--muted); }

/* ---------------- Modal ---------------- */
.modal-overlay{
  position:fixed; inset:0; background: rgba(18,22,43,0.35); backdrop-filter: blur(4px);
  z-index: 200; display:none; align-items:flex-start; justify-content:center; overflow-y:auto; padding: 60px 20px;
}
.modal-overlay.open{ display:flex; }
.modal-box{
  background: #fff; border:1px solid var(--line); border-radius:14px; max-width:600px; width:100%;
  padding: 34px 30px; position:relative; box-shadow: 0 30px 70px -30px rgba(18,22,43,0.35);
}
.modal-close{ position:absolute; top:16px; right:16px; background:none; border:none; color:var(--muted); font-size:20px; cursor:pointer; }
.modal-close:hover{ color:var(--indigo); }
.modal-box h3{ font-size:20px; margin-bottom:16px; padding-right:30px; }
.modal-section{ margin-bottom:16px; }
.modal-section .k{ font-family: var(--font-mono); font-size:10.5px; color:var(--indigo); text-transform:uppercase; letter-spacing:0.08em; margin-bottom:6px; }
.modal-section .v{ color:#3A4055; font-size:14px; }
.modal-links{ display:flex; gap:12px; margin-top:18px; }

/* ---------------- Terminal ---------------- */
.terminal{
  background: #12162B; border:1px solid var(--line); border-radius:10px;
  padding:24px 26px; font-family: var(--font-mono); font-size:13px; color:#8FE3B8;
  max-width: 600px; min-height: 240px;
}
.terminal .prompt{ color: #7DD3FC; }
.terminal-cursor{ display:inline-block; width:8px; height:14px; background:#8FE3B8; animation: blink 1s step-start infinite; vertical-align:middle; }
@keyframes blink{ 50%{ opacity:0; } }

/* ---------------- Education timeline ---------------- */
.timeline{ position:relative; padding-left: 30px; }
.timeline::before{ content:""; position:absolute; left:5px; top:6px; bottom:6px; width:1px; background: linear-gradient(var(--indigo), var(--violet)); }
.t-item{ position:relative; padding-bottom:32px; }
.t-item:last-child{ padding-bottom:0; }
.t-item::before{
  content:""; position:absolute; left:-30px; top:4px; width:10px; height:10px; border-radius:50%;
  background: var(--indigo); box-shadow: 0 0 0 4px var(--glow);
}
.t-year{ font-family: var(--font-mono); color:var(--indigo); font-size:12.5px; margin-bottom:4px; }
.t-title{ font-family: var(--font-display); font-weight:600; font-size:16px; }
.t-sub{ color: var(--muted); font-size:13.5px; margin-top:2px; }

/* ---------------- Certifications / strengths ---------------- */
.two-col{ display:grid; grid-template-columns:1fr 1fr; gap:48px; }
@media (max-width:820px){ .two-col{ grid-template-columns:1fr; } }
.mini-card{ background: var(--panel); border:1px solid var(--line); border-radius:10px; padding:16px 18px; margin-bottom:12px; }
.mini-card .t{ font-family: var(--font-display); font-weight:600; font-size:15px; }
.mini-card .y{ font-family: var(--font-mono); color:var(--muted); font-size:12px; margin-top:4px; }
.strength-row{ display:flex; gap:10px; flex-wrap:wrap; }
.strength-pill{ font-family: var(--font-mono); font-size:12.5px; color:var(--indigo); border:1px solid rgba(79,70,229,0.3); background: rgba(79,70,229,0.05); padding:8px 15px; border-radius:22px; }

/* ---------------- Resume CTA ---------------- */
.resume-cta{ text-align:center; background: var(--panel); border:1px solid var(--line); border-radius:14px; padding:52px 30px; }
.resume-cta h2{ margin-bottom:10px; }
.resume-cta p{ color:#3A4055; max-width:460px; margin: 0 auto 26px; }
.resume-note{ font-family: var(--font-mono); font-size:11px; color:var(--muted); margin-top:14px; }

/* ---------------- Contact ---------------- */
.contact-grid{ display:grid; grid-template-columns:1fr 0.8fr; gap:48px; align-items:start; }
@media (max-width:900px){ .contact-grid{ grid-template-columns:1fr; } }
.form-field{ margin-bottom:16px; }
.form-field label{ display:block; font-family: var(--font-mono); font-size:11px; color:var(--muted); margin-bottom:7px; text-transform:uppercase; letter-spacing:0.05em; }
.form-field input, .form-field textarea{
  width:100%; background: #fff; border:1px solid var(--line); border-radius:6px;
  padding:11px 13px; color:var(--text); font-family: var(--font-body); font-size:14px;
}
.form-field textarea{ min-height:110px; resize:vertical; }
.form-field input:focus, .form-field textarea:focus{ border-color: var(--indigo); }
.form-note{ font-family: var(--font-mono); font-size:11px; color:var(--muted); margin-top:10px; }

.contact-info{ display:flex; flex-direction:column; gap:12px; }
.info-card{ background: var(--panel); border:1px solid var(--line); border-radius:10px; padding:14px 16px; font-family: var(--font-mono); font-size:13px; }
.info-card .k{ color:var(--muted); font-size:10.5px; text-transform:uppercase; letter-spacing:0.06em; display:block; margin-bottom:5px; }
#contact-orb{ width:100%; aspect-ratio:1/1; max-width:200px; margin-top:18px; }

footer{ border-top:1px solid var(--line); padding:36px 0; }
.footer-inner{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:18px; }
.footer-brand{ font-family: var(--font-display); font-weight:700; }
.footer-role{ font-family: var(--font-mono); color:var(--muted); font-size:12px; margin-top:4px; }
.footer-links{ display:flex; gap:18px; list-style:none; font-family: var(--font-mono); font-size:12px; }
.footer-copy{ width:100%; text-align:center; font-family: var(--font-mono); font-size:11px; color:var(--muted); margin-top:22px; }

::selection{ background: var(--indigo); color:#fff; }