/*
  Blog styles. Mirrors the tokens and pencil primitives from index.html so
  posts read as part of the same sketchbook. The SVG filters these rules
  reference (#pencil, #pencil-long, #grain, #rough) live inline in each page.
*/

:root {
  --paper: #f4f1e9;
  --sheet: #fbfaf6;
  --graphite: #262622;
  --text: #3a3934;
  --muted: #6c6a61;
  --hatch: rgba(38, 38, 34, 0.34);
  --hatch-strong: rgba(38, 38, 34, 0.5);
  --grid: rgba(24, 92, 61, 0.075);
  --green: #185c3d;
  --bar-base: #8a877c;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --rule: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 10' preserveAspectRatio='none'%3E%3Cpath d='M1 5.3C120 4.5 260 6 400 5.1s300-.9 420 .3 260 .5 378-.5' fill='none' stroke='%23262622' stroke-width='1.5' stroke-linecap='round'/%3E%3Cpath d='M40 5.9C210 5.2 430 6.3 650 5.6s380-.5 510-1' fill='none' stroke='%23262622' stroke-width='.7' stroke-opacity='.45' stroke-linecap='round'/%3E%3C/svg%3E");
  --rule-soft: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 10' preserveAspectRatio='none'%3E%3Cpath d='M1 5.6C140 4.8 300 6.1 460 5.2s320-.7 440 .2 220 .4 298-.4' fill='none' stroke='%23262622' stroke-opacity='.42' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E");
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --max: 1120px;
  --measure: 700px;
}

* {
  box-sizing: border-box;
}

html {
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .18 0 0 0 0 .14 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: clip;
  background: transparent;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  color: var(--graphite);
  text-wrap: balance;
}

a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px dashed var(--green);
  outline-offset: 5px;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: min(calc(100% - 48px), var(--max));
  margin-inline: auto;
}

/* Pencil primitives -------------------------------------------------- */

.sketch-card {
  position: relative;
  isolation: isolate;
}

.sketch-card::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1.6px solid var(--graphite);
  border-radius: 3px 7px 4px 8px / 7px 4px 8px 3px;
  background: var(--sheet);
  content: "";
  filter: url(#pencil-long);
}

.sketch-card::after {
  position: absolute;
  inset: 8px -8px -8px 8px;
  z-index: -2;
  background: repeating-linear-gradient(-45deg, var(--hatch) 0 1.2px, transparent 1.2px 6px);
  content: "";
  filter: url(#pencil);
  opacity: 0.7;
}

.ink path,
.ink circle,
.ink rect,
.ink line {
  fill: none;
  stroke: var(--graphite);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ink .accent {
  stroke: var(--green);
  stroke-width: 2.4;
}

.ink .soft {
  stroke-width: 1.4;
  opacity: 0.6;
}

.ink .dashed {
  stroke-dasharray: 3 5;
  opacity: 0.55;
}

.ink .fill-sheet {
  fill: var(--sheet);
}

.ink .fill-green {
  fill: var(--green);
  stroke: var(--green);
}

.sketch {
  overflow: visible;
  filter: url(#pencil);
}

.art-label {
  fill: var(--muted);
  font-family: var(--hand);
  font-size: 19px;
  font-weight: 600;
}

.art-label.strong {
  fill: var(--graphite);
}

.art-label.green {
  fill: var(--green);
}

.art-tag {
  fill: var(--sheet);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hand {
  font-family: var(--hand);
  font-weight: 600;
}

.draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.js .draw-on-view .draw {
  stroke-dashoffset: 1;
}

.js .draw-on-view.is-drawn .draw {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1300ms cubic-bezier(0.55, 0.1, 0.3, 1) var(--d, 0ms);
}

.js .draw-on-view .after-draw {
  opacity: 0;
}

.js .draw-on-view.is-drawn .after-draw {
  opacity: 1;
  transition: opacity 500ms ease 1300ms;
}

.btn {
  position: relative;
  isolation: isolate;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  color: var(--graphite);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 180ms ease;
}

.btn::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1.6px solid var(--graphite);
  border-radius: 4px 9px 5px 10px / 9px 5px 10px 4px;
  background: var(--sheet);
  content: "";
  filter: url(#pencil);
}

.btn::after {
  position: absolute;
  inset: 5px -6px -6px 5px;
  z-index: -2;
  background: repeating-linear-gradient(-45deg, var(--hatch) 0 1.2px, transparent 1.2px 5px);
  content: "";
  filter: url(#pencil);
  opacity: 0;
  transition: opacity 180ms ease;
}

.btn span {
  font-size: 17px;
  line-height: 1;
}

.btn:hover,
.btn:focus-visible {
  transform: translate(-2px, -2px);
}

.btn:hover::after,
.btn:focus-visible::after {
  opacity: 1;
}

.btn:active {
  transform: translate(2px, 2px);
}

.btn-primary {
  color: var(--sheet);
}

.btn-primary::before {
  background: var(--graphite);
  filter: url(#rough);
}

.btn-small {
  min-height: 38px;
  gap: 7px;
  padding: 0 14px;
  font-size: 13px;
}

.btn-small span {
  font-size: 14px;
}

/* Header ------------------------------------------------------------- */

.site-header {
  position: relative;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header::after,
footer::before {
  position: absolute;
  right: 0;
  left: 0;
  height: 10px;
  background: var(--rule) center / 100% 100% no-repeat;
  content: "";
  filter: url(#grain);
  opacity: 0.8;
  pointer-events: none;
}

.site-header::after {
  bottom: -5px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--graphite);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: block;
  flex: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--muted);
  font-size: 14px;
}

nav a {
  text-decoration: none;
}

nav a:not(.btn):hover,
nav a:not(.btn):focus-visible,
nav a[aria-current="page"] {
  color: var(--graphite);
  text-decoration: underline wavy var(--green) 1.5px;
  text-underline-offset: 7px;
}

.x-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--graphite);
  font-weight: 600;
  text-decoration: none;
}

.x-link svg {
  width: 12px;
  height: 12px;
  display: block;
  fill: currentColor;
}

/* Shared blog type --------------------------------------------------- */

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--green);
  font-family: var(--hand);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.kicker::before {
  width: 26px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  content: "";
  transform: rotate(-6deg);
}

a.kicker:hover,
a.kicker:focus-visible {
  text-decoration: underline wavy var(--green) 1.5px;
  text-underline-offset: 6px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 0;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 14px;
}

.post-meta li + li::before {
  margin: 0 12px;
  color: var(--hatch-strong);
  content: "/";
}

/* Post --------------------------------------------------------------- */

.post-hero {
  position: relative;
  isolation: isolate;
  padding: 80px 0 24px;
}

.post-hero::before {
  position: absolute;
  inset: 0 0 -160px;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  content: "";
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 25%, transparent 75%);
  pointer-events: none;
}

.post-head {
  max-width: var(--measure);
  margin-inline: auto;
}

.post-head h1 {
  margin: 0;
  font-size: clamp(38px, 5.4vw, 60px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

.post-head .dek {
  max-width: var(--measure);
  margin: 26px 0 30px;
  color: var(--text);
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.5;
}

.post-body {
  padding: 40px 0 72px;
}

.prose {
  max-width: var(--measure);
  margin-inline: auto;
  font-size: 18px;
  line-height: 1.72;
}

.prose p,
.prose ol,
.prose ul {
  margin: 0 0 1.2em;
}

.prose .lede {
  color: var(--graphite);
  font-size: 21px;
  line-height: 1.6;
}

.prose h2 {
  margin: 2.3em 0 0.65em;
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.024em;
  line-height: 1.12;
}

.prose h3 {
  margin: 1.9em 0 0.5em;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.3;
}

.prose strong {
  color: var(--graphite);
  font-weight: 600;
}

.prose a:not(.btn) {
  color: var(--graphite);
  text-decoration: underline;
  text-decoration-color: rgba(24, 92, 61, 0.55);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.prose a:not(.btn):hover,
.prose a:not(.btn):focus-visible {
  text-decoration: underline wavy var(--green) 1.5px;
}

.prose ol,
.prose ul {
  padding-left: 1.4em;
}

.prose li + li {
  margin-top: 0.5em;
}

.prose li::marker {
  color: var(--green);
  font-weight: 600;
}

.prose sup a:not(.btn) {
  padding: 0 1px;
  font-size: 0.75em;
  text-decoration: none;
}

.prose code {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(24, 92, 61, 0.08);
  color: var(--graphite);
  font-family: var(--mono);
  font-size: 0.8em;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  white-space: nowrap;
}

.nw {
  white-space: nowrap;
}

.prose var {
  font-family: "Times New Roman", Georgia, serif;
  font-size: 1.08em;
}

.prose p sub,
.prose p sup:not(:has(a)) {
  font-size: 0.68em;
  line-height: 0;
}

/* Data retention matrix ---------------------------------------------- */

.retention {
  width: 100%;
  margin: 0.4em 0 1.4em;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.4;
}

.retention th,
.retention td {
  padding: 14px 12px 14px 0;
  text-align: left;
  vertical-align: top;
}

.retention thead th {
  color: var(--muted);
  font-weight: 500;
}

.retention thead code {
  font-size: 0.86em;
}

.retention tr {
  background: var(--rule-soft) left bottom / 100% 10px no-repeat;
}

.retention tbody tr:last-child {
  background-image: none;
}

.retention tbody th {
  width: 34%;
  color: var(--graphite);
  font-weight: 600;
}

.retention td {
  color: var(--text);
}

.retention .is-recorded {
  color: var(--green);
  font-weight: 600;
}

.pull {
  margin: 1.5em 0 1.4em;
  color: var(--green);
  font-family: var(--hand);
  font-size: clamp(30px, 3.6vw, 38px);
  font-weight: 600;
  line-height: 1.12;
  transform: rotate(-1.2deg);
  text-wrap: balance;
}

.note {
  margin: 1.6em 0 1.8em;
  padding: 18px 24px 20px;
  font-size: 16px;
  line-height: 1.6;
}

.note .hand {
  display: block;
  margin-bottom: 2px;
  color: var(--green);
  font-size: 22px;
  line-height: 1.1;
}

.note p {
  margin: 0;
}

/* Figures ------------------------------------------------------------ */

.figure {
  max-width: 960px;
  margin: 56px auto;
}

.figure figcaption {
  max-width: var(--measure);
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.figure figcaption b {
  color: var(--graphite);
  font-weight: 600;
}

.figure-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.panel {
  padding: 18px 20px 14px;
}

.panel-title {
  margin: 0 0 4px;
  color: var(--graphite);
  font-family: var(--hand);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.panel-title.green {
  color: var(--green);
}

.panel .art-label {
  font-size: 21px;
}

.panel svg,
.figure-art svg {
  width: 100%;
  height: auto;
  display: block;
}

.figure-art {
  padding: 22px 26px 18px;
}

/* Learning flow ------------------------------------------------------ */

.flow {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.flow-node {
  padding: 16px 20px 18px;
}

.flow-node > :first-child {
  margin-top: 0;
}

.flow-node > :last-child {
  margin-bottom: 0;
}

.flow-node .flow-title {
  margin: 0;
  color: var(--graphite);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.flow-node p {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.flow-node .flow-q {
  color: var(--green);
  font-family: var(--hand);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
}

.flow-tag {
  display: inline-block;
  margin: 0 0 8px !important;
  color: var(--muted) !important;
  font-family: var(--hand);
  font-size: 21px !important;
  font-weight: 600;
  line-height: 1 !important;
}

.flow-narrow {
  max-width: 400px;
  margin-inline: auto;
}

.flow-branches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 6%;
  text-align: left;
}

.flow-steps {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  line-height: 1.45;
}

.flow-steps li {
  position: relative;
  padding-left: 22px;
}

.flow-steps li + li {
  margin-top: 6px;
}

.flow-steps li::before {
  position: absolute;
  left: 2px;
  color: var(--green);
  font-weight: 700;
  content: "\2192";
}

.flow-arrows {
  width: 100%;
  height: auto;
  display: block;
  margin: 6px 0;
}

.flow-arrows path {
  vector-effect: non-scaling-stroke;
}

.flow-node .flow-sink {
  margin-top: 8px;
  color: var(--green);
  font-size: 21px;
  line-height: 1;
}

/* Formula ------------------------------------------------------------ */

.formula {
  margin: 1.4em 0 1.6em;
  padding: 22px 24px;
  overflow-x: auto;
  color: var(--graphite);
  font-family: "Inter", sans-serif;
  font-size: 20px;
  text-align: center;
  white-space: nowrap;
}

.formula var {
  font-family: "Times New Roman", Georgia, serif;
  font-size: 1.12em;
  font-style: italic;
}

.formula sub,
.formula sup {
  font-family: "Inter", sans-serif;
  font-size: 0.6em;
  font-style: normal;
}

.formula .op {
  padding: 0 0.28em;
}

/* Results chart ------------------------------------------------------ */

.chart {
  max-width: 760px;
  margin-inline: auto;
  padding: 26px 30px 22px;
}

.chart-title {
  margin: 0 0 4px;
  color: var(--graphite);
  font-size: 16px;
  font-weight: 600;
}

.chart-sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}

.bars {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr) 88px;
  align-items: center;
  gap: 14px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bar-row {
  position: relative;
  display: contents;
}

.bar-label {
  color: var(--graphite);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.bar-label small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 400;
}

.bar-track {
  position: relative;
  height: 34px;
  background-image:
    linear-gradient(90deg, rgba(38, 38, 34, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, transparent calc(100% - 1px), rgba(38, 38, 34, 0.14) calc(100% - 1px));
  background-size: 25% 100%, 100% 100%;
  outline: none;
}

.bar {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: calc(var(--v) * 1%);
  border-radius: 0 4px 4px 0;
  background: var(--bar-base);
  transition: filter 160ms ease;
}

.bar.is-learned {
  background: var(--green);
}

.bar-value {
  color: var(--graphite);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1.2;
  text-align: right;
}

.bar-value small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.bar-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: calc(var(--v) * 1%);
  z-index: 2;
  width: max-content;
  max-width: 260px;
  padding: 7px 11px;
  border-radius: 6px;
  background: var(--graphite);
  color: var(--sheet);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-100%, 4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.bar-track:hover .bar,
.bar-track:focus-visible .bar {
  filter: brightness(1.15);
}

.bar-track:hover .bar-tip,
.bar-track:focus-visible .bar-tip {
  opacity: 1;
  transform: translate(-100%, 0);
}

.axis {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr) 88px;
  gap: 0 16px;
  margin-top: 8px;
}

.axis-ticks {
  position: relative;
  grid-column: 2;
  height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.axis-ticks span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

.axis-ticks span:first-child {
  transform: none;
}

.axis-ticks span:last-child {
  transform: translateX(-100%);
}

/* References --------------------------------------------------------- */

.refs {
  margin-top: 3em;
  padding-top: 1.6em;
  background: var(--rule-soft) left top / 100% 10px no-repeat;
}

.refs h2 {
  margin-top: 0.6em;
  font-size: 24px;
}

.refs ol {
  font-size: 15px;
  line-height: 1.55;
}

.refs li {
  color: var(--muted);
}

.refs li + li {
  margin-top: 0.7em;
}

.refs cite {
  color: var(--graphite);
  font-style: normal;
  font-weight: 500;
}

.post-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 1.8em 0 0;
}

/* Blog index --------------------------------------------------------- */

.blog-hero {
  position: relative;
  isolation: isolate;
  padding: 88px 0 56px;
}

.blog-hero::before {
  position: absolute;
  inset: 0 0 -120px;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  content: "";
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 55%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 55%, #000 25%, transparent 75%);
  pointer-events: none;
}

.blog-hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(44px, 6.4vw, 78px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.blog-hero p:last-child {
  max-width: 560px;
  margin: 26px 0 0;
  font-size: clamp(18px, 2vw, 21px);
}

.post-list {
  display: grid;
  gap: 32px;
  margin: 0 0 112px;
  padding: 0;
  list-style: none;
}

.post-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px 48px;
  align-items: end;
  padding: 30px 34px 34px;
  transition: transform 260ms var(--ease-out);
}

.post-card:hover,
.post-card:focus-within {
  transform: translate(-3px, -3px);
}

.post-card h2 {
  max-width: 720px;
  margin: 14px 0 12px;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.12;
}

.post-card h2 a {
  text-decoration: none;
}

/* The whole card is the hit target; the title link stretches over it. */
.post-card h2 a::after {
  position: absolute;
  inset: 0;
  content: "";
}

.post-card p {
  max-width: 640px;
  margin: 0;
  font-size: 16px;
}

.post-card .read {
  color: var(--green);
  font-family: var(--hand);
  font-size: 24px;
  font-weight: 700;
  white-space: nowrap;
}

/* Footer ------------------------------------------------------------- */

footer {
  position: relative;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

footer::before {
  top: -5px;
  transform: scaleX(-1);
}

footer div {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--graphite);
  font-weight: 600;
}

.footer-brand .brand-mark {
  width: 24px;
  height: 24px;
}

.footer-sign {
  color: var(--muted);
  font-family: var(--hand);
  font-size: 20px;
  font-weight: 600;
}

/* Responsive --------------------------------------------------------- */

@media (max-width: 760px) {
  .shell {
    width: min(calc(100% - 32px), var(--max));
  }

  .site-header {
    height: 64px;
  }

  nav {
    gap: 18px;
  }

  nav .nav-wide {
    display: none;
  }

  .post-hero {
    padding: 48px 0 8px;
  }

  .post-body {
    padding-top: 28px;
  }

  .prose {
    font-size: 17px;
  }

  .prose .lede {
    font-size: 19px;
  }

  .figure {
    margin: 40px auto;
  }

  .figure-pair {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .figure-art {
    padding: 16px 12px 12px;
  }

  .sketch-card::after {
    inset: 6px -6px -6px 6px;
  }

  .flow-node {
    padding: 14px 14px 16px;
  }

  .flow-node .flow-title {
    font-size: 17px;
  }

  .flow-node p,
  .flow-steps {
    font-size: 14px;
  }

  .flow-tag {
    font-size: 19px !important;
  }

  .formula {
    padding: 18px 14px;
    font-size: 16px;
  }

  .chart {
    padding: 22px 18px 18px;
  }

  .bars {
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 6px 12px;
  }

  .bar-label {
    grid-column: 1 / -1;
    margin-top: 10px;
  }

  .bar-label small {
    display: inline;
  }

  .bar-label small::before {
    content: " \00b7  ";
  }

  .axis {
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 0 12px;
  }

  .axis-ticks {
    grid-column: 1;
  }

  .bar-tip {
    max-width: 200px;
  }

  .retention {
    font-size: 14px;
  }

  .retention th,
  .retention td {
    padding-right: 8px;
  }

  .retention tbody th {
    width: 28%;
  }

  .blog-hero {
    padding: 52px 0 40px;
  }

  .post-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 24px 22px 26px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    min-height: 124px;
  }

  footer div {
    flex-wrap: wrap;
    gap: 10px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .draw-on-view .draw {
    stroke-dashoffset: 0;
    transition: none;
  }

  .js .draw-on-view .after-draw {
    opacity: 1;
    transition: none;
  }

  .btn,
  .btn::after,
  .post-card,
  .bar,
  .bar-tip {
    transition: none;
  }
}

/* Model pages -------------------------------------------------------- */

.model-links {
  margin-top: 1.2em;
  color: var(--muted);
  font-size: 15px;
}

.post-head .post-cta {
  margin-top: 0;
}

.retention a code {
  color: var(--green);
}

.prose pre.code {
  margin: 0.6em 0 1.4em;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1.4px solid var(--graphite);
  border-radius: 3px 7px 4px 8px / 7px 4px 8px 3px;
  background: var(--sheet);
  font-size: 14px;
  line-height: 1.55;
}

.prose pre.code code {
  padding: 0;
  background: none;
  font-size: inherit;
  white-space: pre;
}

/* Language switcher ------------------------------------------------- */

.lang-switch { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; }
.lang-switch a[aria-current] { color: var(--graphite); font-weight: 600; text-decoration: none; }
:lang(zh) .hand, :lang(ja) .hand, :lang(zh) .kicker, :lang(ja) .kicker,
:lang(zh) .section-label, :lang(ja) .section-label,
:lang(zh) .footer-sign, :lang(ja) .footer-sign { font-family: inherit; font-weight: 600; }
:lang(zh) .footer-sign, :lang(ja) .footer-sign { font-size: 13px; }

/* Long words in other languages (Russian especially) must not widen tables on phones. */
.retention th,
.retention td {
  overflow-wrap: anywhere;
  hyphens: auto;
}

.prose {
  overflow-wrap: break-word;
}

/* Answer-first summary on model pages ------------------------------- */

.prose .tldr {
  margin: 0 0 0.4em;
  padding: 14px 18px;
  border-left: 3px solid var(--green);
  background: rgba(24, 92, 61, 0.06);
}

.prose .updated {
  margin: 0 0 1.6em;
  color: var(--muted);
  font-size: 14px;
}

.prose .tldr code {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Very narrow phones (320–360px) with longer translated labels. */
@media (max-width: 420px) {
  .prose p code,
  .prose li code,
  .blog-hero code {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 360px) {
  .site-header nav {
    gap: 12px;
  }

  .site-header .btn-small {
    padding-inline: 10px;
    font-size: 12px;
  }

  .site-header .btn-small span {
    display: none;
  }
}
