/* Base layout */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* leave space for the sticky header when jumping to anchors */
  scroll-padding-top: 120px; /* you can tweak this value */
}

/* Prevent sticky header from covering anchored sections */
section[id] {
  scroll-margin-top: 120px; /* match scroll-padding-top value */
}

:root {
  --bg: #050816;
  --bg-alt: #0b1020;
  --card-bg: #0f172a;
  --accent: #38bdf8;
  --accent-2: #a855f7;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --border-subtle: rgba(148, 163, 184, 0.3);
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.85);
  --radius-lg: 18px;
  --radius-pill: 999px;
  --max-width: 960px;
  --section-gap: 2.4rem;
}

/* Make images responsive */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, #1e293b 0, #020617 55%);
  color: var(--text);
  font-family: "Space Grotesk", "SF Pro Text", "Plus Jakarta Sans",
    system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 0 0 8px 0;
  z-index: 50;
  font-size: 0.9rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.page::before,
.page::after {
  content: "";
  position: fixed;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
}

.page::before {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.32), transparent 60%);
  top: -60px;
  right: 5%;
}

.page::after {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.28), transparent 60%);
  bottom: 10%;
  left: 3%;
}

/* Header */
.site-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  background: linear-gradient(
      135deg,
      rgba(56, 189, 248, 0.16),
      transparent 40%,
      rgba(139, 92, 246, 0.16)
    ),
    radial-gradient(circle at top left, #020617 0, #020617 55%);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.8rem 1.25rem 1.4rem;
}

.site-title {
  font-size: clamp(2rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  margin: 0 0 0.35rem;
}

.site-subtitle {
  margin: 0;
  color: var(--accent);
  font-weight: 500;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--accent));
  box-shadow: 0 0 0 8px rgba(56, 189, 248, 0.15), 0 0 0 16px rgba(168, 85, 247, 0.08);
}

.site-tagline {
  margin: 0.4rem 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* Nav */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.site-nav a {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease,
    transform 0.1s ease;
}

.site-nav a:hover {
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.95);
  transform: translateY(-1px);
}

/* Focus styles for accessibility */
.site-nav a:focus,
.btn:focus,
.pub-link:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Main content */
.content {
  max-width: var(--max-width);
  width: 100%;
  margin: 1.8rem auto 2.4rem;
  padding: 0 1.25rem 0.5rem;
  flex: 1;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.4rem;
  margin-bottom: var(--section-gap);
  border: 1px solid rgba(15, 23, 42, 0.9);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top left,
    var(--accent-soft),
    transparent 55%
  );
  opacity: 0.6;
  pointer-events: none;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
}

.section-note {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.lead {
  font-size: 1.05rem;
  margin: 0 0 0.6rem;
}

.muted {
  color: var(--text-muted);
  margin: 0;
}

/* About */
.about-grid {
  display: grid;
  gap: 1.2rem;
}

.about-grid p {
  max-width: 58ch;
}

.about-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.about-list li {
  margin-bottom: 0.5rem;
}

/* Badges */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.badge-row img {
  height: 26px;
  max-width: 100%;
}

.badge-row a {
  transition: transform 0.12s ease, filter 0.12s ease;
}

.badge-row a:hover {
  transform: translateY(-2px) scale(1.01);
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.25));
}

/* Tech stack groups */
.stack-group + .stack-group {
  margin-top: 1.6rem;
}

.stack-group h3 {
  margin: 0 0 0.6rem;
  font-size: 1.02rem;
}

/* GitHub stats */
.stats-grid {
  display: grid;
  gap: 0.9rem;
}

.stats-grid img {
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: #020617;
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(15, 23, 42, 0.9);
  padding: 0.9rem 1.25rem 1.3rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: #020617;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
  align-items: center;
  overflow: hidden;
}

.hero-copy {
  display: grid;
  gap: 0.75rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  width: fit-content;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.2;
}

.hero-lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.16s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b1020;
  border: none;
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.35);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.05);
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.hero-meta {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.meta-item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.meta-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.78rem;
}

.meta-value {
  color: var(--text);
}

.hero-badges {
  display: grid;
  gap: 0.7rem;
  justify-content: start;
}

.stat-pill {
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(168, 85, 247, 0.1));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.pill-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.pill-value {
  font-size: 1.2rem;
  font-weight: 700;
}

/* Project Grid Layout */
.project-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.project-item {
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.project-item:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.project-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 600;
}

.project-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
  flex: 1;
}

/* Publication Styling */
.publication-item {
  border-left: 3px solid var(--accent-2);
  padding-left: 1rem;
  margin-bottom: 1rem;
}

.pub-link {
  text-decoration: none;
  display: block;
  width: fit-content;
}

.pub-title {
  font-weight: 600;
  display: inline-block;
  margin-bottom: 0.3rem;
  color: var(--text);
  line-height: 1.3;
  transition: color 0.15s ease;
}

.pub-link:hover .pub-title {
  color: var(--accent);
}

.pub-journal {
  font-style: italic;
  color: var(--accent);
  font-size: 0.9rem;
}

/* Responsive tweaks */
@media (min-width: 720px) {
  .card {
    padding: 1.8rem 1.9rem;
  }

  .about-grid {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid img:last-child {
    grid-column: 1 / -1;
    max-width: 70%;
    justify-self: center;
  }
}

@media (max-width: 480px) {
  .site-header-inner {
    padding-top: 1.4rem;
  }

  .badge-row img {
    height: 24px;
  }
}