:root {
  --bg: #08090c;
  --bg-elev: #0e1117;
  --bg-card: #10141b;
  --bg-card-2: #141a23;
  --border: #1a212b;
  --border-strong: #29313c;
  --text: #e8eef5;
  --text-dim: #97a3b1;
  --text-muted: #5f6a78;
  --accent: #70a7ff;
  --accent-2: #b388ff;
  --accent-3: #6ee7c2;
  --accent-soft: rgba(112, 167, 255, 0.12);
  --radius: 16px;
  --maxw: 1140px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #000;
  padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Noise overlay */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Scroll progress */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  transition: width 0.05s linear;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 9, 12, 0.65);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.1px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-soft), rgba(179,136,255,0.14));
  border: 1px solid var(--border-strong);
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 800;
  font-size: 15px;
}
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--text-dim);
}
.nav-links a {
  position: relative;
  padding: 4px 2px;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.is-active { color: var(--text); }
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -10px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
}

/* Hero */
.hero {
  position: relative;
  padding: 140px 0 0;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
}
.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}
.aurora-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(112,167,255,0.5), transparent 60%);
  top: -200px; right: -140px;
  opacity: 0.6;
  animation: drift1 22s ease-in-out infinite alternate;
}
.aurora-2 {
  width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(179,136,255,0.4), transparent 60%);
  top: 120px; left: -180px;
  opacity: 0.55;
  animation: drift2 26s ease-in-out infinite alternate;
}
.aurora-3 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(110,231,194,0.22), transparent 60%);
  bottom: -100px; left: 40%;
  opacity: 0.6;
  animation: drift3 30s ease-in-out infinite alternate;
}
@keyframes drift1 {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(-70px, 40px) scale(1.12); }
}
@keyframes drift2 {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(80px, -30px) scale(1.08); }
}
@keyframes drift3 {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(-40px, -60px) scale(1.1); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 60px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(14, 17, 23, 0.7);
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 32px;
  letter-spacing: 0.04em;
  width: max-content;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #3fb950;
  box-shadow: 0 0 0 4px rgba(63,185,80,0.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.5; }
}

.hero-title {
  font-size: clamp(56px, 9vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
  font-weight: 800;
}
.hero-title .line {
  display: block;
}
.hero-title .grad {
  background: linear-gradient(110deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-3) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradShift 8s linear infinite;
}
@keyframes gradShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-role {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  margin: 0 0 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-sub {
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--text-dim);
  max-width: 680px;
  margin: 0 0 40px;
}

.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: rgba(18, 24, 33, 0.7);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease,
              transform 0.1s ease, box-shadow 0.2s ease;
}
.btn:hover {
  border-color: var(--accent);
  background: rgba(22, 29, 39, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(112,167,255,0.15);
}
.btn:active { transform: translateY(0); }

.btn-primary {
  position: relative;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #061018;
  border-color: transparent;
  font-weight: 600;
  overflow: hidden;
}
.btn-primary::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
  border-radius: inherit;
  filter: blur(14px);
  opacity: 0.55;
  z-index: -1;
  transition: opacity 0.2s ease;
}
.btn-primary:hover {
  border-color: transparent;
  box-shadow: 0 12px 40px rgba(112,167,255,0.45);
}
.btn-primary:hover::before { opacity: 0.85; }

/* Marquee */
.marquee {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  background: rgba(8, 9, 12, 0.5);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  padding: 22px 0;
}
.marquee-track {
  display: flex;
  gap: 32px;
  white-space: nowrap;
  animation: marquee 45s linear infinite;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-muted);
  width: max-content;
}
.marquee-track span:not(.sep) { color: var(--text-dim); }
.marquee-track .sep { color: var(--accent); opacity: 0.5; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee:hover .marquee-track { animation-play-state: paused; }

/* Sections */
.section {
  position: relative;
  padding: 110px 0;
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-size: clamp(26px, 2.8vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 36px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.section-title .num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

.prose {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 760px;
  margin: 0 0 28px;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 56px;
  align-items: start;
}
.about-stats {
  display: grid;
  gap: 14px;
}
.stat {
  background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}
.stat-num {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(110deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.stat-label {
  font-size: 13.5px;
  color: var(--text-dim);
  margin-top: 8px;
}
@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* Bento grid (Skills) */
.bento {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}
.bento > .card { grid-column: span 2; }
.bento > .bento-feature {
  grid-column: span 3;
  grid-row: span 2;
}
.bento > .card:nth-child(2) { grid-column: span 3; }
@media (max-width: 920px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento > .card { grid-column: span 1; }
  .bento > .bento-feature { grid-column: span 2; grid-row: auto; }
  .bento > .card:nth-child(2) { grid-column: span 2; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: 1fr; }
  .bento > .card, .bento > .bento-feature, .bento > .card:nth-child(2) { grid-column: span 1; }
}

/* Regular grids */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 920px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }

/* Cards */
.card {
  background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14.5px;
}
.bento-feature h3 { font-size: 20px; }
.bento-feature p { font-size: 15.5px; margin-bottom: 14px; }

.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 16px 50px rgba(0,0,0,0.4);
}

.card-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(112,167,255,0.2);
  border-radius: 10px;
  margin-bottom: 16px;
  transition: transform 0.25s ease, background 0.25s ease;
}
.card:hover .card-icon {
  transform: scale(1.08) rotate(-3deg);
  background: rgba(112,167,255,0.18);
}
.card-icon svg { width: 18px; height: 18px; }

/* Spotlight cursor effect */
.spotlight {
  --spot-x: 50%;
  --spot-y: 50%;
}
.spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    400px circle at var(--spot-x) var(--spot-y),
    rgba(112,167,255,0.13),
    transparent 45%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}
.spotlight:hover::before { opacity: 1; }
.spotlight > * { position: relative; z-index: 1; }

/* Gradient border on hover */
.card.spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(112,167,255,0) 0%,
    rgba(112,167,255,0.5) 50%,
    rgba(179,136,255,0.4) 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.card.spotlight:hover::after { opacity: 1; }

/* Tags */
.tags {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tags li {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(14,17,23,0.7);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 6px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.card:hover .tags li {
  border-color: var(--border-strong);
  color: var(--text);
}

/* Certifications */
.cert-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
}
.cert-head .section-title { margin: 0; }
.cert-count {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(14,17,23,0.6);
}
.cert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 720px) { .cert-grid { grid-template-columns: 1fr; } }

.cert-group {
  background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}
.cert-group:hover {
  border-color: var(--border-strong);
}
.cert-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.cert-group h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cert-group .count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(112,167,255,0.25);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
}
.cert-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.cert-list li {
  position: relative;
  padding-left: 22px;
  font-size: 14.5px;
  color: var(--text);
}
.cert-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Contact */
.section-contact {
  background:
    radial-gradient(ellipse at 50% 100%, rgba(112,167,255,0.06), transparent 60%),
    linear-gradient(180deg, transparent, rgba(179,136,255,0.04));
}
.contact .email {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: clamp(22px, 3.4vw, 38px);
  font-weight: 500;
  background: linear-gradient(110deg, var(--accent), var(--accent-2), var(--accent-3));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease;
  animation: gradShift 10s linear infinite;
  letter-spacing: -0.01em;
}
.contact .email svg {
  color: var(--accent);
  transition: transform 0.2s ease;
}
.contact .email:hover {
  border-bottom-color: var(--accent);
}
.contact .email:hover svg {
  transform: translate(3px, -3px);
}

/* Footer */
.site-footer {
  padding: 36px 0 48px;
  color: var(--text-muted);
  font-size: 13px;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
}
.muted { color: var(--text-muted); }

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* Mobile */
@media (max-width: 720px) {
  .nav-links { display: none; }
  .hero { padding: 100px 0 0; min-height: auto; }
  .section { padding: 80px 0; }
  .hero-inner { padding-bottom: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
