:root {
  --bg: #0b1220;
  --bg-soft: #111a2e;
  --card: #121c31;
  --text: #e7eefc;
  --muted: #a8b3cf;
  --brand: #6ea8fe;
  --brand-2: #8b5cf6;
  --border: rgba(255, 255, 255, 0.08);
  --header-bg: rgba(11, 18, 32, 0.85);
  --section-muted: rgba(255, 255, 255, 0.02);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

[data-theme='light'] {
  --bg: #f5f8ff;
  --bg-soft: #ebf1ff;
  --card: #ffffff;
  --text: #17243d;
  --muted: #4f5f80;
  --brand: #2f6fd6;
  --brand-2: #6d43d1;
  --border: rgba(23, 36, 61, 0.12);
  --header-bg: rgba(245, 248, 255, 0.86);
  --section-muted: rgba(23, 36, 61, 0.03);
  --shadow: 0 18px 40px rgba(23, 36, 61, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  background: radial-gradient(circle at top, rgba(110, 168, 254, 0.18), transparent 35%), var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(110,168,254,0.06), transparent 35%, rgba(139,92,246,0.05));
  opacity: .7;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.narrow { width: min(900px, calc(100% - 2rem)); }
.section { padding: 4.2rem 0; position: relative; }
.muted { background: var(--section-muted); }
.site-header {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(16px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; }
.brand {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 14px; color: white; font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow);
}
.site-nav { display: flex; flex-wrap: wrap; gap: .95rem; align-items: center; }
.site-nav a { color: var(--muted); font-weight: 500; font-size: .94rem; transition: color .25s ease, transform .25s ease; }
.site-nav a.active, .site-nav a:hover { color: var(--text); text-decoration: none; transform: translateY(-1px); }
.nav-toggle { display: none; }
.nav-actions { display: flex; align-items: center; gap: .6rem; }
.hero-grid, .grid-2, .grid-3, .grid-1 { display: grid; gap: 1.25rem; }
.hero-grid { grid-template-columns: 1.4fr 1fr; align-items: center; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-1 { grid-template-columns: 1fr; }
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card::after {
  content: '';
  position: absolute;
  inset: auto -20% -45% auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(110,168,254,0.16), transparent 70%);
  pointer-events: none;
}
.eyebrow { color: var(--brand); text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; }
h1,h2,h3 { line-height: 1.15; margin-top: 0; font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4vw, 3.7rem); margin-bottom: .85rem; }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); margin-bottom: .65rem; }
h3 { font-size: 1.08rem; margin-bottom: .45rem; }
p, li, .meta, .tags, .hero-meta { font-size: .98rem; }
.lead { font-size: 1rem; color: var(--muted); max-width: 60ch; }
.typing-line { display: flex; align-items: center; gap: .35rem; margin: 0 0 1.15rem; color: var(--muted); font-size: .97rem; }
.typing-prefix { color: var(--text); font-weight: 600; }
.typing-text { color: var(--brand); font-weight: 600; min-height: 1.1em; }
.typing-cursor { color: var(--brand); animation: blinkCursor 1s step-end infinite; }
.cta-group { display: flex; gap: .9rem; flex-wrap: wrap; margin: 1.5rem 0; }
.btn { padding: .78rem 1.08rem; border-radius: 13px; font-weight: 600; font-size: .94rem; display: inline-block; transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease, background-color .25s ease, color .25s ease; }
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: white; box-shadow: 0 12px 30px rgba(110,168,254,.18); }
.btn-secondary { border: 1px solid var(--border); color: var(--text); background: color-mix(in srgb, var(--card) 74%, transparent); }
.btn.is-disabled, .btn[aria-disabled='true'] { opacity: .64; pointer-events: auto; cursor: not-allowed; }
.theme-toggle {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  padding: .55rem .8rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .86rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  cursor: pointer;
  transition: transform .25s ease, border-color .25s ease, background-color .25s ease;
}
.theme-toggle:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--brand) 32%, var(--border)); text-decoration: none; }
.hero-meta, .meta, .tags { color: var(--muted); }
.hero-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .95rem; }
.section-heading { margin-bottom: 1.5rem; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.check-list li::before { content: '✓'; color: var(--brand); margin-right: .7rem; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.prose p { color: var(--muted); }
.timeline { display: grid; gap: 1.25rem; }
.timeline-item ul { color: var(--muted); }
.site-footer { border-top: 1px solid var(--border); padding: 1.25rem 0; color: var(--muted); }
.footer-wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.project-card, .timeline-item { height: 100%; }
.contact-card p { margin: .75rem 0; }
.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.skill-badge {
  display: inline-flex;
  align-items: center;
  padding: .35rem .65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 80%, transparent);
  color: var(--text);
  font-size: .84rem;
  line-height: 1.3;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
  animation: badgeIn .5s ease both;
}
.skill-badge:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 20%, transparent);
}
.hero-copy { animation: fadeUp .8s ease both; }
.hero-card { transform: translateY(0); animation: floatCard 6s ease-in-out infinite; }
.hover-rise { transition: transform .25s ease, border-color .25s ease; }
.hover-rise:hover { transform: translateY(-6px); border-color: rgba(110,168,254,0.25); }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(5px);
  opacity: .55;
}
.orb-1 {
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(110,168,254,.45), transparent 70%);
  top: -25px; right: -20px;
  animation: drift 8s ease-in-out infinite;
}
.orb-2 {
  width: 90px; height: 90px;
  background: radial-gradient(circle, rgba(139,92,246,.35), transparent 70%);
  bottom: -15px; left: -10px;
  animation: drift 7s ease-in-out infinite reverse;
}
.reveal { opacity: 0; transform: translateY(20px); 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 fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes floatCard { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes drift { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(10px, -8px, 0) scale(1.05); } }
@keyframes blinkCursor { 50% { opacity: .2; } }
@keyframes badgeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
  .hero-grid, .grid-2, .grid-3, .two-col { grid-template-columns: 1fr; }
  .site-nav { display: none; width: 100%; }
  .site-nav.open { display: flex; }
  .nav-wrap { flex-wrap: wrap; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    padding: .75rem 1rem; border-radius: 12px;
    border: 1px solid var(--border); background: transparent; color: var(--text);
  }
  .theme-toggle { padding: .75rem .9rem; }
  .theme-toggle__text { display: none; }
}
