/* =========================================================
   0) Design Tokens
   ========================================================= */
:root {
  --bg: #0b0f17;
  --surface: #0f172a;
  --card: #111b33;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #60a5fa;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --max: 980px;
}

/* =========================================================
   1) Reset / Base
   ========================================================= */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  position: relative;
  min-height: 100%;
}

/* Background gradient layer */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      1200px 700px at 20% -10%,
      rgba(96, 165, 250, 0.25),
      transparent 60%
    ),
    radial-gradient(
      900px 600px at 85% 10%,
      rgba(52, 211, 153, 0.12),
      transparent 60%
    ),
    var(--bg);
}

/* Typography / Links */
a {
  color: var(--text);
  text-decoration: none;
}
a:hover {
  color: white;
}
p {
  margin: 0 0 16px;
  color: var(--text);
}
small,
.muted {
  color: var(--muted);
}

/* Layout Container */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 18px;
}

/* =========================================================
   2) Navigation
   ========================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11, 15, 23, 0.7);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 12px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand:hover {
  opacity: 0.9;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(96, 165, 250, 0.6);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* =========================================================
   3) Buttons / Pills
   ========================================================= */
.pill {
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  transition:
    transform 0.12s ease,
    background 0.12s ease,
    border-color 0.12s ease;
}
.pill:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.45);
  background: rgba(96, 165, 250, 0.14);
  color: white;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}
.btn:hover {
  background: rgba(96, 165, 250, 0.22);
}

/* =========================================================
   4) Hero
   ========================================================= */
.hero {
  padding: 56px 0 26px;
}
.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.hero .sub {
  font-size: 16px;
  color: var(--muted);
  max-width: 70ch;
}

/* =========================================================
   5) Grids / Layout Helpers
   ========================================================= */
.grid {
  display: grid;
  gap: 14px;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Certifications: centered wrapping layout */
.cert-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
/* each cert card: consistent width and flexible */
.cert-grid .card {
  flex: 1 1 240px; /* grows, shrinks, base width */
  max-width: 310px; /* prevents huge cards on wide screens */
}

/* =========================================================
   6) Cards
   ========================================================= */
.card {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.card p {
  color: var(--muted);
  margin: 0;
}

/* Certification card header row */
.cert-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.cert-top h3 {
  margin: 0;
  line-height: 1.25;
}

.cert-provider {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.9;
  flex: 0 0 auto;
}

/* Provider pill */
.provider-pill {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
  opacity: 0.9;
}

.proj-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.proj-top h3 {
  min-width: 0;
}

.tag {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
  opacity: 0.9;
}

.tag.subtle {
  color: var(--muted);
  opacity: 1;
}

.proj-meta {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.project-link {
  margin-top: auto;
  padding-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.project-link:hover {
  color: var(--text);
}

.projects-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.project-card {
  display: flex;
  flex-direction: column;
  grid-column: span 3; /* 4 per row in a 12-col grid */
}

.project-card.featured {
  grid-column: span 4; /* 3 per row */
}

/* =========================================================
   7) Sections / Dividers / Utility
   ========================================================= */
.section {
  padding: 18px 0 8px;
}

.section h2 {
  color: var(--text);
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.section h2::after {
  content: "";
  display: block;
  width: 36px;
  height: 2px;
  background: var(--accent);
  margin-top: 8px;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--muted);
}

.hr {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* Inline "Now" line */
.now {
  font-style: italic;
  margin-top: -6px;
  margin-bottom: 8px;
}

/* Scrollable code / content block */
.scrollable {
  max-height: 360px;
  overflow: auto;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

/* =========================================================
   8) Footer
   ========================================================= */
.footer {
  padding: 40px 0 50px;
  color: var(--muted);
}
.footer a {
  color: var(--muted);
}
.footer a:hover {
  color: white;
}

.footer-row {
  align-items: center;
}

.footer-icons {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  transition:
    transform 0.12s ease,
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}
.icon-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.icon {
  width: 20px;
  height: 20px;
}

/* =========================================================
   9) Forms
   ========================================================= */
.form label {
  display: block;
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.form input,
.form textarea {
  resize: vertical;
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  outline: none;
}
.form input:focus,
.form textarea:focus {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.12);
}

/* =========================================================
   10) Responsive
   ========================================================= */
@media (max-width: 820px) {
  /* Certifications: make cards span the screen on mobile */
  .cert-grid {
    justify-content: stretch;
  }

  .cert-grid .card {
    flex: 1 1 100%;
    max-width: 100%;
  }

  /* Footer: stack and center */
  .footer {
    text-align: center;
  }

  .footer .grid {
    justify-items: center;
  }

  .footer-icons {
    justify-content: center;
    margin-top: 12px;
  }

  /* Slightly smaller icon buttons on mobile */
  .icon-link {
    width: 34px;
    height: 34px;
  }

  .icon {
    width: 18px;
    height: 18px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .project-card,
  .project-card.featured {
    grid-column: 1 / -1;
  }

  body::before {
    background: var(--bg);
  }
}
