:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --text: #172033;
  --muted: #657188;
  --line: #dfe6ee;
  --brand: #0a6f78;
  --brand-2: #174f86;
  --accent: #c9933c;
  --dark: #0b1220;
  --dark-2: #111b2d;
  --dark-text: #e9f0f7;
  --shadow: 0 18px 50px rgba(21, 37, 59, 0.10);
  --radius: 22px;
  --radius-sm: 14px;
  --max-width: 1180px;
}

[data-theme="dark"] {
  --bg: #09101c;
  --surface: #101a2a;
  --surface-2: #0d1725;
  --text: #e8eef5;
  --muted: #a7b2c2;
  --line: #23324a;
  --brand: #58c7c9;
  --brand-2: #7db8f4;
  --accent: #e5b35c;
  --dark: #050a12;
  --dark-2: #0a1220;
  --dark-text: #eef5fb;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
button, input, select { font: inherit; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 9999;
  padding: .7rem 1rem;
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.skip-link:focus { top: 1rem; }

.container { width: min(calc(100% - 2rem), var(--max-width)); margin-inline: auto; }
.section { position: relative; padding: 6.8rem 0; }
.section-muted { background: var(--surface-2); }
.section-dark { background: linear-gradient(145deg, var(--dark), var(--dark-2)); color: var(--dark-text); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}
.nav-wrap { min-height: 74px; display: flex; align-items: center; gap: 1.25rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); font-size: .82rem;
  box-shadow: 0 8px 18px rgba(17, 92, 124, .2);
}
.brand-text { white-space: nowrap; }
.nav { margin-left: auto; }
.nav-links { display: flex; align-items: center; gap: 1.35rem; }
.nav-links a { text-decoration: none; color: var(--muted); font-weight: 650; font-size: .94rem; }
.nav-links a:hover { color: var(--brand); }
.nav-toggle { display: none; border: 0; background: transparent; color: var(--text); font-size: 1.45rem; cursor: pointer; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); cursor: pointer; display: grid; place-items: center;
}
.theme-toggle:hover { border-color: var(--brand); }

.hero { overflow: hidden; padding-top: 7.6rem; padding-bottom: 7.6rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, .65fr); gap: 5rem; align-items: center; }
.hero-glow { position: absolute; border-radius: 999px; filter: blur(10px); opacity: .38; pointer-events: none; }
.hero-glow-one { width: 380px; height: 380px; right: -120px; top: -100px; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 35%, transparent), transparent 70%); }
.hero-glow-two { width: 420px; height: 420px; left: -180px; bottom: -180px; background: radial-gradient(circle, color-mix(in srgb, var(--brand-2) 28%, transparent), transparent 70%); }
.eyebrow { margin: 0 0 .8rem; text-transform: uppercase; letter-spacing: .16em; font-size: .76rem; font-weight: 850; color: var(--brand); }
.hero h1 { margin: 0; font-size: clamp(2.7rem, 5.4vw, 5.4rem); line-height: 1.02; letter-spacing: -.055em; max-width: 880px; }
.hero-lead { margin: 1.6rem 0 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.24rem); max-width: 780px; }
.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .85rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .76rem 1.15rem; border-radius: 12px; text-decoration: none; font-weight: 750; transition: transform .2s ease, box-shadow .2s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 12px 24px rgba(20, 92, 118, .2); }
.button-secondary { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.hero-meta { margin-top: 2.8rem; display: flex; gap: 2.2rem; flex-wrap: wrap; }
.hero-meta div { display: grid; }
.hero-meta strong { font-size: 1.55rem; line-height: 1; }
.hero-meta span { margin-top: .35rem; color: var(--muted); font-size: .82rem; }

.profile-card { padding: 1.55rem; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.profile-image-wrap { position: relative; width: 116px; margin-bottom: 1.1rem; }
.profile-image { width: 116px; height: 116px; object-fit: cover; border-radius: 30px; border: 4px solid var(--surface); box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.availability-dot { position: absolute; width: 18px; height: 18px; right: -2px; bottom: 7px; border-radius: 50%; background: #22a970; border: 3px solid var(--surface); }
.profile-card h2 { margin: 0; font-size: 1.42rem; letter-spacing: -.025em; }
.profile-role { margin: .25rem 0 .7rem; font-size: .9rem; color: var(--brand); font-weight: 750; }
.profile-bio { color: var(--muted); font-size: .94rem; margin: 0; }
.profile-location { display: flex; gap: .55rem; align-items: center; margin: 1rem 0; color: var(--muted); font-size: .9rem; }
.compact-links { display: flex; flex-wrap: wrap; gap: .45rem; }
.compact-links a { text-decoration: none; font-size: .78rem; font-weight: 750; padding: .4rem .62rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); }

.two-column { display: grid; grid-template-columns: .9fr 1.1fr; gap: 5rem; }
.section-heading h2 { margin: 0; font-size: clamp(2rem, 3.5vw, 3.2rem); line-height: 1.12; letter-spacing: -.04em; }
.section-heading > p:not(.eyebrow) { color: var(--muted); max-width: 680px; }
.section-heading.centered { text-align: center; max-width: 820px; margin: 0 auto 2.8rem; }
.section-heading.centered > p:not(.eyebrow) { margin-inline: auto; }
.about-copy { color: var(--muted); font-size: 1.06rem; }
.about-copy p:first-child { margin-top: 0; }
.pill-row { margin-top: 1.6rem; display: flex; gap: .55rem; flex-wrap: wrap; }
.pill-row span, .repo-topic { padding: .35rem .6rem; border-radius: 999px; background: color-mix(in srgb, var(--brand) 10%, var(--surface)); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line)); font-weight: 750; font-size: .76rem; }

.featured-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.featured-card { position: relative; overflow: hidden; padding: 1.65rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(22, 41, 68, .05); display: flex; flex-direction: column; min-height: 320px; }
.featured-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--accent)); }
.featured-top { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.featured-label { color: var(--brand); font-weight: 800; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }
.repo-stats { display: inline-flex; gap: .8rem; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.featured-card h3 { margin: .7rem 0 .5rem; font-size: 1.5rem; letter-spacing: -.03em; }
.featured-card p { margin: 0; color: var(--muted); }
.tech-row { margin-top: 1.1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.featured-links { margin-top: auto; padding-top: 1.35rem; display: flex; flex-wrap: wrap; gap: .8rem; }
.featured-links a { font-weight: 800; color: var(--brand); text-decoration: none; font-size: .9rem; }
.featured-links a:hover { text-decoration: underline; }

.repo-toolbar { display: grid; grid-template-columns: 1fr 220px 210px; gap: .75rem; margin: 2rem 0 1rem; }
.search-box { display: flex; align-items: center; gap: .55rem; padding: 0 .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.search-box input { width: 100%; min-height: 46px; border: 0; outline: 0; background: transparent; color: var(--text); }
.repo-toolbar select { min-height: 46px; padding: 0 .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); }
.repo-status { color: var(--muted); font-size: .9rem; }
.repo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.repo-card { padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); display: flex; flex-direction: column; min-height: 250px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.repo-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); box-shadow: var(--shadow); }
.repo-card h3 { margin: .45rem 0 .55rem; font-size: 1.08rem; line-height: 1.25; overflow-wrap: anywhere; }
.repo-card h3 a { text-decoration: none; }
.repo-card h3 a:hover { color: var(--brand); }
.repo-category { font-size: .72rem; font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: .07em; }
.repo-description { color: var(--muted); font-size: .89rem; margin: 0; }
.repo-topics { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .9rem; }
.repo-topic { font-size: .68rem; padding: .22rem .42rem; }
.repo-footer { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-top: auto; padding-top: 1rem; color: var(--muted); font-size: .77rem; }
.repo-language { display: inline-flex; align-items: center; gap: .35rem; }
.language-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.empty-state { grid-column: 1 / -1; padding: 2rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-sm); color: var(--muted); }

.area-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.area-card { padding: 1.35rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.area-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand); font-size: 1.35rem; }
.area-card h3 { margin: .9rem 0 .45rem; font-size: 1.06rem; }
.area-card p { margin: 0; color: var(--muted); font-size: .9rem; }

.profiles-layout { display: grid; grid-template-columns: .65fr 1.35fr; gap: 4rem; align-items: start; }
.section-dark .eyebrow { color: #7ee1dc; }
.section-dark .section-heading > p:not(.eyebrow) { color: #aab8c8; }
.profile-link-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .7rem; }
.profile-link-grid a { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 0 .8rem; padding: 1rem 1.1rem; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; text-decoration: none; background: rgba(255,255,255,.045); }
.profile-link-grid a:hover { background: rgba(255,255,255,.085); }
.profile-link-grid span { font-weight: 800; }
.profile-link-grid small { color: #aab8c8; }
.profile-link-grid b { grid-column: 2; grid-row: 1 / 3; align-self: center; color: #7ee1dc; }

.site-footer { padding: 2.3rem 0; border-top: 1px solid var(--line); background: var(--surface); }
.footer-wrap { display: flex; justify-content: space-between; gap: 2rem; align-items: center; }
.footer-wrap p { margin: .2rem 0 0; color: var(--muted); font-size: .85rem; }
.footer-right { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 1rem; color: var(--muted); font-size: .82rem; }
.footer-right a { color: var(--brand); text-decoration: none; font-weight: 750; }
.noscript { padding: 1rem; text-align: center; background: #fff3cd; color: #664d03; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 980px) {
  .hero-grid, .two-column, .profiles-layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .profile-card { max-width: 620px; }
  .repo-grid, .area-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .repo-toolbar { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .section { padding: 5rem 0; }
  .hero { padding-top: 5.5rem; }
  .brand-text { display: none; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; left: 1rem; right: 1rem; top: 68px; padding: .8rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); flex-direction: column; align-items: stretch;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .65rem .75rem; }
  .featured-grid, .repo-grid, .area-grid, .profile-link-grid { grid-template-columns: 1fr; }
  .repo-toolbar { grid-template-columns: 1fr; }
  .search-box { grid-column: auto; }
  .hero-meta { gap: 1.3rem; }
  .footer-wrap { align-items: flex-start; flex-direction: column; }
  .footer-right { justify-content: flex-start; }
}

/* Scholarly context linking repositories to books, papers, and package documentation */
.scholarly-context {
  margin-top: 1rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 88%, var(--brand) 12%);
  display: grid;
  gap: .25rem;
}
.scholarly-context.compact { margin-top: .85rem; padding: .7rem .8rem; }
.scholarly-type {
  color: var(--brand);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.scholarly-title { font-size: .9rem; font-weight: 700; line-height: 1.45; }
.related-resource-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--brand);
  font-size: .88rem;
  font-weight: 800;
  text-decoration: none;
}
.related-resource-link:hover { text-decoration: underline; }
