/* BioBTree website theme — shares the Sugi Atlas design tokens (slate + blue,
   dark dotted hero) so the two sites read as one family. Plain static CSS, no build. */
:root {
  --bg: #fafafa;
  --bg-elev: #ffffff;
  --bg-soft: #f4f5f7;
  --fg: #0f172a;
  --fg-muted: #475569;
  --fg-soft: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --on-accent: #ffffff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow-md: 0 4px 10px rgba(15,23,42,.06), 0 2px 4px rgba(15,23,42,.04);
  --shadow-lg: 0 18px 50px rgba(15,23,42,.12);
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  /* domain accents reused from the KG meta-graph */
  --c-gene: #e15759; --c-prot: #4f9d4f; --c-expr: #4ca39c; --c-path: #b07aa1;
  --c-var: #3aa6b5; --c-dis: #4e79a7; --c-drug: #d6a219; --c-other: #8a6bbf;
  /* KG hero background + dotted grid (theme-aware) */
  --kg-hero-bg: linear-gradient(180deg, #e7eef9 0%, #edf2fb 100%);
  --kg-dot: rgba(37, 99, 235, .045);
  --header-bg: rgba(255,255,255,.85);
}
/* dark theme (Sugi Atlas palette) — toggled via [data-theme=dark] on <html> */
[data-theme="dark"] {
  --bg: #0b0e14; --bg-elev: #131822; --bg-soft: #1a2030;
  --fg: #e6e9ef; --fg-muted: #a3aec0; --fg-soft: #7a8699;
  --border: #1f2937; --border-strong: #334155;
  --accent: #60a5fa; --accent-soft: rgba(96,165,250,.13); --on-accent: #0b1220;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.25), 0 1px 3px rgba(0,0,0,.18);
  --shadow-md: 0 4px 10px rgba(0,0,0,.32), 0 2px 4px rgba(0,0,0,.22);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.45);
  --kg-hero-bg: linear-gradient(to bottom, #0f172a, #1e293b);
  --kg-dot: rgba(255,255,255,.055);
  --header-bg: rgba(11,14,20,.82);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;            /* safety net: never let stray width cause a horizontal scroll
                                  (overflow:clip, unlike hidden, doesn't break position:sticky) */
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--font-mono); }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; color: var(--fg); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand svg { display: block; }
.brand .v { font-size: 11px; font-weight: 600; color: var(--fg-soft); border: 1px solid var(--border-strong); border-radius: 999px; padding: 1px 7px; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.header-right .nav-menu { order: 1; }          /* nav links first… */
.header-right .theme-toggle { order: 2; }       /* …toggle on the far right */
.nav-menu { position: relative; }
.site-nav { display: flex; align-items: center; gap: 22px; }
/* theme toggle — borderless icon only (Atlas style); just the icon swaps on toggle */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border: none; background: none; padding: 0; color: var(--fg-soft); cursor: pointer; }
.theme-toggle:hover { color: var(--fg); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }
.site-nav a { color: var(--fg-muted); font-size: 14.5px; font-weight: 500; }
.site-nav a:hover { color: var(--fg); text-decoration: none; }
.site-nav a.cta { color: var(--accent); }
/* hamburger button (hidden on desktop) */
.nav-toggle { display: none; background: none; cursor: pointer; padding: 0; width: 40px; height: 40px;
  align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--fg); }
.nav-toggle-bars { position: relative; display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: currentColor; border-radius: 2px; }
.nav-toggle-bars::before { top: -6px; } .nav-toggle-bars::after { top: 6px; }
.nav-close { display: none; }
.nav-backdrop { display: none; }
/* mobile: hamburger toggles a right-side drawer via the `.open` class (set by site.js).
   Plain div + button (no <details>) — Chrome 131+'s ::details-content containment
   breaks position:fixed drawers, so we drive it with JS instead. */
@media (max-width: 720px) {
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav-toggle { display: inline-flex; }
  .site-nav { position: fixed; top: 0; right: 0; z-index: 61; height: 100%; width: min(78vw, 300px);
    background: #fff; box-shadow: -8px 0 30px rgba(15,23,42,.18); flex-direction: column; align-items: stretch;
    gap: 0; padding: 60px 0 20px; display: none; }
  .nav-menu.open .site-nav { display: flex; animation: navSlideIn .22s ease; }
  .site-nav a { padding: .9rem 1.6rem; font-size: 1.05rem; border-bottom: 1px solid var(--border); }
  .nav-close { display: block; position: absolute; top: 10px; right: 12px; background: none; border: none;
    font-size: 28px; line-height: 1; color: var(--fg-soft); cursor: pointer; }
  .nav-close:hover { color: var(--fg); }
  .nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.42); z-index: 60; }
  .nav-menu.open .nav-backdrop { display: block; animation: navFade .2s ease; }
}
@keyframes navSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes navFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nav-menu.open .site-nav, .nav-menu.open .nav-backdrop { animation: none; } }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px;
  padding: 11px 20px; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; transition: .15s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(37,99,235,.28); }
.btn-primary:hover { background: #1d4ed8; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-light { background: #fff; color: var(--fg); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-light:hover { border-color: var(--border-strong); }

/* ---- hero (theme-aware: light + line grid in light mode, slate in dark) ---- */
.hero { position: relative; overflow: hidden; text-align: center;
  background: var(--kg-hero-bg); color: var(--fg); padding: 4.5rem 0 4rem; border-bottom: 1px solid var(--border); }
.hero-dots { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--kg-dot) 1px, transparent 1px), linear-gradient(90deg, var(--kg-dot) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(ellipse 85% 78% at 50% 30%, #000 12%, transparent 80%);
  mask-image: radial-gradient(ellipse 85% 78% at 50% 30%, #000 12%, transparent 80%); }
.hero-content { position: relative; z-index: 1; max-width: 920px; margin: 0 auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .74rem; color: var(--accent); font-weight: 600; margin: 0 0 1.1rem; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.04; margin: 0 0 1rem; color: var(--fg); }
.hero h1 .grad, .grad-dark { background: linear-gradient(90deg,#2563eb,#7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme="dark"] .hero h1 .grad, [data-theme="dark"] .grad-dark { background: linear-gradient(90deg,#60a5fa,#a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { font-size: 1.08rem; color: var(--fg-muted); max-width: 70ch; margin: 0 auto 2rem; line-height: 1.6; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 2.4rem; }

/* query showcase line in hero */
.qline { display: inline-flex; flex-wrap: wrap; gap: 0; align-items: center; justify-content: center;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm);
  padding: 14px 18px; font-family: var(--font-mono); font-size: clamp(.8rem,2.4vw,1rem); margin: 0 auto 1rem; max-width: 760px; }
.qline .e { color: var(--fg); } .qline .op { color: var(--accent); padding: 0 6px; } .qline .f { color: #c2780c; }
[data-theme="dark"] .qline .f { color: #fbbf24; }
.qcap { color: var(--fg-soft); font-size: .9rem; margin: 0 auto; max-width: 60ch; }

/* ---- stats strip ---- */
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 2.6rem; margin-top: 2.6rem; }
.stat { text-align: center; }
.stat strong { display: block; font-size: 1.9rem; font-weight: 700; color: var(--fg); letter-spacing: -.02em; }
.stat span { font-size: .82rem; color: var(--fg-soft); text-transform: uppercase; letter-spacing: .08em; }
a.stat { text-decoration: none; }
a.stat:hover strong { color: var(--accent); }
a.stat:hover span { color: var(--fg-muted); }

/* ---- sections ---- */
section { padding: 4.5rem 0; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 64ch; margin: 0 auto 2.8rem; }
.section-head .eyebrow { color: var(--accent); }
.section-head h2 { font-size: clamp(1.7rem,3.5vw,2.3rem); font-weight: 700; letter-spacing: -.02em; margin: .2rem 0 .7rem; }
.section-head p { color: var(--fg-muted); font-size: 1.05rem; margin: 0; }

/* feature grid */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px,1fr)); gap: 18px; }
/* grid children must be allowed to shrink below their content min-size, otherwise a
   non-wrapping <pre> blows the track out and the whole page overflows horizontally
   (which on mobile pushes the fixed nav drawer off-screen). */
.grid > * { min-width: 0; }
/* two-up layout that collapses to one column on small screens */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.grid-2 > * { min-width: 0; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 22px 24px; box-shadow: var(--shadow-sm); transition: .15s; }
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-2px); }
.card .ico { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font-size: 19px; margin-bottom: 14px; background: var(--accent-soft); color: var(--accent); }
.card h3 { font-size: 1.08rem; margin: 0 0 6px; letter-spacing: -.01em; }
.card p { color: var(--fg-muted); font-size: .94rem; margin: 0; }

/* lead paragraph (intro/context above a step flow) */
.lead { max-width: 72ch; margin: -1.4rem auto 2.4rem; text-align: center; color: var(--fg-muted); font-size: 1.02rem; line-height: 1.65; }

/* methodology pipeline */
.pipeline { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; flex-wrap: wrap; }
.pipeline li { flex: 1 1 175px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 20px; box-shadow: var(--shadow-sm); }
.pipeline .pnum { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; margin-bottom: 11px; }
.pipeline h3 { font-size: 1rem; margin: 0 0 5px; letter-spacing: -.01em; }
.pipeline p { color: var(--fg-muted); font-size: .9rem; margin: 0; }

/* two-graph comparison */
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.twocol > * { min-width: 0; }
@media (max-width: 720px) { .twocol { grid-template-columns: 1fr; } }
.gcard { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.gcard-accent { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-md); }
.gcard h3 { font-size: 1.2rem; margin: 0 0 4px; letter-spacing: -.01em; }
.gcard .gtag { color: var(--fg-muted); font-size: .95rem; margin: 0 0 16px; }
.gnums { display: flex; gap: 2rem; margin-bottom: 16px; }
.gnums span { font-size: .78rem; color: var(--fg-soft); text-transform: uppercase; letter-spacing: .06em; }
.gnums b { display: block; font-size: 1.6rem; font-weight: 700; color: var(--fg); letter-spacing: -.02em; }
.glist { margin: 0; padding-left: 1.1rem; color: var(--fg-muted); font-size: .92rem; line-height: 1.75; }
.gcard > p { color: var(--fg-muted); font-size: .92rem; margin: 0; }
.twocol-head { text-align: center; font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; margin: 2.8rem 0 1.2rem; }
/* inline download block inside the subgraph card */
.gdl { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.gdl-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-soft); margin: 0 0 6px; }
.gdl a { font-family: var(--font-mono); font-size: .9rem; font-weight: 600; }
.gdl-note { font-size: 12px; color: var(--fg-soft); margin: 8px 0 0; }

/* code block */
.code { background: #0f172a; color: #e2e8f0; border-radius: var(--radius); padding: 18px 20px; overflow-x: auto;
  font-family: var(--font-mono); font-size: .88rem; line-height: 1.7; box-shadow: var(--shadow-md); }
.code .c { color: #64748b; } .code .k { color: #60a5fa; } .code .s { color: #fbbf24; } .code .u { color: #34d399; }

/* KG page: title + full-bleed arc + numbers as ONE hero block. The arc iframe is
   transparent, so the hero background flows behind the whole thing (no card). */
.kg-hero { position: relative; padding-bottom: 1rem; background: var(--kg-hero-bg); border-bottom: 1px solid var(--border); }
/* faint line grid behind the hero (theme-aware colour, masked to fade out at edges) */
.kg-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(var(--kg-dot) 1px, transparent 1px),
                    linear-gradient(90deg, var(--kg-dot) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(ellipse 85% 78% at 50% 20%, #000 10%, transparent 78%);
  mask-image: radial-gradient(ellipse 85% 78% at 50% 20%, #000 10%, transparent 78%); }
.kg-hero-bar, .kg-arc, .kg-viz-cap { position: relative; z-index: 1; }
/* compact top bar: title on the left, the numbers on the right (one row) so both are
   visible above the fold; the arc then takes the rest. */
.kg-hero-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 32px; flex-wrap: wrap; padding: .85rem 0 .85rem; }
.kg-hero-title { text-align: left; }
.kg-hero-title .eyebrow { color: var(--accent); margin: 0 0 .2rem; }
.kg-hero-title h1 { font-size: clamp(1.4rem, 2.8vw, 2.1rem); font-weight: 700; letter-spacing: -.02em; margin: 0; }
.grad-dark { background: linear-gradient(90deg, #2563eb, #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kg-stats { display: flex; flex-wrap: wrap; gap: 0 1.9rem; align-items: baseline; }
.kg-stats .stat { text-align: center; }
.kg-stats .stat strong { display: block; font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; color: var(--fg); line-height: 1.05; }
.kg-stats .stat span { font-size: .68rem; color: var(--fg-soft); text-transform: uppercase; letter-spacing: .06em; }
.kg-arc { width: 100%; }
.kg-arc iframe { display: block; width: 100%; border: 0; height: 68vh; min-height: 480px; }
.kg-viz-cap { text-align: center; font-size: 13px; color: var(--fg-muted); max-width: 76ch; margin: 10px auto 0; line-height: 1.5; padding: 0 24px; }
.kg-viz-cap a { color: var(--accent); white-space: nowrap; }
@media (max-width: 720px) { .kg-hero-bar { justify-content: center; } .kg-hero-title { text-align: center; } .kg-stats { justify-content: center; } .kg-arc iframe { height: 62vh; min-height: 420px; } }


/* KG embed frame */
.embed { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); background: #fff; }
.embed iframe { display: block; width: 100%; border: 0; }
.embed-bar { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--bg-soft); border-bottom: 1px solid var(--border); font-size: 13px; color: var(--fg-soft); }
.embed-bar .dot { width: 10px; height: 10px; border-radius: 50%; }
.embed-bar a { margin-left: auto; }

/* two-col prose */
.prose { max-width: 70ch; margin: 0 auto; }
.prose p { color: var(--fg-muted); }
.prose h3 { margin-top: 2rem; }

/* ---- footer ---- */
.site-footer { background: #0f172a; color: #94a3b8; padding: 3rem 0 2.4rem; font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }
.site-footer a { color: #cbd5e1; }
.site-footer .fcol h4 { color: #e2e8f0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; }
.site-footer .fcol a { display: block; margin: 6px 0; }
.footer-bottom { margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid #1e293b; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; color: #64748b; font-size: 13px; }
