/* Tricotta — the platform's own layout, written on the design-system tokens only.
   Components are DS classes (.btn .pill .field .input ...); here only layout and the
   few page-level pieces (topbar, page, cards, auth card). Logical properties only
   (i18n rule 1), unitless line-height (rule 2), no fixed-width labels (rule 3). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5;
  font-family: var(--font-sans); font-size: var(--s-0); -webkit-font-smoothing: antialiased; }
img, svg { max-inline-size: 100%; }
a { color: inherit; text-decoration: none; }
/* prose keeps its underline: a link inside a paragraph must look like one */
.legal a, .lede a, .muted a, .sub a, p.faint a { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.topbar { display: flex; align-items: center; gap: var(--sp-5); padding: var(--sp-3) var(--sp-5);
  border-block-end: 1px solid var(--border); background: var(--surface); position: sticky; inset-block-start: 0; z-index: var(--z-nav); }
.topnav { display: flex; gap: var(--sp-4); }
.topnav a { color: var(--ink-2); text-decoration: none; padding-block: var(--sp-1); }
.topnav a:hover { color: var(--ink); }
.topbar-end { margin-inline-start: auto; display: flex; gap: var(--sp-2); align-items: center; }
.brand { font-weight: 700; color: var(--primary-ink); text-decoration: none; letter-spacing: .01em; }

.page { max-inline-size: 1100px; margin-inline: auto; padding: var(--sp-6) var(--sp-5); }
.page.flash { padding-block: var(--sp-3) 0; }
.footer { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; justify-content: center;
  padding: var(--sp-6) var(--sp-5); color: var(--ink-3); border-block-start: 1px solid var(--border); margin-block-start: var(--sp-7); }
.footer .lang { display: flex; align-items: center; gap: var(--sp-2); }
.footer .lang label { font-size: var(--s--1); }

h1 { font-size: var(--s-3); margin: 0 0 var(--sp-3); line-height: 1.15; }
h2 { font-size: var(--s-2); margin: var(--sp-6) 0 var(--sp-3); }
.lede { font-size: var(--s-1); color: var(--ink-2); max-inline-size: 60ch; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: var(--s--1); }
.actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-block: var(--sp-5); }

/* cards: the front door and catalogue */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-4); margin-block: var(--sp-5); }
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-4); color: inherit; text-decoration: none; box-shadow: var(--sh-1); }
.card:hover { border-color: var(--primary-line); box-shadow: var(--sh-2); }
.card h3 { margin: 0 0 var(--sp-1); font-size: var(--s-0); }
.card .kind { color: var(--ink-3); font-size: var(--s--1); }
.card .axes { margin-block-start: var(--sp-2); display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.family { margin-block-start: var(--sp-6); }
/* the fibre's figurine (static/app/fibres/), ink on transparent, a band on top of the card;
   what it shows (origine.nome_comune: «pecora», «faggio», «petrolio») sits on it, bottom left */
.figurine { position: relative; display: block; margin: 0; background: var(--surface-2); border-radius: var(--r-sm); }
.figurine img { display: block; inline-size: 100%; block-size: 100%; object-fit: contain; box-sizing: border-box; padding: var(--sp-2); }
.figurine:has(.source) img { padding-block-end: calc(var(--sp-2) + 1.9em); }      /* the label lies on the band, not on the drawing */
.figurine .source { position: absolute; inset-inline-start: var(--sp-2); inset-block-end: var(--sp-2); padding: 1px var(--sp-2);
  background: var(--surface); border-radius: var(--r-sm); color: var(--ink-2); font-size: var(--s--1); line-height: 1.5; }
.card.fibre .figurine { block-size: 150px; margin-block-end: var(--sp-3); }
.fibre-head { display: grid; grid-template-columns: 1fr 240px; gap: var(--sp-5); align-items: start; }
.fibre-head .figurine { aspect-ratio: 1 / 1; }
@media (max-width: 640px) { .fibre-head { grid-template-columns: 1fr; gap: var(--sp-3); } .fibre-head .figurine { order: -1; inline-size: 180px; } }

/* lists (my garments, profiles, versions) */
.table { inline-size: 100%; border-collapse: collapse; }
.table th, .table td { text-align: start; padding: var(--sp-2) var(--sp-3); border-block-end: 1px solid var(--border); }
.table th { color: var(--ink-3); font-weight: 600; font-size: var(--s--1); }
.empty { padding: var(--sp-6); text-align: center; color: var(--ink-3); border: 1px dashed var(--border-2); border-radius: var(--r-lg); }

/* the sign-in card */
.auth { min-block-size: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--sp-5); }
.auth-card { inline-size: min(420px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-6); box-shadow: var(--sh-2); }
.auth-card .brand { display: inline-flex; margin-block-end: var(--sp-4); }
.auth-card h1 { font-size: var(--s-2); }
.auth-card .btn { inline-size: 100%; margin-block-start: var(--sp-4); }
.auth-card .row .btn { inline-size: auto; margin: 0; }
.field { margin-block-start: var(--sp-3); }
.field label { display: block; font-size: var(--s--1); color: var(--ink-2); margin-block-end: var(--sp-1); }
.field input, .field select { inline-size: 100%; box-sizing: border-box; font: inherit; padding: 10px 12px;
  border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); }
.field input:focus, .field select:focus { outline: 2px solid var(--ring); outline-offset: 1px; }
.otp input { font-family: var(--font-mono, monospace); font-size: var(--s-2); letter-spacing: .4em; text-align: center; }
.err { color: var(--danger); font-size: var(--s--1); margin-block-start: var(--sp-1); }
.row { display: flex; justify-content: space-between; gap: var(--sp-2); margin-block-start: var(--sp-4); }

/* machines */
.filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-block: var(--sp-4); }
.filters .input { inline-size: auto; }
.card.machine img { inline-size: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--surface); border-radius: var(--r-sm); margin-block-end: var(--sp-2); }
/* the kind of machine: a small line icon (static/app/machine-types.svg) beside its name, in the brand green;
   the machine's own name is what the card is about */
.mkind { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-size: var(--s--1); }
.mkind .ic { inline-size: 18px; block-size: 18px; flex: none; }
.card.machine h4 { margin: 0 0 var(--sp-1); font-size: var(--s-1); font-weight: 600; line-height: 1.2; }
.card.machine h3 + .mkind { margin-block-end: var(--sp-1); }
.card.machine .specs { color: var(--ink-3); font-size: var(--s--1); margin-block-start: var(--sp-1); }
.card.machine .axes { margin-block-start: var(--sp-2); }
.machine-figure .mkind { font-size: var(--s-0); margin-block-end: var(--sp-3); }
.machine-figure .mkind .ic { inline-size: 22px; block-size: 22px; }
/* the machine page: the kind under the name, the specs on the left, what it can do on the right */
.machine-sub { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-4); margin-block: calc(-1 * var(--sp-2)) 0; }
.machine-sub .mkind { font-size: var(--s-0); }
.machine-sub .mkind .ic { inline-size: 22px; block-size: 22px; }
.machine-caps { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5); }
.machine-caps .h-side { font-size: var(--s-0); margin: 0; }
.machine-caps .h-side.sub { margin-block-start: var(--sp-4); color: var(--ink-2); }
.caps-added { list-style: none; padding: 0; margin: var(--sp-2) 0 0; display: grid; gap: var(--sp-1); }
.caps-added .faint { font-size: var(--s--1); }
.card.tool .specs, .card .specs { color: var(--ink-3); font-size: var(--s--1); margin-block-start: var(--sp-1); }
.card.tool .mkind { margin-block-end: var(--sp-1); }
.brand-index { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); margin-block: var(--sp-4) var(--sp-2); font-size: var(--s--1); }
/* grouped by manufacturer: each group takes as many columns as it has machines, so the brands with
   one or two sit side by side; inside a group the cards follow the same columns (subgrid) */
.brand-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 var(--sp-3); }
.brand-group { scroll-margin-block-start: 80px; display: grid; grid-template-columns: subgrid; align-content: start;
  grid-column: span 4; }
.brand-group.span-1 { grid-column: span 1; } .brand-group.span-2 { grid-column: span 2; } .brand-group.span-3 { grid-column: span 3; }
.brand-group > * { grid-column: 1 / -1; }
.brand-group .cards { display: contents; }
.brand-group .card { grid-column: auto; margin-block-end: var(--sp-3); }
.brand-head { margin-block: var(--sp-5) var(--sp-3); font-size: var(--s-1); }
.brand-group > .muted { margin-block: calc(-1 * var(--sp-2)) var(--sp-3); }
@media (max-width: 1000px) {
  .brand-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brand-group.span-4 { grid-column: span 3; }
}
@media (max-width: 760px) {
  .brand-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-group.span-3, .brand-group.span-4 { grid-column: span 2; }
}
@media (max-width: 540px) {
  .brand-groups { grid-template-columns: minmax(0, 1fr); }
  .brand-group[class*="span-"] { grid-column: span 1; }
}
.machine-page { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--sp-6); align-items: start; margin-block: var(--sp-5); }
.machine-figure img { inline-size: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.caps { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-block-start: var(--sp-3); }
.caps .pill.via { border-style: dashed; color: var(--ink-2); }
.check { display: block; margin-block: var(--sp-2); }
.check.off { opacity: .45; }
.card.machine.owned { border-color: var(--primary-line); background: var(--primary-soft); }
.card.tool img { inline-size: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: var(--r-sm); margin-block-end: var(--sp-2); }
.card.tool .row { justify-content: flex-start; align-items: center; }
.plan.needles { max-inline-size: 420px; }
@media (max-width: 1023px) { .machine-page { grid-template-columns: 1fr; } }

/* garments */
.card.garment img { inline-size: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--r-sm); margin-block-end: var(--sp-2); background: var(--surface); }
.card.garment .cover { color: inherit; text-decoration: none; display: block; }
.garment-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--sp-6); align-items: start; margin-block: var(--sp-5); }
.garment-figure { margin: 0; }
.garment-figure img { inline-size: 100%; aspect-ratio: 1 / 1; object-fit: cover; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.garment-figure.is-drawing img { object-fit: contain; padding: var(--sp-6); box-sizing: border-box; }   /* the engine's drawing: whole, never cropped */
.garment-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--sp-5); }
.outputs .card h3 { color: var(--primary-ink); }
@media (max-width: 1023px) { .garment-page { grid-template-columns: 1fr; } }

/* how it works */
.notice { background: var(--warn-soft); border-radius: var(--r); padding: var(--sp-3) var(--sp-4); font-size: var(--s--1); margin-block: var(--sp-4); }
.steps { list-style: none; padding: 0; margin: var(--sp-6) 0; display: grid; gap: var(--sp-6); }
.step { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.step img { inline-size: 100%; aspect-ratio: 4 / 3; object-fit: contain; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.step h2 { margin-block-start: 0; }
@media (max-width: 640px) { .step { grid-template-columns: 1fr; } }

/* profile form */
.measures th { inline-size: 40%; text-transform: capitalize; }
.input.num { inline-size: 7em; }
.swatches .input { inline-size: 100%; min-inline-size: 5em; }

/* stash */
.swatch { display: inline-block; inline-size: 14px; block-size: 14px; border-radius: 50%; border: 1px solid var(--border-2); vertical-align: middle; }

/* legal pages */
.legal { max-inline-size: 72ch; }
.legal h2 { font-size: var(--s-1); margin-block: var(--sp-6) var(--sp-2); }
.legal .notice { background: var(--warn-soft); border-radius: var(--r); padding: var(--sp-3) var(--sp-4); font-size: var(--s--1); margin-block: var(--sp-4); }
.legal ul { padding-inline-start: 1.2em; }
.legal .table th { inline-size: 40%; }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-4); }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-5); }
.plan .price { font-size: var(--s-3); font-weight: 700; margin-block: var(--sp-2); }
.plan ul { padding-inline-start: 1.2em; color: var(--ink-2); }
.pact { background: var(--primary-soft); border-radius: var(--r-lg); padding: var(--sp-5); margin-block-start: var(--sp-6); }

@media (max-width: 640px) {
  .topnav { display: none; }
  .page { padding: var(--sp-5) var(--sp-4); }
}

/* the gestures: a how-to opened on request, never on top of anyone */
.prereqs { margin-block: var(--sp-3); padding-inline-start: var(--sp-5); }
.prereqs li { margin-block: var(--sp-2); }
details.gesture { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  margin-block: var(--sp-3); }
details.gesture[open] { border-color: var(--primary-line); box-shadow: var(--sh-1); }
details.gesture > summary { cursor: pointer; padding: var(--sp-3) var(--sp-4); display: flex; flex-wrap: wrap;
  align-items: center; gap: var(--sp-2); list-style: none; }
details.gesture > summary::-webkit-details-marker { display: none; }
details.gesture > summary::before { content: "+"; font-weight: 700; color: var(--ink-3); inline-size: 1em; }
details.gesture[open] > summary::before { content: "−"; }
details.gesture .g-name { font-weight: 600; margin-inline-end: auto; }
details.gesture .g-body { padding: 0 var(--sp-4) var(--sp-4); border-block-start: 1px solid var(--border); padding-block-start: var(--sp-3); }
.g-steps { margin: var(--sp-3) 0; padding-inline-start: var(--sp-5); display: grid; gap: var(--sp-3); }
.g-steps > li > p { margin: 0; }
.g-why { color: var(--ink-2); font-size: var(--s--1); margin-block-start: var(--sp-1) !important; }
.g-num { color: var(--primary-ink); font-size: var(--s--1); margin-block-start: var(--sp-1) !important; }
.g-parts { font-size: var(--s--1); color: var(--ink-3); margin-block-start: var(--sp-1) !important; }
.g-parts abbr { text-decoration: underline dotted; cursor: help; }
.g-dont { margin-block: var(--sp-3); padding-inline-start: var(--sp-5); color: var(--ink-2); }
.g-gloss { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--sp-1) var(--sp-4); margin-block: var(--sp-4); }
.g-gloss dt { font-weight: 600; }
.g-gloss dd { margin: 0; color: var(--ink-2); }
.g-open li { margin-block: var(--sp-3); }
@media (max-width: 640px) { .g-gloss { grid-template-columns: 1fr; } .g-gloss dd { margin-block-end: var(--sp-2); } }

/* ============================================================
   THE PUBLIC SIDE — editorial register, ported from the quarry
   (old/static/app/app.css), 2 September 2026. On the DS tokens only,
   no new hex. The public pages live in LIGHT only (founder's call):
   no toggle, no prefers-color-scheme — see web/public.html.
   ============================================================ */

/* ---- full-bleed containers (each section wears its own band) ---- */
.wrap { inline-size: 100%; max-inline-size: min(1320px, 94vw); margin-inline: auto; padding-inline: var(--sp-5); }
.wrap-narrow { max-inline-size: 760px; }
.section { padding-block: var(--sp-7); }
.band { background: var(--surface); border-block: 1px solid var(--border); }
.center { text-align: center; }
.spread { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }

/* ---- editorial headings (magazine register) ---- */
.eyebrow { font-size: var(--s--1); text-transform: uppercase; letter-spacing: .14em; font-weight: 700;
  color: var(--primary-ink); display: block; }
.h-hero { font-family: var(--font-display); font-weight: 500; line-height: 1.02; letter-spacing: -.02em;
  font-size: clamp(2.6rem, 5.6vw, var(--s-5)); margin: var(--sp-3) 0 0; }
.h-sec { font-family: var(--font-display); font-weight: 500; line-height: 1.06; letter-spacing: -.02em;
  font-size: var(--s-3); margin: 0; }
.h-card { font-family: var(--font-display); font-weight: 500; font-size: var(--s-2); line-height: 1.1; margin: 0; }
.lede strong { color: var(--ink); font-weight: 650; }
.section-head { max-inline-size: 58ch; margin-block-end: var(--sp-6); }
.section-head.center { margin-inline: auto; }

/* ---- hero ---- */
.hero { padding-block: clamp(var(--sp-6), 7vw, 88px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--sp-7); align-items: center; }
.hero .lede { font-size: var(--s-2); line-height: 1.35; margin-block-start: var(--sp-4); max-inline-size: 46ch; }
.hero-cta { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-block-start: var(--sp-5); align-items: center; }
.hero-cta .btn { font-size: var(--s-1); }
.hero-note { margin-block-start: var(--sp-3); font-size: var(--s--1); color: var(--ink-3); }

/* The knitter's grid, fading: until there is a photograph, it tells the gesture of
   the product — from the chart to the garment worn. */
.worn { aspect-ratio: 4 / 5; border-radius: var(--r-xl); overflow: hidden; position: relative;
  background: linear-gradient(160deg, var(--primary-soft), var(--surface)); border: 1px solid var(--border);
  box-shadow: var(--sh-3); display: grid; place-items: center; }
.worn::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 26px),
                    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 26px);
  -webkit-mask-image: linear-gradient(180deg, var(--surface) 0%, transparent 54%);
          mask-image: linear-gradient(180deg, var(--surface) 0%, transparent 54%); opacity: .75; }
.worn img { inline-size: 100%; block-size: 100%; object-fit: cover; position: relative; z-index: 1; }
.worn .ph { position: relative; z-index: 1; font-family: var(--font-display); font-style: italic;
  color: var(--primary-ink); opacity: .55; font-size: var(--s-2); }
.worn-tag { position: absolute; z-index: 2; inset-inline-start: 14px; inset-block-end: 14px; }

/* ---- counters (the domain's real numbers) ---- */
.counters { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); }
.counter { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; }
.counter .num { font-family: var(--font-display); font-weight: 500; line-height: 1; font-size: var(--s-4); color: var(--ink); }
.counter .lbl { font-size: var(--s--1); color: var(--ink-2); max-inline-size: 20ch; }
a.counter:hover .num { color: var(--primary-ink); }

/* ---- the three certainties ---- */
.checks { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.checkline { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-4);
  border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--sh-1); }
.checkline .tick { inline-size: 26px; block-size: 26px; border-radius: 50%; display: grid; place-items: center;
  flex: none; background: var(--primary); color: var(--on-primary); }
.checkline .tick svg { inline-size: 15px; block-size: 15px; }
.checkline b { display: block; font-size: var(--s-0); }
.checkline p { margin: 2px 0 0; font-size: var(--s--1); color: var(--ink-2); }

/* ---- doors: if you would rather start elsewhere ---- */
.doors { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
.door { display: flex; gap: var(--sp-4); padding: var(--sp-5); align-items: flex-start; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); transition: border-color .14s, box-shadow .14s; }
.door:hover { border-color: var(--primary-line); box-shadow: var(--sh-2); }
.door .glyph { inline-size: 46px; block-size: 46px; border-radius: var(--r); flex: none; display: grid;
  place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.door .glyph svg { inline-size: 24px; block-size: 24px; }
.door h3 { font-size: var(--s-1); margin: 0; }
.door p { font-size: var(--s--1); color: var(--ink-2); margin: 3px 0 0; }

/* ---- the four steps, in brief ---- */
.beats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); }
.beat .step-n { font-family: var(--font-mono); font-size: var(--s--1); font-weight: 700; color: var(--primary-ink); }
.beat h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--s-1); margin: var(--sp-2) 0 var(--sp-1); }
.beat p { margin: 0; font-size: var(--s--1); color: var(--ink-2); }

/* ---- closing band ---- */
.cta-band { background: var(--primary); color: var(--on-primary); border-radius: var(--r-xl);
  padding: var(--sp-7) var(--sp-5); text-align: center; }
.cta-band .eyebrow { color: inherit; opacity: .85; }
.cta-band .h-sec { color: inherit; margin-block-start: var(--sp-2); }
.cta-band .btn.secondary { background: var(--surface); color: var(--primary-ink); border-color: transparent; }
.cta-band .sub { margin-block-start: var(--sp-4); opacity: .92; font-size: var(--s--1); }
.cta-band .sub a { text-decoration: underline; }

/* ---- garment card: the media carries the knitter's grid when the photo is missing ---- */
.card.garment { padding: 0; overflow: hidden; transition: transform .12s, box-shadow .16s, border-color .16s; }
.card.garment:hover { transform: translateY(-3px); }
.card.garment .cover { display: block; }
.card.garment .media { position: relative; aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, var(--primary-soft), var(--surface-2)); }
.card.garment .media img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover;
  margin: 0; border-radius: 0; }
.card.garment .media.is-placeholder img { object-fit: contain; padding: var(--sp-5); }
.card.garment .body { padding: var(--sp-4); }
.card.garment .body h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--s-1); line-height: 1.15; }
.card.garment .body .about { display: inline-block; margin-block-start: var(--sp-2); font-size: var(--s--1);
  color: var(--primary-ink); }

/* ---- the public topbar: taller, with the mark, the active item, and the language ---- */
.topbar { block-size: 72px; padding-inline: var(--sp-5); backdrop-filter: saturate(1.4) blur(10px);
  background: color-mix(in srgb, var(--surface) 88%, transparent); }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 600;
  font-size: var(--s-1); letter-spacing: -.01em; color: var(--ink); }
.brand .brandmark { inline-size: 34px; block-size: 34px; display: block; flex: none; }
/* the wordmark (docs/piattaforma/marchio): outlines, coloured by the page so it follows the theme;
   lifted so the body of the letters, not the box with the stitch above the i, sits on the middle of the cone */
.brand .wordmark { block-size: 20px; inline-size: auto; aspect-ratio: 7100 / 1682; display: block; flex: none;
  translate: 0 -18.5%; --wm-ink: var(--ink); --wm-accent: var(--primary); }
.topnav a { font-weight: 600; padding: 7px 11px; border-radius: var(--r-sm); }
.topnav a:hover { background: var(--surface-2); }
.topnav a.on { color: var(--primary-ink); }
/* the end of the bar reads at the same size as the navigation, never smaller */
.topbar-end { gap: var(--sp-3); }
.topbar-end .btn { --h: 40px; font-size: var(--s-0); padding: 0 18px; }
.topbar-end .btn.subtle { padding-inline: 10px; }
.lang-pick { display: flex; align-items: center; }
/* the trigger looks like a navigation item; the list is the DS menu (.menu, components.css) */
.lang-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: var(--s-0); font-weight: 600;
  color: var(--ink-2); background: transparent; border: 0; border-radius: var(--r-sm); padding: 7px 8px; cursor: pointer; }
.lang-btn svg { inline-size: 14px; block-size: 14px; color: var(--ink-3); transition: transform .15s; }
.lang-btn:hover, .lang-btn:has(+ .menu:popover-open) { color: var(--ink); background: var(--surface-2); }
.lang-btn:has(+ .menu:popover-open) svg { transform: rotate(180deg); }
.lang-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.lang-menu button.on { color: var(--primary-ink); font-weight: 600; }
.lang-menu button .tick { margin-inline-start: auto; color: var(--primary); }

/* ---- footer in columns ---- */
.footer { display: block; text-align: start; background: var(--surface); padding-block: var(--sp-6); }
.footer .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--sp-5); }
.footer .col { display: flex; flex-direction: column; gap: 8px; font-size: var(--s--1); }
.footer .col b { font-size: var(--s--2); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.footer .col a { color: var(--ink-2); }
.footer .col a:hover { color: var(--ink); }
.footer .col .sig { color: var(--ink-3); max-inline-size: 34ch; }
.footer .foot-end { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center;
  margin-block-start: var(--sp-6); padding-block-start: var(--sp-4); border-block-start: 1px solid var(--border);
  color: var(--ink-3); font-size: var(--s--1); }

@media (max-width: 1023px) {
  .counters { grid-template-columns: repeat(2, 1fr); gap: var(--sp-6) var(--sp-4); }
  .beats, .checks { grid-template-columns: 1fr; }
  .footer .cols { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .worn { max-inline-size: 340px; margin-inline: auto; }
  .doors { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .footer .cols { grid-template-columns: 1fr; }
  .topbar-end .btn.subtle { display: none; }
  .topbar-end .btn .long { display: none; }
  .topbar-end .btn .short { display: inline; }
}

/* label served to assistive tech only (the language picker's) */
.visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; }

/* ---- the figurines: five bodies, five poses (the grading, seen) ---- */
/* The drawing fills the card edge to edge (the figurines are centred by
   `manage.py bake_figurines`), so the card carries no ground of its own: any tint or grid
   under it would only show as a strip wherever the sheet does not reach. */
.figurines { position: relative; aspect-ratio: 52 / 78; max-inline-size: 400px; margin: 0 auto;
  border-radius: var(--r-xl); overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--sh-2); }
.figurines .fig { position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s ease; z-index: 1; }
.figurines .fig.on { opacity: 1; }
.figurines .fig img { inline-size: 100%; block-size: 100%; object-fit: contain;
  mix-blend-mode: multiply; }          /* the drawing's near-white ground melts into the card */
.figurines-cap { margin-block-start: var(--sp-3); max-inline-size: 400px; margin-inline: auto; font-size: var(--s--1); color: var(--ink-3); text-align: center; }
.sizes-list { list-style: none; padding: 0; margin: var(--sp-5) 0 0; display: grid; gap: var(--sp-4); }
.sizes-list b { display: block; font-size: var(--s-0); }
.sizes-list p { margin: 2px 0 0; font-size: var(--s--1); color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .figurines .fig { transition: none; } }
/* the same size in seven charts: the lit column follows the figurine (waiting list, 10 Oct) */
.sizes-grid > * { min-inline-size: 0; }            /* the table scrolls in its column, never the page */
.size-chart-wrap { margin-block-start: var(--sp-5); overflow-x: auto; }
.size-chart { border-collapse: collapse; inline-size: 100%; font-size: var(--s--1); }
.size-chart th, .size-chart td { padding: 7px 4px; text-align: center; border-block-end: 1px solid var(--border); white-space: nowrap; }
.size-chart th[scope="row"], .size-chart thead th:first-child { text-align: start; font-weight: 400; color: var(--ink-2); padding-inline-end: var(--sp-3); }
.size-chart td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-2); transition: background .4s ease, color .4s ease; }
.size-chart td.on { background: var(--primary-soft); color: var(--ink); font-weight: 600; }
.size-chart td .none { color: var(--ink-3); }
.size-chart .sz { font: 600 var(--s--1)/1 var(--font-mono); min-inline-size: 38px; padding: 7px 6px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--surface); color: var(--ink); cursor: pointer; transition: background .4s ease, color .4s ease, border-color .4s ease; }
.size-chart .sz:hover { border-color: var(--primary); }
.size-chart .sz.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.size-chart-note { margin-block-start: var(--sp-3); font-size: var(--s--1); color: var(--ink-3); max-inline-size: 52ch; }
@media (max-width: 480px) {
  .size-chart th[scope="row"] { white-space: normal; padding-inline-end: var(--sp-2); }
  .size-chart th, .size-chart td { padding-inline: 2px; }
  .size-chart .sz { min-inline-size: 0; inline-size: 100%; padding-inline: 2px; }
}
@media (prefers-reduced-motion: reduce) { .size-chart td, .size-chart .sz { transition: none; } }

/* the garments as one strip across the page (waiting list, 10 Oct: the board's columns made the cards
   «piccole e tante» on a desktop). Every card the same width and height; the strip scrolls inside itself,
   the first card on the page's own left edge, and goes round (the script in join.html); the page never scrolls. */
.strip { --gutter: max(var(--sp-5), calc((100vw - min(1320px, 94vw)) / 2 + var(--sp-5))); position: relative; }
.strip-track { display: flex; gap: var(--sp-4); overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: var(--sp-2) var(--gutter) var(--sp-4); scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.strip-track::-webkit-scrollbar { display: none; }
.strip-track:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.strip-track > .board-card { flex: 0 0 clamp(240px, 21vw, 320px); scroll-snap-align: start; }
.strip-arrow { position: absolute; inset-block-start: calc(var(--sp-2) + clamp(240px, 21vw, 320px) / 2); translate: 0 -50%;
  inline-size: 44px; block-size: 44px; border-radius: 50%; background: var(--surface); border-color: var(--border-2);
  color: var(--ink); box-shadow: var(--sh-2, var(--sh-1)); }
.strip-arrow:hover { background: var(--surface); color: var(--primary-ink); border-color: var(--ink-3); }
.strip-arrow[hidden] { display: none; }
.strip-arrow.back { inset-inline-start: max(var(--sp-3), calc(var(--gutter) - 22px)); }
.strip-arrow.back svg { transform: scaleX(-1); }
.strip-arrow.fwd { inset-inline-end: max(var(--sp-3), calc(var(--gutter) - 22px)); }
@media (hover: none) { .strip-arrow { display: none; } }
.board-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh-1);
  padding: var(--sp-2); display: flex; flex-direction: column; gap: 6px; }
.board-fam { margin: 4px 2px -2px; font-size: var(--s--2); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.board-img { aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: #eceff0; }
.board-img img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
.board-card h4 { margin: 2px 2px 0; font-size: var(--s-0); }
.board-also { margin: 0 2px; font-size: var(--s--1); color: var(--ink-2); }
.board-chips { list-style: none; margin: auto 0 0; padding: 4px 2px 2px; display: flex; flex-wrap: wrap; gap: 4px; }
.board-chips li { font-size: var(--s--2); color: var(--ink-2); background: var(--primary-soft); border-radius: var(--r-pill); padding: 2px 8px; }
/* Motivi on the front page (ADR-094): four incised swatches beside the words, the way in */
.wl-motifs { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--sp-6, 40px); align-items: center; }
.wl-motif-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.wl-motif { display: grid; gap: 6px; color: inherit; text-decoration: none; font-size: var(--s--1); font-weight: 600; }
.wl-motif:hover span { color: var(--primary-ink); }
.wl-motif .mt-swatch { position: relative; aspect-ratio: 4/3; border-radius: var(--r); overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--border); }
.wl-motif .mt-fabric { position: absolute; inset: 0; }
.wl-motif .mt-fabric svg { width: 100%; height: 100%; display: block; }
@media (max-width: 860px) { .wl-motifs { grid-template-columns: 1fr; } }
.board-note { margin-block-start: var(--sp-3); font-size: var(--s--1); color: var(--ink-3); max-inline-size: 72ch; }

/* how it works: five numbered steps */
.steps { list-style: none; counter-reset: step; margin: 0 0 var(--sp-5); padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-4); }
.steps li { counter-increment: step; border-block-start: 2px solid var(--primary); padding-block-start: var(--sp-3); }
.steps li::before { content: counter(step); display: block; font: 600 var(--s--1)/1 var(--font-mono); color: var(--primary); margin-block-end: var(--sp-2); }
.steps b { display: block; font-size: var(--s-0); }
.steps p { margin: var(--sp-2) 0 0; font-size: var(--s--1); color: var(--ink-2); line-height: 1.5; }
.steps-after { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps, .checks.steps-after { grid-template-columns: 1fr; } }

/* ---------- the waiting list (plan P1.11): the form beside the promise ---------- */
.wl-points { margin-block-start: var(--sp-5); padding-inline-start: 1.1em; color: var(--ink-2); max-inline-size: 52ch; }
.wl-points li + li { margin-block-start: var(--sp-2); }
.wl-card { inline-size: 100%; justify-self: end; max-inline-size: 460px; }
.wl-card h2 { font-size: var(--s-2); margin: 0; }
.wl-choices { border: 0; padding: 0; margin: var(--sp-4) 0 0; }
.wl-choices legend { font-size: var(--s--1); color: var(--ink-2); padding: 0; margin-block-end: var(--sp-2); }
.wl-choice { display: flex; gap: var(--sp-2); align-items: flex-start; padding-block: 6px; cursor: pointer; line-height: 1.35; }
.wl-choice input { flex: none; inline-size: 20px; block-size: 20px; margin: 1px 0 0; accent-color: var(--primary); }
.wl-check { margin-block-start: var(--sp-3); font-size: var(--s--1); color: var(--ink-2); }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .wl-card { justify-self: stretch; max-inline-size: none; }
}

/* ---------- my garments, as cards ---------- */
.mine { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-4); margin-block-start: var(--sp-5); }
.mine-card { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: var(--sp-4); padding: var(--sp-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.mine-img { display: block; aspect-ratio: 1; background: var(--surface-2); border-radius: var(--r); overflow: hidden; }
.mine-img img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.mine-img img.is-drawn { object-fit: contain; padding: var(--sp-3); background: var(--surface); }
.mine-body h2 { font-size: var(--s-1); margin: 0 0 2px; }
.mine-body p { margin: 0 0 4px; font-size: var(--s--1); }
.mine-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: var(--sp-2); }
.empty .btn { margin-block-start: var(--sp-3); }

/* ---- the face of the site while it opens by invitation (ADR-089): prose, checks, questions ---- */
.wl-prose { max-inline-size: 68ch; margin-block-end: var(--sp-6); }
.wl-prose p { font-size: var(--s-0); line-height: 1.55; color: var(--ink-2); }
.wl-prose p + p { margin-block-start: var(--sp-3); }
.wl-checks { margin-block-end: var(--sp-5); }
.wl-faq { max-inline-size: 72ch; margin: 0 0 var(--sp-6); }
.wl-qa { padding-block: var(--sp-4); border-block-start: 1px solid var(--border); }
.wl-qa:last-child { border-block-end: 1px solid var(--border); }
.wl-qa > summary { font-weight: 700; font-size: var(--s-0); cursor: pointer; list-style: none; display: flex; gap: var(--sp-3); justify-content: space-between; align-items: baseline; }
.wl-qa > summary::-webkit-details-marker { display: none; }
.wl-qa > summary::after { content: "+"; font-weight: 600; color: var(--primary); flex: none; }
.wl-qa[open] > summary::after { content: "−"; }
.wl-qa > p { margin: var(--sp-2) 0 0; color: var(--ink-2); line-height: 1.5; }
@media (max-width: 900px) { .checks.wl-checks { grid-template-columns: 1fr; } }

/* the hand needles beside the machines: two cards, never a grid of one */
.cards.needles { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); max-inline-size: 760px; margin-block: var(--sp-4) var(--sp-6); }
.cards.needles .card p { margin: var(--sp-2) 0 0; font-size: var(--s--1); }

/* a long label and a short one on the same button: the short one only on a phone (the phone rule
   is below, after this one: the other way round the button was an empty green square) */
.topbar-end .btn .short { display: none; }
@media (max-width: 640px) {
  .topbar-end .btn .long { display: none; } .topbar-end .btn .short { display: inline; }
  .topbar { gap: var(--sp-3); padding-inline: 16px; }
  .topbar-end { gap: 4px; }
  .topbar-end .btn { padding: 0 12px; font-size: var(--s--1); }
  .lang-btn { font-size: var(--s--1); padding-inline: 6px; }
}

/* the tables of the fibre and yarn sheets scroll inside themselves on a phone, never the page */
.table-scroll { max-inline-size: 100%; overflow-x: auto; }

/* the front page on a phone (10 Oct 2026, «you scroll too much»: 13 screens): the opening's text at
   reading size, the sections closer together; the questions are closed already (join.html) */
@media (max-width: 640px) {
  .hero { padding-block: var(--sp-5); }
  .hero .lede { font-size: var(--s-1); line-height: 1.45; }
  .hero-cta .btn { font-size: var(--s-0); }
  .section { padding-block: var(--sp-6); }
  .steps { gap: var(--sp-4); }
  .figurines, .figurines-cap { max-inline-size: 200px; }      /* the body of each size: half a screen was too much */
}

/* On a phone the long sections go sideways, one card at a time, with dots underneath (the founder,
   10 Oct: «back and forth, with the phone upright»). `data-swipe` on the list; the dots are drawn
   by join.html's script. Above 640 px nothing changes. */
.swipe-dots { display: none; }
@media (max-width: 640px) {
  .section [data-swipe] { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%;
    gap: var(--sp-3); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    margin-inline: calc(-1 * var(--sp-5)); padding-inline: var(--sp-5); scroll-padding-inline: var(--sp-5);
    padding-block-end: 2px; scrollbar-width: none; align-items: start; }
  .section [data-swipe]::-webkit-scrollbar { display: none; }
  .section [data-swipe] > * { scroll-snap-align: start; min-inline-size: 0; }
  .section .steps[data-swipe] > li { background: var(--surface); border: 1px solid var(--border); border-block-start: 3px solid var(--primary);
    border-radius: var(--r-lg); padding: var(--sp-4); }
  .swipe-dots { display: flex; justify-content: center; gap: 6px; margin: var(--sp-3) 0 var(--sp-4); }
  .swipe-dots[hidden] { display: none; }
  .swipe-dots button { all: unset; flex: none; box-sizing: border-box; inline-size: 8px; block-size: 8px;
    min-inline-size: 0; min-block-size: 0; border-radius: 4px; background: var(--border-2); cursor: pointer;
    transition: inline-size .2s ease, background .2s ease; }
  .swipe-dots button[aria-current="true"] { background: var(--primary); inline-size: 20px; border-radius: 4px; }
}
