/* ==========================================================================
   FlowLet project page — visual system adapted from the paper's figure style:
   tinted pastel panels, colored small-caps section labels, rounded cards with
   soft borders/shadows, monospace chips, numbered badges, connecting arrows.
   ========================================================================== */

:root {
  /* Panel tints */
  --blue-bg: #e9f1f9;   --blue-border: #cfe0ef;  --blue-ink: #2f6db0;
  --peach-bg: #fdeede;  --peach-border: #f4d9c2; --peach-ink: #c96a37;
  --green-bg: #e7f4ec;  --green-border: #cce7d6; --green-ink: #3f9d57;
  --gray-bg: #eef1f4;   --gray-border: #dde3e9;  --gray-ink: #5b6670;
  --violet-bg: #eeebfb00; /* unused placeholder */

  /* Neutrals */
  --ink: #232a31;
  --muted: #5b6670;
  --line: #e3e8ee;
  --card: #ffffff;
  --page: #f7f9fb;
  --navy: #1f3a5f;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05), 0 2px 6px rgba(16,24,40,.05);
  --maxw: 1080px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--blue-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- Top navigation ------------------------------------------------ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247,249,251,.85);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.nav .brand { font-weight: 800; letter-spacing: -.02em; font-size: 1.12rem; color: var(--ink); }
.nav .brand span { color: var(--blue-ink); }
.nav .links { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.nav .links a {
  color: var(--muted); font-size: .9rem; font-weight: 600;
  padding: 7px 12px; border-radius: 999px;
}
.nav .links a:hover { background: var(--gray-bg); color: var(--ink); text-decoration: none; }

/* ---------- Section scaffolding ------------------------------------------ */
section { padding: 56px 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: none; }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--blue-ink);
  margin: 0 0 10px;
}
.eyebrow.peach { color: var(--peach-ink); }
.eyebrow.green { color: var(--green-ink); }
.eyebrow.gray  { color: var(--gray-ink); }

h2.section-title { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 8px; }
.section-lead { color: var(--muted); max-width: 760px; margin: 0 0 28px; }

/* ---------- Hero ---------------------------------------------------------- */
.hero { padding: 60px 0 40px; text-align: center; }
.venue-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 700; color: var(--peach-ink);
  background: var(--peach-bg); border: 1px solid var(--peach-border);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(1.8rem, 4.2vw, 3rem); line-height: 1.1;
  letter-spacing: -.03em; font-weight: 800; margin: 0 auto 18px; max-width: 18ch;
}
.hero h1 .lit { color: var(--blue-ink); }
.authors { font-size: 1.05rem; margin: 0 auto 6px; max-width: 820px; }
.authors a { color: var(--ink); font-weight: 600; }
.authors sup { color: var(--blue-ink); font-weight: 700; }
.affil { color: var(--muted); font-size: .92rem; margin: 0 auto 4px; }
.corr { color: var(--muted); font-size: .82rem; margin: 2px auto 0; }

.btn-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 26px 0 6px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: .92rem;
  padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform .08s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.blue { background: var(--blue-ink); border-color: var(--blue-ink); color: #fff; }
.btn .ico { font-size: 1.05em; line-height: 1; }
.paper-note { color: var(--muted); font-size: .82rem; max-width: 620px; margin: 14px auto 0; }
.paper-note b { color: var(--ink); }

/* ---------- Generic cards & grids ---------------------------------------- */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 6px; font-size: 1.02rem; font-weight: 700; }
.card p { margin: 0; color: var(--muted); font-size: .93rem; }

/* numbered badge */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  font-family: var(--mono); font-weight: 700; font-size: .9rem;
  background: var(--blue-bg); color: var(--blue-ink); border: 1px solid var(--blue-border);
  margin-bottom: 12px;
}
.card.peach .badge { background: var(--peach-bg); color: var(--peach-ink); border-color: var(--peach-border); }
.card.green .badge { background: var(--green-bg); color: var(--green-ink); border-color: var(--green-border); }

/* ---------- Stat highlight cards ---------------------------------------- */
.stat {
  text-align: center; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 16px; box-shadow: var(--shadow-sm);
}
.stat .num { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.stat .num.blue { color: var(--blue-ink); }
.stat .num.peach { color: var(--peach-ink); }
.stat .num.green { color: var(--green-ink); }
.stat .lbl { font-weight: 700; font-size: .95rem; margin-top: 2px; }
.stat .sub { color: var(--muted); font-size: .82rem; margin-top: 6px; }

/* monospace chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--mono); font-size: .78rem; font-weight: 600;
  padding: 5px 11px; border-radius: 7px;
  background: var(--gray-bg); border: 1px solid var(--gray-border); color: var(--ink);
}
.chip.blue { background: var(--blue-bg); border-color: var(--blue-border); color: var(--blue-ink); }
.chip.peach { background: var(--peach-bg); border-color: var(--peach-border); color: var(--peach-ink); }
.chip.green { background: var(--green-bg); border-color: var(--green-border); color: var(--green-ink); }

/* ---------- Pipeline panels (mirrors the paper figure style) ------------- */
.pipeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: stretch; }
.panel {
  border-radius: var(--radius); padding: 18px; border: 1px solid var(--line);
  background: var(--card); position: relative;
}
.panel .plabel {
  font-family: var(--mono); font-size: .7rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px;
}
.panel.blue  { background: var(--blue-bg);  border-color: var(--blue-border); }
.panel.blue  .plabel { color: var(--blue-ink); }
.panel.peach { background: var(--peach-bg); border-color: var(--peach-border); }
.panel.peach .plabel { color: var(--peach-ink); }
.panel.green { background: var(--green-bg); border-color: var(--green-border); }
.panel.green .plabel { color: var(--green-ink); }
.panel h4 { margin: 0 0 6px; font-size: 1.02rem; }
.panel p { margin: 0; font-size: .9rem; color: #41525f; }
.panel .io { font-family: var(--mono); font-size: .78rem; color: #41525f; margin-top: 10px; }
.panel .io b { color: var(--ink); }

/* ---------- Figures ------------------------------------------------------ */
figure.fig { margin: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); }
figure.fig img { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); cursor: zoom-in; }
figure.fig.dark img { background: #000; }
/* Plot-type figures (matplotlib charts) read better constrained and centered,
   unlike the wide brain montages which use the full column width. */
figure.fig.plot { max-width: 640px; margin-left: auto; margin-right: auto; }
figure.fig figcaption { color: var(--muted); font-size: .85rem; margin-top: 10px; }
figure.fig figcaption b { color: var(--ink); }

/* ---------- Abstract ----------------------------------------------------- */
.abstract { max-width: 820px; margin: 0 auto; }
.abstract p { margin: 0; font-size: 1.07rem; line-height: 1.8; color: #36424c; text-align: justify; }
.abstract p b { color: var(--ink); }

/* ---------- Perspective / note block ------------------------------------ */
.note-block { max-width: 760px; margin: 18px auto 0; }
.note-block p { color: #36424c; font-size: 1.04rem; line-height: 1.8; margin: 0 0 14px; }
.note-block p b { color: var(--ink); }
.note-block .read-more { text-align: center; margin-top: 18px; }
.note-block .read-more a { font-weight: 700; font-size: .98rem; }

/* ---------- Code / BibTeX ------------------------------------------------ */
pre.code {
  background: #0f1b2a; color: #d7e3f0; border-radius: var(--radius);
  padding: 18px 20px; overflow-x: auto; font-family: var(--mono);
  font-size: .82rem; line-height: 1.6; border: 1px solid #14263c;
}
.copy-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.copy-btn {
  font-family: var(--font); font-size: .8rem; font-weight: 700; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  padding: 6px 12px; border-radius: 8px;
}
.copy-btn:hover { background: var(--gray-bg); }

/* ---------- Footer ------------------------------------------------------- */
footer { background: var(--navy); color: #c8d6e6; padding: 30px 0; border: none; text-align: center; }
footer a { color: #fff; font-weight: 600; }
footer .small { font-size: .82rem; color: #8aa2bd; margin-top: 8px; }

/* ---------- Lightbox ----------------------------------------------------- */
.lb { position: fixed; inset: 0; background: rgba(10,16,24,.9); display: none;
  align-items: center; justify-content: center; z-index: 100; padding: 24px; cursor: zoom-out; }
.lb.open { display: flex; }
.lb img { max-width: 96vw; max-height: 92vh; border-radius: 8px; }

/* ---------- Responsive --------------------------------------------------- */
@media (max-width: 900px) {
  .grid.cols-3, .grid.cols-4, .pipeline { grid-template-columns: 1fr; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .nav .links { display: none; }
}
@media (max-width: 560px) {
  .stat .num { font-size: 1.6rem; }
}
