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

:root {
  --bg: #030003;
  --bg-elevated: #141414;
  --bg-card: #141414;
  --text: #e4e4e4;
  --text-muted: #888;
  --accent: #4dd864;
  --accent-hover: #6ee787;
  --accent-dim: rgba(77, 216, 100, 0.15);
  --accent-glow: rgba(77, 216, 100, 0.08);
  --border: #2a2a2a;
  --nav-bg: rgba(10, 10, 10, 0.85);
  --scanline-color: rgba(77, 216, 100, 0.008);
  --hero-glow: rgba(77, 216, 100, 0.04);
  --card-shadow: rgba(77, 216, 100, 0.05);
  --cta-shadow: rgba(77, 216, 100, 0.3);
  --pulse-shadow: rgba(77, 216, 100, 0.4);
  --dot-shadow: rgba(77, 216, 100, 0.4);
  --dot-bg: #030003;
  --avatar-filter: none;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", Consolas, monospace;
  --max-width: 1080px;
  --gap: 2rem;
  --nav-height: 56px;
}

:root,
[data-theme="dark"] {
  /* dark-mode overrides (defaults from :root above) */
  --avatar-filter: none;
}

[data-theme="light"] {
  --bg: #f8f9fa;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #555;
  --accent: #2d9a4e;
  --accent-hover: #38b860;
  --accent-dim: rgba(45, 154, 78, 0.18);
  --accent-glow: rgba(45, 154, 78, 0.06);
  --border: #e0e0e0;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --scanline-color: rgba(0, 0, 0, 0.01);
  --hero-glow: rgba(45, 154, 78, 0.06);
  --card-shadow: rgba(45, 154, 78, 0.08);
  --dot-bg: #f8f9fa;
  --cta-shadow: rgba(45, 154, 78, 0.25);
  --pulse-shadow: rgba(45, 154, 78, 0.3);
  --dot-shadow: rgba(45, 154, 78, 0.3);
  --avatar-filter: none;
}

[data-theme="dark"] {
  --bg: #030003;
  --bg-elevated: #141414;
  --bg-card: #141414;
  --text: #e4e4e4;
  --text-muted: #888;
  --accent: #4dd864;
  --accent-hover: #6ee787;
  --accent-dim: rgba(77, 216, 100, 0.15);
  --accent-glow: rgba(77, 216, 100, 0.08);
  --border: #2a2a2a;
  --nav-bg: rgba(10, 10, 10, 0.85);
  --scanline-color: rgba(77, 216, 100, 0.008);
  --hero-glow: rgba(77, 216, 100, 0.04);
  --card-shadow: rgba(77, 216, 100, 0.05);
  --cta-shadow: rgba(77, 216, 100, 0.3);
  --pulse-shadow: rgba(77, 216, 100, 0.4);
  --dot-shadow: rgba(77, 216, 100, 0.4);
  --dot-bg: #030003;
  --avatar-filter: brightness(0.8) contrast(1.05) saturate(0.8) hue-rotate(90deg) sepia(0.15) drop-shadow(0 0 8px rgba(77, 216, 100, 0.12));
}

html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    var(--scanline-color) 2px,
    var(--scanline-color) 4px
  );
  pointer-events: none;
  z-index: 999;
}

#cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
  opacity: 0;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gap);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

/* ── Nav ── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent) !important;
  letter-spacing: 0.1em;
}

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

.nav-links a {
  font-size: 0.85rem;
  color: var(--text-muted) !important;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent) !important;
}

/* ── Hero ── */

.hero {
  padding: calc(var(--nav-height) + 6rem) 0 6rem;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, var(--hero-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
}

.hero-avatar {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-elevated);
  filter: var(--avatar-filter);
}

.hero-text {
  flex: 1;
  min-width: 0;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--pulse-shadow); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(77, 216, 100, 0); }
}

.role {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.typing-text {
  /* text inserted by JS typing animation */
}

.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  max-width: 520px;
}

.about {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 560px;
  line-height: 1.7;
}

.cta {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.cta:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 20px var(--cta-shadow);
}

/* ── Section headings ── */

section {
  padding: 4rem 0;
  position: relative;
}

section:not(:first-of-type)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), var(--accent-dim), var(--border), transparent);
}

.terminal-prompt {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  opacity: 0.5;
  margin-bottom: 0.25rem;
}

section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
/* ── Stats ── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.stat:hover::before {
  opacity: 1;
}

.stat:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 20px var(--card-shadow);
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

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

/* ── Services ── */

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.service {
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.service::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.service:hover::before {
  opacity: 1;
}

.service:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 25px var(--card-shadow);
}

.service-icon-wrap {
  margin-bottom: 1rem;
}

.service-icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.service h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.service p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Stack ── */

.stack-group {
  margin-bottom: 2rem;
}

.stack-category {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--accent);
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stack-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.stack-item:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: 0 0 15px var(--card-shadow);
}

.stack-logo {
  width: 36px;
  height: 36px;
  color: var(--accent);
}

.stack-name {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Experience / Timeline ── */

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline-line {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border) 60%, transparent);
}

.entry {
  position: relative;
  padding-bottom: 2.5rem;
}

.entry:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -2.3rem;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  z-index: 1;
  transition: box-shadow 0.3s;
}

.entry:hover .timeline-dot {
  box-shadow: 0 0 10px var(--dot-shadow);
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-bottom: 0.5rem;
}

.entry-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.period {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.entry > p {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tags span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
}

/* ── Contact ── */

.contact > .container > p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-link {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.contact-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.contact-link:hover::before {
  opacity: 1;
}

.contact-link:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 20px var(--card-shadow);
}

.contact-link .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.contact-link > span:last-child {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
}

/* ── Footer ── */

footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Scroll Reveal ── */

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

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

/* ── Pixel Canvas ── */

#pixels {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ── Responsive ── */
@media (min-width: 900px) {
  .hero-content {
    flex-direction: row;
    align-items: center;
  }
}

@media (min-width: 600px) {
  .hero h1 {
    font-size: 3rem;
  }

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

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stack-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .contact-links {
    flex-direction: row;
  }

  .contact-link {
    flex: 1;
  }
}

@media (max-width: 400px) {
  .hero {
    padding: calc(var(--nav-height) + 3rem) 0 2rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .hero-avatar {
    display: none;
  }

  .nav-links {
    gap: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .stat {
    padding: 1rem;
  }

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

  .entry-header {
    flex-direction: column;
  }

  .timeline {
    padding-left: 1.5rem;
  }

  .timeline-dot {
    left: -1.8rem;
  }

  section {
    padding: 3rem 0;
  }
}
/* ── System Theme Sync ── */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f8f9fa;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --text: #1a1a1a;
    --text-muted: #555;
    --accent: #2d9a4e;
    --accent-hover: #38b860;
    --accent-dim: rgba(45, 154, 78, 0.18);
    --accent-glow: rgba(45, 154, 78, 0.06);
    --border: #e0e0e0;
    --nav-bg: rgba(255, 255, 255, 0.85);
    --scanline-color: rgba(0, 0, 0, 0.01);
    --hero-glow: rgba(45, 154, 78, 0.06);
    --card-shadow: rgba(45, 154, 78, 0.08);
    --cta-shadow: rgba(45, 154, 78, 0.25);
    --pulse-shadow: rgba(45, 154, 78, 0.3);
    --dot-shadow: rgba(45, 154, 78, 0.3);
    --dot-bg: #f8f9fa;
    --avatar-filter: none;
  }
}
