:root {
  --green: #024731;      /* UH Mānoa green */
  --green-2: #0b6e4f;
  --accent: #f2a900;
  --bg: #ffffff;
  --bg-alt: #f3f6f4;
  --text: #17211c;
  --muted: #5b6b63;
  --border: #dde5e0;
  --card: #ffffff;
  --hero-bg: #021a13;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1411;
    --bg-alt: #111c18;
    --text: #e6eee9;
    --muted: #9db0a6;
    --border: #22332c;
    --card: #15221d;
    --green-2: #3fbf8c;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font: 16px/1.65 Inter, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
}
h1, h2, h3, h4 { font-family: "Space Grotesk", Inter, sans-serif; line-height: 1.2; margin: 0 0 .6em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; margin-top: 2rem; }
h4 { font-size: 1.1rem; }
a { color: var(--green-2); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 20px; }
.wrap.section { padding-left: 20px; padding-right: 20px; }
.alt { background: var(--bg-alt); padding: 80px 0; }
.sub { color: var(--muted); margin-top: -.3em; margin-bottom: 2rem; }
.muted { color: var(--muted); }
.center { text-align: center; margin-top: 2rem; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--hero-bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.2rem; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; background: #fff; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { color: #cfe3d9; font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 75% 40%, #0b4a36 0%, var(--hero-bg) 60%);
  color: #fff;
  padding: 120px 0 130px;
}
.hero-text { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4rem); max-width: 14ch; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; }
.lead { font-size: 1.2rem; color: #cfe3d9; max-width: 56ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  border: 1px solid currentColor; font-weight: 600; color: inherit;
}
.btn:hover { text-decoration: none; opacity: .85; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1b1300; }
.section .btn, .alt .btn { color: var(--green-2); }

.orbit { position: absolute; right: -80px; top: 50%; width: 620px; max-width: 80vw; transform: translateY(-50%); opacity: .55; }
.orbit .planet { fill: #0b6e4f; }
.orbit .ring { fill: none; stroke: #4fd1a1; stroke-opacity: .35; stroke-width: 1.5; stroke-dasharray: 4 6; }
.orbit .sat rect { fill: var(--accent); }
.sat-1 { offset-path: path("M 50 300 A 250 110 0 1 0 550 300 A 250 110 0 1 0 50 300"); animation: fly 18s linear infinite; transform-box: fill-box; }
.sat-2 { offset-path: path("M 120 300 A 180 180 0 1 0 480 300 A 180 180 0 1 0 120 300"); animation: fly 11s linear infinite reverse; }
@keyframes fly { to { offset-distance: 100%; } }
@media (prefers-reduced-motion: reduce) { .sat-1, .sat-2 { animation: none; } }

/* Grids & cards */
.grid { display: grid; gap: 24px; }
.grid.two { grid-template-columns: repeat(2, 1fr); gap: 40px; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column;
}
.card p { color: var(--muted); font-size: .95rem; }
.card > a, .card .links { margin-top: auto; font-weight: 600; font-size: .9rem; }
.tag {
  align-self: flex-start; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 10px; border-radius: 999px; margin-bottom: 12px;
  background: var(--border); color: var(--muted);
}
.tag.current { background: #d8f3e7; color: #075239; }
.tag.edu { background: #fff1cc; color: #6b4b00; }

.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.facts li { border-left: 3px solid var(--accent); padding: 6px 0 6px 14px; }
.facts strong { display: block; font-family: "Space Grotesk", sans-serif; font-size: 1.4rem; color: var(--green-2); }
.facts span { color: var(--muted); font-size: .9rem; }

/* Repos */
.repos-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 1rem; }
#repo-filter {
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font: inherit; min-width: 260px; margin-bottom: 2rem;
}
.repo { gap: 6px; }
.repo h4 { margin: 0; font-size: 1rem; word-break: break-word; }
.repo p { margin: 0; flex: 1; }
.repo .meta { display: flex; gap: 14px; font-size: .82rem; color: var(--muted); margin-top: 10px; }
.lang-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; background: var(--green-2); vertical-align: -1px; }

/* Contact */
address { font-style: normal; color: var(--muted); font-size: 1.05rem; }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.contact-list span { color: var(--muted); }

.footer { background: var(--hero-bg); color: #9db0a6; padding: 28px 0; font-size: .9rem; }
.footer p { margin: 0; }

/* Responsive */
@media (max-width: 900px) {
  .grid.three, .grid.four { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--hero-bg); padding: 8px 20px 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 0; }
  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
  .section, .alt { padding-top: 56px; padding-bottom: 56px; }
  .hero { padding: 80px 0 90px; }
  .orbit { opacity: .25; right: -200px; }
  #repo-filter { min-width: 0; width: 100%; }
}

/* Featured repositories */
.featured { gap: 24px; margin-bottom: 3rem; }
.feature { padding: 28px; }
.feature h3 { margin-top: 0; font-size: 1.5rem; }
.feature .btn { align-self: flex-start; margin-top: auto; }
.layers { list-style: none; padding: 0; margin: 0 0 1.5rem; display: flex; flex-wrap: wrap; gap: 8px; }
.layers a {
  display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 500;
  border: 1px solid var(--border); background: var(--bg-alt);
}
.layers a:hover { text-decoration: none; border-color: var(--green-2); }
.search-head { align-items: center; }
.search-head h3 { margin: 0 0 2rem; }
.repo-grid:empty { display: none; }

/* Sub-pages */
.page-hero {
  background: radial-gradient(ellipse at 80% 30%, #0b4a36 0%, var(--hero-bg) 65%);
  color: #fff; padding: 72px 0 64px;
}
.page-hero h1 { font-size: clamp(2rem, 5vw, 3rem); }
.page-hero .lead { margin: 0; }
.page-hero a { color: var(--accent); }
.nav-links a[aria-current="page"] { color: #fff; border-bottom: 2px solid var(--accent); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 2rem; }
.toolbar input, .toolbar select {
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font: inherit;
}
.toolbar input { flex: 1; min-width: 220px; max-width: 460px; margin: 0; }
.note { margin-top: 3rem; }

/* Publications */
.pub-year { display: grid; grid-template-columns: 120px 1fr; gap: 24px; padding: 24px 0; border-top: 1px solid var(--border); }
.pub-year h2 { color: var(--green-2); font-size: 1.6rem; margin: 0; }
.pubs { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.pub-title { font-weight: 600; font-size: 1.05rem; color: var(--text); }
.pub-title:hover { color: var(--green-2); }
.pub-authors { color: var(--text); opacity: .85; font-size: .95rem; margin-top: 2px; }
.pub-venue { color: var(--muted); font-size: .9rem; font-style: italic; }
.pub-tags { display: flex; gap: 6px; margin-top: 8px; }
.pub-tags .tag { margin: 0; }
@media (max-width: 680px) {
  .pub-year { grid-template-columns: 1fr; gap: 10px; }
  .toolbar input { max-width: none; }
}

/* Mission media */
.card.has-media { padding: 0; overflow: hidden; }
.card.has-media .body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.card.has-media .body > a { margin-top: auto; font-weight: 600; font-size: .9rem; }
.span-2 { grid-column: span 2; }
.gallery { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 3px; aspect-ratio: 16 / 7; min-height: 0; overflow: hidden; background: var(--border); }
.gallery a { display: block; overflow: hidden; min-height: 0; }
.gallery .main { grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.gallery a:hover img { transform: scale(1.04); }
.mission-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.credit { font-size: .75rem !important; opacity: .8; margin: -.4em 0 1em; }
@media (max-width: 680px) {
  .span-2 { grid-column: auto; }
  .gallery { aspect-ratio: 4 / 3; }
}
.gallery img[src*="cleanroom"] { object-position: center 25%; }
.card.split { flex-direction: row; }
.split-img { flex: 0 0 50%; background: #0d1226; display: flex; align-items: center; overflow: hidden; }
.split-img img { width: 100%; height: auto; display: block; }
.card.split .links { margin-top: auto; }
@media (max-width: 680px) {
  .card.split { flex-direction: column; }
}
.mission-img.portrait { aspect-ratio: 4 / 3; object-position: center 15%; }
.card.has-media > a { margin-top: 0; }
