:root {
  --bg: #05070f;
  --text: #e8ecf9;
  --muted: #9ea6c6;
  --accent: #76f3ff;
  --accent-2: #8d7bff;
  --glass: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.2);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  --header-bg: rgba(5, 7, 15, 0.5);
}

[data-theme="light"] {
  --bg: #eef2ff;
  --text: #12182d;
  --muted: #47506f;
  --accent: #2563eb;
  --accent-2: #8b5cf6;
  --glass: rgba(255, 255, 255, 0.62);
  --border: rgba(18, 24, 45, 0.12);
  --shadow: 0 12px 26px rgba(71, 83, 129, 0.18);
  --header-bg: rgba(238, 242, 255, 0.76);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.site-header,
main,
footer {
  position: relative;
  z-index: 2;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 7vw;
  backdrop-filter: blur(10px);
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.15rem;
}

.nav-links {
  display: flex;
  gap: 1.2rem;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

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

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  border-radius: 999px;
  width: 2.2rem;
  height: 2.2rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.25s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-icon {
  font-size: 1rem;
  line-height: 1;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.repo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2.2rem;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  transition: transform 0.2s ease, background 0.25s ease;
}

.repo-link:hover {
  transform: translateY(-1px);
}

main,
footer {
  width: min(1120px, 88vw);
  margin: 0 auto;
}

.hero {
  padding: 14vh 0 10vh;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 1fr);
  gap: 1.2rem;
  align-items: center;
}

.hero-avatar {
  border-radius: 18px;
  padding: 1.2rem;
  text-align: center;
}

.avatar-orb {
  width: 108px;
  height: 108px;
  margin: 0 auto 0.8rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  background: radial-gradient(circle at 20% 20%, var(--accent), var(--accent-2));
  box-shadow: 0 16px 30px rgba(90, 120, 255, 0.3);
}

.eyebrow {
  color: var(--accent);
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin-bottom: 0.6rem;
}

h1 {
  font-size: clamp(2rem, 8vw, 4.4rem);
  line-height: 1.05;
  margin: 0 0 1rem;
}

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

.hero-actions {
  margin-top: 1.8rem;
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #061019;
  box-shadow: 0 8px 26px rgba(130, 150, 255, 0.35);
}

.btn.ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.hero-metrics {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.metric h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.metric {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 120px;
  padding: 1rem 1rem 1.1rem;
  border-radius: 16px;
}

.metric-icon {
  font-size: 1.55rem;
  color: var(--accent);
}

.metric p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.section {
  padding: 1rem 0 2rem;
}

h3 {
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  margin-bottom: 1rem;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

h4 {
  margin: 0.1rem 0 0.65rem;
  font-size: 1.05rem;
}

p,
li {
  color: var(--muted);
  line-height: 1.7;
}

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

.panel {
  border-radius: 16px;
  padding: 1rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.period {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

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

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.project-tags span {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.btn-sm {
  font-size: 0.82rem;
  padding: 0.5rem 0.8rem;
}

.contact {
  padding-bottom: 5rem;
}

.contact-layer {
  margin-top: 1rem;
}

.layer-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--text);
}

.contact-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: stretch;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-align: center;
  border-radius: 14px;
  padding: 0.9rem;
  text-decoration: none;
  color: var(--text);
  height: 100%;
  margin: 0;
}

.metric,
.timeline-item,
.skills-grid .panel,
.projects-grid .panel {
  height: 100%;
}

.foot-note {
  margin-top: 1rem;
  font-size: 0.9rem;
}

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

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

.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.15s ease;
}

@media (max-width: 960px) {
  .hero-grid,
  .hero-metrics,
  .projects-grid,
  .skills-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }

  .repo-link {
    padding: 0 0.6rem;
  }
}
