/* ============= Design Tokens ============= */
:root {
  --bg: #ffffff;
  --fg: #1a1d24;
  --muted: #6b7280;
  --border: rgba(26, 29, 36, 0.08);
  --card: #ffffff;
  --surface: #fafafa;
  --primary: #9044f4;          /* warm coral */
  --primary-2: #9044f4;
  --primary-fg: #ffffff;
  --accent: #2f9e8f;            /* sage */
  --ring: rgba(130, 103, 253, 0.45);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.04), 0 12px 32px -20px rgba(0,0,0,0.14);
  --shadow-glow: 0 12px 36px -16px rgba(130, 103, 253, 0.45);
  --radius: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gradient-text: linear-gradient(120deg, #1a1d24, var(--primary) 70%);
  --gradient-primary: linear-gradient(135deg, #ebb3e2, #9044f4);
  --gradient-hero:
    radial-gradient(ellipse 90% 70% at 15% 0%, rgba(130, 103, 253, 0.45), transparent 60%),
    radial-gradient(ellipse 70% 60% at 100% 20%, rgba(50, 237, 212, 0.08), transparent 65%);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-sans: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

/* ============= Base ============= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.025em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--primary); color: var(--primary-fg); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.mono { font-family: var(--font-mono); }
.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============= Header ============= */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-bar { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--gradient-primary); color: var(--primary-fg);
  display: grid; place-items: center; font-family: var(--font-display);
  font-weight: 700; box-shadow: var(--shadow-glow);
  transition: transform 0.3s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-4deg); }
.brand-name {
  font-family: var(--font-display); font-size: 0.8rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
.nav-desktop { display: none; align-items: center; gap: 0.25rem; }
@media (min-width: 768px) { .nav-desktop { display: flex; } }
.nav-link {
  padding: 0.5rem 0.85rem; font-size: 0.9rem; color: var(--muted);
  border-radius: 6px; transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--fg); }
.nav-link.active { color: var(--fg); background: var(--surface); }

.menu-toggle {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--border); background: transparent; border-radius: 8px;
  cursor: pointer; gap: 4px;
}
.menu-toggle span {
  display: block; width: 18px; height: 2px; background: var(--fg);
  transition: transform 0.3s, opacity 0.3s;
}
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3px) rotate(-45deg); }
@media (min-width: 768px) { .menu-toggle { display: none; } }

.nav-mobile {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 0 1.5rem; max-height: 0; overflow: hidden;
  border-top: 1px solid transparent;
  transition: max-height 0.35s var(--ease), padding 0.3s, border-color 0.2s;
}
.nav-mobile.open {
  max-height: 360px; padding: 1rem 1.5rem; border-top-color: var(--border);
}

/* ============= Buttons ============= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 0.75rem 1.25rem; border-radius: 8px;
  font-weight: 500; font-size: 0.95rem; cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-primary { background: var(--gradient-primary); color: var(--primary-fg); box-shadow: var(--shadow-glow); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-outline { border-color: var(--border); background: rgba(255,255,255,0.5); color: var(--fg); }
.btn-outline:hover { border-color: var(--primary); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--fg); }

/* ============= Hero ============= */
.hero { position: relative; background-image: var(--gradient-hero); overflow: hidden; }
.grid-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.4;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.hero-inner { position: relative; padding: 6rem 1.5rem 7rem; }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.3em;
  color: var(--primary); text-transform: uppercase; margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 0.6rem;
  animation: floatUp 0.7s var(--ease) both;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: var(--shadow-glow); }
.hero-title {
  font-size: clamp(2.5rem, 7vw, 5.5rem); font-weight: 700; line-height: 0.95;
  animation: floatUp 0.8s var(--ease) 0.1s both;
}
.hero-sub {
  margin-top: 1.75rem; max-width: 38rem; font-size: 1.1rem;
  color: var(--muted); line-height: 1.7;
  animation: floatUp 0.8s var(--ease) 0.2s both;
}
.hero-sub strong { color: var(--fg); font-weight: 600; }
.hero-actions {
  margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: 0.75rem;
  animation: floatUp 0.8s var(--ease) 0.25s both;
}
.stats {
  margin-top: 4rem; padding-top: 2.5rem; border-top: 1px solid var(--border);
  display: grid; gap: 1.5rem; grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat-k { font-family: var(--font-display); font-size: 1.85rem; color: var(--primary); }
.stat-v { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }

/* ============= Sections ============= */
.section { padding: 5rem 1.5rem; }
.section-label {
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.3em; color: var(--primary); text-transform: uppercase;
}
.section h2 { font-size: clamp(1.75rem, 3vw, 2.4rem); margin-top: 0.85rem; margin-bottom: 2rem; }
.two-col { display: grid; gap: 3rem; }
@media (min-width: 768px) { .two-col { grid-template-columns: 1fr 2fr; } }
.prose p { color: var(--muted); font-size: 1.05rem; line-height: 1.75; margin-bottom: 1.1rem; }

/* ============= Cards & Grids ============= */
.grid-3, .grid-4 { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-card);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); border-color: rgba(130, 103, 253, 0.45); }
.card-title i{
  font-size: 20px;
  margin-right: 8px;
  color: #7069f5;
}
.card-title {
  font-family: var(--font-display); font-size: 0.78rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 1rem;
}
.bullet li { display: flex; align-items: center; gap: 0.55rem; padding: 0.25rem 0; }
.bullet li::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
}

.project h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.project p { color: var(--muted); font-size: 0.95rem; margin-bottom: 1rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags span {
  font-size: 0.72rem; font-family: var(--font-mono);
  padding: 0.25rem 0.55rem; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
}

.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.row h3 { font-size: 1.05rem; margin-bottom: 0.25rem; }
.period { font-family: var(--font-mono); font-size: 0.75rem; color: var(--primary); white-space: nowrap; }

.cert-list { display: flex; flex-direction: column; gap: 0.75rem; }
.cert-list li {
  display: flex; align-items: center; gap: 1rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.cert-list li:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.cert-list .num { font-family: var(--font-mono); color: var(--primary); font-size: 0.85rem; }

/* ============= CTA ============= */
.cta {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: 18px;
  background: var(--card); padding: 2.5rem; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 1.5rem;
  align-items: flex-start; justify-content: space-between;
}
.cta::before {
  content: ""; position: absolute; top: -120px; right: -120px;
  width: 280px; height: 280px; border-radius: 50%;
  background: rgba(130, 103, 253, 0.45); filter: blur(60px);
}
.cta h2 { margin-bottom: 0.5rem; }
@media (min-width: 768px) { .cta { flex-direction: row; align-items: center; padding: 3rem; } }

/* ============= Footer ============= */
.site-footer { border-top: 1px solid var(--border); margin-top: 6rem; }
.footer-grid {
  display: grid; gap: 2rem; padding: 3rem 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.foot-title {
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.85rem;
}
.foot-links { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.95rem; }
.foot-links a { transition: color 0.2s; }
.foot-links a:hover { color: var(--primary); }
.footer-bar {
  border-top: 1px solid var(--border); padding: 1.25rem 1.5rem;
  font-size: 0.78rem; color: var(--muted);
  display: flex; flex-direction: column; gap: 0.4rem;
  justify-content: space-between;
}
@media (min-width: 640px) { .footer-bar { flex-direction: row; } }

/* ============= Animations ============= */
@keyframes floatUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }
