:root {
  --bg: #070b14;
  --bg-soft: #10192b;
  --surface: rgba(17, 24, 39, 0.55);
  --text: #e8ecf4;
  --muted: #a4b0c3;
  --line: rgba(151, 165, 191, 0.2);
  --brand: #72a8ff;
  --brand-2: #7f7fff;
  --shadow: 0 12px 40px rgba(3, 8, 24, 0.4);
}

body.light {
  --bg: #eff3fb;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --text: #111827;
  --muted: #4b5563;
  --line: rgba(17, 24, 39, 0.12);
  --brand: #335eff;
  --brand-2: #9249ff;
  --shadow: 0 14px 36px rgba(70, 80, 110, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 20%, #0f1f3b 0%, var(--bg) 45%);
  min-height: 100vh;
  overflow-x: hidden;
}

body.light {
  background: linear-gradient(160deg, #ebefff 0%, #f8fbff 50%, #eef2ff 100%);
}

h1,
h2,
h3,
h4 {
  font-family: "Space Grotesk", Inter, sans-serif;
  margin: 0;
}

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

main {
  width: min(1150px, 92vw);
  margin: 0 auto;
}

.splash {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 100;
  background: var(--bg);
  color: var(--text);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash.hide {
  opacity: 0;
  visibility: hidden;
}

#particles {
  position: fixed;
  inset: 0;
  z-index: -3;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.2;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  animation: drift 30s linear infinite;
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(42px); }
}

.glass {
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.site-header {
  width: min(1150px, 92vw);
  margin: 1rem auto 0;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0.8rem;
  z-index: 20;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--brand);
}

nav {
  display: flex;
  gap: 1rem;
}

nav a {
  font-size: 0.92rem;
  color: var(--muted);
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--text);
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn,
.btn,
.filter-row button {
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  border-radius: 12px;
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.icon-btn:hover,
.btn:hover,
.filter-row button:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 60%, var(--line));
}

.btn.primary,
.filter-row .active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-color: transparent;
}

.hero {
  min-height: calc(100vh - 96px);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 2rem;
  padding: 2.5rem 0;
}

.pill {
  display: inline-block;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  margin-bottom: 1rem;
}

.hero-name {
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, #f8fafc, #78a7ff, #bfa1ff, #f8fafc);
  background-size: 280%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: glowText 8s linear infinite;
}

body.light .hero-name {
  background: linear-gradient(90deg, #1f2937, #3455ea, #8d3dff, #111827);
  background-size: 280%;
  -webkit-background-clip: text;
  background-clip: text;
}

@keyframes glowText {
  from { background-position: 0%; }
  to { background-position: 280%; }
}

.hero-subtitle {
  margin: 0.7rem 0;
  font-size: clamp(1rem, 2.5vw, 1.45rem);
}

.hero-intro {
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.8;
}

.cta-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.3rem;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  display: grid;
  gap: 1rem;
}

.orb-wrap {
  height: 190px;
  display: grid;
  place-items: center;
}

.orb {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f6fbff, #6a91ff 42%, #7f4dff 75%, #2a214a 100%);
  box-shadow: 0 0 90px rgba(93, 128, 255, 0.6);
  transition: transform 0.16s linear;
}

.terminal {
  border-radius: 18px;
  overflow: hidden;
}

.terminal header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
}

.terminal header span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f87171;
}

.terminal header span:nth-child(2) { background: #fbbf24; }
.terminal header span:nth-child(3) { background: #4ade80; }

.terminal header p {
  margin: 0 0 0 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.terminal-log {
  height: 180px;
  overflow: auto;
  padding: 0.9rem;
  font-family: Consolas, monospace;
  font-size: 0.88rem;
  color: #91f2af;
}

body.light .terminal-log {
  color: #1f6f42;
}

#terminal-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-top: 1px solid var(--line);
  padding: 0.7rem 0.9rem;
  font-family: Consolas, monospace;
}

#terminal-input {
  width: 100%;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}

.section {
  padding: 5rem 0;
}

.section h3 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: 0.8rem;
}

.section p {
  color: var(--muted);
  line-height: 1.8;
}

.section-head {
  margin-bottom: 1.4rem;
}

.skills-grid,
.project-grid,
.repo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.skill-card,
.project-card,
.repo-card,
.time-item,
.contact-card,
.contact-form,
.contrib-block {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.skill-card:hover,
.project-card:hover,
.repo-card:hover,
.time-item:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brand) 68%, var(--line));
}

.skill-card h4,
.project-card h4,
.repo-card h4 {
  margin-bottom: 0.8rem;
}

.meter {
  height: 8px;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 0.8s ease;
}

.filter-row {
  display: flex;
  gap: 0.7rem;
  margin: 0.4rem 0 1rem;
  flex-wrap: wrap;
}

.project-tags,
.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.8rem 0;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.card-links {
  display: flex;
  gap: 0.6rem;
}

.github-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem;
}

.stat strong {
  display: block;
  font-size: 1.4rem;
}

.contrib-grid {
  display: grid;
  grid-template-columns: repeat(20, 11px);
  gap: 4px;
  margin-top: 0.8rem;
}

.contrib-cell {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.2);
}

.contrib-cell.l1 { background: #1e3a8a; }
.contrib-cell.l2 { background: #2563eb; }
.contrib-cell.l3 { background: #3b82f6; }
.contrib-cell.l4 { background: #60a5fa; }

.timeline {
  border-left: 2px solid var(--line);
  margin-left: 0.55rem;
  padding-left: 1.2rem;
  display: grid;
  gap: 1rem;
}

.time-item {
  position: relative;
}

.time-item::before {
  content: "";
  position: absolute;
  left: -1.85rem;
  top: 1.1rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
}

.contact-wrap {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1rem;
}

.contact-form {
  display: grid;
  gap: 0.5rem;
}

.contact-form input,
.contact-form textarea {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.66rem 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
  outline: none;
}

.form-note {
  min-height: 1.2rem;
}

footer {
  width: min(1150px, 92vw);
  margin: 0 auto;
  padding: 1.4rem 0 2.5rem;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

