:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c1d1f;
  --muted: #5f6368;
  --line: #e6e3dc;
  --accent: #1f4e5f;
  --accent-soft: #e7eff1;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141517;
    --surface: #1c1e21;
    --text: #e9e7e2;
    --muted: #9aa0a6;
    --line: #2d3034;
    --accent: #8cc3d3;
    --accent-soft: #1f2d32;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); font-size: .9rem; }

/* Nav */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { font-family: var(--serif); font-weight: 600; color: var(--text); font-size: 1.05rem; white-space: nowrap; }
.nav-links { display: flex; gap: 20px; font-size: .92rem; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero { padding: 72px 0 48px; }
.eyebrow { font-family: var(--mono); font-size: .8rem; color: var(--muted); letter-spacing: .02em; margin: 0 0 12px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); letter-spacing: -.01em; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 660px; margin: 20px 0 0; }
.chips { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: .82rem; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 32px; font-size: .95rem; }
.button {
  display: inline-block; padding: 8px 16px; border-radius: 8px;
  background: var(--accent); color: var(--bg); font-weight: 500;
}
.button:hover { text-decoration: none; opacity: .9; }
.button--ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); padding: 7px 15px; }

/* Sections */
.section { padding: 40px 0; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head h2 { font-size: 1.7rem; }
.section-head a { font-size: .9rem; }

/* Publications */
.pubs { list-style: none; padding: 0; margin: 0; }
.pub { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.pub:last-child { border-bottom: 0; }
.pub-meta { font-family: var(--mono); font-size: .8rem; color: var(--muted); padding-top: 3px; }
.venue { display: block; color: var(--accent); font-weight: 600; }
.pub-title { font-weight: 600; color: var(--text); font-size: 1.02rem; }
.pub-title:hover { color: var(--accent); }
.pub p { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }

.patents { margin-top: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.patents summary { cursor: pointer; padding: 12px 16px; font-weight: 600; }
.patents .count { font-family: var(--mono); font-size: .75rem; color: var(--muted); font-weight: 400; margin-left: 6px; }
.patents ul { margin: 0; padding: 0 16px 16px 36px; color: var(--muted); font-size: .93rem; }
.patents li { margin: 8px 0; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text);
  transition: border-color .15s, transform .15s;
}
a.card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.card h3 { font-size: 1.12rem; }
.card p { margin: 0; color: var(--muted); font-size: .93rem; flex: 1; }
.org { font-family: var(--mono); font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.arrow { color: var(--accent); font-family: var(--sans); font-size: .9em; }
.tags { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-family: var(--mono); font-size: .72rem; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
/* Apps panel */
.apps-panel {
  margin: 8px 0 48px; padding: 32px;
  border-radius: 16px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.apps-panel .eyebrow { margin-bottom: 4px; color: var(--accent); }
.apps-panel h2 { font-size: 2rem; }
.app-card { border-color: color-mix(in srgb, var(--accent) 20%, var(--line)); box-shadow: 0 1px 2px rgb(0 0 0 / .04); }
a.app-card:hover { box-shadow: 0 6px 20px rgb(0 0 0 / .08); }
.launch { font-size: .88rem; font-weight: 600; color: var(--accent); margin-top: 4px; }
.nav-links a.nav-apps { color: var(--accent); font-weight: 600; }

/* Footer */
.footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 32px 20px 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }

/* App pages */
.app-page { padding: 48px 20px; }
.app-page h1 { font-size: 2.2rem; }
.app-page--wide { max-width: none; }
.app-body { margin-top: 32px; }
.app-form label { display: block; font-weight: 500; margin-bottom: 6px; }
.app-form .row { display: flex; gap: 8px; max-width: 420px; }
.app-form input {
  flex: 1; min-width: 0; padding: 8px 12px; font: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text);
}
.app-form button { padding: 8px 16px; font: inherit; font-weight: 500; border: 0; border-radius: 8px; background: var(--accent); color: var(--bg); cursor: pointer; }
.greeting { font-family: var(--serif); font-size: 1.6rem; margin-top: 24px; }

@media (max-width: 600px) {
  .hero { padding: 48px 0 32px; }
  .nav-links { gap: 12px; font-size: .82rem; }
  .brand--home { display: none; }
  .nav:has(.brand--home) { justify-content: flex-end; }
  .pub { grid-template-columns: 1fr; gap: 4px; }
  .apps-panel { padding: 20px 16px; margin-left: -4px; margin-right: -4px; }
  .pub-meta .venue { display: inline; margin-right: 4px; }
}
