:root {
  color-scheme: dark;
  --bg-primary: #080b12;
  --bg-secondary: #101624;
  --bg-surface: #171d2c;
  --bg-card: #1c2435;
  --text-primary: #f8fafc;
  --text-secondary: #a4aec1;
  --text-muted: #64748b;
  --accent-purple: #8b5cf6;
  --accent-cyan: #22d3ee;
  --border-subtle: rgba(255, 255, 255, .06);
  --border-mid: rgba(255, 255, 255, .12);
  --neutral-rgb: 255, 255, 255;
  --surface-rgb: 23, 29, 44;
  --hero-proof-rgb: 18, 24, 45;
  --nav-background: rgba(8, 11, 18, .88);
  --hero-background: linear-gradient(135deg, #080b12 0%, #0d1220 46%, #111735 100%);
  --hero-title-gradient: linear-gradient(135deg, #a78bfa, #22d3ee 60%, #6ee7b7);
  --hero-statement-gradient: linear-gradient(100deg, #c4b5fd, #67e8f9 58%, #6ee7b7);
  --reel-background: #0b1020;
  --reel-card-start: rgba(38, 43, 73, .87);
  --reel-card-start-purple: rgba(45, 31, 76, .92);
  --reel-card-start-cyan: rgba(20, 51, 69, .82);
  --reel-card-end: rgba(16, 22, 39, .96);
  --shadow-tint: 0, 0, 0;
  --font-heading: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg-primary: #f7f8ff;
  --bg-secondary: #edf1fb;
  --bg-surface: #fff;
  --bg-card: #fff;
  --text-primary: #1b2440;
  --text-secondary: #44536c;
  --text-muted: #53617a;
  --accent-purple: #613bbd;
  --accent-cyan: #006475;
  --border-subtle: rgba(36, 50, 88, .12);
  --border-mid: rgba(36, 50, 88, .22);
  --neutral-rgb: 36, 50, 88;
  --surface-rgb: 255, 255, 255;
  --hero-proof-rgb: 255, 255, 255;
  --nav-background: rgba(247, 248, 255, .90);
  --hero-background: linear-gradient(135deg, #fbfbff 0%, #eef0ff 53%, #e1f5fb 100%);
  --hero-title-gradient: linear-gradient(135deg, var(--light-purple), var(--light-cyan) 60%, var(--light-green));
  --hero-statement-gradient: linear-gradient(100deg, var(--light-purple), var(--light-cyan) 58%, var(--light-green));
  --reel-background: #eff2fc;
  --reel-card-start: #f2efff;
  --reel-card-start-purple: #f2e9fc;
  --reel-card-start-cyan: #e4f4f5;
  --reel-card-end: #fff;
  --shadow-tint: 75, 85, 125;
  --light-ink: #1b2440;
  --light-ink-soft: #44536c;
  --light-ink-muted: #53617a;
  --light-purple: #623db8;
  --light-cyan: #006475;
  --light-green: #176745;
  --light-amber: #804b00;
  --light-blue: #2458a2;
  --light-rose: #a41d4e;
  --light-red: #ac2029;
}

:root[data-theme='light'] {
  --timeline-highlight: linear-gradient(130deg, #fff 55%, #f0eaff);
}

.theme-control:not([hidden]) {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 82px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(var(--shadow-tint), .08);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.theme-switch span {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: background .2s ease, color .2s ease;
}
.theme-switch[aria-checked='false'] span:first-child,
.theme-switch[aria-checked='true'] span:last-child {
  background: #6540bd;
  color: #fff;
  box-shadow: 0 2px 8px rgba(101, 64, 189, .26);
}
.theme-switch:hover {
  border-color: var(--accent-purple);
  box-shadow: 0 3px 12px rgba(101, 64, 189, .14);
}

.theme-control button:focus-visible,
.hero-socials a:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

.hero-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-socials .social-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--social-ink);
  border-radius: 11px;
  background: var(--bg-surface);
  color: var(--social-ink);
  font-size: 1.12rem;
  text-decoration: none;
  transition: transform .2s ease, background-color .2s ease;
}

.hero-socials .social-icon:hover {
  background: var(--social-ink);
  color: var(--bg-primary);
  transform: translateY(-2px);
}

.hero-socials .linkedin { --social-ink: var(--light-blue, #8dc9ff); }
.hero-socials .whatsapp { --social-ink: var(--light-green, #7ee6ae); }
.hero-socials .github { --social-ink: var(--text-primary); }
.hero-socials .instagram { --social-ink: var(--light-rose, #f9a8d4); }

@media (prefers-reduced-motion: reduce) {
  .hero-socials .social-icon:hover { transform: none; }
}

@media (max-width: 900px) {
  .hero-socials { justify-content: center; }
}

@media (max-width: 480px) {
  .nav-bar { flex-wrap: wrap; }
}


/* Light mode is a first-class design, not merely inverted dark surfaces. */
:root[data-theme='light'] {
  --bg-primary: #f8fafc;
  --bg-secondary: #eef2f8;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #18243b;
  --text-secondary: #42516b;
  --text-muted: #52617a;
  --light-ink: #18243b;
  --light-ink-soft: #41516a;
  --light-ink-muted: #52617a;
  --light-purple: #5e35b1;
  --light-cyan: #0b6477;
  --light-green: #166944;
  --accent-purple: #5e35b1;
  --accent-cyan: #0b6477;
  --border-subtle: rgba(33, 47, 76, .13);
  --border-mid: rgba(33, 47, 76, .23);
  --nav-background: rgba(255, 255, 255, .94);
  --hero-background: linear-gradient(125deg, #ffffff 0%, #f4f1ff 51%, #edf9fc 100%);
  --hero-title-gradient: linear-gradient(115deg, #5331a4 0%, #09677e 72%, #1b6a49 100%);
  --hero-statement-gradient: linear-gradient(115deg, #5331a4, #09677e 64%, #1b6a49);
  --reel-background: #f3f6fb;
  --reel-card-start: #ffffff;
  --reel-card-start-purple: #faf7ff;
  --reel-card-start-cyan: #f3fafc;
  --reel-card-end: #ffffff;
  --shadow-tint: 39, 55, 86;
}

:root[data-theme='light'] body {
  background: var(--bg-primary);
  color: var(--text-primary);
}

:root[data-theme='light'] .navbar,
:root[data-theme='light'] .navbar.scrolled {
  background: var(--nav-background);
  border-bottom: 1px solid rgba(42, 58, 87, .12);
  box-shadow: 0 6px 24px rgba(42, 58, 87, .07);
}
:root[data-theme='light'] .nav-link { color: #41516a; }
:root[data-theme='light'] .nav-link:hover,
:root[data-theme='light'] .nav-link.active {
  color: #43218d;
  background: rgba(102, 67, 184, .1);
}
:root[data-theme='light'] .nav-toggle { border-color: #cbd4e1; background: #fff; }
:root[data-theme='light'] .nav-toggle .bar { background: #263651; }
:root[data-theme='light'] .mobile-drawer {
  background: linear-gradient(180deg, #fff, #f5f7fc);
  border-left-color: #e0e5ef;
  box-shadow: -20px 0 50px rgba(26, 40, 73, .16);
}
:root[data-theme='light'] .theme-switch {
  background: #f5f7fd;
  border-color: #c7cee0;
}

:root[data-theme='light'] .hero {
  background-image:
    radial-gradient(ellipse 48% 52% at 78% 40%, rgba(123, 95, 219, .13), transparent 76%),
    radial-gradient(ellipse 35% 45% at 5% 80%, rgba(22, 147, 170, .07), transparent 76%),
    var(--hero-background);
}
:root[data-theme='light'] .hero::after { opacity: .4; }
:root[data-theme='light'] .glow-orb { opacity: .42; }
:root[data-theme='light'] .hero-grid-overlay {
  background-image: linear-gradient(rgba(30, 49, 82, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 49, 82, .045) 1px, transparent 1px);
}
:root[data-theme='light'] .hero-proof span,
:root[data-theme='light'] .stat-card,
:root[data-theme='light'] .reel-card,
:root[data-theme='light'] .timeline-card,
:root[data-theme='light'] .pro-card,
:root[data-theme='light'] .personal-card {
  background-color: rgba(255, 255, 255, .93);
  border-color: rgba(39, 55, 86, .13);
  box-shadow: 0 7px 28px rgba(37, 50, 79, .055);
}
:root[data-theme='light'] .reel-card {
  background-image: linear-gradient(145deg, var(--reel-card-start-purple), #fff);
}
:root[data-theme='light'] .reel-card:nth-child(3) {
  background-image: linear-gradient(145deg, var(--reel-card-start-cyan), #fff);
}
:root[data-theme='light'] .timeline-card[data-highlight='true'] {
  background-image: linear-gradient(130deg, #fff 55%, #f3edff);
  border-color: rgba(94, 53, 177, .24);
}
:root[data-theme='light'] .pro-card:hover,
:root[data-theme='light'] .personal-card:hover,
:root[data-theme='light'] .reel-card:hover {
  border-color: rgba(94, 53, 177, .35);
  box-shadow: 0 18px 42px rgba(51, 52, 96, .12);
}
:root[data-theme='light'] .personal-tech-row span {
  background: #edf9f2;
  border-color: #cde8d7;
  color: #166944;
}
:root[data-theme='light'] .card-badge,
:root[data-theme='light'] .card-company-chip,
:root[data-theme='light'] .pro-company,
:root[data-theme='light'] .personal-desc {
  color: var(--text-secondary);
}
:root[data-theme='light'] .hero-socials .social-icon {
  background: #fff;
  border-width: 1.5px;
  box-shadow: 0 3px 13px rgba(34, 47, 75, .05);
}
:root[data-theme='light'] .hero-socials .social-icon:hover {
  background: var(--social-ink);
  color: #fff;
  border-color: var(--social-ink);
}
:root[data-theme='light'] .btn-outline {
  color: #263651;
  background: rgba(255,255,255,.88);
  border-color: rgba(46, 61, 91, .24);
}
:root[data-theme='light'] .btn-outline:hover {
  color: #43218d;
  background: #f4f0ff;
}

@media (max-width: 500px) {
  .theme-switch { min-width: 76px; }
  .theme-switch span { width: 32px; height: 32px; }
}

/* Developer-tool ownership and links */
.project-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.project-owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, .24);
  background: rgba(139, 92, 246, .1);
  color: var(--light-purple, #c4b5fd);
  font-size: .69rem;
  font-weight: 700;
  line-height: 1.2;
}
.project-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 20px;
  row-gap: 10px;
  margin-top: auto;
}
.project-actions .project-link {
  margin: 0;
  min-height: 34px;
}
:root .project-source-link {
  color: var(--light-ink-soft, #cbd5e1);
}
:root .project-source-link:hover {
  color: var(--light-purple, #c4b5fd);
}

/* Open-source developer tool featured section */
.npm-feature-section {
  padding: clamp(60px, 8vw, 112px) 24px;
  background: var(--bg-secondary);
  border-block: 1px solid var(--border-subtle);
  scroll-margin-top: 106px;
}
.npm-feature-container {
  width: min(100%, 1200px);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 74px);
  align-items: center;
}
.npm-feature-copy { min-width: 0; }
.npm-eyebrow {
  display: flex; align-items: center; gap: 10px;
  color: var(--light-purple, #c4b5fd);
  font-size: .75rem; font-weight: 750; text-transform: uppercase;
  letter-spacing: .09em; margin: 0 0 20px;
}
.npm-feature-copy h2 {
  margin: 0 0 20px;
  font: 750 clamp(2.25rem, 4.5vw, 4.1rem)/1.12 'Space Grotesk', sans-serif;
  letter-spacing: -.05em; color: var(--text-primary);
}
.npm-feature-copy h2 span { color: var(--light-purple, #a78bfa); }
.npm-feature-lead { color: var(--text-secondary); line-height: 1.8; font-size: 1.05rem; }
.npm-feature-lead strong { color: var(--text-primary); overflow-wrap: anywhere; }
.npm-feature-note { margin: 14px 0 0; color: var(--text-secondary); font-size: .85rem; line-height: 1.75; }
.npm-feature-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 26px; }
.npm-feature-tags span {
  padding: 6px 11px; border: 1px solid var(--border-mid); border-radius: 999px;
  background: var(--bg-surface); color: var(--text-secondary); font-size: .75rem; font-weight: 600;
}
.npm-feature-links { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; }
.npm-feature-links a { color: var(--light-purple, #a78bfa); font-weight: 750; font-size: .85rem; text-decoration: underline; text-underline-offset: 4px; }
.npm-feature-links .npm-feature-primary {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 20px; background: #6841c0; color: #fff;
  border: 1px solid #8765d2; border-radius: 11px; text-decoration: none;
  box-shadow: 0 8px 20px rgba(78,44,143,.16);
}
.npm-feature-links .npm-feature-primary:hover { background: #502c9b; }
.npm-feature-visual {
  display: block; overflow: hidden; min-width: 0;
  border: 1px solid var(--border-mid); border-radius: 20px;
  background: var(--bg-surface); box-shadow: 0 18px 44px rgba(var(--shadow-tint), .14);
  text-decoration: none;
}
.npm-feature-visual img { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; }
.npm-feature-visual span {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; color: var(--text-primary);
  font-size: .85rem; font-weight: 750;
}
.npm-feature-visual:hover { border-color: var(--accent-purple); }
:root[data-theme='light'] .npm-feature-section { background: #f1f4fa; }
:root[data-theme='light'] .npm-feature-links a { color: #5832aa; }
:root[data-theme='light'] .npm-feature-links .npm-feature-primary { color: #fff; }
:root[data-theme='light'] .npm-feature-visual { background: #fff; }
@media (max-width: 830px) {
  .npm-feature-container { grid-template-columns: 1fr; }
  .npm-feature-section { padding-inline: 18px; }
  .npm-feature-copy h2 { font-size: clamp(2.1rem, 8vw, 3.4rem); }
  .npm-feature-visual { max-width: 680px; }
}
