:root {
  --bg: #0b0d12;
  --bg-2: #12151d;
  --card: rgba(20, 24, 34, 0.82);
  --border: rgba(42, 49, 68, 0.85);
  --text: #e6e8ee;
  --muted: #949cb2;
  --accent: #5eead4;
  --accent-2: #818cf8;
  --radius: 14px;
  --max: 1020px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
strong { color: var(--text); font-weight: 600; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.accent { color: var(--accent); }
.highlight { color: var(--text); font-weight: 600; border-bottom: 1px solid rgba(94, 234, 212, 0.4); }

/* COSMOS ASCII CANVAS & FOCUS HUD */
#cosmosCanvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.cosmos-btn {
  background: rgba(94, 234, 212, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.3);
  color: var(--accent);
  padding: .3rem .7rem; border-radius: 99px;
  font-size: .76rem; cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
}
.cosmos-btn:hover, .cosmos-btn.active {
  background: var(--accent); color: #052924; border-color: var(--accent);
}
.nav-links { align-items: center; }

main, .footer {
  position: relative; z-index: 1;
  transition: opacity .45s ease, transform .45s ease;
}
body.cosmos-focus main,
body.cosmos-focus .footer {
  opacity: 0; pointer-events: none; transform: scale(0.985);
}

.cosmos-hud {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 55; display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  justify-content: center;
  background: rgba(11, 13, 18, 0.85); backdrop-filter: blur(12px);
  border: 1px solid rgba(94, 234, 212, 0.35); border-radius: 99px;
  padding: .55rem 1.1rem; font-size: .72rem; color: var(--muted);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
}
.cosmos-hud[hidden] { display: none !important; }
.cosmos-hud-actions { display: flex; align-items: center; gap: .75rem; }
.cosmos-hud a { color: var(--accent); text-decoration: underline; }
.cosmos-hud button {
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: .72rem;
  padding: .22rem .6rem; border-radius: 99px; cursor: pointer;
}
.cosmos-hud button:hover { border-color: var(--accent); color: var(--accent); }

/* Frosted glass elevation over ASCII cosmos */
.about-card, .timeline-card, .project, .skill-card, .featured-project {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hero::before {
  content: ""; position: absolute; inset: 4rem 0 1rem -2rem; z-index: -1;
  background: radial-gradient(ellipse 52% 68% at 22% 50%, rgba(11, 13, 18, 0.76) 0%, transparent 72%);
  pointer-events: none;
}

/* NAV */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 5vw, 3rem);
  background: rgba(11, 13, 18, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-color: var(--border); }
.logo { font-weight: 700; font-size: 1.35rem; letter-spacing: -.02em; }
.nav-links { display: flex; gap: 2rem; }
.nav-links a { color: var(--muted); font-size: .92rem; transition: color .2s; }
.nav-links a:hover { color: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 28px; height: 20px; position: relative; }
.nav-toggle span { position: absolute; left: 0; width: 100%; height: 2px; background: var(--text); transition: .3s; }
.nav-toggle span:first-child { top: 4px; }
.nav-toggle span:last-child { bottom: 4px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 9px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { bottom: 9px; transform: rotate(-45deg); }

/* LAYOUT */
main { max-width: var(--max); margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 3rem); }
.section { padding: 5.5rem 0; }
.section-title {
  display: flex; align-items: center; gap: .75rem;
  font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; margin-bottom: 2.5rem;
}
.section-title::after { content: ""; flex: 1; max-width: 280px; height: 1px; background: var(--border); }
.section-title .mono { font-size: 1.05rem; font-weight: 500; }

/* HERO */
.hero {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  position: relative; padding: 6.5rem 0 3rem;
}
.glow {
  position: absolute; top: 15%; left: -12%; width: 560px; height: 560px; z-index: -1;
  background: radial-gradient(circle, rgba(94,234,212,.14), rgba(129,140,248,.09) 45%, transparent 70%);
  filter: blur(44px);
}
.hero-hi { color: var(--accent); margin-bottom: .9rem; font-size: .88rem; letter-spacing: .02em; }
.hero h1 { font-size: clamp(2.8rem, 7.5vw, 5.2rem); line-height: 1.05; letter-spacing: -.04em; font-weight: 700; }
.hero-sub {
  font-size: clamp(1.6rem, 4.2vw, 3rem); line-height: 1.15; letter-spacing: -.03em;
  color: var(--muted); font-weight: 600; margin-top: .5rem; max-width: 820px;
}
.hero-text { max-width: 640px; color: var(--muted); margin-top: 1.5rem; font-size: 1.08rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.25rem; }

/* METRICS BAR */
.metrics-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--border);
}
.metric { display: flex; flex-direction: column; gap: .25rem; }
.metric-val { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; color: var(--accent); letter-spacing: -.02em; }
.metric-label { font-size: .82rem; color: var(--muted); line-height: 1.4; }

/* BUTTONS */
.btn {
  display: inline-block; padding: .85rem 1.6rem; border-radius: 10px;
  font-weight: 600; font-size: .95rem; transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.btn-primary { background: var(--accent); color: #062a25; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(94,234,212,.6); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ABOUT */
.about-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 2.75rem; align-items: start; }
.about-text p { color: var(--muted); margin-bottom: 1.1rem; font-size: 1.03rem; }
.about-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem;
}
.avatar {
  width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 1.5rem; color: #062a25; margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.facts { list-style: none; display: grid; gap: 1rem; }
.facts li { display: flex; flex-direction: column; gap: .15rem; font-size: .93rem; color: var(--text); }
.facts span { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; }
.fact-strong { display: flex; align-items: center; font-weight: 600; }
.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
  margin-right: .55rem; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(34,197,94,.22);
}

/* EXPERIENCE TIMELINE */
.timeline {
  position: relative; display: grid; gap: 1.5rem; padding-left: 1.75rem;
  border-left: 1px solid var(--border); margin-left: .5rem;
}
.timeline-item { position: relative; }
.timeline-marker {
  position: absolute; left: -2.13rem; top: 1.65rem; width: 11px; height: 11px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--muted);
}
.timeline-item.current .timeline-marker {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.18);
}
.timeline-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.65rem 1.85rem; transition: border-color .25s, transform .25s;
}
.timeline-item.current .timeline-card { border-color: rgba(94, 234, 212, 0.35); }
.timeline-card:hover { border-color: var(--accent-2); transform: translateY(-2px); }
.timeline-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem;
}
.timeline-header h4 { font-size: 1.12rem; font-weight: 600; line-height: 1.35; }
.role-tag {
  display: inline-block; font-size: .72rem; font-weight: 500; color: var(--accent-2);
  background: rgba(129, 140, 248, 0.12); padding: .15rem .55rem; border-radius: 99px;
  vertical-align: middle; margin-left: .4rem;
}
.company { color: var(--muted); font-size: .92rem; margin-top: .2rem; font-weight: 500; }
.company.accent { color: var(--accent); }
.timeline-date {
  font-size: .78rem; color: var(--muted); white-space: nowrap;
  background: rgba(255,255,255,.03); padding: .3rem .65rem; border-radius: 6px; border: 1px solid var(--border);
}
.badge-live {
  color: var(--accent); border-color: rgba(94, 234, 212, 0.35); background: rgba(94, 234, 212, 0.08);
}
.timeline-points { list-style: none; display: grid; gap: .6rem; }
.timeline-points li {
  position: relative; padding-left: 1.15rem; color: var(--muted); font-size: .95rem; line-height: 1.6;
}
.timeline-points li::before {
  content: "▹"; position: absolute; left: 0; color: var(--accent);
}

/* FEATURED PROJECT */
.projects-stack { display: grid; gap: 1.75rem; }
.featured-project {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 2rem; align-items: center;
  background: linear-gradient(145deg, var(--card), rgba(22, 26, 36, 0.7));
  border: 1px solid rgba(94, 234, 212, 0.3); border-radius: var(--radius);
  padding: 2.25rem;
}
.featured-project.side-project {
  border-color: rgba(129, 140, 248, 0.35);
}
.indigo-text { color: var(--accent-2) !important; }
.btn-indigo { background: var(--accent-2); color: #090b14; }
.btn-indigo:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(129, 140, 248, 0.65); }

.pcb-mini { padding: 1.15rem; display: grid; gap: .75rem; }
.pcb-mini-input {
  padding: .7rem .85rem; border-radius: 9px; background: var(--bg-2);
  border: 1px solid var(--border); display: flex; flex-direction: column; gap: .15rem;
}
.pcb-mini-input span { font-size: .64rem; color: var(--muted); letter-spacing: .07em; }
.pcb-mini-input strong { font-size: 1.35rem; color: var(--text); }
.pcb-mini-rows { display: grid; gap: .5rem; }
.pcb-mini-rows div {
  display: flex; justify-content: space-between; align-items: center;
  padding: .58rem .8rem; border-radius: 8px; background: var(--card);
  border: 1px solid var(--border); font-size: .74rem;
}
.pcb-mini-rows em { font-style: normal; color: var(--muted); }
.pcb-mini-rows .pcb-mini-tax em { color: #fb7185; font-weight: 600; }
.pcb-mini-rows .pcb-mini-net {
  border-color: rgba(94, 234, 212, 0.45); background: rgba(94, 234, 212, 0.08);
}
.pcb-mini-rows .pcb-mini-net span,
.pcb-mini-rows .pcb-mini-net strong { color: var(--accent); font-size: .82rem; }

.numera-preview:hover {
  border-color: var(--accent-2);
  box-shadow: 0 16px 36px -16px rgba(129, 140, 248, 0.4);
}
.numera-mini { padding: 1.15rem; display: grid; gap: .75rem; }
.nm-target {
  text-align: center; padding: .65rem; border-radius: 10px;
  background: rgba(129, 140, 248, 0.08); border: 1px solid rgba(129, 140, 248, 0.3);
  display: flex; flex-direction: column;
}
.nm-target span { font-size: .64rem; color: var(--accent-2); letter-spacing: .08em; }
.nm-target strong { font-size: 1.85rem; color: var(--text); line-height: 1.1; }
.nm-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.nm-tiles div {
  height: 52px; border-radius: 9px; background: var(--card); border: 1px solid var(--border);
  display: grid; place-items: center; font-weight: 700; font-size: 1.05rem;
}
.nm-tiles div.nm-sel {
  border-color: var(--accent); background: rgba(94, 234, 212, 0.12); color: var(--accent);
}
.nm-ops { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.nm-ops span {
  height: 34px; border-radius: 7px; background: var(--bg-2); border: 1px solid var(--border);
  display: grid; place-items: center; font-weight: 700; color: var(--muted);
}
.nm-ops span.nm-op-on {
  background: var(--accent-2); color: #090b14; border-color: var(--accent-2);
}
.fp-eyebrow { font-size: .74rem; color: var(--accent); letter-spacing: .06em; margin-bottom: .55rem; }
.featured-project h4 { font-size: clamp(1.3rem, 2.5vw, 1.65rem); line-height: 1.25; margin-bottom: .85rem; }
.fp-desc { color: var(--muted); font-size: .98rem; margin-bottom: 1.15rem; }
.fp-pillars { list-style: none; display: grid; gap: .6rem; margin-bottom: 1.35rem; }
.fp-pillars li { position: relative; padding-left: 1.15rem; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.fp-pillars li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }
.fp-pillars code { font-family: "JetBrains Mono", monospace; font-size: .8rem; color: var(--accent); }
.fp-actions { display: flex; flex-wrap: wrap; gap: .85rem; }

.fp-preview {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; transition: transform .25s, border-color .25s, box-shadow .25s;
  display: block;
}
.fp-preview:hover {
  transform: translateY(-4px); border-color: var(--accent);
  box-shadow: 0 16px 36px -16px rgba(94, 234, 212, 0.35);
}
.fp-window-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem .9rem; background: var(--bg-2); border-bottom: 1px solid var(--border);
  font-size: .72rem; color: var(--muted);
}
.fp-dots { display: flex; gap: 5px; }
.fp-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); display: inline-block; }
.fp-dag-mini { padding: 1.1rem; display: grid; gap: .65rem; }
.fp-step {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .7rem .85rem; border-radius: 8px; background: var(--card);
  border: 1px solid var(--border); font-size: .74rem;
}
.fp-step span { color: var(--text); font-weight: 600; }
.fp-step em { font-style: normal; color: var(--muted); font-size: .7rem; }
.fp-step.active { border-color: rgba(94, 234, 212, 0.45); background: rgba(94, 234, 212, 0.07); }
.fp-step.active span, .fp-step.active em { color: var(--accent); }

/* SIGNATURE IMPACT / CARDS */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.project {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.75rem; display: flex; flex-direction: column; transition: transform .25s, border-color .25s;
}
.project:hover { transform: translateY(-4px); border-color: var(--accent); }
.project-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.1rem; }
.impact-badge {
  font-size: .75rem; color: var(--accent); background: rgba(94, 234, 212, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.22); padding: .28rem .65rem; border-radius: 6px;
}
.project h4 { font-size: 1.18rem; margin-bottom: .65rem; }
.project p { color: var(--muted); font-size: .95rem; flex: 1; margin-bottom: 1.35rem; }

/* SKILLS */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.skill-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; transition: border-color .2s, transform .2s;
}
.skill-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.skill-card h4 { margin-bottom: 1rem; font-size: 1.02rem; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tags span {
  font-family: "JetBrains Mono", monospace; font-size: .76rem; color: var(--accent);
  background: rgba(94,234,212,.08); padding: .3rem .65rem; border-radius: 6px;
}
.tags.small { gap: .75rem; }
.tags.small span { background: none; padding: 0; color: var(--muted); font-size: .76rem; }

/* CONTACT */
.contact { text-align: center; max-width: 620px; margin: 0 auto; }
.contact-title { font-size: clamp(2.2rem, 5vw, 3.2rem); letter-spacing: -.03em; margin: .5rem 0 1rem; }
.contact-text { color: var(--muted); margin-bottom: 2.25rem; font-size: 1.06rem; }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.75rem; margin-top: 2.75rem; }
.socials a { color: var(--muted); font-size: .93rem; transition: color .2s; }
.socials a:hover { color: var(--accent); }

/* FOOTER */
.footer { text-align: center; padding: 2rem; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--border); }

/* REVEAL ANIMATION */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* RESPONSIVE */
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: 62px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-links.open { max-height: 450px; padding-bottom: 1rem; }
  .nav-links a { padding: 1rem clamp(1.25rem, 5vw, 3rem); }
  .metrics-bar { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  .about-grid, .featured-project { grid-template-columns: 1fr; }
  .featured-project { padding: 1.5rem; }
  .timeline { padding-left: 1.25rem; margin-left: .25rem; }
  .timeline-marker { left: -1.63rem; }
  .timeline-header { flex-direction: column; gap: .5rem; }
  .timeline-card { padding: 1.35rem; }
  .section { padding: 4.25rem 0; }
}
