:root {
  --bg: #0c1222;
  --bg-elevated: #121a2e;
  --bg-card: #151f36;
  --bg-card-hover: #1a2744;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #e8edf7;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-2: #f472b6;
  --accent-2-soft: rgba(244, 114, 182, 0.1);
  --green: #34d399;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --container: 1080px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 70%);
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 1;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(12, 18, 34, 0.8);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.header-start {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.lang-switcher-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.lang-switcher-btns {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  color: #0c1222;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-tagline {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

main {
  position: relative;
  z-index: 1;
}

.hero {
  padding: 3.5rem 0 2.5rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-lead {
  max-width: 42rem;
  margin: 0 0 2rem;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.hero-lead code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 0.15em 0.45em;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.stat {
  min-width: 7rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}

.stat-label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.filters-section {
  padding: 0 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(var(--bg) 70%, transparent);
  padding-top: 0.5rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.filter-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.filter-btn.is-active {
  background: var(--accent-soft);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--accent);
}

.projects-section {
  padding-bottom: 3rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.project-card.is-hidden {
  display: none;
}

.project-card--wide {
  grid-column: 1 / -1;
}

.card-top {
  margin-bottom: 0.85rem;
}

.card-category {
  display: inline-block;
  margin-bottom: 0.6rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--accent-2-soft);
  color: var(--accent-2);
}

.project-card[data-category="data"] .card-category {
  background: rgba(52, 211, 153, 0.12);
  color: var(--green);
}

.project-card[data-category="learning"] .card-category {
  background: rgba(129, 140, 248, 0.12);
  color: #a5b4fc;
}

.project-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.project-card h2 a {
  color: inherit;
  text-decoration: none;
}

.project-card h2 a:hover {
  color: var(--accent);
}

.card-domain {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.card-desc {
  flex: 1;
  margin: 0 0 1rem;
  font-size: 0.925rem;
  color: var(--text-muted);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
}

.card-tags li {
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #0c1222;
}

.btn-primary:hover {
  background: #7dd3fc;
}

.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  background: transparent;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

.mini-apps {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.mini-apps-title {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.mini-apps-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-apps-list a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.mini-apps-list a:hover {
  border-color: rgba(56, 189, 248, 0.3);
  background: var(--accent-soft);
}

.mini-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.mini-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.about-section {
  padding: 1rem 0 3.5rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.about-card {
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.about-card h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  font-weight: 700;
}

.about-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.about-card code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--accent);
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-inner p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .lang-switcher {
    justify-content: space-between;
  }

  .hero {
    padding-top: 2.5rem;
  }

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

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
