/* long-form pages (raftkv, thoughts): a reading measure with sketched figures. */

.article {
  width: min(100%, 46rem);
  margin-inline: auto;
}

/* ---- title block ---- */
.article-head {
  display: grid;
  gap: var(--space-5);
  padding-block: clamp(2.5rem, 1.5rem + 3vw, 4.5rem) var(--space-7);
}

.article-head__sub {
  font-size: var(--text-lg);
  color: var(--body);
  max-width: 40ch;
}

.article-head__meta {
  display: grid;
  gap: var(--space-4);
}

.article-head__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-control);
  padding: 0.15rem 0.7rem;
  box-shadow: var(--shadow-1);
}

/* ---- sections ---- */
.article section {
  padding-block: var(--space-7);
  border-top: var(--stroke) dashed var(--line-soft);
}

.article section > h2 {
  font-size: var(--display-sm);
  margin-bottom: var(--space-4);
}

.article p + p {
  margin-top: var(--space-4);
}

.figure {
  margin-block: var(--space-6);
}

/* ---- architecture diagram: a sketched panel ---- */
.diagram {
  overflow-x: auto;
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  padding: var(--space-4);
}

.diagram svg {
  min-width: 620px;
  width: 100%;
  height: auto;
  font-family: var(--font-sans);
}

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

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-5);
  margin-top: var(--space-4);
  font-family: var(--font-hand);
  font-size: var(--text-hand);
  color: var(--ink);
}

.legend i {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.4em;
  border-radius: 3px;
  border: 1.5px solid var(--line);
  vertical-align: -0.05em;
}

.legend .sw-engine {
  background: var(--accent);
}

.legend .sw-sidecar {
  background: var(--sky);
}

/* ---- write path: numbered yellow badges ---- */
.steps {
  list-style: none;
  counter-reset: step;
  margin: var(--space-5) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3.25rem;
  max-width: var(--measure);
  min-height: 2.25rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  display: grid;
  place-items: center;
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 50%;
  border: var(--stroke) solid var(--line);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-hand);
  font-size: 1.375rem;
  font-weight: 700;
  box-shadow: var(--shadow-1);
  transform: rotate(calc(var(--tilt, 0) * 1deg));
}

.steps li:nth-child(odd)::before {
  --tilt: -6;
}

.steps li:nth-child(even)::before {
  --tilt: 5;
}

.steps b {
  font-family: var(--font-mono);
  font-size: 0.875em;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--line-soft);
  border-radius: var(--radius-inline);
  padding: 0.05em 0.4em;
}

/* ---- durability files: three index cards, slightly askew ---- */
.files {
  display: grid;
  gap: var(--space-5);
  margin: var(--space-5) 0 var(--space-6);
}

.files article {
  padding: var(--space-5);
  background: var(--surface);
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-2);
}

.files article:nth-child(1) {
  background: var(--accent-soft);
}

.files article:nth-child(2) {
  transform: rotate(0.8deg);
}

.files article:nth-child(3) {
  transform: rotate(-0.7deg);
}

.files h3 {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.files p {
  font-size: var(--text-sm);
}

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

/* ---- read cost comparison: two speech bubbles and a "vs" ---- */
.compare {
  display: grid;
  gap: var(--space-4);
  margin-block: var(--space-6);
}

.compare__vs {
  font-family: var(--font-hand);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}

.compare .stat {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-5);
  background: var(--surface);
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-2);
}

.compare .stat__num {
  font-size: var(--display-md);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.compare .stat__num small {
  font-family: var(--font-hand);
  font-size: var(--text-hand);
  font-weight: 500;
  color: inherit;
  opacity: 0.75;
  margin-left: 0.3em;
  letter-spacing: 0;
}

.compare .stat__label {
  margin-top: var(--space-2);
  color: var(--ink);
  font-weight: 700;
  font-size: var(--text-base);
}

.compare .stat__sub {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
}

@media (min-width: 40rem) {
  .compare {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-5);
  }
}

/* ---- benchmark table ---- */
.table-scroll {
  overflow-x: auto;
  margin-block: var(--space-6) var(--space-3);
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}

table {
  width: 100%;
  min-width: 30rem;
  border-collapse: collapse;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-hand);
  font-size: var(--text-hand);
  color: var(--ink);
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--stroke) solid var(--line);
  background: var(--accent-soft);
}

th {
  text-align: left;
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--ink);
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--stroke) solid var(--line);
  background: var(--surface-2);
}

td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1.5px dashed var(--line-soft);
  color: var(--body);
  font-weight: 500;
}

tr:last-child td {
  border-bottom: 0;
}

th.num,
td.num {
  text-align: right;
  font-family: var(--font-mono);
}

th.num {
  font-family: var(--font-sans);
}

td.num {
  color: var(--ink);
}

.note {
  font-size: var(--text-sm);
  color: var(--muted);
}

/* ---- empty state (thoughts): a notebook page with a pencil ---- */
.empty {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6);
  margin-top: var(--space-6);
  border: var(--stroke) dashed var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  background-image: repeating-linear-gradient(transparent 0 calc(1.6em - 1.5px), var(--line-soft) calc(1.6em - 1.5px) 1.6em);
  background-origin: content-box;
}

.empty p {
  color: var(--body);
}

.empty__doodle {
  width: 7rem;
  height: auto;
  margin-bottom: var(--space-2);
}

.empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
