/* ===========================================================================
   ANNEAL — the scale exhibit, and the starter shelf.

   Two components the vertical does not have, for two sections ANNEAL renders
   itself (inc/vertical/anneal-sections.php). This file is separate from
   anneal-polish.css on purpose: that file's own docblock limits it to rules
   that OVERRIDE a class the engine or the vertical already styles, and these
   are new components. Mixing the two would make the polish file's promise
   untrue and its contents unreviewable.

   Loaded immediately before anneal-polish.css, so the polish layer still has
   the last word on radius, weight and tracking.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   THE SCALE

   The brand's one idea, drawn as an instrument rather than a shelf. Eight
   near-identical white vessels photographed side by side would have shown the
   same picture eight times; what actually separates the products is the
   number, so the number is what this draws.

   THE ONE COLOUR RULE. Brand law (tokens.md, --ramp-N): a ramp stop "marks a
   position and never fills anything — a stop may not become a panel, button or
   background". Every row is therefore paper, and the only ramp colour on the
   section is a 2px vertical mark at the left edge of each row. Read down the
   list those eight marks run hot to cool: the ramp measuring, which is the one
   job it is permitted to do. Nothing else here is coloured at all.
   ------------------------------------------------------------------------ */

.sk-scale__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--p-space-4);
}
.sk-scale__lead { order: 2; margin-top: 0; }
.sk-scale__all  { order: 3; white-space: nowrap; }

@media (min-width: 768px) {
  .sk-scale__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title action" "lead lead";
    align-items: center;
    column-gap: var(--p-space-8);
  }
  .sk-scale__title { grid-area: title; }
  .sk-scale__all   { grid-area: action; justify-self: end; }
  .sk-scale__lead  { grid-area: lead; max-width: 62ch; }
}

.sk-scale__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Hairlines between positions, and one closing the set. A rule above every row
   plus one below the last is the receipt idiom the footer already uses — the
   list reads as a measured set rather than as items that happen to be near
   each other. */
.sk-scale__row      { border-block-start: 1px solid var(--border); }
.sk-scale__row:last-child { border-block-end: 1px solid var(--border); }

.sk-scale__link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "index price"
    "name  price"
    "facts price"
    "mark  price";
  align-items: center;
  column-gap: clamp(var(--p-space-4), 2.4vw, var(--p-space-8));
  row-gap: var(--p-space-1);
  padding-block: clamp(var(--p-space-4), 1.8vw, var(--p-space-6));
  text-decoration: none;
  color: var(--foreground);
  transition:
    background-color 150ms var(--ms-ease),
    padding-inline-start 200ms var(--ms-ease);
}

/* THE INDEX RULE — the one device this row borrows from the object itself.
   Brand law §2 permits ramp colour in exactly two forms: the whole continuum,
   or "the index rule (2 px, 34% width)". On the vessel that rule is a single
   short mark at the BASE OF THE TYPE BLOCK, and it is the only colour printed
   on the product. So it sits here where it sits there — under the name and its
   facts, not as a bar down the side of the row.

   An earlier draft ran it as a 2px vertical mark the full height of the row.
   That looked like an axis and read well, but it is a third device the law does
   not name, and inventing a new way to show the ramp is exactly how a
   measuring instrument turns into decoration. This version costs nothing and
   makes the page echo the object. */
.sk-scale__rule {
  grid-area: mark;
  width: 34%;
  max-width: 10rem;
  height: 2px;
  margin-block-start: var(--p-space-2);
  background: var(--stop);
}

.sk-scale__index {
  grid-area: index;
  font-size: var(--p-text-12);
  color: var(--foreground);
}
.sk-scale__temp { color: var(--ink-2); }
.sk-scale__temp::before {
  content: "·";
  margin-inline: 0.5ch;
  color: var(--ink-3);
}

.sk-scale__name {
  grid-area: name;
  font-size: clamp(var(--p-text-20), 2.2vw, var(--p-text-24));
  line-height: 1.15;
  letter-spacing: var(--p-tracking-n20);
}

.sk-scale__facts {
  grid-area: facts;
  font-size: var(--p-text-12);
  color: var(--ink-2);
}
.sk-scale__vol::before {
  content: "·";
  margin-inline: 0.5ch;
  color: var(--ink-3);
}

.sk-scale__price {
  grid-area: price;
  align-self: center;
  justify-self: end;
  font-size: var(--p-text-16);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  /* Hairline plus a surface change, never a shadow and never a lift — the
     brand's whole vocabulary for "this responds". The inline padding shift
     moves the row a hair off its mark, which reads as the row stepping
     forward without anything actually leaving the page. */
  .sk-scale__link:hover {
    background: color-mix(in oklab, var(--foreground) 4%, transparent);
    padding-inline-start: var(--p-space-3);
  }
}
.sk-scale__link:focus-visible {
  background: color-mix(in oklab, var(--foreground) 4%, transparent);
}

.sk-scale__note {
  margin: clamp(var(--p-space-6), 2.5vw, var(--p-space-10)) 0 0;
  max-width: 58ch;
  font-size: var(--p-text-15);
  line-height: 1.6;
  color: var(--ink-2);
}

/* -- THE ROW BECOMES COLUMNS ------------------------------------------------
   Stacking index / name / facts at the left edge is right on a phone and wrong
   on a desktop. Measured at 1440: the name cell spans 1176px, its text ends
   near 250, and the price sits at 1274 — about a thousand pixels of nothing
   between a product and what it costs. Eight rows of that read as a database
   dump, not as an instrument, and no amount of colour work fixes it because
   the fault is that the row carries no structure across its own width.

   So the facts become their own column and the row is read across instead of
   down: position and temperature, the name with its index rule beneath it,
   what is in it, and the price. Every column has a job and the width is spent
   on information rather than on gap. The measure is capped rather than fluid —
   past about 20rem the actives column would start pulling the price away from
   the name again, which is the same fault in a slower form. ----------- */
@media (min-width: 1024px) {
  .sk-scale__link {
    grid-template-columns: 8.5rem minmax(9rem, 1fr) minmax(0, 20rem) 7rem;
    grid-template-areas:
      "index name  facts price"
      "index mark  facts price";
    align-items: center;
    row-gap: 0;
  }
  .sk-scale__index { align-self: center; }
  /* The rule sits under the name, and its 34% is now 34% of the NAME's column
     rather than of the whole row — which is what "34% width" means on the
     vessel, where the print area is the type block and nothing else. */
  .sk-scale__rule { max-width: 6rem; margin-block-start: var(--p-space-1-5); }
}

/* Below 640 the index line, the name and the facts stack under one another and
   the price drops to the facts row, so nothing has to be read at 11px. */
@media (max-width: 639px) {
  .sk-scale__link {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "index"
      "name"
      "facts"
      "price"
      "mark";
    row-gap: var(--p-space-2);
  }
  .sk-scale__price { justify-self: start; }
}

/* ---------------------------------------------------------------------------
   START HERE

   The vertical's version is a 7-column copy tile beside a lifestyle photograph,
   so its card list is a single stacked column. Brand law §1.2 forbids a human
   body in any brand image, the photograph is gone, and the tile is full width —
   so the cards lay out as a three-up shelf instead of a stack.
   ------------------------------------------------------------------------ */

@media (min-width: 768px) {
  .sk-start__body .sk-start__cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sk-gap);
  }
}
