/* FakeYeast paper companion, BYO static-site fixture (demo lab). Hand written CSS
   so the bundle reads like a real lab built it, not a framework export. The theme
   leans into the science, fakeGFP fluoresces green, so the lab's signature color
   is an emerald that glows against a deep ink. No external fonts or assets, the
   whole bundle is self contained and served from a sandboxed origin. */

:root {
  --ink: #0c1f1a;
  --ink-soft: #324b44;
  --muted: #5d7068;
  --line: #e2ece7;
  --paper: #ffffff;
  --wash: #f4f8f6;
  --gfp: #11b886;
  --gfp-deep: #0a8c66;
  --gfp-glow: #5ff0c0;
  --violet: #6c5cd6;
  --shadow: 0 18px 40px -24px rgba(12, 31, 26, 0.45);
  --radius: 18px;
  --max: 920px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--wash);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gfp-deep); }

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 50;
}
.skip:focus { left: 12px; }

/* Sticky nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 22px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { color: var(--gfp-deep); display: inline-flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 15px; letter-spacing: -0.01em; }
.brand-text em { font-style: normal; font-size: 11.5px; color: var(--muted); }

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: 9px;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-links a:hover { background: var(--wash); color: var(--ink); }
.nav-links a.is-active { color: var(--gfp-deep); background: rgba(17, 184, 134, 0.1); }

.nav-cta {
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  padding: 8px 14px;
  border-radius: 10px;
  white-space: nowrap;
}
.nav-cta:hover { background: #16332b; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 130% at 75% -10%, #103a30 0%, #0a241d 55%, #071813 100%);
  color: #eafaf3;
  padding: 76px 22px 64px;
}
.hero-glow {
  position: absolute;
  inset: -40% -10% auto auto;
  width: 60vw;
  height: 60vw;
  max-width: 620px;
  max-height: 620px;
  background: radial-gradient(circle, rgba(95, 240, 192, 0.5) 0%, rgba(17, 184, 134, 0.18) 40%, transparent 70%);
  filter: blur(10px);
  animation: drift 12s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); opacity: 0.85; }
  to { transform: translate(-6%, 6%) scale(1.12); opacity: 1; }
}
.hero-inner { position: relative; max-width: var(--max); margin: 0 auto; }

.kicker {
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 700;
  color: var(--gfp-glow);
}
.hero h1 {
  margin: 0 0 18px;
  max-width: 18ch;
  font-size: clamp(30px, 5.2vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.lede {
  margin: 0 0 22px;
  max-width: 62ch;
  font-size: clamp(16px, 2vw, 19px);
  color: #c3e7da;
}
.authors {
  margin: 0 0 26px;
  font-size: 15px;
  color: #dff5ec;
}
.authors .aff {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: #8fbfb0;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #eafaf3;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.14); }
.btn-primary {
  background: linear-gradient(180deg, var(--gfp) 0%, var(--gfp-deep) 100%);
  border-color: transparent;
  color: #04231a;
  box-shadow: 0 10px 26px -10px rgba(17, 184, 134, 0.7);
}
.btn-primary:hover { background: linear-gradient(180deg, #19c897 0%, var(--gfp-deep) 100%); }
.btn-ghost { background: transparent; }

.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(95, 240, 192, 0.14);
  color: var(--gfp-glow);
  border: 1px solid rgba(95, 240, 192, 0.25);
}
.hero-meta .dim { font-size: 12.5px; color: #79a99a; }

/* Layout */
main { max-width: var(--max); margin: 0 auto; padding: 0 22px 40px; }

/* Stat tiles */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: -36px 0 26px;
  position: relative;
  z-index: 5;
}
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
}
.stat-value {
  display: block;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--gfp-deep);
  font-variant-numeric: tabular-nums;
}
.stat-label { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }

/* Cards */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 32px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(12, 31, 26, 0.04);
  scroll-margin-top: 84px;
}
.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gfp-deep);
}
.card h2 {
  margin: 0 0 12px;
  font-size: clamp(20px, 3vw, 26px);
  letter-spacing: -0.015em;
}
.card p { margin: 0 0 12px; color: var(--ink-soft); }
.card p:last-child { margin-bottom: 0; }
.card .big { font-size: 18px; color: var(--ink); }

/* Dark centerpiece card, makes the network glow read. */
.card-dark {
  background: radial-gradient(130% 130% at 80% -20%, #0f3329 0%, #0a221b 55%, #07140f 100%);
  border-color: rgba(95, 240, 192, 0.16);
  color: #d9f3ea;
}
.eyebrow-light { color: var(--gfp-glow); }
.h-light { color: #eafaf3; }
.p-light { color: #a9cdc0; }
.cap-light { color: #79a99a; border-left-color: rgba(95, 240, 192, 0.2); }

/* Figures */
.figure { margin: 18px 0 0; }
.figure figcaption {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  border-left: 3px solid var(--line);
  padding-left: 12px;
}

.dose-chart, .bars-chart {
  width: 100%;
  background:
    linear-gradient(180deg, #fbfffd 0%, #f3fbf7 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.dose-chart svg, .bars-chart svg { display: block; width: 100%; height: auto; }

/* Dose chart svg elements (styled here, drawn in app.js) */
.axis { stroke: #cddcd5; stroke-width: 1; }
.grid { stroke: #e8f1ec; stroke-width: 1; }
.tick-label { fill: var(--muted); font-size: 11px; font-family: inherit; }
.axis-title { fill: var(--ink-soft); font-size: 12px; font-weight: 600; font-family: inherit; }
.fit-band { fill: rgba(17, 184, 134, 0.12); }
.fit-line { fill: none; stroke: var(--gfp); stroke-width: 3; stroke-linecap: round; }
.fit-line.draw { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: dash 1.6s ease forwards; }
@keyframes dash { to { stroke-dashoffset: 0; } }
.pt { fill: #fff; stroke: var(--gfp-deep); stroke-width: 2.5; transition: r 0.12s ease; cursor: pointer; }
.pt:hover { r: 7.5; }
.marker-line { stroke: var(--violet); stroke-width: 1.5; stroke-dasharray: 4 4; }
.marker-dot { fill: var(--violet); stroke: #fff; stroke-width: 2.5; }

.dose-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.dose-controls label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.dose-controls input[type="range"] {
  flex: 1;
  min-width: 160px;
  accent-color: var(--gfp-deep);
  height: 4px;
}
.readout {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.readout .ro-x { color: var(--violet); }
.readout .ro-y { color: var(--gfp-deep); }
.readout .ro-arrow { color: var(--muted); font-weight: 500; margin: 0 2px; }

/* 3D interactome (Figure 1). Dark glassy panel so the node glow pops. */
.figure { position: relative; }
.net-figure { margin-top: 20px; }
.net-wrap {
  position: relative;
  width: 100%;
  height: 540px;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(80% 80% at 50% 40%, #0b2a22 0%, #07140f 70%, #050d0a 100%);
  border: 1px solid rgba(95, 240, 192, 0.16);
  cursor: grab;
  touch-action: none;
}
.net-wrap.dragging { cursor: grabbing; }
.net-canvas { display: block; width: 100%; height: 100%; }

.net-stats {
  position: absolute;
  top: 14px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  color: #cdeee0;
  background: rgba(7, 20, 15, 0.5);
  border: 1px solid rgba(95, 240, 192, 0.18);
  padding: 7px 12px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-variant-numeric: tabular-nums;
}
.net-stats span { color: var(--gfp-glow); }
.net-dot { width: 4px; height: 4px; border-radius: 50%; background: #5d7068; }

.net-legend {
  position: absolute;
  top: 14px;
  right: 16px;
  margin: 0;
  padding: 10px 12px;
  list-style: none;
  display: grid;
  gap: 5px;
  background: rgba(7, 20, 15, 0.5);
  border: 1px solid rgba(95, 240, 192, 0.16);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.net-legend li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #b6d7cb; }
.net-legend .lg-dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }

.net-hint {
  position: absolute;
  bottom: 13px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #7fae9f;
  background: rgba(7, 20, 15, 0.45);
  padding: 5px 12px;
  border-radius: 999px;
  pointer-events: none;
}

.net-tip {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -135%);
  background: #04231a;
  border: 1px solid rgba(95, 240, 192, 0.3);
  color: #eafaf3;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 6;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.7);
}
.net-tip .tip-sub { display: block; font-weight: 500; color: #8fbfb0; font-size: 11px; }

/* Methods grid */
.methods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.method {
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px;
}
.method h3 { margin: 0 0 6px; font-size: 15px; color: var(--ink); }
.method p { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* Data table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; margin-top: 6px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 420px; }
.data-table th, .data-table td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.data-table thead th { background: var(--wash); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td:last-child { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--gfp-deep); }
.data-table .strain { font-weight: 600; color: var(--ink); }

.downloads { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gfp); }
.chip:hover { border-color: var(--gfp); color: var(--ink); }

/* Team */
.team { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.member { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.member strong { font-size: 14px; }
.member em { font-style: normal; font-size: 12px; color: var(--muted); }
.avatar {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  margin-bottom: 6px;
  background: linear-gradient(135deg, rgba(17, 184, 134, 0.16), rgba(108, 92, 214, 0.16));
  color: var(--gfp-deep);
  font-weight: 800; font-size: 16px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.avatar::after { content: attr(data-initials); }

/* Citation */
.citation {
  margin: 6px 0 16px;
  padding: 16px 18px;
  background: var(--wash);
  border-left: 3px solid var(--gfp);
  border-radius: 0 12px 12px 0;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.cite-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cite .btn { color: var(--ink); border-color: var(--line); background: var(--wash); }
.cite .btn-primary { color: #04231a; background: linear-gradient(180deg, var(--gfp) 0%, var(--gfp-deep) 100%); border-color: transparent; }
.cite .btn:hover { transform: translateY(-1px); }
.bibtex {
  margin: 16px 0 0;
  padding: 16px 18px;
  background: var(--ink);
  color: #cdeee0;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
}

/* Footer */
.site-foot { border-top: 1px solid var(--line); background: var(--paper); }
.foot-inner { max-width: var(--max); margin: 0 auto; padding: 30px 22px 40px; }
.foot-lead { margin: 0 0 8px; font-size: 14px; color: var(--ink-soft); max-width: 70ch; }
.foot-dim { margin: 0; font-size: 13px; color: var(--muted); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 760px) {
  .nav-links { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .methods-grid { grid-template-columns: 1fr; }
  .team { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 24px 20px; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-glow, .fit-line.draw { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .fit-line.draw { stroke-dashoffset: 0; }
}
