/* Jenko demo — product page: configurator + 3D model. Builds on site.css tokens.
   Square cells between hairlines (the format chips' grammar), selected = ink, no yellow except the primary button. */

.config { margin-top: clamp(72px, 9vw, 144px); }
.config__grid { margin-top: clamp(40px, 5vw, 72px); row-gap: 32px; align-items: start; }

/* ——— Stage: 3D view + tools ——— */
.config__stage { grid-column: 1 / span 7; position: sticky; top: calc(var(--header-h) + 16px); }
.config__view {
  position: relative; height: min(76svh, 780px); min-height: 420px;
  background: var(--paper-hi); overflow: hidden;
  touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none;
}
.config__view.is-dragging { cursor: grabbing; }
.config__view canvas { display: block; width: 100%; height: 100%; }
.config__view:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.config__fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.config__view.is-3d .config__fallback { display: none; }
.config__tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--rule-strong);
}
.config__tools[hidden] { display: none; }
.config__rot { display: inline-flex; margin-left: auto; }
.tool {
  min-height: 44px; padding: 0 16px;
  font: inherit; font-size: var(--step--1); font-weight: 560; letter-spacing: 0.01em;
  color: var(--ink); background: transparent; border: 1px solid var(--rule-strong); border-radius: 0; cursor: pointer;
  transition: background-color var(--dur-s) ease, color var(--dur-s) ease;
}
.tool:hover { background: var(--paper-hi); }
.tool[aria-pressed="true"] { background: var(--ink); color: var(--paper-hi); border-color: var(--ink); }
.config__hint { margin-top: 10px; }

/* ——— Panel: parameters ——— */
.config__panel { grid-column: 9 / span 4; display: grid; gap: 30px; }
.opt-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.opt-group legend { padding: 0 0 10px; font-size: var(--step--1); font-weight: 560; letter-spacing: 0.01em; }
.opt-rows { border-top: 1px solid var(--rule-strong); }
.opt-row { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); border-bottom: 1px solid var(--rule-strong); }
.opt-row__h { font-size: var(--step--1); color: var(--ink-2); font-variant-numeric: tabular-nums; padding: 14px 0; }
.opts { display: grid; }
.opts--1 { grid-template-columns: minmax(0, 1fr); }
.opts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opt-group > .opts { border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); }
.opts--1 .opt + .opt { border-top: 1px solid var(--rule); }
.opts--2 .opt:nth-child(n+3), .opts--3 .opt:nth-child(n+4) { border-top: 1px solid var(--rule); }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.opt > span {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; height: 100%; box-sizing: border-box;
  font-size: var(--step--1); line-height: 1.3; font-variant-numeric: tabular-nums;
  border-left: 1px solid var(--rule);
  transition: background-color var(--dur-s) ease, color var(--dur-s) ease;
}
.opt:hover > span { background: var(--paper-hi); }
.opt input:checked + span { background: var(--ink); color: var(--paper-hi); }
.opt input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: -2px; box-shadow: inset 0 0 0 4px var(--paper-hi); }
/* Checkboxes: a square box in front of the label, filled when checked. */
.opt--check > span::before {
  content: ""; flex: none; width: 14px; height: 14px; border: 1.5px solid currentColor; box-sizing: border-box;
}
.opt--check input:checked + span::before { background: currentColor; box-shadow: inset 0 0 0 2.5px var(--ink); }

.config__custom { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.config__custom[hidden] { display: none; }
.config__custom .field input { font-size: var(--step-0); min-height: 48px; font-variant-numeric: tabular-nums; }

/* ——— Summary ——— */
.config__sum { display: grid; gap: 18px; padding-top: 18px; border-top: 1px solid var(--rule-strong); }
.config__sum-h { font-size: var(--step-2); }
.config__sum dl { margin: 0; }
.config__sum dl div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.config__sum dt { font-size: var(--step--1); color: var(--ink-2); }
.config__sum dd { margin: 0; font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.config__sum .btn { justify-self: start; }

@media (max-width: 1100px) {
  .config__stage { grid-column: 1 / span 7; }
  .config__panel { grid-column: 8 / span 5; }
}
@media (max-width: 900px) {
  .config__stage, .config__panel { grid-column: 1 / -1; }
  .config__stage { position: static; }
  .config__view { height: min(68svh, 560px); min-height: 360px; }
}
@media (max-width: 480px) {
  .config__tools { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .config__tools .tool { padding: 0 10px; white-space: nowrap; min-width: 0; }
  .config__rot { margin-left: 0; }
}
@media (max-width: 420px) {
  .opts--2 { grid-template-columns: minmax(0, 1fr); }
  .opts--2 .opt + .opt { border-top: 1px solid var(--rule); }
  .config__custom { grid-template-columns: minmax(0, 1fr); }
}

/* ——— The same elements, photographed (macros) ——— */
.real { margin-top: clamp(96px, 11vw, 176px); }
.macros {
  list-style: none; margin: clamp(40px, 5vw, 72px) auto 0; padding-block: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px var(--gutter);
}
.macros .plate__frame { aspect-ratio: 1; }
.macros figcaption { margin-top: 10px; }
.real .film { margin-top: clamp(40px, 5vw, 72px); }
@media (max-width: 900px) {
  .macros {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(150px, 42%);
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding-bottom: 8px;
    padding-inline: var(--margin); scroll-padding-inline: var(--margin);
  }
  .macros li { scroll-snap-align: start; }
}

/* ——— Formats to scale: 16 fronts on one floor line ——— */
.lineup { margin-top: clamp(40px, 5vw, 72px); overflow-x: auto; overscroll-behavior-x: contain; }
.lineup__svg { display: block; width: 100%; min-width: 1300px; height: auto; }
/* phones: the strip scrolls; it opens on the chosen format and fades at the edge to show there is more */
@media (max-width: 900px) { .lineup { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); } }
.lineup__floor { stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.lineup__tick { stroke: var(--rule-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.lineup__item { cursor: pointer; outline: none; }
.lineup__item rect { fill: var(--stone); stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; transition: fill var(--dur-s) ease; }
.lineup__item:hover rect { fill: #c8ccc6; }
.lineup__item[aria-pressed="true"] rect { fill: var(--ink); }
.lineup__item:focus-visible rect { stroke-width: 4; }
.lineup__h { font-family: var(--font); font-size: 190px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
/* drawing units: 190 renders at label size (13–14 px) */
.lineup__sel { font-family: var(--font); font-size: 190px; font-weight: 560; fill: var(--ink); font-variant-numeric: tabular-nums; }

/* ——— PROFROID / CARRIER example ——— */
.case__head .link { justify-self: start; }
.macros:focus-visible, .lineup:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
