:root {
  --bg: #05070d;
  --panel: rgba(12, 18, 30, .78);
  --panel-strong: #0d1320;
  --text: #edf7ff;
  --muted: #9fb0c4;
  --line: rgba(122, 241, 255, .16);
  --cyan: #39f4ff;
  --blue: #2f7dff;
  --purple: #8f5cff;
  --green: #72ffb6;
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
  --radius: 8px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f6f8fb;
  --panel: rgba(255, 255, 255, .82);
  --panel-strong: #ffffff;
  --text: #101827;
  --muted: #526176;
  --line: rgba(47, 125, 255, .2);
  --shadow: 0 20px 55px rgba(28, 43, 75, .16);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background .35s ease, color .35s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 18% 12%, rgba(57, 244, 255, .12), transparent 28%),
    radial-gradient(circle at 78% 8%, rgba(143, 92, 255, .14), transparent 30%),
    linear-gradient(135deg, rgba(13, 19, 32, .96), var(--bg));
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
.container { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.narrow { width: min(840px, calc(100% - 40px)); }
.section-pad { padding: 110px 0; position: relative; }
.compact { padding: 72px 0; }
.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  gap: 16px;
  background: #05070d;
  transition: opacity .45s ease, visibility .45s ease;
}
.loader span {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(57, 244, 255, .25);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.loader strong { font-family: "JetBrains Mono", monospace; letter-spacing: .12em; color: var(--cyan); }
.loaded .loader { opacity: 0; visibility: hidden; }
.progress { position: fixed; inset: 0 auto auto 0; width: 0; height: 3px; z-index: 90; background: linear-gradient(90deg, var(--cyan), var(--purple)); }
.cursor-dot { position: fixed; width: 18px; height: 18px; border: 1px solid var(--cyan); border-radius: 50%; pointer-events: none; z-index: 99; transform: translate(-50%, -50%); opacity: .65; transition: width .2s, height .2s, opacity .2s; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: 1px solid transparent;
  transition: background .25s, border-color .25s;
}
.site-header.scrolled { background: rgba(5, 7, 13, .78); border-color: var(--line); backdrop-filter: blur(20px); }
[data-theme="light"] .site-header.scrolled { background: rgba(246, 248, 251, .82); }
.nav { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(57,244,255,.2), rgba(143,92,255,.18)); border: 1px solid var(--line); font-family: "JetBrains Mono", monospace; color: var(--cyan); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a { padding: 10px 12px; border-radius: var(--radius); color: var(--muted); font-weight: 600; font-size: 14px; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(57, 244, 255, .08); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn, .menu-btn, .reader-toggle {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: var(--radius);
  min-width: 42px;
  height: 42px;
  cursor: pointer;
}
.menu-btn { display: none; padding: 0 12px; }

.hero { min-height: calc(100vh - 76px); display: grid; align-items: center; overflow: hidden; }
#matrix-canvas, .hero-grid { position: absolute; inset: 0; z-index: -2; }
.hero-grid {
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.85), transparent 82%);
}
.hero-inner { display: grid; grid-template-columns: 1fr .9fr; gap: 58px; align-items: center; }
.eyebrow { margin: 0 0 14px; color: var(--cyan); font-family: "JetBrains Mono", monospace; font-size: 13px; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(48px, 8vw, 104px); line-height: .92; letter-spacing: 0; }
h2 { margin: 0; font-size: clamp(30px, 4vw, 54px); line-height: 1.02; letter-spacing: 0; }
h3 { margin: 0 0 10px; font-size: 20px; }
.role-line { font-size: clamp(21px, 3vw, 34px); color: var(--muted); margin: 24px 0 0; }
#rotating-title { color: var(--cyan); font-weight: 800; }
.hero-text, .page-hero p { max-width: 680px; color: var(--muted); font-size: 18px; line-height: 1.75; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border-radius: var(--radius); font-weight: 800; border: 1px solid var(--line); cursor: pointer; }
.btn.primary { color: #001014; background: linear-gradient(135deg, var(--cyan), var(--green)); border-color: transparent; }
.btn.ghost { background: rgba(255,255,255,.05); }
.btn.text { border-color: transparent; color: var(--cyan); }
.social-row { display: flex; gap: 10px; margin-top: 24px; }
.social-row a { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); color: var(--cyan); font-family: "JetBrains Mono", monospace; }
.hero-visual { position: relative; }
.hero-visual img { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); aspect-ratio: 4 / 3; object-fit: cover; }
.status-panel { position: absolute; right: 18px; bottom: 18px; padding: 14px 18px; border-radius: var(--radius); }
.status-panel span { display: block; color: var(--muted); font-size: 12px; }
.status-panel strong { color: var(--green); }

.split, .two-col, .contact-grid, .testimonial-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: start; }
.metric-grid, .card-grid, .cert-grid, .project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card-grid.four { grid-template-columns: repeat(4, 1fr); }
.metric-grid article, .feature-card, .cert-card, .project-card, .quote-card, .github-card, .tracker, .terminal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 24px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.metric-grid strong { display: block; font-size: 32px; color: var(--cyan); }
.metric-grid span, .feature-card p, .cert-card p, .project-card p, .quote-card p, .tracker p { color: var(--muted); line-height: 1.65; }
.feature-card:hover, .cert-card:hover, .project-card:hover { transform: translateY(-6px); border-color: rgba(57, 244, 255, .45); box-shadow: 0 0 38px rgba(57, 244, 255, .08); }
.feature-card > span, .cert-card > span { font-family: "JetBrains Mono", monospace; color: var(--cyan); }
.panel-band { background: linear-gradient(180deg, transparent, rgba(47, 125, 255, .06), transparent); }
.section-head { margin-bottom: 28px; max-width: 820px; }

.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.skills-grid.small { grid-template-columns: 1fr; }
.skill { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.skill span { display: flex; justify-content: space-between; margin-bottom: 12px; font-weight: 700; }
.skill i { display: block; width: 100%; height: 9px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.skill i::before { content: ""; display: block; width: var(--level, 0); height: 100%; background: linear-gradient(90deg, var(--cyan), var(--purple)); border-radius: inherit; transition: width 1.2s ease; }

.track-line { height: 12px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin: 28px 0; }
.track-line span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; color: var(--muted); }
.check-list li { padding-left: 26px; position: relative; }
.check-list li::before { content: ""; position: absolute; left: 0; top: 7px; width: 10px; height: 10px; background: var(--cyan); border-radius: 2px; box-shadow: 0 0 16px var(--cyan); }
pre { margin: 0; white-space: pre-wrap; color: var(--green); font-family: "JetBrains Mono", monospace; line-height: 1.7; }
.activity-bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; height: 120px; }
.activity-bars span { background: linear-gradient(var(--cyan), var(--blue)); border-radius: 4px; min-height: 24px; animation: pulse 2.6s ease-in-out infinite; }
.activity-bars span:nth-child(2) { height: 70%; animation-delay: .2s; }
.activity-bars span:nth-child(3) { height: 38%; animation-delay: .4s; }
.activity-bars span:nth-child(4) { height: 88%; animation-delay: .6s; }
.activity-bars span:nth-child(5) { height: 56%; animation-delay: .8s; }
.activity-bars span:nth-child(6) { height: 76%; animation-delay: 1s; }

.page-hero { padding-top: 140px; }
.timeline { position: relative; display: grid; gap: 26px; }
.timeline::before { content: ""; position: absolute; left: 18px; top: 0; bottom: 0; width: 1px; background: linear-gradient(var(--cyan), var(--purple)); }
.timeline-item { margin-left: 56px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -46px; top: 28px; width: 16px; height: 16px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 24px var(--cyan); }
.timeline-item span { color: var(--cyan); font-family: "JetBrains Mono", monospace; }
.timeline-item p { color: var(--muted); line-height: 1.8; }

.contact-form, .info-card, .map-card, .widget, .comments-ui { border-radius: var(--radius); padding: 24px; }
.contact-form { display: grid; gap: 16px; }
label span { display: block; color: var(--muted); margin-bottom: 8px; font-weight: 700; }
input, textarea, select {
  width: 100%;
  color: var(--text);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(57,244,255,.12); }
.form-note, .success { color: var(--muted); font-size: 14px; }
.success { display: none; color: var(--green); }
.success.show { display: block; animation: pop .35s ease; }
.contact-side { display: grid; gap: 16px; }
.info-card a { display: block; padding: 12px 0; color: var(--cyan); border-bottom: 1px solid var(--line); }
.map-card { min-height: 260px; position: relative; overflow: hidden; display: grid; place-items: center; }
.map-grid { position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 34px 34px; opacity: .9; }
.map-card span { position: relative; padding: 10px 14px; border-radius: var(--radius); background: var(--panel-strong); color: var(--cyan); }

.blog-platform { --bg: #030509; }
.blog-hero h1 { max-width: 980px; }
.blog-tools { display: flex; gap: 10px; padding: 12px; border-radius: var(--radius); margin-top: 28px; max-width: 760px; }
.reader-toggle { padding: 0 14px; white-space: nowrap; }
.blog-layout { display: grid; grid-template-columns: 300px 1fr; gap: 26px; align-items: start; }
.blog-sidebar { position: sticky; top: 96px; display: grid; gap: 16px; }
.widget h2 { margin: 0 0 16px; font-size: 18px; }
.filter-list { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-list button { border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--muted); border-radius: var(--radius); padding: 9px 10px; cursor: pointer; }
.filter-list button.active { color: #001014; background: var(--cyan); }
.recent-list a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.newsletter form { display: grid; gap: 8px; }
.newsletter button { min-height: 42px; border: 0; border-radius: var(--radius); background: var(--cyan); color: #001014; font-weight: 800; }
.featured-posts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 44px; }
.post-list { display: grid; gap: 14px; }
.post-card { display: grid; grid-template-columns: 180px 1fr; gap: 18px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); transition: transform .25s, border-color .25s; }
.post-card:hover { transform: translateY(-4px); border-color: rgba(57,244,255,.45); }
.post-thumb { min-height: 130px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(57,244,255,.2), rgba(143,92,255,.18)), url("../images/hero-cyber-network.png") center/cover; border: 1px solid var(--line); }
.post-card h3 { font-size: 23px; }
.post-meta { color: var(--cyan); font-family: "JetBrains Mono", monospace; font-size: 12px; }
.post-card p { color: var(--muted); line-height: 1.6; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-row span { color: var(--muted); border: 1px solid var(--line); padding: 5px 8px; border-radius: var(--radius); font-size: 12px; }
.reading-light { --bg: #f9fbff; --text: #111827; --muted: #4b5b72; --panel: rgba(255,255,255,.9); }

.article-layout { width: min(850px, calc(100% - 40px)); }
.back-link { color: var(--cyan); display: inline-block; margin-bottom: 30px; }
.article-header { margin-bottom: 28px; }
.article-header h1 { font-size: clamp(38px, 6vw, 74px); }
.article-content { color: var(--muted); font-size: 18px; line-height: 1.85; }
.article-content h2 { color: var(--text); font-size: 32px; margin-top: 44px; }
.article-content pre { padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: #05070d; overflow: auto; }
.article-content code { font-family: "JetBrains Mono", monospace; color: var(--green); }
.comments-ui { margin-top: 44px; display: grid; gap: 14px; }
.comments-ui form { display: grid; gap: 12px; }

.site-footer { border-top: 1px solid var(--line); padding: 34px 0; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-inner strong { color: var(--text); }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: .1s; }
.delay-2 { transition-delay: .2s; }
.delay-3 { transition-delay: .3s; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .42; transform: scaleY(.82); } }
@keyframes pop { 50% { transform: scale(1.02); } }

@media (max-width: 940px) {
  .hero-inner, .split, .two-col, .contact-grid, .testimonial-grid, .blog-layout { grid-template-columns: 1fr; }
  .card-grid, .card-grid.four, .metric-grid, .cert-grid, .project-grid, .skills-grid, .featured-posts { grid-template-columns: repeat(2, 1fr); }
  .blog-sidebar { position: static; }
  .nav-links {
    position: fixed;
    inset: 76px 20px auto 20px;
    display: none;
    padding: 14px;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: grid; }
  .menu-btn { display: inline-flex; align-items: center; }
}

@media (max-width: 640px) {
  .container, .narrow, .article-layout { width: min(100% - 28px, 1160px); }
  .section-pad { padding: 78px 0; }
  .card-grid, .card-grid.four, .metric-grid, .cert-grid, .project-grid, .skills-grid, .featured-posts { grid-template-columns: 1fr; }
  .post-card { grid-template-columns: 1fr; }
  .blog-tools, .hero-actions { flex-direction: column; align-items: stretch; }
  .btn, .reader-toggle { width: 100%; }
  .cursor-dot { display: none; }
  h1 { font-size: clamp(42px, 16vw, 66px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
