/* Self-hosted fonts (no third-party requests) */
@font-face { font-family: "Syne"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/syne-700.woff2") format("woff2"); }
@font-face { font-family: "Syne"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/syne-800.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jbmono-400.woff2") format("woff2"); }

:root {
  --bg: #1a1a2e;
  --bg-alt: #242438;
  --panel: rgba(36, 36, 56, 0.72);
  --line: rgba(0, 255, 255, 0.18);
  --line-soft: rgba(224, 224, 224, 0.1);
  --text: #e0e0e0;
  --muted: rgba(224, 224, 224, 0.68);
  --accent: #00ffff;
  --accent-soft: rgba(0, 255, 255, 0.1);
  --ok: #00e0a0;
  --warn: #ffb020;
  --radius: 10px;
  --font-head: "Syne", "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; line-height: 1.1; }
p { margin: 0 0 1em; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: #0d0d1a; padding: 10px 16px; border-radius: 6px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(26, 26, 46, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__icon {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line);
}
.brand__name { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; margin: 0; }
.nav__menu { display: flex; gap: 28px; }
.nav__menu a { text-decoration: none; font-size: 0.9rem; font-weight: 600; color: var(--text); opacity: .85; transition: color .2s, opacity .2s; }
.nav__menu a:hover, .nav__menu a:focus-visible { color: var(--accent); opacity: 1; }
.nav__toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav__toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: transform .2s, opacity .2s; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 26px; border-radius: 6px; font-weight: 600; font-size: 0.95rem;
  text-decoration: none; cursor: pointer; border: 1px solid var(--accent);
  transition: background .2s, color .2s, box-shadow .2s;
  font-family: var(--font-body);
}
.btn--primary { background: var(--accent); color: #0d0d1a; }
.btn--primary:hover { box-shadow: 0 0 24px rgba(0, 255, 255, 0.45); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-soft); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- HERO ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 96px; min-height: calc(100vh - 64px); display: flex; align-items: center; }
.grid-bg {
  position: absolute; inset: 0; opacity: .07; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--accent) 1px, transparent 1px),
    linear-gradient(to bottom, var(--accent) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 40% 40%, #000 30%, transparent 75%);
}
.hero__inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: center; }
.hero__copy { min-width: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: .1em;
  color: var(--accent); border: 1px solid var(--line); background: var(--accent-soft);
  padding: 6px 12px; border-radius: 4px; margin-bottom: 28px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.hero__title { font-weight: 800; font-size: clamp(2.6rem, 7.2vw, 7rem); letter-spacing: 0.02em; margin-bottom: 28px; line-height: 1.02; }
.hero__line { display: block; }
.hero__line--accent {
  color: transparent; -webkit-text-stroke: 2px var(--accent);
  text-shadow: 0 0 40px rgba(0, 255, 255, 0.25);
}
.hero__lead { font-size: 1.4rem; font-weight: 600; max-width: 34ch; margin-bottom: 8px; border-left: 3px solid var(--accent); padding-left: 16px; }
.hero__sub { color: var(--muted); padding-left: 19px; margin-bottom: 36px; max-width: 52ch; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.panel__row { display: flex; justify-content: space-between; color: var(--accent); margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { border: 1px solid var(--line-soft); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.stat__value { font-family: var(--font-head); font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.stat__value small { font-size: .9rem; margin-left: 3px; font-weight: 700; }
.stat__label { color: var(--muted); font-size: .62rem; line-height: 1.45; letter-spacing: .06em; }

/* ---------- SECTIONS ---------- */
.section { padding: 110px 0; }
.section--alt { background: var(--bg-alt); }
.eyebrow { color: var(--accent); margin-bottom: 12px; }
.h2 { font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 800; margin-bottom: 16px; }
.h2--center, .lead--center { text-align: center; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; margin-bottom: 48px; }
.lead--center { margin-inline: auto; }

/* About */
.about { display: grid; grid-template-columns: 320px 1fr; gap: 56px; align-items: start; }
.about__text p:not(.eyebrow):not(.lead) { color: var(--text); opacity: .92; max-width: 68ch; }
.about__text .lead { margin-bottom: 24px; color: var(--accent); }
.avatar { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; border: 1px solid var(--line); background: var(--accent-soft); color: var(--accent); margin-bottom: 18px; }
.skills { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.skills li { padding: 10px 14px; border: 1px solid var(--line-soft); border-radius: 6px; font-size: .92rem; position: relative; padding-left: 30px; }
.skills li::before { content: ""; position: absolute; left: 14px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); transform: translateY(-50%); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 28px; transition: border-color .25s, transform .25s;
  display: flex; flex-direction: column;
}
.card:hover { border-color: var(--accent); transform: translateY(-4px); }
.card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.card__icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.card__icon svg { width: 22px; height: 22px; }
.card h3 { font-size: 1.45rem; font-weight: 700; margin-bottom: 12px; }
.card p { color: var(--muted); flex: 1; }
.tags { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em;
  padding: 4px 9px; border-radius: 4px; color: var(--accent);
  border: 1px solid var(--line); background: var(--accent-soft);
}
.tags--hash li { letter-spacing: .02em; }
.tags--hash li::before { content: "#"; opacity: .6; }

/* Projects */
.ops { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 40px; }
.op {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; transition: border-color .25s;
}
.op:hover { border-color: var(--accent); }
.op__meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.op h3 { font-size: 1.45rem; font-weight: 700; margin-bottom: 12px; }
.op p { color: var(--muted); }
.op .tags { margin-top: auto; padding-top: 8px; }
.op--feature {
  grid-column: 1 / -1;
  border-color: var(--line);
  background: linear-gradient(135deg, rgba(0,255,255,.07), transparent 60%), var(--panel);
}
.op--feature h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.op--feature p { max-width: 75ch; }
.op__facts { list-style: none; padding: 0; margin: 4px 0 20px; display: flex; flex-wrap: wrap; gap: 14px; }
.op__facts li { border: 1px solid var(--line); border-radius: 8px; padding: 12px 18px; display: flex; align-items: baseline; gap: 8px; }
.op__facts b { font-family: var(--font-head); font-size: 1.8rem; color: var(--accent); line-height: 1; }
.op__facts span { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

.lab { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.topology { position: sticky; top: 88px; }
.topology__title { margin-bottom: 18px; }
.topo { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.node { display: flex; flex-direction: column; align-items: center; position: relative; text-align: center; }
.node:not(:last-child)::after {
  content: ""; position: absolute; bottom: -22px; left: 50%; width: 1px; height: 22px;
  background: linear-gradient(var(--accent), transparent);
}
.node__box {
  font-family: var(--font-mono); font-size: .78rem; padding: 8px 16px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--accent-soft); color: var(--text); min-width: 140px;
}
.node--round .node__box { border-radius: 999px; }
.node--hot .node__box { border-color: var(--accent); box-shadow: 0 0 16px rgba(0,255,255,.25); color: var(--accent); }
.node__label { font-family: var(--font-mono); font-size: .66rem; color: var(--muted); margin-top: 4px; }
.node--split { flex-direction: row; justify-content: center; gap: 6px; flex-wrap: wrap; }
.node__box--sm { min-width: 0; padding: 6px 8px; font-size: .68rem; display: flex; flex-direction: column; line-height: 1.3; }
.node__box--sm small { color: var(--muted); font-size: .6rem; }
.op--lab { border-color: var(--line); }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 12px; }
.checklist li { position: relative; padding-left: 28px; color: var(--muted); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .45em; width: 14px; height: 14px; border-radius: 3px;
  border: 1px solid var(--accent); background: var(--accent-soft);
}
.checklist li::after {
  content: ""; position: absolute; left: 4px; top: calc(.45em + 3px); width: 5px; height: 8px;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.checklist b { color: var(--text); font-weight: 600; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 28px; position: relative; display: grid; gap: 28px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), rgba(0,255,255,.1)); }
.tl {
  position: relative; background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 24px 28px;
}
.tl::before {
  content: ""; position: absolute; left: -28px; top: 30px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-alt); border: 2px solid var(--accent); box-shadow: 0 0 10px rgba(0,255,255,.4);
}
.tl:first-child::before { background: var(--accent); }
.tl__date { color: var(--accent); margin-bottom: 6px; }
.tl h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 4px; }
.tl__org { color: var(--muted); margin-bottom: 12px; text-transform: uppercase; }
.tl p:last-child { margin: 0; color: var(--muted); max-width: 80ch; }

/* Certifications */
.certs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.cert { display: flex; flex-direction: column; }
.cert h3 { font-size: 1.45rem; font-weight: 700; margin: 16px 0 6px; }
.cert p:not(.mono) { color: var(--muted); flex: 1; }
.badge { align-self: flex-start; padding: 4px 10px; border-radius: 4px; font-size: .7rem; }
.badge--ok { color: var(--ok); border: 1px solid rgba(0,224,160,.4); background: rgba(0,224,160,.08); }
.badge--pending { color: var(--warn); border: 1px solid rgba(255,176,32,.4); background: rgba(255,176,32,.08); }
.cert__foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line-soft); padding-top: 16px; margin-top: 8px; gap: 12px; flex-wrap: wrap; }
.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Contact */
.contact { display: flex; flex-direction: column; align-items: center; }
.contact__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line); margin-bottom: 20px; }
.form { width: min(760px, 100%); display: grid; gap: 18px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form label { display: grid; gap: 8px; }
.form label .mono { color: var(--accent); }
.form input, .form textarea {
  width: 100%; font: inherit; color: var(--text);
  background: rgba(26, 26, 46, 0.8); border: 1px solid var(--line-soft); border-radius: 6px;
  padding: 12px 14px; transition: border-color .2s, box-shadow .2s; resize: vertical;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,255,255,.12); }
.form__actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.form__alt { margin: 0; color: var(--muted); letter-spacing: .04em; text-transform: none; }
.copy {
  margin-left: 6px; padding: 3px 8px; border-radius: 4px; cursor: pointer;
  background: transparent; color: var(--accent); border: 1px solid var(--line); font-size: .65rem;
}
.copy:hover { background: var(--accent-soft); }
.form__note { margin: 0; color: var(--muted); min-height: 1.2em; }

/* Footer */
.footer { border-top: 1px solid var(--line-soft); padding: 64px 0 28px; background: #151526; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer__grid .brand__name { margin-bottom: 12px; }
.footer__links { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.footer__links a { text-decoration: none; color: var(--muted); }
.footer__links a:hover { color: var(--accent); }
.footer__grid .mono { margin-bottom: 4px; }
.footer__base { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line-soft); padding-top: 22px; color: var(--muted); font-size: .85rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* 404 page */
.notfound { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 80px 0; }
.notfound .h2 { margin-bottom: 12px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1000px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .lab { grid-template-columns: 1fr; }
  .topology { position: static; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__panel { max-width: 460px; }
}
@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__menu {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line-soft);
    max-height: 0; overflow: hidden; transition: max-height .3s;
  }
  .nav__menu a { padding: 14px 16px; border-top: 1px solid var(--line-soft); }
  .nav.is-open .nav__menu { max-height: 420px; }
  .nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
  .nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .about { grid-template-columns: 1fr; }
  .certs { grid-template-columns: 1fr; }
  .ops { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .section { padding: 72px 0; }
  .cards { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 64px; min-height: 0; }
  .hero__line--accent { -webkit-text-stroke-width: 1.5px; }
  .op, .card, .tl { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
.ops--after-lab { margin-top: 20px; margin-bottom: 0; }
