/* CatLLM site styles.
   Shared by index.html and updates.html. Extracted from the inline
   <style> block so both pages stay on one set of tokens. */

/* ── Reset & Variables ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #161616;
  --bg-2:       #1c1c1c;
  --bg-3:       #232323;
  --border:     rgba(255,255,255,0.08);
  --border-hi:  rgba(255,255,255,0.18);
  --teal:       #7ab3aa;
  --teal-dim:   #5a8a83;
  --teal-glow:  rgba(122,179,170,0.10);
  --teal-glow2: rgba(122,179,170,0.04);
  --orange:     #c8946a;
  --orange-glow: rgba(200,148,106,0.10);
  --text:       #e6e6e3;
  --text-2:     #9a9a96;
  --text-3:     #6b6b67;
  --white:      #f5f5f2;
  --amber:      #c8946a;
  --radius:     4px;
  --radius-lg:  6px;
  --font-sans:  'DM Sans', sans-serif;
  --font-mono:  'DM Mono', monospace;
  --font-disp:  'Source Serif 4', Charter, 'Iowan Old Style', Georgia, serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

.dot-grid { display: none; }

/* ── Layout ─────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

section { position: relative; z-index: 1; }

/* ── Nav ─────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(22,22,22,0.92);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-disp);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo-mark {
  height: 24px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  transition: color 0.2s;
}

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

.nav-cta {
  color: var(--text) !important;
  padding: 5px 12px;
  border: 1px solid var(--border-hi);
  border-radius: 3px;
  font-weight: 400 !important;
  font-size: 0.82rem !important;
  transition: border-color 0.2s, color 0.2s !important;
}

.nav-cta:hover { color: var(--teal) !important; border-color: var(--teal-dim); }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  padding: 100px 0 60px;
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.hero-inner .hero-desc { margin-left: auto; margin-right: auto; }
.hero-inner .hero-citation { margin-left: auto; margin-right: auto; justify-content: center; }
.hero-inner .hero-actions { justify-content: center; }
.hero-inner .install-cmd { margin-left: auto; margin-right: auto; }
.hero-inner .lang-tabs { justify-content: center; }

.hero-title {
  font-family: var(--font-disp);
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--white);
  margin-bottom: 14px;
}

.hero-title .teal { color: inherit; font-style: italic; font-weight: 500; }

.hero-subtitle {
  font-family: var(--font-disp);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 400;
  font-style: italic;
  color: var(--text-2);
  line-height: 1.45;
  margin-bottom: 22px;
  letter-spacing: 0;
}

.hero-desc {
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 480px;
}

.hero-desc strong {
  color: var(--text);
  font-weight: 500;
}

.hero-citation {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-3);
  margin-bottom: 26px;
  padding: 0;
  max-width: fit-content;
}

.hero-citation a {
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-color: var(--teal-dim);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s;
}

.hero-citation a:hover { color: var(--teal); }

.citation-sep { color: var(--text-3); opacity: 0.45; }

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

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s;
  border: 1px solid var(--text);
}

.btn-primary:hover {
  background: var(--white);
  border-color: var(--white);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 400;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-hi);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.btn-secondary:hover {
  border-color: var(--text-2);
  color: var(--white);
}

.install-cmd {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  cursor: pointer;
  transition: border-color 0.2s;
  max-width: fit-content;
  /* Pin width to fit the longer R install command so the card stays
     the same size when toggling Python ↔ R, preventing the hero from
     reflowing (and the three buttons from wrapping on narrow widths). */
  min-width: 72ch;
}
@media (max-width: 900px) {
  /* Once the hero stacks to one column, the 72ch min-width overflows
     the content column. Drop it and let the code wrap inside. */
  .install-cmd {
    min-width: 0;
    max-width: 100%;
  }
  .install-cmd code { white-space: normal; word-break: break-all; }
}

.install-cmd:hover { border-color: var(--border-hi); }

.install-cmd code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--teal);
  white-space: nowrap;
}

/* Language-picker tabs. Two shapes: hero-attached and inline-pill. */
.lang-tabs {
  display: inline-flex;
  gap: 0;
  background: transparent;
  margin-bottom: 6px;
}
.lang-tab {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.lang-tab:first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.lang-tab:last-child  { border-top-right-radius: 6px; border-bottom-right-radius: 6px; border-left: none; }
.lang-tab:hover { color: var(--text); }
.lang-tab.is-active {
  background: var(--bg-3);
  color: var(--teal);
  border-color: var(--teal-dim);
}
.lang-tab.is-active + .lang-tab { border-left-color: var(--border); }

.lang-tabs--inline {
  margin-top: 14px;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 2px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.copy-btn:hover { color: var(--text); }
.copy-btn.copied { color: var(--teal); }

.c-keyword  { color: #7eb8f7; }
.c-func     { color: #79d9c7; }
.c-string   { color: #f5c27a; }
.c-comment  { color: var(--text-3); font-style: italic; }
.c-param    { color: #c8d0de; }
.c-value    { color: #f5c27a; }

/* ── Section headers ─────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-disp);
  font-size: clamp(1.5rem, 2.6vw, 1.95rem);
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.section-desc {
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 600px;
}

/* ── Features ─────────────────────────────────────────── */
.features { padding: 70px 0; }

.features-header { margin-bottom: 44px; }

.features-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.features-list > div {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 36px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.features-list dt {
  font-family: var(--font-disp);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.005em;
  line-height: 1.3;
}

.features-list dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.65;
}

@media (max-width: 720px) {
  .features-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ── Pipeline ─────────────────────────────────────────── */
.pipeline { padding: 70px 0; }

.pipeline-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.pipeline-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pipeline-step {
  display: flex;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  cursor: default;
  transition: all 0.2s;
}

.pipeline-step:first-child { border-top: 1px solid var(--border); }

.step-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-3);
  width: 32px;
  flex-shrink: 0;
  margin-top: 2px;
  letter-spacing: 0.05em;
}

.step-content {}

.step-title {
  font-family: var(--font-disp);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.005em;
  margin-bottom: 6px;
}

.step-desc {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.65;
}

.pipeline-visual {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.pv-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}

.pv-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

.pv-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-3);
  margin-left: 6px;
}

.pv-flow {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pv-stage {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s;
}

.pv-stage:hover { border-color: var(--border-hi); }

.pv-stage-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--teal);
  background: var(--teal-glow);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.pv-stage-desc {
  font-size: 0.8rem;
  color: var(--text-2);
}

.pv-arrow {
  text-align: center;
  color: var(--text-3);
  font-size: 0.75rem;
}

/* ── Domain Packages ──────────────────────────────────── */
.packages { padding: 70px 0; }

.packages-header { margin-bottom: 44px; }

.packages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.pkg-card {
  background: transparent;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 22px 22px;
  position: relative;
}

.pkg-tag {
  display: none;
}

.pkg-name {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-3);
  font-weight: 400;
  margin-bottom: 4px;
}

.pkg-domain {
  font-family: var(--font-disp);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.005em;
  margin-bottom: 8px;
}

.pkg-desc {
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 16px;
}

.pkg-install {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.pkg-install:hover { border-color: var(--border-hi); }

.pkg-install code {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-2);
  flex: 1;
}

.pkg-install .copy-btn {
  color: var(--text-3);
}

/* ── Comparison section ──────────────────────────────── */
.compare { padding: 70px 0; }

.compare-header { margin-bottom: 40px; }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 0.88rem;
}

.compare-table th,
.compare-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.compare-table tr:last-child th,
.compare-table tr:last-child td { border-bottom: none; }

.compare-table thead th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}

.compare-table thead th.col-ours {
  color: var(--teal);
  background: rgba(0,220,195,0.05);
}

.compare-table tbody th {
  font-weight: 500;
  color: var(--text);
  font-size: 0.85rem;
  width: 22%;
  background: rgba(0,0,0,0.15);
}

.compare-table tbody td {
  color: var(--text-2);
  width: 26%;
}

.compare-table tbody td.col-ours {
  color: var(--text);
  background: rgba(0,220,195,0.03);
}

.compare-note {
  margin-top: 24px;
  padding: 18px 22px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--teal-dim);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.65;
}

.compare-note strong {
  color: var(--text);
  font-weight: 500;
}

@media (max-width: 760px) {
  .compare-table { font-size: 0.78rem; }
  .compare-table th, .compare-table td { padding: 10px 12px; }
}

/* ── Code section ─────────────────────────────────────── */
.code-section { padding: 70px 0; }

.code-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.code-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.code-dots {
  display: flex;
  gap: 6px;
}

.code-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}

.code-lang {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-3);
}

.code-body {
  padding: 22px 22px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.9;
  color: #c8d0de;
  overflow-x: auto;
}

.code-text { white-space: pre; }

/* ── Research ─────────────────────────────────────────── */
.research { padding: 70px 0; }

.research-inner {
  background: transparent;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 44px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 50px;
  align-items: start;
  position: relative;
}

.research-quote {
  font-family: var(--font-disp);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  line-height: 1.55;
  letter-spacing: 0;
  margin-bottom: 22px;
  max-width: 620px;
}

.research-cta {
  flex-shrink: 0;
}

/* ── Updates ──────────────────────────────────────────── */
.updates { padding: 70px 0 0; }

/* updates.html is the whole page rather than a section, so it needs
   clearance under the 58px fixed nav and its own bottom padding. */
.updates.is-page { padding: 112px 0 80px; }

.nav-links a.is-current { color: var(--text); }

.updates-header { margin-bottom: 30px; }

/* Year rules act as the only headings in the list, so they carry the
   top border and each row carries its own bottom border. */
.updates-year {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-3);
  letter-spacing: 0.14em;
  padding-bottom: 9px;
  margin-top: 26px;
  border-bottom: 1px solid var(--border-hi);
}

.updates-year:first-of-type { margin-top: 0; }

.updates-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.update-item {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 20px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.update-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-3);
  white-space: nowrap;
}

.update-title {
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.5;
  text-decoration: none;
  transition: color 0.15s;
}

.update-item:hover .update-title { color: var(--white); }

.update-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2px 7px;
  white-space: nowrap;
}

.update-tag.is-release  { color: var(--teal);   border-color: rgba(122,179,170,0.28); }
.update-tag.is-preprint { color: var(--orange); border-color: rgba(200,148,106,0.28); }

.updates-more { margin-top: 26px; }

/* Mentions are hidden until assets/mentions.json has approved entries,
   so an empty list never renders an empty heading. */
.mentions { display: none; margin-top: 56px; }
.mentions.has-items { display: block; }

.mentions-intro {
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.7;
  margin: 8px 0 20px;
  max-width: 640px;
}

.mention-source {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2px 7px;
  white-space: nowrap;
}

/* ── Share your work ──────────────────────────────────── */
.share { padding: 0 0 70px; }

.share-inner {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 38px 40px;
  max-width: 800px;
}

.share-title {
  font-family: var(--font-disp);
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 12px;
}

.share-desc {
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 26px;
}

.share-desc em { color: var(--text); font-style: italic; }

.share-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.share-note {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-3);
  line-height: 1.6;
}

/* ── Footer ───────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-logo {
  font-family: var(--font-disp);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.03em;
}

.footer-meta {
  font-size: 0.8rem;
  color: var(--text-3);
  line-height: 1.6;
}

.footer-meta a {
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-meta a:hover { color: var(--teal); }

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--teal); }

/* Scroll-reveal removed — content visible by default. */
.reveal, .reveal.visible { opacity: 1; transform: none; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1080px) {
  /* Nav has 7 items + a CTA pill; below ~1080px they collide before
     the CTA wraps to a second line. Collapse early: there's no
     mobile menu, but the page is short enough to scroll. */
  .nav-links { display: none; }
}

@media (max-width: 900px) {
  .pipeline-inner { grid-template-columns: 1fr; }
  .pipeline-visual { display: none; }
  .packages-grid { grid-template-columns: repeat(2, 1fr); }
  .code-inner { grid-template-columns: 1fr; }
  .research-inner { grid-template-columns: 1fr; }
  /* Stack the language tabs above the install snippet so they
     don't sit beside it when the column narrows. width: max-content
     keeps the tabs only as wide as their content (don't stretch). */
  .lang-tabs { display: flex; width: max-content; }
}

@media (max-width: 560px) {
  .packages-grid { grid-template-columns: 1fr; }
  .hero { padding: 90px 0 50px; }
  .research-inner { padding: 36px 0; }
  /* Date and tag share the first row, title drops to its own line. */
  .update-item { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .update-date { grid-column: 1; grid-row: 1; }
  .update-tag { grid-column: 2; grid-row: 1; justify-self: end; }
  .update-title { grid-column: 1 / -1; grid-row: 2; }
  .share-inner { padding: 26px 22px; }
  .share-cta { flex-direction: column; align-items: stretch; }
  .share-cta a { justify-content: center; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
