:root {
  color-scheme: dark;
  --bg: #080a12;
  --bg-elevated: rgba(16, 19, 32, 0.76);
  --surface: #10131f;
  --surface-hover: #151a2a;
  --text: #f4f7ff;
  --text-muted: #9aa3ba;
  --text-faint: #687189;
  --line: rgba(153, 166, 202, 0.16);
  --line-strong: rgba(153, 166, 202, 0.28);
  --blue: #5b8cff;
  --violet: #9b6dff;
  --cyan: #27e0c1;
  --glow: rgba(91, 140, 255, 0.2);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  scroll-behavior: smooth;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8ff;
  --bg-elevated: rgba(255, 255, 255, 0.82);
  --surface: #ffffff;
  --surface-hover: #f5f7ff;
  --text: #111426;
  --text-muted: #586078;
  --text-faint: #7c849b;
  --line: rgba(40, 51, 85, 0.12);
  --line-strong: rgba(40, 51, 85, 0.22);
  --blue: #315efb;
  --violet: #7647eb;
  --cyan: #008f7a;
  --glow: rgba(49, 94, 251, 0.14);
  --shadow: 0 24px 80px rgba(42, 54, 96, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--bg);
  background-size: 72px 72px;
  background-position: center -1px;
  transition: color 180ms ease, background-color 180ms ease;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(to bottom, transparent 20%, var(--bg) 78%);
  pointer-events: none;
}

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

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.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;
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 44rem;
  height: 44rem;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.13;
  pointer-events: none;
}

.ambient-one {
  top: -26rem;
  left: -14rem;
  background: var(--violet);
}

.ambient-two {
  top: 8rem;
  right: -30rem;
  background: var(--blue);
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  padding: 28px 0;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff;
  font-size: 0.86rem;
  letter-spacing: 0;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  border-radius: 9px;
  box-shadow: 0 0 24px var(--glow);
}

.brand-dot,
.footer-wordmark span {
  color: var(--cyan);
}

.site-nav {
  display: flex;
  gap: 28px;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.site-nav a {
  transition: color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.theme-toggle {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
}

.theme-toggle-track {
  display: flex;
  width: 34px;
  height: 20px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.theme-toggle-track span {
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  border-radius: 50%;
  transform: translateX(14px);
  transition: transform 180ms ease;
}

[data-theme="light"] .theme-toggle-track span {
  transform: translateX(0);
}

main {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 80px;
  align-items: center;
  min-height: 620px;
  padding: 72px 0 72px;
}

.eyebrow,
.section-index {
  margin: 0 0 26px;
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--cyan);
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(3.8rem, 8vw, 7rem);
  font-weight: 720;
  letter-spacing: -0.065em;
  line-height: 0.92;
}

.hero h1 span {
  color: transparent;
  background: linear-gradient(110deg, var(--blue), var(--violet) 58%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-intro {
  max-width: 620px;
  margin: 34px 0 0;
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 40px;
}

.button {
  display: inline-flex;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
  min-width: 180px;
  padding: 14px 18px;
  font-size: 0.86rem;
  font-weight: 650;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

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

.button-primary {
  color: #fff;
  background: linear-gradient(110deg, #4169f2, #8257ef);
  border-color: transparent;
  box-shadow: 0 12px 36px var(--glow);
}

.button-secondary {
  background: var(--bg-elevated);
  backdrop-filter: blur(14px);
}

.profile-panel {
  position: relative;
  padding: 38px;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(145deg, var(--bg-elevated), color-mix(in srgb, var(--surface) 88%, transparent));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.profile-panel::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(135deg, var(--glow), transparent 42%);
  pointer-events: none;
}

.profile-avatar {
  position: relative;
  width: 104px;
  height: 104px;
  padding: 5px;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  box-shadow: 0 0 40px var(--glow);
}

.profile-handle {
  position: relative;
  margin: 16px 0 28px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
}

.profile-stats {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-stats div + div {
  border-left: 1px solid var(--line);
}

.profile-stats strong,
.profile-stats span {
  display: block;
}

.profile-stats strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.7rem;
}

.profile-stats span {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 0.72rem;
}

.profile-sync {
  position: relative;
  margin: 22px 0 0;
  color: var(--text-faint);
  font-size: 0.72rem;
}

.profile-sync .status-dot {
  width: 5px;
  height: 5px;
}

.project-section {
  padding: 64px 0 88px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 34px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4.7rem);
  letter-spacing: -0.055em;
}

.section-heading > p {
  max-width: 380px;
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.section-index {
  margin-bottom: 16px;
}

.project-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.search-field,
.filter-field {
  display: flex;
  align-items: center;
  min-height: 46px;
  color: var(--text-faint);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 10px;
  backdrop-filter: blur(12px);
}

.search-field {
  flex: 1;
  gap: 10px;
  padding: 0 15px;
}

.search-field input,
.filter-field select {
  width: 100%;
  height: 44px;
  background: transparent;
  border: 0;
  outline: 0;
}

.search-field:focus-within,
.filter-field:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--glow);
}

.filter-field {
  width: 170px;
  padding: 0 12px;
}

.result-status {
  min-height: 24px;
  margin: 0 0 18px;
  color: var(--text-faint);
  font-size: 0.76rem;
}

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

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  padding: 22px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.project-card:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  transform: translateY(-4px);
}

.project-card.featured::after {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 190px;
  height: 190px;
  content: "";
  background: var(--blue);
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.16;
  pointer-events: none;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
  margin-bottom: 20px;
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
}

.featured-label {
  color: var(--cyan);
}

.project-card h3 {
  margin: 0;
  font-size: 1.24rem;
  letter-spacing: -0.025em;
}

.project-card h3 a::after {
  position: absolute;
  inset: 0;
  content: "";
}

.project-description {
  display: -webkit-box;
  margin: 14px 0 24px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-top: auto;
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
}

.language {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.language::before {
  width: 7px;
  height: 7px;
  content: "";
  background: var(--language-color, var(--blue));
  border-radius: 50%;
  box-shadow: 0 0 8px color-mix(in srgb, var(--language-color, var(--blue)) 50%, transparent);
}

.project-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 0;
}

.project-topics span {
  padding: 5px 8px;
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.61rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.skeleton {
  min-height: 240px;
  background: linear-gradient(100deg, var(--surface) 20%, var(--surface-hover) 42%, var(--surface) 64%);
  background-size: 200% 100%;
  animation: shimmer 1.35s infinite linear;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 70px 24px;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
}

.empty-state a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  padding: 60px 0 70px;
  margin: 0 auto;
  color: var(--text-faint);
  border-top: 1px solid var(--line);
}

.footer-wordmark {
  color: var(--text);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.site-footer p {
  margin: 4px 0;
  font-size: 0.74rem;
}

.site-footer > a {
  font-size: 0.76rem;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 60px;
    padding-top: 72px;
  }

  .profile-panel {
    max-width: 480px;
  }

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

@media (max-width: 640px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 32px, 1180px);
  }

  .site-header {
    padding-top: 20px;
  }

  .site-nav {
    gap: 16px;
  }

  .site-nav > a:first-child,
  .theme-toggle-label {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 56px 0 60px;
  }

  .hero h1 {
    font-size: clamp(3.25rem, 17vw, 5rem);
  }

  .hero-actions,
  .section-heading,
  .project-toolbar,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .section-heading {
    gap: 20px;
  }

  .project-section {
    padding: 56px 0 72px;
  }

  .filter-field {
    width: 100%;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: 240px;
  }

  .site-footer {
    gap: 24px;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
