/* ---------------------------------------------------------------
   Skella & Co Foundry
   Sits on top of /styles.css. Same tokens, same restraint, more room
   for type. Every family adds one @font-face below.
   --------------------------------------------------------------- */

@font-face {
  font-family: "WMB Block";
  src: url("/foundry/fonts/wmb-block.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: block;
}

:root {
  --f-ink: var(--text);
  --f-paper: var(--bg);
  --f-field: #FFFFFF;
  --f-line: rgba(26, 26, 28, 0.12);
  --f-hint: color-mix(in srgb, var(--brand) 8%, transparent);
  --f-grid: color-mix(in srgb, var(--brand) 14%, transparent);
  --f-grid-major: color-mix(in srgb, var(--brand) 32%, transparent);
  --f-radius: var(--radius-lg);
  --f-wide: 80rem;
}

.shell--foundry {
  max-width: var(--f-wide);
}

/* Foundry header ----------------------------------------------------
   One header. The Skella & Co mark, then "Foundry" as the section name,
   then the foundry's own links. Site links live in the footer. */
.f-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.f-lockup__name {
  padding: 0.1rem 0 0 0.9rem;
  border: 0;
  border-left: 1px solid var(--rule);
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}

.f-lockup__name:hover {
  color: var(--brand);
  border-left-color: var(--rule);
}

.f-cart-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.f-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-size: var(--step--3);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.f-count[hidden] {
  display: none;
}

/* Labels, headings ------------------------------------------------ */
.f-label {
  margin: 0 0 1rem;
  font-size: var(--step--3);
  font-weight: 500;
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  color: var(--soft);
}

.f-section {
  margin-top: clamp(4rem, 8vw, 7rem);
  scroll-margin-top: 1.5rem;
}

.f-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.f-section__head h2 {
  margin: 0;
  font-size: var(--step-3);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.022em;
}

.f-section__head p {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: var(--step-0);
}

.f-intro h1 {
  margin: 0 0 0.75rem;
  font-size: var(--step-3);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.024em;
}

.f-intro .lede-sub {
  margin-bottom: 0;
  max-width: 40rem;
}

.f-prose {
  max-width: 40rem;
}

.f-prose p {
  margin: 0 0 1.1em;
}

.f-prose p:last-child {
  margin-bottom: 0;
}

/* Library (foundry index) ----------------------------------------- */
.f-library {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.f-family {
  border-bottom: 1px solid var(--rule);
  padding: clamp(1.5rem, 3vw, 2.5rem) 0;
}

.f-family__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.5rem;
  font-size: var(--step-0);
  color: var(--muted);
}

.f-family__name {
  font-size: var(--step-1);
  font-weight: 500;
  color: var(--text);
  border: 0;
}

.f-family__name:hover {
  color: var(--brand);
}

.f-family__go {
  margin-left: auto;
  color: var(--text);
}

.f-family__sample {
  display: block;
  margin: 0.75rem 0 0;
  font-size: clamp(2.5rem, 8.5vw, 8rem);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  outline: none;
  color: var(--text);
  caret-color: var(--brand);
}

.f-family__sample:focus-visible {
  box-shadow: inset 0 -2px 0 var(--brand);
}

.f-family__hint {
  margin: 0.5rem 0 0;
  font-size: var(--step--2);
  color: var(--soft);
}

/* Status pill ------------------------------------------------------ */
.f-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  font-size: var(--step--2);
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
}

.f-pill::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--soft);
}

.f-pill--live::before {
  background: var(--ok);
}

.f-pill--soon::before {
  background: var(--warn);
}

/* Three-up info row ------------------------------------------------ */
.f-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.f-points h3 {
  margin: 0 0 0.4rem;
  font-size: var(--step-1);
  font-weight: 500;
}

.f-points p {
  margin: 0;
  font-size: var(--step-0);
  color: var(--muted);
}

.f-points a {
  color: var(--text);
}

/* Specimen hero ------------------------------------------------------ */
.f-hero {
  position: relative;
  padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--rule);
}

.f-hero__name {
  margin: 0;
  font-weight: 900;
  line-height: 0.82;
  white-space: nowrap;
  letter-spacing: 0;
  /* JS fits this to the column. The clamp is the no-JS fallback. */
  font-size: clamp(3.5rem, 15vw, 14rem);
}

.f-hero__grid {
  position: absolute;
  inset: 0 0 auto 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}

.f-hero:hover .f-hero__grid,
.f-hero:focus-within .f-hero__grid {
  opacity: 1;
}

.f-hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin: clamp(1.25rem, 2.5vw, 2rem) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--step-0);
  color: var(--muted);
}

.f-hero__facts strong {
  font-weight: 500;
  color: var(--text);
}

.f-hero__lede {
  margin: clamp(1.25rem, 2.5vw, 2rem) 0 0;
  max-width: 44rem;
  font-size: var(--step-2);
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: -0.012em;
}

/* In-page jump bar */
.f-jump {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  margin: 0 calc(var(--pad-x) * -1);
  padding: 0.85rem var(--pad-x);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
  font-size: var(--step-0);
  scrollbar-width: none;
}

.f-jump a {
  border: 0;
  color: var(--muted);
  white-space: nowrap;
}

.f-jump a:hover,
.f-jump a[aria-current="true"] {
  color: var(--text);
}

.f-jump__buy {
  margin-left: auto;
  color: var(--text) !important;
  font-weight: 500;
}

/* Type tester ----------------------------------------------------------- */
.tester {
  --t-fg: var(--f-ink);
  --t-bg: var(--f-field);
  border: 1px solid var(--f-line);
  border-radius: var(--f-radius);
  background: var(--t-bg);
  color: var(--t-fg);
  overflow: hidden;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.tester__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid color-mix(in srgb, var(--t-fg) 14%, transparent);
  font-size: var(--step--2);
  color: color-mix(in srgb, var(--t-fg) 72%, transparent);
}

.tester__ctl {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.tester__ctl > span:first-child,
.tester__ctl label {
  white-space: nowrap;
}

.tester__val {
  min-width: 2.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--t-fg);
}

.tester input[type="range"] {
  width: clamp(5rem, 9vw, 8rem);
  accent-color: var(--brand);
  background: transparent;
}

.tester input[type="number"] {
  width: 4.25rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid color-mix(in srgb, var(--t-fg) 20%, transparent);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--t-fg);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.tester select {
  padding: 0.25rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--t-fg) 20%, transparent);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--t-fg);
  font: inherit;
}

.tester select option {
  color: var(--f-ink);
  background: #fff;
}

.seg {
  display: inline-flex;
  border: 1px solid color-mix(in srgb, var(--t-fg) 20%, transparent);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.seg button {
  padding: 0.3rem 0.6rem;
  font-size: var(--step--2);
  line-height: 1.2;
  color: inherit;
  border-right: 1px solid color-mix(in srgb, var(--t-fg) 20%, transparent);
}

.seg button:last-child {
  border-right: 0;
}

.seg button[aria-pressed="true"] {
  background: var(--t-fg);
  color: var(--t-bg);
}

.seg button:focus-visible {
  outline-offset: -2px;
}

.swatches {
  display: inline-flex;
  gap: 0.35rem;
}

/* A colour pair as a chip: its own background, "Aa" in its own ink. */
.swatch {
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--sw-bg);
  color: var(--sw-fg);
  box-shadow: inset 0 0 0 1px rgba(128, 128, 128, 0.35);
  font-size: var(--step--3);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: transform 0.15s var(--ease);
}

.swatch:hover {
  transform: scale(1.06);
}

.swatch[aria-pressed="true"] {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.picks {
  display: inline-flex;
  gap: 0.35rem;
}

/* Custom colours: a labelled chip over a hidden native picker. */
.pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 1.9rem;
  padding: 0 0.65rem 0 0.4rem;
  border: 1px solid color-mix(in srgb, var(--t-fg) 20%, transparent);
  border-radius: var(--radius-pill);
  font-size: var(--step--3);
  color: inherit;
  cursor: pointer;
}

.pick:hover {
  border-color: color-mix(in srgb, var(--t-fg) 45%, transparent);
}

.pick:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.pick__dot {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(128, 128, 128, 0.45);
}

.pick input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.contrast {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.contrast b {
  font-weight: 500;
  color: var(--t-fg);
}

.tester__tools {
  margin-left: auto;
  display: inline-flex;
  gap: 1rem;
}

.tester__tools button {
  font-size: var(--step--2);
  color: inherit;
  border-bottom: 1px solid currentColor;
}

.tester__tools button:hover {
  color: var(--t-fg);
}

.tester__text {
  display: block;
  min-height: 2.5em;
  padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1.15rem, 3vw, 2.5rem);
  outline: none;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  caret-color: var(--brand);
  color: var(--t-fg);
  font-size: 120px;
  line-height: 1.05;
}

.tester__text:focus-visible {
  box-shadow: inset 0 0 0 2px var(--brand);
}

.tester__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.75rem 1.15rem;
  border-top: 1px solid color-mix(in srgb, var(--t-fg) 14%, transparent);
  font-size: var(--step--2);
  color: color-mix(in srgb, var(--t-fg) 65%, transparent);
  min-height: 2.75rem;
}

.tester__missing {
  color: var(--t-fg);
}

.tester__missing mark {
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  color: inherit;
  padding: 0 0.2em;
  border-radius: 3px;
  font-family: var(--font-sans);
}

/* Waterfall -------------------------------------------------------------- */
.waterfall {
  list-style: none;
  margin: 0;
  padding: 0;
}

.waterfall li {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}

.waterfall__size {
  font-size: var(--step--2);
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

.waterfall__line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  line-height: 1.15;
  outline: none;
  caret-color: var(--brand);
}

.waterfall__line:focus-visible {
  box-shadow: inset 0 -2px 0 var(--brand);
}

/* Compositions (in use) --------------------------------------------------- */
.compose {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

.compose__card {
  position: relative;
  grid-column: span 6;
  min-height: clamp(14rem, 28vw, 22rem);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border-radius: var(--f-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.compose__card--wide {
  grid-column: span 12;
}

.compose__card--third {
  grid-column: span 4;
}

.compose__card--two-thirds {
  grid-column: span 8;
}

@media (max-width: 48rem) {
  .compose__card,
  .compose__card--third,
  .compose__card--two-thirds {
    grid-column: span 12;
  }
}

.compose__kicker {
  font-family: var(--font-sans);
  font-size: var(--step--3);
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  opacity: 0.7;
}

.compose__big {
  margin: 0;
  line-height: 0.9;
}

.compose__note {
  font-family: var(--font-sans);
  font-size: var(--step--2);
  opacity: 0.7;
  margin: 0;
}

/* Glyphs -------------------------------------------------------------- */
.glyphs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 26rem);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}

@media (max-width: 56rem) {
  .glyphs {
    grid-template-columns: 1fr;
  }
}

.glyphs__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
  font-size: var(--step--2);
  color: var(--muted);
  --t-fg: var(--text);
  --t-bg: var(--bg);
}

.glyphs__group + .glyphs__group {
  margin-top: 1.5rem;
}

.glyphs__group h3 {
  margin: 0 0 0.6rem;
  font-size: var(--step--3);
  font-weight: 500;
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  color: var(--soft);
}

.glyphs__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr));
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.glyph {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 2rem;
  line-height: 1;
  color: var(--text);
  background: var(--surface);
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.glyph:hover {
  background: var(--f-hint);
}

.glyph[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
}

.glyph:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
  border-radius: 0;
  z-index: 1;
}

.inspector {
  position: sticky;
  top: 4.25rem;
  border: 1px solid var(--f-line);
  border-radius: var(--f-radius);
  background: var(--surface);
  overflow: hidden;
}

.inspector__stage {
  position: relative;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}

.inspector__stage svg {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.inspector__stage .metric {
  stroke: var(--soft);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.inspector__stage .metric--base {
  stroke: var(--brand);
}

.inspector__stage .advance {
  fill: var(--f-hint);
}

.inspector__stage .grid line {
  stroke: var(--f-grid);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.inspector__stage .grid line.major {
  stroke: var(--f-grid-major);
}

.inspector__stage .outline {
  fill: var(--text);
}

.inspector[data-outline] .outline {
  fill: color-mix(in srgb, var(--text) 6%, transparent);
  stroke: var(--text);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.inspector .pts {
  display: none;
}

.inspector[data-outline] .pts {
  display: inline;
}

.inspector .pts circle {
  fill: var(--surface);
  stroke: var(--brand);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.inspector__labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-size: var(--step--3);
  color: var(--soft);
}

.inspector__labels span {
  position: absolute;
  left: 0.6rem;
  transform: translateY(-120%);
  letter-spacing: 0.04em;
}

.inspector__body {
  padding: 1rem 1.15rem 1.15rem;
}

.inspector__name {
  margin: 0;
  font-size: var(--step-1);
  font-weight: 500;
}

.inspector dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  margin: 0.75rem 0 1rem;
  font-size: var(--step--2);
}

.inspector dt {
  color: var(--soft);
}

.inspector dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.inspector__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: var(--step--2);
}

.inspector__actions button {
  border-bottom: 1px solid currentColor;
  color: var(--muted);
}

.inspector__actions button:hover,
.inspector__actions button[aria-pressed="true"] {
  color: var(--text);
}

.charmap {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-0);
}

.charmap th,
.charmap td {
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: middle;
}

.charmap th {
  font-size: var(--step--3);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
}

.charmap td:first-child {
  font-size: 1.75rem;
  width: 3.5rem;
}

.charmap td.num {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* Spec table -------------------------------------------------------- */
.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0 clamp(1.5rem, 4vw, 3rem);
  margin: 0;
}

.specs div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: var(--step-0);
}

.specs dt {
  color: var(--soft);
}

.specs dd {
  margin: 0;
}

.f-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}

@media (max-width: 52rem) {
  .f-story {
    grid-template-columns: 1fr;
  }
}

.f-story__figure {
  margin: 0;
  border: 1px solid var(--f-line);
  border-radius: var(--f-radius);
  background: var(--surface);
  padding: clamp(1rem, 2vw, 1.5rem);
}

.f-story__figure figcaption {
  margin-top: 0.75rem;
  font-size: var(--step--2);
  color: var(--muted);
}

.f-story__figure svg {
  width: 100%;
  height: auto;
}

/* Notice ----------------------------------------------------------- */
.f-notice {
  display: grid;
  gap: 0.5rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--warn) 6%, transparent);
  font-size: var(--step-0);
}

.f-notice strong {
  font-weight: 500;
}

.f-notice p {
  margin: 0;
}

/* Licence picker ------------------------------------------------------ */
.picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}

@media (max-width: 56rem) {
  .picker {
    grid-template-columns: 1fr;
  }
}

.picker fieldset {
  margin: 0 0 1.75rem;
  padding: 0;
  border: 0;
  min-width: 0;
}

.picker legend {
  padding: 0;
  margin-bottom: 0.75rem;
  font-size: var(--step--3);
  font-weight: 500;
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  color: var(--soft);
}

.choice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.35rem 0.9rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--f-line);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.choice + .choice {
  margin-top: 0.5rem;
}

.choice:hover {
  border-color: var(--text);
}

.choice:has(input:checked) {
  border-color: var(--text);
  box-shadow: inset 0 0 0 1px var(--text);
}

.choice:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.choice input[type="checkbox"],
.choice input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--text);
}

.choice__title {
  font-weight: 500;
  font-size: var(--step-0);
}

.choice__desc {
  grid-column: 2 / -1;
  font-size: var(--step--2);
  color: var(--muted);
  line-height: 1.45;
}

.choice__price {
  font-variant-numeric: tabular-nums;
  font-size: var(--step-0);
  white-space: nowrap;
}

.choice__sample {
  font-size: 1.6rem;
  line-height: 1;
}

.choice__tier {
  grid-column: 2 / -1;
  display: none;
  margin-top: 0.4rem;
}

.choice:has(input:checked) .choice__tier {
  display: block;
}

.choice__tier select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--f-line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: var(--step-0);
}

.choice[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.summary {
  position: sticky;
  top: 4.25rem;
  padding: 1.25rem;
  border: 1px solid var(--f-line);
  border-radius: var(--f-radius);
  background: var(--surface);
}

.summary h3 {
  margin: 0 0 0.75rem;
  font-size: var(--step-1);
  font-weight: 500;
}

.summary__lines {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--step--1);
}

.summary__lines li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.summary__lines li span:last-child {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.summary__lines .muted {
  color: var(--muted);
}

.summary__empty {
  color: var(--muted);
  font-size: var(--step--1);
  margin: 0;
}

.summary__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 0.85rem;
  font-size: var(--step-2);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.summary__tax {
  margin: 0.25rem 0 1rem;
  font-size: var(--step--2);
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--text);
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--bg);
  font-size: var(--step-0);
  font-weight: 500;
  text-align: center;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

/* Buttons keep their own colours, whatever link rules sit around them. */
a.btn,
a.btn:hover {
  border-bottom-width: 1px;
}

a.btn:not(.btn--ghost) {
  color: var(--bg);
}

a.btn:not(.btn--ghost):hover {
  color: #fff;
}

.btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn--ghost,
a.btn--ghost {
  background: transparent;
  color: var(--text);
}

.btn--auto {
  width: auto;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  background: transparent;
  color: var(--soft);
  border-color: var(--rule);
  cursor: not-allowed;
}

.summary__note {
  margin: 0.85rem 0 0;
  font-size: var(--step--2);
  color: var(--muted);
}

.summary__note a {
  color: var(--text);
}

/* Licence explainer cards */
.licence-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.licence-types li {
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--f-line);
  border-radius: var(--f-radius);
  background: var(--surface);
}

.licence-types h3 {
  margin: 0 0 0.35rem;
  font-size: var(--step-1);
  font-weight: 500;
}

.licence-types p {
  margin: 0;
  font-size: var(--step-0);
  color: var(--muted);
}

.licence-types .tiers {
  margin-top: 0.6rem;
  font-size: var(--step--2);
  color: var(--soft);
}

/* Trial block ------------------------------------------------------------ */
.trial {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(16rem, 1fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid var(--f-line);
  border-radius: var(--f-radius);
  background: var(--surface);
}

@media (max-width: 48rem) {
  .trial {
    grid-template-columns: 1fr;
  }
}

.trial ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: var(--step-0);
  color: var(--muted);
}

.trial li + li {
  margin-top: 0.35rem;
}

.trial__cta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
}

.trial__cta p {
  margin: 0;
  font-size: var(--step--2);
  color: var(--muted);
}

.trial__cta p a {
  color: var(--text);
}

/* Cart -------------------------------------------------------------------- */
.cart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}

@media (max-width: 56rem) {
  .cart {
    grid-template-columns: 1fr;
  }
}

.cart__item {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}

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

.cart__item header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.cart__item h3 {
  margin: 0;
  font-size: var(--step-1);
  font-weight: 500;
}

.cart__item ul {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  font-size: var(--step--1);
  color: var(--muted);
}

.cart__item li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0;
}

.cart__item li span:last-child {
  font-variant-numeric: tabular-nums;
}

.cart__item button {
  font-size: var(--step--2);
  color: var(--muted);
  border-bottom: 1px solid currentColor;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.field label {
  font-size: var(--step--1);
  font-weight: 500;
}

.field small {
  font-size: var(--step--2);
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--f-line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: var(--step-0);
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: start;
  margin-bottom: 0.85rem;
  font-size: var(--step--1);
  line-height: 1.45;
}

.check input {
  margin-top: 0.2rem;
  accent-color: var(--text);
}

.check a {
  color: var(--text);
}

.form-error {
  margin: 0.75rem 0 0;
  font-size: var(--step--1);
  color: var(--danger);
}

.form-ok {
  margin: 0.75rem 0 0;
  font-size: var(--step--1);
  color: var(--ok);
}

/* Legal documents ---------------------------------------------------------- */
.doc {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) minmax(0, 44rem);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: start;
}

@media (max-width: 56rem) {
  .doc {
    grid-template-columns: minmax(0, 1fr);
  }
}

.doc > * {
  min-width: 0;
}

.doc__toc {
  position: sticky;
  top: 1.5rem;
  font-size: var(--step--1);
}

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

.doc__toc li + li {
  margin-top: 0.4rem;
}

.doc__toc a {
  border: 0;
  color: var(--muted);
}

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

@media (max-width: 56rem) {
  .doc__toc {
    position: static;
  }
}

.doc .legal h2 {
  scroll-margin-top: 1.5rem;
}

.doc .legal h3 {
  margin: 1.5em 0 0.5em;
  font-size: var(--step-1);
  font-weight: 500;
}

.doc .legal ol {
  margin: 0 0 1.15em;
  padding-left: 1.4rem;
  font-size: var(--step-1);
  line-height: 1.65;
}

.doc .legal li + li {
  margin-top: 0.35em;
}

.doc .legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25em;
  font-size: var(--step-0);
}

.doc .legal th,
.doc .legal td {
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.doc .legal th {
  font-weight: 500;
}

.plain {
  margin: 0 0 1.5em;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
  background: var(--f-hint);
  font-size: var(--step-0);
}

.plain p {
  margin: 0;
  font-size: var(--step-0) !important;
}

.plain strong {
  font-weight: 500;
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq details:first-of-type {
  border-top: 1px solid var(--rule);
}

.faq summary {
  padding: 1.1rem 2rem 1.1rem 0;
  font-size: var(--step-1);
  cursor: pointer;
  list-style: none;
  position: relative;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 1.05rem;
  color: var(--muted);
  transition: transform 0.2s var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.faq .answer {
  padding: 0 0 1.25rem;
  max-width: 44rem;
  color: var(--text);
}

.faq .answer p {
  margin: 0 0 0.85em;
}

.faq .answer a {
  color: var(--text);
}

.faq h2 {
  margin: 2.5rem 0 1rem;
  font-size: var(--step--3);
  font-weight: 500;
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  color: var(--soft);
}

/* Toast for copy actions */
.f-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 50;
  transform: translate(-50%, 1rem);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--bg);
  font-size: var(--step--1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.f-toast[data-show] {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Motion: settle letters in once, never again */
@media (prefers-reduced-motion: no-preference) {
  .f-settle {
    animation: fSettle 0.9s var(--ease) both;
  }
}

@keyframes fSettle {
  from {
    opacity: 0;
    transform: translateY(0.08em);
    letter-spacing: 0.04em;
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .f-nav,
  .f-jump,
  header.site,
  footer.site,
  .doc__toc {
    display: none;
  }
}

/* Glyph cells and the character map draw in the family on show */
.glyph,
.charmap td.font-specimen {
  font-family: var(--specimen), var(--font-sans);
}

.gridfig svg .ink {
  fill: var(--text);
}

.glyphs__group h3 {
  font-family: var(--font-sans);
}

@media (max-width: 26rem) {
  .f-lockup {
    gap: 0.7rem;
  }

  .f-lockup__name {
    padding-left: 0.7rem;
    font-size: var(--step-0);
  }

  .f-header .header-controls {
    gap: 1rem;
  }

  .f-hide-narrow {
    display: none;
  }
}

/* Wide tables scroll inside their own box, never the page. */
.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.25em;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  margin: 0;
  min-width: 32rem;
}

.cart .summary h2 {
  margin: 0 0 0.75rem;
  font-size: var(--step-1);
  font-weight: 500;
}
