/* v3 cases group (2026-10-21): the cases overview and the four case pages. Linked only from pages/<lang>/cases.html and case-*.html.
   Every colour comes from the :root tokens in site.css; this file adds no hex values. */

/* Hero diagram of a case without a product screen: a coded step SVG on a soft violet panel, same ground as the step visual slot */
.case-hero-viz {
  margin: 0;
  align-self: center;
  background: linear-gradient(135deg, var(--tint-violet), var(--canvas) 70%);
  border: 1px solid var(--hair);
  border-radius: var(--r-l);
  padding: var(--s-6);
}
.case-hero-viz svg {
  margin: 0 auto;
  max-width: 440px;
}
/* each map card links to its case or demo page, so it must look and act like a link on hover and keyboard focus */
.case-hero-viz a .card {
  transition:
    stroke 0.15s,
    fill 0.15s;
}
.case-hero-viz a:hover .card,
.case-hero-viz a:focus-visible .card {
  stroke: var(--violet);
  stroke-width: 2;
  fill: var(--tint-violet);
}
.case-hero-viz a:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

/* Before → now: one row per change, so the old way and the new way read as a pair. A table, because the rows are real pairs */
.case-swap {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.case-swap th {
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  text-align: left;
  padding: var(--s-3) var(--s-5);
  color: var(--muted);
  background: var(--sunken);
  border-bottom: 1px solid var(--hair);
}
.case-swap th.is-new {
  color: var(--violet);
}
.case-swap thead td {
  background: var(--sunken);
  border-bottom: 1px solid var(--hair);
}
.case-swap td {
  padding: var(--s-4) var(--s-5);
  vertical-align: top;
  border-bottom: 1px solid var(--hair);
  line-height: 1.45;
  overflow-wrap: break-word;
}
.case-swap tbody tr:last-child td {
  border-bottom: 0;
}
.case-swap .old {
  width: 36%;
  color: var(--muted);
  font-size: var(--fs-small);
}
.case-swap .to {
  width: 40px;
  padding-left: 0;
  padding-right: 0;
  color: var(--accent-ink);
}
.case-swap .to svg {
  width: 20px;
  height: 20px;
  margin-top: 2px;
}
.case-swap .new {
  color: var(--ink);
  font-weight: 500;
}
.case-swap .to path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Proof row under the table: the number or diagram card left, the facts and the layers right */
.case-proof {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-7);
  align-items: start;
  margin-top: var(--s-6);
}
.case-viz {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-1);
  padding: var(--s-6);
}
.case-viz svg {
  margin: 0;
  max-width: 440px;
}
.case-viz figcaption {
  margin-top: var(--s-5);
  display: grid;
  gap: var(--s-2);
}
.case-viz-note {
  font-size: var(--fs-small);
  color: var(--text-2);
  line-height: 1.5;
}
.case-facts {
  display: grid;
  gap: var(--s-5);
  padding-top: var(--s-2);
}
.case-facts dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--s-3) var(--s-5);
  align-items: baseline;
}
.case-facts dt {
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--muted);
}
.case-facts dd {
  font-size: var(--fs-small);
  color: var(--ink);
}
.case-facts .label {
  display: block;
  margin-bottom: var(--s-3);
}

/* The layers this system uses, as pills that link to their layer page */
.case-layers {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.case-layers a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: var(--fs-small);
  font-weight: 500;
  border: 1px solid var(--tint-violet-line);
  background: var(--tint-violet);
  color: var(--violet-deep);
  transition: border-color 0.15s;
}
.case-layers a::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--violet);
}
.case-layers a:hover {
  border-color: var(--violet);
}

/* SVG parts of this group, next to the step-svg set in site.css */
.step-svg .t-b {
  font-size: 16px;
  font-weight: 700;
  fill: var(--ink);
}
.step-svg .t-num {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  fill: var(--ink);
}
.step-svg .bar-old {
  fill: var(--hair-strong);
}
.step-svg .bar-new {
  fill: var(--accent);
}
.step-svg .bar-v {
  fill: var(--violet);
}
.step-svg .tile {
  fill: var(--tint-violet);
  stroke: var(--tint-violet-line);
  stroke-width: 1.5;
}
.step-svg .tile-bar {
  fill: var(--violet);
}
/* the Demo chip of the cards (coral, D33), drawn in the overview hero */
.step-svg .demo-chip {
  fill: var(--coral);
}
.step-svg .t-chip {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  fill: var(--ink);
}

@media (max-width: 900px) {
  .case-proof {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-6);
  }
  .case-hero-viz,
  .case-viz {
    padding: var(--s-4);
  }
  .case-hero-viz {
    max-width: 520px;
  }
  /* at about 0.82 scale the 14 px badge text drops under 12 px on screen */
  .case-hero-viz .t-badge {
    font-size: 16px;
  }
  .case-hero-viz .t-chip {
    font-size: 14px;
  }
}
/* phone: every pair becomes one block, the old way small above the new way */
@media (max-width: 600px) {
  .case-swap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .case-swap,
  .case-swap tbody,
  .case-swap tr,
  .case-swap td {
    display: block;
    width: auto;
  }
  .case-swap tr {
    padding: var(--s-4);
    border-bottom: 1px solid var(--hair);
  }
  .case-swap tr:last-child {
    border-bottom: 0;
  }
  .case-swap td,
  .case-swap .old,
  .case-swap .to {
    padding: 0;
    border: 0;
    width: auto;
  }
  .case-swap .old::before,
  .case-swap .new::before {
    content: attr(data-label);
    display: block;
    font-size: var(--fs-label);
    font-weight: 600;
    letter-spacing: var(--track-label);
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
  }
  .case-swap .new::before {
    color: var(--violet);
  }
  .case-swap .to {
    width: auto;
    padding: var(--s-2) 0;
  }
  .case-swap .to svg {
    transform: rotate(90deg);
    margin: 0;
  }
}
@media (pointer: coarse) {
  .case-layers a {
    min-height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .case-layers a,
  .case-hero-viz a .card {
    transition: none;
  }
}
/* A two-sentence heading where each sentence must keep its own line (Tim, D105/D107): lifts the 22ch cap */
.intro > div > h2.h2-lines {
  max-width: none;
}
