@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Sora:wght@300;400;500&family=JetBrains+Mono:wght@400;500&display=swap");

/* Monochrome tokens, shared with MLLM Gallery and the ReasonCLIP page */
:root {
  --black: #050505;
  --white: #ffffff;
  --soft: #f4f4f6;
  --soft-2: #ececef;
  --line: rgba(0, 0, 0, 0.12);
  --line-strong: rgba(0, 0, 0, 0.35);
  --muted: rgba(0, 0, 0, 0.55);
  --faint: rgba(0, 0, 0, 0.38);
  --bar-base: #c9c9ce;
  --bar-s1: #7a7a80;
  --bar-s2: #050505;
  --pos: #050505;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.08);
  --title-font: "Sora", "Inter", system-ui, sans-serif;
  --body-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --content: 960px;
  --wide: 1080px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

::selection { background: var(--black); color: var(--white); }

/* ---------- Nav ---------- */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  transition: background 220ms ease, border-color 220ms ease;
  border-bottom: 1px solid transparent;
}
.navbar.is-scrolled {
  background: rgba(255, 255, 255, 0.86);
  border-bottom-color: var(--line);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--title-font);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.02em;
  flex: 0 0 auto;
}
.brand svg { width: 28px; height: 28px; }
.nav-links {
  display: flex;
  min-width: 0;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(244, 244, 246, 0.86);
  color: rgba(0, 0, 0, 0.75);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.pill:hover { border-color: rgba(0, 0, 0, 0.3); background: var(--white); color: var(--black); }
.pill-dark { background: var(--black); border-color: var(--black); color: var(--white); }
.pill-dark:hover { background: rgba(0, 0, 0, 0.82); color: var(--white); }
.pill svg { width: 14px; height: 14px; flex: 0 0 auto; }
.pill svg.logo { width: 18px; height: 18px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 128px 16px 72px;
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 85%);
}
.hero-grid::before,
.hero-grid::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 42%;
  width: 640px;
  height: 640px;
  margin: -320px 0 0 -320px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  animation: pulse-ring 9s ease-in-out infinite;
}
.hero-grid::after { width: 400px; height: 400px; margin: -200px 0 0 -200px; animation-delay: -3.5s; }

@keyframes pulse-ring {
  0%, 100% { opacity: 0.5; transform: scale(0.94); }
  50% { opacity: 0.12; transform: scale(1.06); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--wide);
  margin: 0 auto;
  text-align: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.eyebrow .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--black); }

.hero h1 {
  margin: 18px 0 0;
  font-family: var(--title-font);
  font-size: clamp(2.7rem, 9vw, 5.6rem);
  font-weight: 300;
  letter-spacing: -0.075em;
  line-height: 0.95;
}
.hero h1 .num { color: rgba(0, 0, 0, 0.32); }
.hero .subtitle {
  max-width: 760px;
  text-wrap: balance;
  margin: 18px auto 0;
  font-family: var(--title-font);
  font-size: clamp(1.1rem, 2.6vw, 1.55rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.authors {
  max-width: 820px;
  margin: 30px auto 0;
  font-size: 15px;
  line-height: 1.8;
}
.authors a { text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.authors a:hover { border-bottom-color: var(--black); }
.authors sup { color: var(--muted); font-size: 0.7em; margin-left: 1px; }
.affils {
  max-width: 820px;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.affils span { white-space: nowrap; margin: 0 6px; }
.affils .note { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}
.hero-actions .pill { min-height: 40px; padding: 0 18px; font-size: 13px; }

/* ---------- Layout ---------- */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.toc { display: none; }
main { min-width: 0; width: 100%; max-width: var(--content); margin: 0 auto; }

section.block {
  padding: 72px 0 8px;
}

.section-index {
  display: block;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
h2 {
  margin: 0 0 18px;
  font-family: var(--title-font);
  font-size: clamp(1.8rem, 4.6vw, 2.6rem);
  font-weight: 300;
  letter-spacing: -0.06em;
  line-height: 1.05;
}
h3 {
  margin: 36px 0 10px;
  font-family: var(--title-font);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
p { margin: 0 0 16px; }
.lead { font-size: 18px; line-height: 1.6; color: rgba(0, 0, 0, 0.8); margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
strong { font-weight: 600; }
main p a { text-decoration: none; border-bottom: 1px solid var(--line-strong); }
main p a:hover { border-bottom-color: var(--black); }

code, .mono { font-family: var(--mono); font-size: 0.86em; }
:not(pre) > code { background: var(--soft); border-radius: 4px; padding: 1px 5px; }

figure { margin: 28px 0; }
figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.55; }
figcaption b { color: var(--black); font-weight: 600; }

/* ---------- TL;DR + stats ---------- */
.tldr {
  border-left: 2px solid var(--black);
  padding: 2px 0 2px 18px;
  margin: 0 0 28px;
}
.tldr .tag { font-family: var(--mono); font-size: 11px; color: var(--muted); display: block; margin-bottom: 4px; }

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 32px 0 8px;
}
.stat { padding: 20px 14px 18px 0; }
.stat + .stat { padding-left: 14px; border-left: 1px solid var(--line); }
.stat:nth-child(3) { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
.stat:nth-child(4) { border-top: 1px solid var(--line); }
.stat .value {
  font-family: var(--title-font);
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 300;
  letter-spacing: -0.06em;
  line-height: 1;
}
.stat .value small { font-size: 0.45em; letter-spacing: 0; color: var(--muted); margin-left: 4px; }
.stat .label { margin-top: 10px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.stat .label b { color: var(--black); font-weight: 500; }

/* ---------- Stage stepper ---------- */
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
}
.seg button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(0, 0, 0, 0.6);
  font-size: 12px;
  font-weight: 500;
  min-height: 30px;
  padding: 0 13px;
  white-space: nowrap;
}
.seg button:hover { color: var(--black); }
.seg button.is-active { background: var(--black); color: var(--white); }

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.7);
  background: var(--white);
}

/* ---------- Tables ---------- */
.table-wrap { margin: 20px 0; border-top: 1px solid var(--black); border-bottom: 1px solid var(--black); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { font-weight: 500; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
tbody tr + tr td { border-top: 1px solid rgba(0,0,0,0.06); }


/* ---------- Code ---------- */
.code {
  position: relative;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  overflow: hidden;
}
.code-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.copy-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  color: var(--black);
}
.copy-btn:hover { border-color: var(--line-strong); }
pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
}
#bibtex { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
footer {
  margin-top: 96px;
  padding: 28px 16px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
footer .wrap { max-width: var(--wide); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
footer a { color: var(--black); }

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

/* ---------- Desktop ---------- */
@media (min-width: 720px) {
  .navbar { padding: 18px 28px; }
  .hero { padding: 150px 24px 90px; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 1px solid var(--line); padding-left: 14px; border-top: 0; }
  .stat:nth-child(4) { border-top: 0; }
}

@media (min-width: 1180px) {
  .page { grid-template-columns: 190px minmax(0, 1fr); gap: 40px; }
  .toc {
    display: block;
    position: sticky;
    top: 96px;
    align-self: start;
    padding-top: 76px;
    font-size: 12px;
  }
  .toc .toc-title { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
  .toc a {
    display: block;
    padding: 5px 0 5px 12px;
    border-left: 1px solid var(--line);
    color: var(--muted);
    text-decoration: none;
    transition: color 160ms ease, border-color 160ms ease;
  }
  .toc a:hover { color: var(--black); }
  .toc a.is-active { color: var(--black); border-left-color: var(--black); font-weight: 500; }
  main { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-grid::before, .hero-grid::after { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .lang-row .bar i, .lh-img img { transition: none; }
}


/* =================== LingT2I components =================== */

/* ---------- Hero: one prompt, ten languages ---------- */
.lang-hero {
  max-width: 820px;
  margin: 48px auto 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  text-align: left;
  overflow: hidden;
}
.lh-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.lh-langs { display: flex; gap: 2px; }
.lh-langs button {
  border: 0;
  background: transparent;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 7px;
  border-radius: 999px;
  text-transform: uppercase;
}
.lh-langs button:hover { color: var(--black); }
.lh-langs button.is-active { background: var(--black); color: var(--white); }
.lh-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.lh-img { background: var(--soft); aspect-ratio: 1 / 1; overflow: hidden; }
.lh-img img { width: 100%; height: 100%; object-fit: cover; transition: opacity 260ms ease; }
.lh-img img.is-fading { opacity: 0.15; }
.lh-text { padding: 22px 22px 20px; display: grid; align-content: center; gap: 10px; }
.lh-label { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.lh-prompt {
  margin: 0;
  font-family: var(--title-font);
  font-size: 21px;
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.45;
}
.lh-prompt[dir="rtl"] { text-align: right; }
.lh-gloss { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ---------- Stats with a unit ---------- */
.stat .value small { font-size: 0.42em; letter-spacing: 0; color: var(--muted); margin-left: 5px; }

/* ---------- Tasks ---------- */
.tasks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 8px;
}
.task {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 20px 22px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.task .meta { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.task .name { font-family: var(--title-font); font-size: 21px; letter-spacing: -0.03em; }
.task .count { font-family: var(--title-font); font-size: 34px; font-weight: 300; letter-spacing: -0.05em; line-height: 1.1; }
.task .count small { font-size: 14px; letter-spacing: 0; color: var(--muted); }
.task p { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.dim-groups { display: grid; gap: 6px; }
.dim-groups div { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.dim-groups b { width: 104px; font-size: 12px; font-weight: 500; }

/* ---------- Language table ---------- */
.lang-table { border-top: 1px solid var(--black); border-bottom: 1px solid var(--black); }
.lang-row {
  display: grid;
  grid-template-columns: 44px 170px 120px 120px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  font-size: 13px;
}
.lang-row + .lang-row { border-top: 1px solid rgba(0, 0, 0, 0.06); }
.lang-row.head { color: var(--muted); font-size: 12px; font-weight: 500; border-bottom: 1px solid var(--line); }
.lang-row .lc { font-family: var(--mono); font-size: 12px; text-transform: uppercase; }
.lang-row .native { color: var(--muted); margin-left: 6px; }
.lang-row .bar { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.lang-row .bar i { display: block; height: 100%; width: 0; background: var(--black); border-radius: 999px; transition: width 900ms cubic-bezier(.2,.7,.2,1); }
.lang-row .num { text-align: right; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- Construction flow ---------- */
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  counter-reset: fl;
}
.flow li {
  counter-increment: fl;
  position: relative;
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 14px 22px 14px 0;
  border-top: 2px solid var(--black);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.flow li + li { padding-left: 0; }
.flow li::before { content: "0" counter(fl); font-family: var(--mono); font-size: 11px; color: var(--faint); }
.flow li b { color: var(--black); font-weight: 500; font-size: 14px; }
.flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 10px;
  top: -6px;
  border: 5px solid transparent;
  border-left: 7px solid var(--black);
}

/* ---------- Heatmaps ---------- */
.heat-card { margin-top: 20px; }
.heat-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.heat-wrap { margin: 10px 0 0; }
table.heat { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 12px; table-layout: fixed; }
table.heat th {
  padding: 4px 2px;
  font-weight: 500;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  border: 0;
}
table.heat th.model { text-align: left; width: 132px; padding-left: 0; }
table.heat th .lc { font-family: var(--mono); text-transform: uppercase; }
table.heat td {
  padding: 0;
  height: 30px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  border-radius: 4px;
  border: 0;
  white-space: nowrap;
  transition: outline-color 120ms ease;
  outline: 1.5px solid transparent;
  outline-offset: -1.5px;
}
table.heat td.model { text-align: left; font-family: var(--body-font); font-size: 12.5px; padding-left: 0; }
table.heat td.cell { cursor: default; }
table.heat td.cell:hover { outline-color: var(--black); }
table.heat td.side { background: var(--soft); color: var(--black); }
table.heat td.side.best { font-weight: 600; }
table.heat tr.group td {
  height: auto;
  padding: 12px 0 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  text-align: left;
}
table.heat tr.avg td { font-style: normal; }
table.heat tr.avg td.model { color: var(--muted); }
table.heat th.gap { width: 10px; }
.heat-readout { min-height: 1.6em; margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.heat-readout b { color: var(--black); font-weight: 500; }
table.heat.dims th.model { width: 110px; }
#dimTabs { margin-top: 6px; }

.findings { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.findings li { padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); line-height: 1.55; }
.findings b { display: block; color: var(--black); font-weight: 500; margin-bottom: 2px; }

/* ---------- Gallery ---------- */
.gal { margin-top: 20px; }
.gal-grid {
  display: grid;
  grid-template-columns: 96px repeat(10, minmax(0, 1fr));
  gap: 3px;
  margin-top: 16px;
}
.gal-grid .colhead {
  border: 0;
  background: none;
  padding: 6px 0;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
}
.gal-grid .colhead:hover { color: var(--black); background: var(--soft); }
.gal-grid .colhead.is-active { background: var(--black); color: var(--white); }
.gal-grid .rowhead { display: flex; align-items: center; font-size: 12px; font-weight: 500; padding-right: 6px; }
.gal-grid .corner { font-family: var(--mono); font-size: 10px; color: var(--faint); display: flex; align-items: center; }
.gal-grid .cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  background: var(--soft);
  cursor: pointer;
  transition: opacity 200ms ease;
}
.gal-grid .cell img { width: 100%; height: 100%; object-fit: cover; }

.gal-grid .cell.in-col { box-shadow: 0 0 0 1.5px var(--black); }
.gal-prompt {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--soft);
  display: grid;
  gap: 6px;
  min-height: 92px;
}
.gal-prompt p { margin: 0; font-size: 15px; line-height: 1.6; }
.gal-prompt p[dir="rtl"] { text-align: right; }
.gal-prompt mark { background: var(--black); color: var(--white); padding: 0 5px; border-radius: 4px; }

/* zoom on hover */
.zoom {
  position: fixed;
  z-index: 60;
  width: 300px;
  pointer-events: none;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.28);
  background: var(--white);
  opacity: 0;
  transition: opacity 120ms ease;
}
.zoom.is-on { opacity: 1; }
.zoom img { width: 100%; display: block; }
.zoom span { display: block; padding: 6px 10px; font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ---------- Patterns ---------- */
.pattern {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 28px;
  align-items: start;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.pattern:first-of-type { margin-top: 12px; }
.pattern h3 { margin-top: 0; }
.pattern-text p { font-size: 15px; color: rgba(0, 0, 0, 0.75); }
.pattern-grid { display: grid; gap: 6px; }
.pattern-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pattern-grid.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pattern-grid figure { margin: 0; }
.pattern-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 6px; background: var(--soft); }
.pattern-grid figcaption { margin-top: 4px; font-size: 11px; line-height: 1.35; color: var(--muted); }
.pattern-grid figcaption .lc { font-family: var(--mono); color: var(--black); text-transform: uppercase; margin-right: 4px; }
.pattern-grid figcaption .req { display: block; color: var(--black); font-size: 12px; }

.demo { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--black); border-bottom: 1px solid var(--black); }
.demo li { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; align-items: baseline; gap: 12px; padding: 12px 0; font-size: 14px; }
.demo li + li { border-top: 1px solid var(--line); }
.demo .v { white-space: nowrap; font-family: var(--title-font); font-size: 26px; font-weight: 300; letter-spacing: -0.04em; text-align: right; }
.demo .d { color: var(--muted); font-size: 13px; }

/* ---------- Causes ---------- */
.checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 20px; }
.check { padding: 18px 16px 18px 0; display: grid; gap: 6px; align-content: start; }
.check + .check { padding-left: 16px; border-left: 1px solid var(--line); }
.check .meta { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.check .big { font-family: var(--title-font); font-size: 22px; font-weight: 300; letter-spacing: -0.03em; line-height: 1.2; }
.check p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; }

/* ---------- Takeaways ---------- */
.takeaways { margin: 8px 0 0; padding: 0; list-style: none; counter-reset: tk; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.takeaways li { counter-increment: tk; display: grid; grid-template-columns: 34px 1fr; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.takeaways li::before { content: "0" counter(tk); font-family: var(--mono); font-size: 12px; color: var(--faint); padding-top: 3px; }

@media (max-width: 900px) {
  .lh-body, .tasks, .pattern, .findings { grid-template-columns: minmax(0, 1fr); }
  .checks, .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lang-row { grid-template-columns: 36px 1fr 90px 64px; }
  .lang-row .branch, .lang-row .bar { display: none; }
}
