/* =========================================================
   THEME TOKENS
   Shared colors and effects used across every section.
   ========================================================= */
:root {
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-card-hover: #161616;
  --border: #1f1f1f;
  --border-hover: #2e2e2e;
  --text-primary: #f0f0f0;
  --text-secondary: #888888;
  --text-muted: #444444;
  --accent: #00ff88;
  --accent-dim: #00ff8820;
  --accent-blue: #4af0ff;
  --accent-blue-dim: #4af0ff15;
  --nav-bg: rgba(10,10,10,0.85);
  --dot-color: #ffffff08;
  --scrollbar-thumb: #00ff88;
  --scrollbar-track: #111;
  --input-bg: #0e0e0e;
  --shadow-card: 0 0 20px #00ff8815;

  /* GitHub heatmap colors, matched to the main green accent. */
  --gh-c0: #0d1a0d;
  --gh-c1: #00331a;
  --gh-c2: #006633;
  --gh-c3: #00aa55;
  --gh-c4: #00ff88;
}

[data-theme="light"] {
  --bg: #f5f5f0;
  --bg-card: #ffffff;
  --bg-card-hover: #f9f9f6;
  --border: #e0e0da;
  --border-hover: #c8c8c0;
  --text-primary: #0a0a0a;
  --text-secondary: #555550;
  --text-muted: #aaaaaa;
  --accent: #008f4c;
  --accent-dim: #008f4c18;
  --accent-blue: #0077aa;
  --accent-blue-dim: #0077aa12;
  --nav-bg: rgba(245,245,240,0.88);
  --dot-color: #00000008;
  --scrollbar-thumb: #008f4c;
  --scrollbar-track: #e0e0da;
  --input-bg: #f0f0eb;
  --shadow-card: 0 0 20px #008f4c12;

  --gh-c0: #eaf5ee;
  --gh-c1: #9fe1b8;
  --gh-c2: #3dbd78;
  --gh-c3: #008f4c;
  --gh-c4: #005c30;
}

/* =========================================================
   GLOBAL BASE
   Reset, typography, page background, and shared transitions.
   ========================================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Sora', sans-serif;
  line-height: 1.6;
  background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
  background-size: 24px 24px;
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
}

/* Scoped, performant transitions on interactive states only */
a,
button,
.btn-filled,
.btn-outlined,
.stat-card,
.timeline-card,
.edu-card,
.pill,
.project-card,
.tag {
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.2;
}

/* =========================================================
   SHARED LAYOUT
   Reusable section shell and heading pattern.
   ========================================================= */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 24px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}

.section-num {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.section-header h2 {
  color: var(--text-primary);
  font-size: 1.6rem;
  font-weight: 700;
}

.section-line {
  flex: 0 0 60px;
  height: 1px;
  background: var(--accent);
}

/* =========================================================
   NAVIGATION
   Fixed desktop nav plus the mobile slide-out drawer.
   ========================================================= */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  border-bottom: 1px solid transparent;
}

#navbar.scrolled {
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.15rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 22px;
}

.nav-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--text-secondary);
  position: relative;
  padding: 4px 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

#theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

#theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

#hamburger {
  display: none;
  font-size: 1.4rem;
  color: var(--text-primary);
}

.nav-links-mobile {
  list-style: none;
  position: fixed;
  top: 64px;
  right: 0;
  bottom: 0;
  left: auto;
  width: 70%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  padding: 32px 28px 32px 32px;
  background: var(--bg);
  z-index: 98;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-links-mobile.open {
  transform: translateX(0);
}

.nav-links-mobile a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  width: 100%;
}

.nav-links-mobile a:hover,
.nav-links-mobile a.active {
  color: var(--accent);
}

.nav-links-mobile a svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.nav-links-mobile a:hover svg,
.nav-links-mobile a.active svg {
  opacity: 1;
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 64px;
  background: rgba(0,0,0,0.5);
  z-index: 97;
  backdrop-filter: blur(2px);
}

.nav-overlay.open {
  display: block;
}

/* =========================================================
   SHARED UI ELEMENTS
   Buttons and small tags reused across multiple sections.
   ========================================================= */
.btn-filled {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 4px;
}

.btn-filled:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-dim);
}

.btn-outlined {
  display: inline-block;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 4px;
}

.btn-outlined:hover {
  transform: translateY(-2px);
  background: var(--accent-dim);
  box-shadow: 0 8px 24px var(--accent-dim);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 4px;
}
