:root {
  --bg: #0b0f14;
  --bg-elev: #10161e;
  --bg-card: #0f151d;
  --fg: #e6edf3;
  --fg-dim: #98a4b3;
  --muted: #64748b;
  --accent: #7ee787;
  --accent-2: #79c0ff;
  --warn: #f0c674;
  --border: #1f2730;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

html[data-theme="light"] {
  --bg: #f7f9fc;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --fg: #0b1220;
  --fg-dim: #475569;
  --muted: #94a3b8;
  --accent: #16a34a;
  --accent-2: #2563eb;
  --warn: #b45309;
  --border: #e5e7eb;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

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

/* BOOT INTRO — WebGL globe spy-locator */
.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0b0f14;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.boot-overlay.boot-in  { opacity: 1; }
.boot-overlay.boot-out { opacity: 0; }
.boot-canvas {
  display: block;
  filter: drop-shadow(0 0 40px rgba(126, 231, 135, 0.08));
}
.boot-readout {
  position: absolute;
  left: max(24px, calc(50% - 360px));
  bottom: max(24px, calc(50% - 280px));
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  line-height: 1.85;
  letter-spacing: 0.04em;
  user-select: none;
}
.boot-line {
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.boot-line.on { opacity: 1; transform: translateY(0); }
.boot-line.boot-lock {
  margin-top: 6px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #7ee787;
  text-shadow: 0 0 12px rgba(126, 231, 135, 0.35);
}

@media (max-width: 600px) {
  .boot-readout {
    left: 24px;
    right: 24px;
    bottom: 24px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-overlay { display: none !important; }
}


html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(126, 231, 135, 0.08), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(121, 192, 255, 0.07), transparent 60%);
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip:focus {
  left: 12px;
  top: 12px;
  background: var(--bg-elev);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 10;
}

/* HERO */
.hero {
  padding: 64px 0 16px;
}
.hero-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}
.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-dim);
}
.theme-toggle {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.theme-toggle:active { transform: scale(0.95); }
.brand-path { margin-left: 6px; }
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  margin: 20px 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-weight: 700;
}
.hero .muted { color: var(--muted); font-weight: 500; }
.tagline {
  color: var(--fg-dim);
  font-size: clamp(15px, 1.6vw, 18px);
  margin: 0 0 20px;
  max-width: 640px;
}

.stack-line {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg-dim);
  margin: 0 0 22px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  letter-spacing: 0.01em;
  line-height: 1.6;
}
.stack-label {
  color: var(--muted);
  flex-shrink: 0;
}
.stack-items {
  color: var(--fg-dim);
}
.stack-items::selection { background: rgba(126, 231, 135, 0.25); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
}
.chip:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
}
.chip:active { transform: translateY(0); }
.chip-ghost { background: transparent; color: var(--fg-dim); }

/* TERMINAL */
.terminal-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 24px 12px;
  box-sizing: border-box;
}
.terminal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, rgba(255,255,255,0.02), transparent);
}
.term-title {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  text-align: center;
}
.term-body {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.65;
  padding: 18px;
  min-height: 320px;
  max-height: 60vh;
  overflow-y: auto;
}
.output { white-space: pre-wrap; word-wrap: break-word; }
.output a { color: var(--accent-2); }
.output .line { display: block; }
.output .ok { color: var(--accent); }
.output .warn { color: var(--warn); }
.output .err { color: #ff7b72; }
.output .dim { color: var(--fg-dim); }
.output .hdr { color: var(--accent); font-weight: 700; }
.output .cmd { color: var(--accent-2); }
.inline-suggest {
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.inline-suggest:hover .cmd { color: var(--accent); }

.input-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
}
.prompt { color: var(--accent); user-select: none; }
#input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  flex: 1;
  caret-color: var(--accent);
}
.cursor {
  width: 8px;
  height: 16px;
  background: var(--accent);
  display: inline-block;
  animation: blink 1.05s steps(2) infinite;
  margin-left: -6px;
  opacity: 0.85;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ACTIVITY */
.activity {
  max-width: 880px;
  margin: 36px auto 0;
  padding: 0 24px;
}
.activity-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.activity-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
  text-decoration: none;
}
.activity-link:hover { color: var(--accent); text-decoration: none; }

/* CONTRIBUTION GRAPH */
.contrib {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.contrib-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.contrib-total { color: var(--fg); }
.contrib-total .num { color: var(--accent); font-weight: 700; }
.contrib-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.contrib-legend .cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  display: inline-block;
}
.l0 { background: var(--border); }
.l1 { background: rgba(126,231,135,0.25); }
.l2 { background: rgba(126,231,135,0.45); }
.l3 { background: rgba(126,231,135,0.7); }
.l4 { background: var(--accent); }
html[data-theme="light"] .l1 { background: rgba(22,163,74,0.22); }
html[data-theme="light"] .l2 { background: rgba(22,163,74,0.42); }
html[data-theme="light"] .l3 { background: rgba(22,163,74,0.65); }
html[data-theme="light"] .l4 { background: var(--accent); }

.contrib-graph {
  width: 100%;
}
.contrib-graph svg {
  display: block;
  width: 100%;
  height: auto;
}
.contrib-graph rect.cell { rx: 2; }
.contrib-graph rect.cell:hover { stroke: var(--accent); stroke-width: 1; }
.contrib-graph rect.l0 { fill: var(--border); }
.contrib-graph rect.l1 { fill: rgba(126,231,135,0.28); }
.contrib-graph rect.l2 { fill: rgba(126,231,135,0.5); }
.contrib-graph rect.l3 { fill: rgba(126,231,135,0.75); }
.contrib-graph rect.l4 { fill: #7ee787; }
html[data-theme="light"] .contrib-graph rect.l1 { fill: rgba(22,163,74,0.25); }
html[data-theme="light"] .contrib-graph rect.l2 { fill: rgba(22,163,74,0.5); }
html[data-theme="light"] .contrib-graph rect.l3 { fill: rgba(22,163,74,0.75); }
html[data-theme="light"] .contrib-graph rect.l4 { fill: #16a34a; }
.contrib-graph text.month {
  fill: var(--fg-dim);
  font-family: var(--mono);
  font-size: 10px;
}
.contrib-graph text.day {
  fill: var(--fg-dim);
  font-family: var(--mono);
  font-size: 9px;
}
.contrib-skeleton {
  height: 120px;
  background: linear-gradient(90deg, var(--border), rgba(255,255,255,0.04), var(--border));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 6px;
}
.contrib-error {
  color: var(--fg-dim);
  font-family: var(--mono);
  font-size: 13px;
  padding: 24px 0;
  text-align: center;
}

.activity-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.activity-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  text-decoration: none;
  transition: background 0.12s ease;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover {
  background: rgba(126, 231, 135, 0.04);
  text-decoration: none;
}
html[data-theme="light"] .activity-item:hover {
  background: rgba(22, 163, 74, 0.04);
}
.activity-when {
  color: var(--fg-dim);
  font-size: 12px;
  white-space: nowrap;
}
.activity-msg {
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  min-width: 0;
}
.activity-msg-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ev {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}
.ev-push    { color: var(--accent);   background: rgba(126,231,135,0.10); }
.ev-pr      { color: var(--accent-2); background: rgba(121,192,255,0.10); }
.ev-release { color: var(--warn);     background: rgba(240,198,116,0.12); }
.ev-create  { color: var(--fg-dim);   background: rgba(148,163,184,0.10); }
.ev-public  { color: var(--fg-dim);   background: rgba(148,163,184,0.10); }
.ev-star    { color: var(--warn);     background: rgba(240,198,116,0.10); }
html[data-theme="light"] .ev-push    { background: rgba(22,163,74,0.10); }
html[data-theme="light"] .ev-pr      { background: rgba(37,99,235,0.10); }
html[data-theme="light"] .ev-release { background: rgba(180,83,9,0.12); }
.activity-repo {
  color: var(--fg-dim);
  font-size: 12px;
  white-space: nowrap;
}

/* Skeleton loader */
.activity-skeleton {
  display: grid;
  grid-template-columns: 80px 1fr 140px;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.activity-skeleton:last-child { border-bottom: none; }
.sk {
  display: block;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--border), rgba(255,255,255,0.04), var(--border));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.sk-when { width: 50px; }
.sk-msg  { width: 70%; }
.sk-repo { width: 100%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.activity-error {
  padding: 16px 18px;
  color: var(--fg-dim);
  font-family: var(--mono);
  font-size: 13px;
}

@media (max-width: 600px) {
  .activity-item, .activity-skeleton { grid-template-columns: 60px 1fr; }
  .activity-repo, .sk-repo { grid-column: 2; color: var(--muted); }
}

/* PROJECTS */
.projects {
  max-width: 880px;
  margin: 36px auto 0;
  padding: 0 24px;
}
.section-title {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg-dim);
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--fg);
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
  text-decoration: none;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  text-decoration: none;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.badge {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  background: rgba(126, 231, 135, 0.08);
  border: 1px solid rgba(126, 231, 135, 0.2);
  padding: 3px 8px;
  border-radius: 999px;
}
html[data-theme="light"] .badge {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.25);
}
.arrow { color: var(--fg-dim); }
.card h3 {
  font-size: 18px;
  margin: 4px 0 6px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card p {
  color: var(--fg-dim);
  font-size: 14px;
  margin: 0 0 12px;
  line-height: 1.5;
}
.card-foot {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.card-inline {
  display: inline;
  color: var(--fg-dim);
}
.card-inline-link {
  color: var(--accent-2);
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.card-inline-link:hover { color: var(--accent); }

/* FOOTER */
.footer {
  margin-top: 48px;
  padding: 24px;
  border-top: 1px solid var(--border);
}
.foot-inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
  gap: 12px;
  flex-wrap: wrap;
}
.foot-links { display: flex; gap: 14px; }
.foot-links a { color: var(--fg-dim); }
.foot-links a:hover { color: var(--accent); }

/* Scrollbar (webkit) */
.term-body::-webkit-scrollbar { width: 8px; }
.term-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.term-body::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 600px) {
  .hero { padding-top: 40px; }
  .term-body { font-size: 13px; min-height: 260px; }
  .foot-inner { justify-content: center; text-align: center; }
}
