:root {
  --bg: #0b0b1a;
  --bg-2: #12122a;
  --surface: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.09);
  --text: #e9e9f5;
  --muted: #9a9ab8;

  --pink: #ff3d8b;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --lime: #a3e635;
  --amber: #fbbf24;
  --orange: #fb7185;

  --grad: linear-gradient(110deg, var(--pink), var(--violet) 45%, var(--cyan));
  --radius: 18px;
  --max: 1100px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: radial-gradient(1200px 800px at 85% -10%, rgba(139, 92, 246, 0.18), transparent 60%),
              radial-gradient(900px 700px at -10% 40%, rgba(255, 61, 139, 0.12), transparent 60%),
              var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

a { color: inherit; }

#bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* Nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-left: max(clamp(1.25rem, 4vw, 3rem), env(safe-area-inset-left));
  padding-right: max(clamp(1.25rem, 4vw, 3rem), env(safe-area-inset-right));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  background: rgba(11, 11, 26, 0.6);
  border-bottom: 1px solid var(--border);
}
.logo {
  font-weight: 700;
  font-size: 1.5rem;
  text-decoration: none;
  letter-spacing: -0.03em;
}
.logo span { color: var(--pink); }
.nav nav { display: flex; gap: clamp(0.75rem, 2.5vw, 2rem); }
.nav nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav nav a:hover, .nav nav a:focus-visible { color: var(--text); }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  background: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.25s, opacity 0.25s;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Layout */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 max(clamp(1.25rem, 4vw, 2rem), env(safe-area-inset-right)) 0 max(clamp(1.25rem, 4vw, 2rem), env(safe-area-inset-left));
}

.section { padding: 6rem 0 2rem; }

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}
.section-title .num { font-size: 1rem; color: var(--pink); font-weight: 400; }

/* Hero */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 6rem;
}
.eyebrow { color: var(--cyan); font-size: 0.9rem; margin-bottom: 1rem; }
h1 {
  font-size: clamp(3.5rem, 11vw, 8rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  font-weight: 700;
}
.gradient-text {
  background: var(--grad);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 8s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }

.tagline {
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  color: var(--muted);
  margin: 1.5rem 0 2.5rem;
  max-width: 40ch;
}

/* Terminal */
.terminal {
  width: 100%;
  max-width: 640px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(8, 8, 20, 0.85);
  box-shadow: 0 30px 80px -20px rgba(139, 92, 246, 0.35);
  overflow: hidden;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.amber { background: #febc2e; }
.dot.green { background: #28c840; }
.terminal-title { margin-left: auto; margin-right: auto; font-size: 0.78rem; color: var(--muted); }
.terminal-body {
  padding: 1.2rem 1.4rem;
  font-size: 0.88rem;
  line-height: 1.75;
  min-height: calc(10 * 1.75em + 2.4rem);
  white-space: pre-wrap;
  color: #cfd0ea;
}
.terminal-body .prompt { color: var(--lime); }
.terminal-body .key { color: var(--cyan); }
.terminal-body .str { color: var(--amber); }
.cursor { color: var(--pink); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Stats */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-top: 3rem;
}
.stat { display: flex; flex-wrap: wrap; align-items: baseline; max-width: 12rem; }
.stat-num, .stat-plus {
  font-size: 2.6rem;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label { width: 100%; color: var(--muted); font-size: 0.9rem; }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 3rem;
  align-items: start;
}
.about-grid p { color: var(--muted); margin-bottom: 1.1rem; }
.about-grid p.lead { color: var(--text); font-size: 1.3rem; line-height: 1.5; }
.focus { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.chip {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-weight: 500;
  border: 1px solid currentColor;
  background: color-mix(in srgb, currentColor 10%, transparent);
  transition: transform 0.25s;
}
@media (hover: hover) {
  .chip:hover { transform: translateX(6px); }
}
.c1 { color: var(--pink); } .c2 { color: var(--violet); } .c3 { color: var(--cyan); }
.c4 { color: var(--lime); } .c5 { color: var(--amber); } .c6 { color: var(--orange); }

/* Skill cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 1.25rem;
}
.card {
  --accent: var(--pink);
  position: relative;
  padding: 1.75rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%),
              color-mix(in srgb, var(--accent) 22%, transparent), transparent 45%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
  .card:hover::before { opacity: 1; }
}
.card-icon {
  display: inline-grid;
  place-items: center;
  min-width: 3rem;
  height: 3rem;
  padding: 0 0.6rem;
  border-radius: 12px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  margin-bottom: 1rem;
}
.card h3 { font-size: 1.25rem; margin-bottom: 1rem; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  font-size: 0.82rem;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #d4d4ea;
}

/* Timeline */
.timeline { list-style: none; position: relative; padding-left: 2rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 0.4rem; bottom: 0.4rem;
  width: 2px;
  background: linear-gradient(var(--pink), var(--violet), var(--cyan));
  border-radius: 2px;
}
.timeline li { position: relative; padding-bottom: 2.5rem; }
.timeline li::before {
  content: "";
  position: absolute;
  left: calc(-2rem + 0px);
  top: 0.45rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 61, 139, 0.15);
}
.timeline li:first-child::before { background: var(--pink); animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 61, 139, 0.25); }
  50% { box-shadow: 0 0 0 10px rgba(255, 61, 139, 0); }
}
.when { font-size: 0.8rem; color: var(--cyan); }
.timeline h3 { font-size: 1.3rem; margin: 0.15rem 0 0.4rem; }
.timeline p { color: var(--muted); max-width: 70ch; }

/* Pentuple */
.pentuple {
  position: relative;
  border-radius: 24px;
  padding: 2px;
  background: var(--grad);
  overflow: hidden;
}
.pentuple-glow {
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 0deg, var(--pink), var(--violet), var(--cyan), var(--lime), var(--pink));
  animation: spin 10s linear infinite;
  opacity: 0.9;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pentuple-content {
  position: relative;
  border-radius: 22px;
  background: linear-gradient(160deg, #15153a, #0d0d22);
  padding: clamp(2rem, 5vw, 3.5rem);
}
.pentuple h3 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}
.pentuple p { color: var(--muted); max-width: 62ch; }
.flags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0 2rem;
}
.flags li {
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  background: var(--grad);
  background-size: 200% auto;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background-position 0.5s, transform 0.2s, box-shadow 0.3s;
  box-shadow: 0 10px 30px -10px rgba(255, 61, 139, 0.6);
}
@media (hover: hover) {
  .btn:hover { background-position: right center; transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(139, 92, 246, 0.7); }
}
.btn span { transition: transform 0.2s; }
.btn:active { transform: scale(0.97); }
@media (hover: hover) {
  .btn:hover span { transform: translateX(4px); }
}

/* Beyond */
.beyond-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1.25rem;
}
.mini {
  padding: 1.75rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.mini-icon { font-size: 2rem; display: block; margin-bottom: 0.75rem; }
.mini h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.mini p { color: var(--muted); font-size: 0.95rem; }

/* Footer */
.footer {
  text-align: center;
  padding: 5rem 1rem 3rem;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 760px) {
  .menu-toggle { display: flex; }
  .nav nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem max(1.25rem, env(safe-area-inset-left)) 1rem;
    background: rgba(11, 11, 26, 0.96);
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .nav.open nav { transform: none; opacity: 1; visibility: visible; }
  .nav nav a {
    padding: 0.85rem 0;
    font-size: 1.1rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
  }
  .nav nav a:last-child { border-bottom: 0; }

  .section { padding-top: 4.5rem; }
  .section-title { margin-bottom: 1.75rem; }
  .hero { padding-top: 5.5rem; padding-bottom: 2rem; }
  .tagline { margin: 1.25rem 0 2rem; }

  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-grid p.lead { font-size: 1.15rem; }
  .focus { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
  .chip { font-size: 0.9rem; padding: 0.45rem 0.9rem; }

  .stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
  }
  .stat-num, .stat-plus { font-size: 2rem; }
  .stat-label { font-size: 0.78rem; line-height: 1.35; }

  .card, .mini { padding: 1.4rem; }
  .pentuple-content { padding: 1.75rem 1.4rem; }
  .btn { width: 100%; justify-content: center; }
  .timeline { padding-left: 1.6rem; }
  .timeline li::before { left: -1.6rem; }
}

@media (max-width: 480px) {
  .terminal-bar { padding: 0.6rem 0.8rem; }
  .terminal-body { font-size: 0.68rem; padding: 1rem; line-height: 1.7; }
}

@media (max-width: 360px) {
  .terminal-body { font-size: 0.62rem; padding: 0.85rem; }
  .stat-num, .stat-plus { font-size: 1.7rem; }
}

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