:root {
  color-scheme: light;
  --bg: #f7f8fc;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-muted: #f4f4ff;
  --header: #171a2b;
  --header-strong: #0f1222;
  --text: #20243a;
  --muted: #5d647f;
  --border: rgba(98, 94, 255, 0.14);
  --accent: #625eff;
  --accent-dark: #4a46cc;
  --accent-soft: rgba(98, 94, 255, 0.1);
  --shadow: 0 18px 48px rgba(16, 20, 40, 0.08);
  --radius: 16px;
  --content-width: 1140px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Roboto, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

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

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

img {
  max-width: 100%;
}

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

.site-header {
  position: static;
  background: var(--header);
  color: #ffffff;
  box-shadow: 0 8px 28px rgba(11, 13, 26, 0.22);
}

.site-header-top,
.footer-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header-top {
  min-height: 4.5rem;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand:hover,
.source-link:hover,
.nav-link:hover {
  color: #ffffff;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff 0%, #8f8bff 100%);
  box-shadow: 0 0 18px rgba(143, 139, 255, 0.7);
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 500;
}

.icon-link {
  justify-content: center;
  width: 2.5rem;
  min-width: 2.5rem;
  padding: 0;
}

.header-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.site-nav {
  background: var(--header-strong);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: stretch;
  overflow: visible;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 3.2rem;
  padding: 0 1rem;
  border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 500;
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.03);
}

.nav-link-active {
  border-bottom-color: var(--accent);
  color: #ffffff;
}

.nav-dropdown {
  position: relative;
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  padding-bottom: 0.35rem;
  margin-bottom: -0.35rem;
}

.nav-summary {
  list-style: none;
  cursor: pointer;
}

.nav-summary::-webkit-details-marker {
  display: none;
}

.nav-summary::after {
  content: "▾";
  margin-left: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.8;
}

.nav-dropdown[open] .nav-summary,
.nav-dropdown:hover .nav-summary,
.nav-dropdown:focus-within .nav-summary {
  background: rgba(255, 255, 255, 0.03);
}

.nav-summary.nav-link-active {
  border-bottom-color: var(--accent);
  color: #ffffff;
}

.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  display: none;
  min-width: 14rem;
  max-width: min(18rem, calc(100vw - 2rem));
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(10, 16, 32, 0.22);
}

.nav-dropdown[open] .nav-menu,
.nav-dropdown:hover .nav-menu,
.nav-dropdown:focus-within .nav-menu {
  display: block;
}

.nav-menu a {
  display: block;
  padding: 0.7rem 0.85rem;
  border-radius: 0.65rem;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-menu a:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.hero {
  display: flex;
  align-items: center;
  min-height: 70vh;
  padding: 6rem 0 5.5rem;
  text-align: center;
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(15, 18, 34, 0.75), rgba(15, 18, 34, 0.9)),
    radial-gradient(circle at 20% 18%, rgba(98, 94, 255, 0.48), transparent 24rem),
    radial-gradient(circle at 80% 10%, rgba(141, 138, 255, 0.34), transparent 22rem),
    linear-gradient(135deg, #14182d 0%, #1b2240 55%, #121629 100%);
}

.hero .container {
  max-width: 980px;
}

.hero-copy {
  max-width: 860px;
  margin: 0 auto;
}

.section {
  padding: 5.5rem 0;
  border-top: 1px solid rgba(98, 94, 255, 0.08);
}

.section-alt {
  background: var(--bg-alt);
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c5c2ff;
}

.section .eyebrow,
.section-heading .eyebrow {
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(3.4rem, 7vw, 6rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  color: #ffffff;
}

h2 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--accent);
}

h3 {
  font-size: 1.25rem;
  color: var(--text);
}

.hero-kicker {
  max-width: 34rem;
  margin: 1rem auto 0;
  font-size: 1.2rem;
  font-weight: 500;
  color: #f1f2ff;
}

.intro-divider {
  width: 220px;
  max-width: 80%;
  margin: 2rem auto;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
}

.hero-text,
.section-heading p,
.card p,
.repo-card p,
.publication p,
.site-footer p {
  color: var(--muted);
}

.hero-text {
  max-width: 48rem;
  margin: 0 auto;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.82);
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.75rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
}

.button-primary:hover {
  background: var(--accent-dark);
}

.section-heading {
  max-width: 48rem;
  margin: 0 auto 3rem;
  text-align: center;
}

.section-heading-spaced {
  margin-top: 4rem;
}

.card-grid,
.repo-grid,
.publication-list {
  display: grid;
  gap: 1.5rem;
}

.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.four-up {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card,
.repo-card,
.publication {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover,
.repo-card:hover,
.publication:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 54px rgba(16, 20, 40, 0.12);
}

.card p,
.repo-card p,
.publication p {
  margin: 0.85rem 0 0;
}

.card a,
.repo-card a {
  font-weight: 600;
}

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

.repo-card-featured {
  grid-column: span 3;
  background: linear-gradient(135deg, rgba(98, 94, 255, 0.09), rgba(255, 255, 255, 0.96));
}

.repo-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.repo-tag {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.85rem;
  font-weight: 700;
}

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

.publication p {
  font-weight: 600;
  color: var(--accent-dark);
}

.site-footer {
  padding: 2.5rem 0 3rem;
  background: var(--header-strong);
  color: rgba(255, 255, 255, 0.72);
}

.site-footer p,
.site-footer a {
  color: rgba(255, 255, 255, 0.72);
}

.site-footer a {
  font-weight: 600;
}

@media (max-width: 960px) {
  .three-up,
  .four-up,
  .repo-grid,
  .publication-list {
    grid-template-columns: 1fr;
  }

  .repo-card-featured {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .site-header-top,
  .footer-layout {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero,
  .section {
    padding: 4.5rem 0;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    font-size: clamp(2.8rem, 14vw, 4.2rem);
  }

  .site-nav-list {
    width: 100%;
    overflow: visible;
  }

  .nav-dropdown {
    width: auto;
  }

  .nav-menu {
    position: absolute;
    min-width: 14rem;
    margin: 0;
  }
}
