:root {
  --bg: #070b1f;
  --bg2: #0d1330;
  --card: rgba(18, 26, 60, 0.72);
  --line: rgba(165, 216, 255, 0.14);
  --text: #e8eeff;
  --muted: #9aa8d0;
  --violet: #8b5cf6;
  --violet2: #a78bfa;
  --ice: #a5d8ff;
  --green: #6ee7b7;
  --amber: #fcd34d;
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: radial-gradient(1200px 700px at 80% -10%, #1b1a4a 0%, transparent 60%), var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, canvas, svg { max-width: 100%; }
a { color: var(--ice); text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3, h4 { font-family: "Space Grotesk", sans-serif; line-height: 1.15; margin: 0 0 .6rem; }
p { margin: 0 0 1rem; overflow-wrap: anywhere; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.small { font-size: .8rem; }

#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .55; }

.wrap { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 20px; }
.section { padding: 84px 20px 20px; }
.eyebrow { color: var(--violet2); font-size: .85rem; letter-spacing: .08em; margin-bottom: .6rem; text-transform: lowercase; }
.cursor { animation: blink 1s steps(2) infinite; color: var(--ice); }
@keyframes blink { 50% { opacity: 0; } }
h2 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin-bottom: 1.4rem; }
h3 { font-size: 1.25rem; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: rgba(7, 11, 31, .78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-family: "Space Grotesk", sans-serif; font-weight: 700; color: #fff; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--ice)); box-shadow: 0 0 12px var(--violet); }
.brand-sub { font-family: "JetBrains Mono", monospace; font-weight: 400; font-size: .75rem; color: var(--muted); }
.links { display: flex; gap: 22px; align-items: center; }
.links a { color: var(--muted); font-size: .92rem; transition: color .2s; }
.links a:hover { color: #fff; }
.cta-link { padding: 7px 14px; border: 1px solid var(--violet); border-radius: 999px; color: #fff !important; }
.menu-btn { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: transform .25s, opacity .25s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* HERO */
.hero { padding-top: 90px; padding-bottom: 40px; min-height: 82vh; display: flex; flex-direction: column; justify-content: center; }
.hero h1 { font-size: clamp(2.2rem, 7.5vw, 4.4rem); letter-spacing: -.02em; margin-bottom: 1.2rem; }
.grad { background: linear-gradient(100deg, var(--violet2), var(--ice)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 640px; font-size: clamp(1rem, 2.4vw, 1.2rem); color: var(--muted); }
.lead strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.4rem 0; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.chips li { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ice); font-size: .82rem; background: rgba(165,216,255,.05); }

.btn { display: inline-block; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: .95rem; border: 1px solid transparent; transition: transform .2s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: linear-gradient(120deg, var(--violet), #6d8bff); color: #fff; box-shadow: 0 8px 28px rgba(139, 92, 246, .35); }
.btn.ghost { border-color: var(--line); color: var(--text); background: rgba(255,255,255,.03); }
.btn.ghost:hover { border-color: var(--ice); }

/* CARDS */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; backdrop-filter: blur(6px); }

/* ABOUT */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; align-items: start; }
.about-text p { color: var(--muted); }
.about-text strong { color: var(--text); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stat .num { display: block; font-family: "Space Grotesk", sans-serif; font-size: 2rem; font-weight: 700; color: var(--ice); }
.stat .lbl { font-size: .78rem; color: var(--muted); line-height: 1.3; display: block; }

/* PROJECTS */
.project { margin-bottom: 26px; transition: border-color .25s, transform .25s; }
.project:hover { border-color: rgba(167, 139, 250, .5); transform: translateY(-3px); }
.project p { color: var(--muted); }
.tag { display: inline-block; font-family: "JetBrains Mono", monospace; font-size: .72rem; color: var(--violet2); margin-bottom: .5rem; }
.bullets { padding-left: 1.15rem; margin: 0 0 1rem; color: var(--muted); }
.bullets li { margin-bottom: .4rem; }
.bullets li::marker { color: var(--violet); }
.stack { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.stack li { padding: 4px 10px; font-size: .75rem; border-radius: 8px; background: rgba(139, 92, 246, .14); color: var(--violet2); border: 1px solid rgba(139, 92, 246, .3); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: .6rem; }
.status { font-family: "JetBrains Mono", monospace; font-size: .8rem; display: inline-block; padding: 3px 10px; border-radius: 6px; margin-bottom: .6rem; }
.status.done { background: rgba(110, 231, 183, .12); color: var(--green); }
.status.plan { background: rgba(252, 211, 77, .12); color: var(--amber); }

/* DEMO */
.demo { margin-top: 1.4rem; padding: 18px; border: 1px dashed rgba(165, 216, 255, .28); border-radius: 14px; background: rgba(7, 11, 31, .5); }
.demo-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; margin-bottom: 8px; }
.demo-top p { margin: 0; color: var(--ice); }
.demo label { color: var(--violet2); }
input[type="range"] { width: 100%; accent-color: var(--violet); margin: 6px 0 14px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; }
.bars .bar { flex: 1; min-width: 0; background: linear-gradient(180deg, var(--ice), var(--violet)); border-radius: 4px 4px 0 0; transition: height .25s ease; position: relative; }
.note { font-size: .78rem; color: var(--muted); margin: 10px 0 0; font-style: italic; }

/* ESG */
.esg p { color: var(--muted); }
.esg strong { color: var(--text); }
.esg-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 1rem; }
.pill { padding: 16px; border-radius: 14px; border: 1px solid var(--line); text-align: center; }
.pill b { display: block; font-family: "Space Grotesk", sans-serif; font-size: 1.8rem; }
.pill span { font-size: .8rem; color: var(--muted); }
.pill.e b { color: var(--green); } .pill.s b { color: var(--ice); } .pill.g b { color: var(--violet2); }

/* TIMELINE */
.timeline { position: relative; padding-left: 26px; border-left: 2px solid var(--line); display: grid; gap: 22px; }
.t-item { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.t-item::before { content: ""; position: absolute; left: -35px; top: 26px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--violet); }
.t-when { font-size: .75rem; color: var(--violet2); }
.t-org { color: var(--ice); font-size: .9rem; margin-bottom: .5rem; }
.t-item p:last-child { color: var(--muted); margin: 0; }

/* SKILLS */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-bottom: 18px; }
.skills-grid h3, .interests h3 { font-size: 1.05rem; margin-bottom: .9rem; }
.interests p, .edu p { color: var(--muted); margin: 0; }
.edu h3 { margin-bottom: .2rem; }

/* CONTACT */
.contact p { color: var(--muted); }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px; }

/* FOOTER */
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 60px; padding-bottom: 40px; color: var(--muted); }
.footer p { margin: 0; }

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

:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; border-radius: 4px; }

/* RESPONSIVE */
@media (max-width: 820px) {
  .about-grid, .split { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .menu-btn { display: block; }
  .links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(7, 11, 31, .97);
    border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .links.open { max-height: 420px; }
  .links a { padding: 14px 24px; border-top: 1px solid var(--line); }
  .cta-link { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
}
@media (max-width: 520px) {
  .section { padding-top: 64px; }
  .card { padding: 20px; }
  .esg-pills { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
  .timeline { padding-left: 20px; }
  .t-item::before { left: -29px; }
  .bars { height: 100px; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cursor { animation: none; }
  .btn, .project { transition: none; }
}
