/* ============================================================
   BayesBiont.jl landing — light scientific theme
   Reuses Fuzue's IBM Plex stack; olive accent for daylight.
   ============================================================ */

/* --- self-hosted fonts (copied from ~/fuzue-new-site/fonts/) --- */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/IBMPlexSans-300.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 300; font-display: swap; src: url("fonts/IBMPlexSans-300italic.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexSans-400.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/IBMPlexSans-500.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexMono-400.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/IBMPlexMono-500.ttf") format("truetype"); }

/* ============================================================ tokens */

:root {
  --bg:           #ffffff;
  --bg-surface:   #ffffff;
  --bg-alt:       #f1f3f6;        /* cool neutral gray — no green */
  --bg-tinted:    #f6f8fb;        /* very light cool gray, breath of blue */
  --text:         #14171c;        /* near-black, slight cool undertone */
  --text-muted:   #4d5159;
  --text-faint:   #898d96;
  --border:       #dadee4;
  --border-soft:  #e7eaef;

  /* PRIMARY — cobalt blue (scientific, distinctly NOT olive/green) */
  --accent:        #1d70bf;
  --accent-dark:   #155590;
  --accent-soft:   #dfeaf6;
  --accent-line:   #b8d2ec;

  /* SECONDARY — rose (pamiec pink, darkened for light bg) */
  --rose:          #c93e7e;
  --rose-dark:     #a82d63;
  --rose-soft:     #fae0ed;

  /* TERTIARY — amber for highlights, code keywords */
  --amber:         #c4791b;
  --amber-soft:   #fbe6c9;
  --yellow:        #a88b15;

  /* plot tokens — curve in deep cobalt, band in soft blue envelope */
  --plot-curve:    #155590;
  --plot-band:     rgba(29, 112, 191, 0.13);
  --plot-data:     #14171c;

  --font-sans:    "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-display: "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;

  --text-base:    17px;
  --text-lede:    clamp(1.125rem, 1rem + 0.7vw, 1.375rem);
  --text-display: clamp(2.5rem, 1.7rem + 3.6vw, 4.25rem);
  --text-h2:      clamp(1.65rem, 1.3rem + 1.4vw, 2.3rem);
  --text-h3:      1.15rem;

  --container-max: 1080px;
  --container-pad: clamp(1.25rem, 4vw, 2.5rem);
  --space-block:   clamp(4rem, 2.5rem + 5vw, 7rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 160ms;
}

/* ============================================================ reset */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol, dl, dt, dd, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ============================================================ base */

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* paper-grain atmosphere */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)' opacity='1'/%3E%3C/svg%3E");
}

::selection { background: var(--accent-soft); color: var(--text); }

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

code, pre {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

:not(pre) > code {
  background: var(--bg-alt);
  padding: 0.05em 0.35em;
  border-radius: 3px;
  font-size: 0.9em;
  color: var(--text);
}

a.text-link,
.lede a,
.prose a,
.ref-list a,
.compare a,
.example-foot a {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: color var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out);
}

a.text-link:hover,
.lede a:hover,
.prose a:hover,
.ref-list a:hover,
.compare a:hover,
.example-foot a:hover {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

sup a {
  border-bottom: none;
  color: var(--rose-dark);
  font-weight: 500;
}
sup a:hover {
  background: var(--rose-soft);
}

/* ============================================================ header */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.brand-logo {
  height: 22px;
  width: auto;
}

.brand-divider {
  color: var(--text-faint);
  font-weight: 300;
  font-size: 1.1rem;
  line-height: 1;
}

.brand-pkg {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--text);
  font-weight: 500;
}

.brand-pkg-ext {
  color: var(--rose);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 1.5vw, 1.6rem);
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.45rem 0;
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out);
}

.nav-links a:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}

@media (max-width: 720px) {
  .nav-links li:nth-child(-n+3) { display: none; }
}

/* ============================================================ hero */

.hero {
  padding: clamp(3rem, 2rem + 4vw, 5.5rem) 0 var(--space-block);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 2rem + 3vw, 4rem);
  align-items: center;
}

@media (min-width: 880px) {
  .hero-grid {
    grid-template-columns: 1fr 1.15fr;
  }
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-display);
  line-height: 1.0;
  letter-spacing: -0.016em;
  color: var(--text);
  margin-bottom: 1.75rem;
  max-width: 14ch;
}

.hero h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--rose);
  font-family: var(--font-display);
}

.lede {
  font-size: var(--text-lede);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: 2.25rem;
  font-weight: 400;
}

.lede code {
  font-size: 0.92em;
  background: var(--bg-alt);
  padding: 0.05em 0.35em;
  border-radius: 3px;
  color: var(--text);
}

/* ----- CTAs ----- */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 2.5rem;
}

.hero-meta {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  display: grid;
  gap: 0.5rem;
  font-size: 0.9rem;
  max-width: 36ch;
}

.hero-meta > div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  align-items: baseline;
}

.hero-meta dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.hero-meta dd {
  color: var(--text-muted);
}

.hero-meta a {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: 2px;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -16px var(--accent-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--text);
  background: var(--bg-surface);
  transform: translateY(-1px);
}

.btn-arrow { transition: transform var(--t-fast) var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(3px); }

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ----- hero figure ----- */

.hero-figure {
  position: relative;
  padding: 0;
  /* no card, no border — let the plot breathe */
}

.hero-figure::before {
  content: "fig. 1";
  position: absolute;
  top: 0.25rem;
  left: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.growth-svg { width: 100%; height: auto; }

.growth-svg .grid line {
  stroke: var(--border);
  stroke-width: 1;
}
.growth-svg .grid line.grid-faint {
  stroke: var(--border-soft);
  stroke-dasharray: 2 4;
}

.growth-svg .axis-label text {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--text-faint);
  letter-spacing: 0.05em;
}
.growth-svg .axis-label text.tick {
  font-size: 10px;
}

.growth-svg .band {
  fill: var(--plot-band);
}

.growth-svg .curve {
  fill: none;
  stroke: var(--plot-curve);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.growth-svg .data-points circle {
  fill: var(--plot-data);
  stroke: var(--bg-surface);
  stroke-width: 1.5;
}

.hero-figure figcaption {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 46ch;
  padding-inline: 0.25rem;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

/* ============================================================ blocks */

.block {
  padding: var(--space-block) 0;
  border-top: 1px solid var(--border);
}

.block-tinted {
  background: var(--bg-tinted);
}

.block-refs {
  background: var(--bg-alt);
}

.block-head {
  margin-bottom: clamp(2rem, 1.5rem + 1.5vw, 3rem);
  max-width: 60ch;
}

.block { counter-increment: section; }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: inline-flex;
  align-items: baseline;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.section-label::before {
  content: "§ " counter(section, decimal-leading-zero);
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.1em;
}

.section-label::after {
  content: "";
  align-self: center;
  display: block;
  width: 28px;
  height: 1px;
  background: var(--border);
}

.block-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h2);
  line-height: 1.1;
  letter-spacing: -0.014em;
  color: var(--text);
  max-width: 22ch;
}

.block-title em {
  font-style: italic;
  color: var(--rose);
  font-weight: 500;
}

.block-intro {
  margin-top: 1rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 60ch;
  line-height: 1.65;
}

/* ============================================================ what's in the box (def grid) */

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem 2rem;
}

@media (min-width: 700px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 980px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.def {
  padding: 1.25rem 0 1.25rem 1.5rem;
  border-left: 2px solid var(--border);
  transition: border-color var(--t-fast) var(--ease-out);
}

.def:hover {
  border-left-color: var(--accent);
}

.def h3 {
  font-size: var(--text-h3);
  font-weight: 500;
  margin-bottom: 0.5rem;
  letter-spacing: -0.005em;
}

.def p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 36ch;
}

/* ============================================================ prose grid (Why Bayesian) */

.prose-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 880px) {
  .prose-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
}

.prose h3 {
  font-size: var(--text-h3);
  font-weight: 500;
  margin-bottom: 0.75rem;
  letter-spacing: -0.005em;
}

.prose p {
  color: var(--text-muted);
  font-size: 0.97rem;
  line-height: 1.7;
  max-width: 42ch;
}

.prose code {
  font-size: 0.88em;
}

/* ============================================================ compare (Kinbiont vs BayesBiont) */

.compare {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 780px) {
  .compare {
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }

  .compare-col {
    border-left: 1px solid var(--border);
    padding-left: 2.25rem;
  }

  .compare-col:first-child {
    padding-left: 0;
    padding-right: 2.25rem;
    border-left: none;
  }
}

.compare-col {
  padding-block: 0.5rem;
}

.compare-col h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.compare-col h3 a {
  border-bottom: 1px solid var(--text);
  padding-bottom: 1px;
}

.compare-col--accent h3 a {
  border-bottom-color: var(--accent);
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
}

.tag--accent {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.compare-col--accent {
  position: relative;
}

@media (min-width: 780px) {
  .compare-col--accent::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6rem;
    bottom: 0.6rem;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
  }
  .compare-col--accent {
    padding-left: 2.5rem;
  }
}

.compare-col ul {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
}

.compare-col li {
  padding-left: 1.4rem;
  position: relative;
  color: var(--text-muted);
  font-size: 0.97rem;
  line-height: 1.55;
}

.compare-col li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 0.65rem;
  height: 1px;
  background: var(--accent);
}

.when-to-use {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  font-size: 0.93rem;
  color: var(--text-muted);
  max-width: none;
  line-height: 1.65;
}

.when-to-use strong {
  color: var(--text);
  font-weight: 500;
}

/* ============================================================ example */

.example-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 900px) {
  .example-grid {
    grid-template-columns: 1fr 1.3fr;
    gap: clamp(3rem, 2rem + 3vw, 4.5rem);
  }
}

.example-copy .section-label { margin-bottom: 1rem; }
.example-copy .block-title { margin-bottom: 1.25rem; }

.example-foot {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 50ch;
}

.code {
  background: #14110e;
  color: #f3efe6;
  border-radius: 4px;
  padding: clamp(1rem, 0.75rem + 1vw, 1.6rem);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.7;
  border: 1px solid #2a2520;
  box-shadow: 0 24px 56px -38px rgba(20, 17, 14, 0.25);
}

.code-sm {
  font-size: 0.84rem;
  padding: 0.9rem 1.1rem;
}

.code .c-key { color: #e0a857; }                      /* keywords — amber */
.code .c-mod { color: #5cdca8; font-weight: 500; }    /* modules — pamiec mint */
.code .c-fn  { color: #7fc4eb; }                       /* functions — sky */
.code .c-str { color: #f78ec2; }                       /* strings — pamiec rose */
.code .c-sym { color: #e0a857; font-style: italic; }   /* symbols — amber italic */
.code .c-com { color: #6e6862; font-style: italic; }   /* comments — muted */
.code .c-num { color: #f78ec2; }                       /* numbers — rose */

/* ============================================================ install grid */

.install-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 780px) {
  .install-grid {
    grid-template-columns: 1fr 1fr;
    gap: clamp(2.5rem, 2rem + 3vw, 4rem);
  }
}

.install-grid .block-title { margin-bottom: 0.75rem; }
.install-grid .block-intro { margin-top: 0; margin-bottom: 1.25rem; }

/* ============================================================ references */

.ref-list {
  counter-reset: ref;
  display: grid;
  gap: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 72ch;
}

.ref-list li {
  counter-increment: ref;
  padding-left: 2.25rem;
  position: relative;
}

.ref-list li::before {
  content: counter(ref) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--rose-dark);
  width: 1.75rem;
  text-align: right;
}

.ref-list em {
  color: var(--text);
  font-style: italic;
}

/* ============================================================ footer */

.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: clamp(3rem, 2rem + 2vw, 4.5rem) 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2.5rem;
  }
}

.site-footer .brand { margin-bottom: 0.85rem; }

.site-footer p {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 32ch;
}

.site-footer h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
  margin-bottom: 0.85rem;
}

.site-footer ul li {
  margin-bottom: 0.45rem;
}

.site-footer ul li a {
  color: var(--text-muted);
  font-size: 0.95rem;
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out);
  padding-bottom: 1px;
}

.site-footer ul li a:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.footer-foot {
  margin-top: clamp(2.5rem, 2rem + 1vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ============================================================ motion respect */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
