/* Relight tray: the page is the wall, the samples stand off it, one light moves over all of them. */
.tray-page { --gut: 16px; --gap: 10px; --label: 50px; --nav: 96px; }
.tray-page main { container-type: inline-size; }
.tray-page ::selection { background: rgba(var(--accent-rgb), 0.22); }
.tray-page nav { background: var(--bg); }   /* the tray scrolls under it on a phone; a clear bar would stack logo on heading */

.tray { --s: calc((100cqw - 2 * var(--gut) - var(--gap)) / 2);
  padding: var(--nav) var(--gut) 0; }
.tray-side { display: contents; }   /* so the dock sticks to the whole tray, not to a box its own height */
.tray-head .eyebrow { margin-bottom: var(--s-1); }
.tray-head p { margin: var(--s-2) 0 0; font-size: var(--t-body-sm); line-height: 1.45; color: var(--ink-2); max-width: 44ch; }

.tray-grid { position: relative; list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid;
  grid-template-columns: repeat(2, var(--s)); gap: var(--s-2) var(--gap); touch-action: pan-y; }
.tray-cell { display: block; min-width: 0; }
.tray-sample { display: block; position: relative; width: var(--s); height: var(--s); -webkit-touch-callout: none; -webkit-user-drag: none; }
.tray-poster { position: relative; z-index: 1; display: block; width: 100%; height: 100%; background: var(--bg-alt); }
/* A plate standing off the wall, cast on the page. Offset for the default light: 5 mm stand-off at 12° from above. */
/* box-shadow, not filter: blur(): it rasterises once and the layer only translates, so a phone composites no blur per frame. */
.tray-shadow { position: absolute; inset: 0; background: rgba(var(--ink-rgb), 0.16); box-shadow: 0 0 calc(var(--s) * 0.035) rgba(var(--ink-rgb), 0.2);
  transform: translate3d(0, calc(var(--s) * 0.039), 0); will-change: transform; }
.tray-canvas { position: absolute; top: 0; left: 0; z-index: 2; width: 100%; pointer-events: none; opacity: 0;
  transition: opacity var(--dur-3) var(--ease); }
.tray-canvas.is-on { opacity: 1; }
.tray-cell.is-live .tray-poster { visibility: hidden; }
.tray-label { position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; align-items: center; column-gap: var(--s-2);
  height: var(--label); }   /* name on the first line; depth and the "open" cue share the second */
.tray-name { font-family: var(--font-display); font-size: 19px; line-height: 1.2; color: var(--ink); text-decoration: none;
  text-underline-offset: 3px; }
.tray-name { grid-column: 1 / -1; align-self: end; }
.tray-name:hover { color: var(--accent); text-decoration: underline; }
.tray-depth { grid-column: 1; grid-row: 2; align-self: start; }
.tray-cue { grid-column: 2; grid-row: 2; align-self: start; justify-self: end; font-size: 13px; line-height: 20px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--accent); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.tray-cue:hover { color: var(--ink); }
.tray-sample::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow var(--dur-2) var(--ease); }
.tray-sample:hover::after, .tray-sample:focus-visible::after { box-shadow: inset 0 0 0 2px var(--accent); }
.tray-name:focus-visible, .tray-cue:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tray-depth { font-size: 12px; line-height: 20px; letter-spacing: 0.02em; color: var(--ink-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* The light control docks under the thumb on a phone, clear of the samples being compared. */
.tray-dock { position: sticky; bottom: var(--consent-h, 0px); z-index: 4; margin: 0 calc(-1 * var(--gut)); padding: var(--s-2) var(--gut) calc(var(--s-2) + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: 1fr 124px; align-items: end; gap: var(--s-2) var(--s-3); background: var(--bg);
  border-top: 1px solid var(--rule-2); visibility: hidden; }
.tray-js .tray-dock { visibility: visible; }
.tray-hint { grid-column: 1 / -1; margin: 0; font-size: var(--t-body-sm); line-height: 1.3; font-weight: 500; color: var(--ink); }
.tray-hint__mouse, .tray-hint__still { display: none; }
@media (hover: hover) and (pointer: fine) {
  .tray-hint__touch { display: none; }
  .tray-hint__mouse { display: inline; }
}
.tray-still .tray-hint__touch, .tray-still .tray-hint__mouse { display: none; }
.tray-still .tray-hint__still { display: inline; }
.tray-pad { grid-column: 2; grid-row: 2; display: block; width: 100%; height: auto; touch-action: none; cursor: grab; overflow: visible; }
.tray-pad:active { cursor: grabbing; }
.tray-pad__sky { fill: rgba(var(--ink-rgb), 0.05); stroke: rgba(var(--ink-rgb), 0.42); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.tray-pad__ring { fill: none; stroke: rgba(var(--ink-rgb), 0.16); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tray-pad__ray { stroke: var(--accent); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.tray-pad__dot circle { fill: var(--accent); }
.tray-pad__dot circle:first-child { fill: rgba(var(--accent-rgb), 0.18); transform-box: fill-box; transform-origin: center;
  animation: tray-grab 1.8s var(--ease) 6; }
.tray-touched .tray-pad__dot circle:first-child, .tray-still .tray-pad__dot circle:first-child { animation: none; }
@keyframes tray-grab { 50% { transform: scale(1.45); opacity: 0.55; } }
.tray-pad:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.tray-still .tray-pad { cursor: default; touch-action: auto; pointer-events: none; }

.tray-lights { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.tray-lights button { display: flex; align-items: flex-start; width: 100%; min-height: 48px; padding: 6px 4px 7px; font: inherit; font-size: 13px; line-height: 1.2; text-align: left; color: var(--ink-2);
  background: none; border: 0; border-top: 1px solid var(--rule-3); cursor: pointer;
  transition: color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease); }
.tray-lights button:hover { color: var(--ink); border-top-color: var(--ink-muted); }
.tray-lights button[aria-pressed="true"] { color: var(--accent); border-top: 2px solid var(--accent); padding-top: 5px; }

.tray-scale { display: flex; align-items: center; gap: var(--s-2); margin: var(--s-2) 0; font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.tray-scale i { display: block; width: calc(var(--s) / 3); height: 5px; border: 1px solid var(--ink-muted); border-top: 0; }

/* 13 samples leave the last row short: the door to Bespoke finishes it. */
.tray-door { display: flex; flex-direction: column; justify-content: center; gap: var(--s-3); padding: var(--s-3) 0; font-size: var(--t-body-sm); line-height: 1.5; color: var(--ink-2); }
.tray-door p { margin: 0; }

.tray-note { padding: var(--s-7) var(--gut) 0; max-width: 62ch; }
.tray-list { padding: var(--s-7) var(--gut) var(--s-8); }
.tray-list h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.15; margin: 0 0 var(--s-3); color: var(--ink); }
.tray-list > p { font-size: var(--t-body); line-height: 1.65; color: var(--ink-2); margin: 0 0 var(--s-4); max-width: 62ch; }
.tray-list ul { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: grid; column-gap: var(--s-7); }
.tray-list li a { display: grid; gap: var(--s-1); padding: var(--s-3) 0 var(--s-4); border-top: 1px solid var(--rule-2); color: var(--ink); text-decoration: none; }
.tray-list__name { font-family: var(--font-display); font-size: 22px; line-height: 1.2; }
.tray-list__line { font-size: var(--t-body-sm); line-height: 1.5; color: var(--ink-2); }
.tray-list li a:hover .tray-list__name { color: var(--accent); }
.tray-note h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.15; margin: 0 0 var(--s-3); color: var(--ink); }
.tray-note p { font-size: var(--t-body); line-height: 1.65; color: var(--ink-2); margin: 0 0 var(--s-4); }
.tray-note a { color: var(--accent); text-underline-offset: 3px; }
.tray-measure { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--rule-2); }
.tray-measure button { min-height: 44px; padding: 0 var(--s-4); font: inherit; font-size: var(--t-body-sm); color: var(--ink); background: none; border: 1px solid var(--ink-muted); cursor: pointer; }
.tray-measure button:hover { color: var(--accent); border-color: var(--accent); }
.tray-measure button:disabled { opacity: 0.55; cursor: progress; }
.tray-measure output { display: block; margin-top: var(--s-3); font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; color: var(--ink-2); overflow-wrap: anywhere; user-select: all; }

/* Phones: the dock folds to one line (relight-tray.js adds the toggle) and the name and cue get 44px touch areas. */
.tray-dock__bar { display: none; }
@media (max-width: 899px) {
  .tray-page { --label: 68px; }
  .tray-name, .tray-cue { display: flex; align-items: center; min-height: 44px; margin-block: -6px; }
  .tray-name { margin-block: 0 -4px; }
  .tray-cue { margin-block: -12px; }
  .tray-js .tray-hint { grid-row: 2; }
  .tray-js .tray-pad, .tray-js .tray-lights { grid-row: 3; }
  .tray-js .tray-dock__bar { grid-row: 1; grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
  .tray-dock__name { font-size: var(--t-body-sm); line-height: 1.3; font-weight: 500; color: var(--ink); min-width: 0; }
  .tray-dock__btn { display: flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-2); font: inherit; font-size: 13px; color: var(--accent);
    background: none; border: 0; cursor: pointer; }
  .tray-dock__btn::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-135deg) translate(-2px, -2px);
    transition: transform var(--dur-2) var(--ease); }
  .tray-dock__btn[aria-expanded="true"]::after { transform: rotate(45deg) translate(-2px, -2px); }
  .tray-dock__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .tray-js .tray-dock { padding-top: 0; padding-bottom: env(safe-area-inset-bottom); }
  .tray-js .tray-dock:not(.is-open) > :not(.tray-dock__bar) { display: none; }
  .tray-js .tray-dock.is-open { padding-bottom: calc(var(--s-2) + env(safe-area-inset-bottom)); }
}

@media (min-width: 640px) {
  .tray { --s: calc((100cqw - 2 * var(--gut) - 2 * var(--gap)) / 3); }
  .tray-page { --gut: 24px; --gap: 14px; }
  .tray-grid { grid-template-columns: repeat(3, var(--s)); row-gap: var(--s-3); }
  .tray-door { grid-column: span 2; max-width: 48ch; }
  .tray-list ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
  .tray-page { --gut: 40px; --gap: 18px; --aside: 280px; --nav: 102px; }
  .tray { --s: max(232px, min(calc((100cqw - var(--aside) - 2 * var(--gut) - 2 * var(--gap) - 48px) / 3),
                              calc((100svh - var(--nav) - var(--s-6) - var(--gap) - 2 * var(--label)) / 2)));
    padding: var(--nav) var(--gut) var(--s-6); display: grid; grid-template-columns: var(--aside) auto; grid-template-rows: auto 1fr; column-gap: 48px; row-gap: var(--s-5);
    justify-content: center; align-items: start; }
  .tray-head { grid-column: 1; grid-row: 1; }
  .tray-head p { font-size: var(--t-body); line-height: 1.55; margin-top: var(--s-4); }
  .tray-grid { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
  .tray-side { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; position: sticky; top: var(--nav); }
  .tray-scale { order: 2; }
  .tray-dock { position: static; margin: 0; padding: 0; display: block; border: 0; background: none; }
  .tray-hint { margin-bottom: var(--s-3); }
  .tray-pad { width: 100%; max-width: 240px; }
  .tray-lights { grid-template-columns: 1fr; gap: 0; margin-top: var(--s-5); max-width: 240px; }
  .tray-lights button { min-height: 38px; padding: 9px 0; font-size: 14px; }
  .tray-lights button[aria-pressed="true"] { padding-top: 8px; }
  .tray-scale { margin: var(--s-5) 0 0; }
  .tray-name { font-size: 22px; }
  .tray-note { padding: var(--s-8) var(--gut) 0; margin: 0 auto; max-width: 1180px; box-sizing: border-box; }
  .tray-note p { max-width: 62ch; }
  .tray-list { padding: var(--s-8) var(--gut) var(--s-9); margin: 0 auto; max-width: 1180px; box-sizing: border-box; }
}

@media (prefers-reduced-motion: reduce) {
  .tray-canvas, .tray-lights button { transition: none; }
  .tray-pad__dot circle:first-child { animation: none; }
}

/* The index opens on one design in a room (Burak 2026-11-13); the tray follows as the second section. */
.idx-hero { padding: var(--nav) 0 0; }
.idx-hero__img { margin: 0; position: relative; }
.idx-hero__img img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 55%; background: var(--bg-alt); }   /* the 840 × 672 phone source is cropped, never stretched, so the designs show on the first screen */
.idx-hero__img figcaption { padding: var(--s-2) var(--gut) 0; font-size: 12px; letter-spacing: 0.02em; color: var(--ink-muted); text-align: right; }
.idx-hero__img figcaption a { color: inherit; text-underline-offset: 3px; }
.idx-hero__img figcaption a:hover { color: var(--accent); }
.idx-hero__copy { padding: var(--s-3) var(--gut) 0; }
.idx-hero__copy h1 { font-family: var(--font-display); font-weight: 300; font-size: clamp(38px, 11vw, 48px); line-height: 1.02;
  letter-spacing: -0.01em; margin: 0; color: var(--ink); text-wrap: balance; }
.idx-hero__copy h1 em { font-style: italic; color: var(--accent); }
.idx-hero__side p { margin: var(--s-3) 0 0; font-size: var(--t-body); line-height: 1.55; color: var(--ink-2); max-width: 46ch; }
.idx-hero__links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-5); margin-top: var(--s-4); }
.idx-hero__links .btn-primary { min-height: 44px; }
.idx-hero + .tray { padding-top: var(--s-5); }
.tray-head h2 { scroll-margin-top: var(--s-4); }   /* the hero's button lands on the heading (the page's scroll-padding already clears the nav) */
.tray-head h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.15; margin: 0; color: var(--ink); text-wrap: balance; }   /* a section heading, not a second hero */
.tray-tag { position: absolute; z-index: 3; bottom: var(--s-2); right: var(--s-2); padding: 3px var(--s-2); background: var(--bg); font-size: 12px; line-height: 1.4;
  letter-spacing: 0.02em; color: var(--accent); white-space: nowrap; pointer-events: none; }   /* on the sample, over the live canvas; bottom right, where Accelerando's window thins out */

/* Phones: a tighter hero, so the tray heading and the first row of samples reach the first screen. */
@media (max-width: 899px) {
  .idx-hero__copy h1 { font-size: clamp(32px, 9.4vw, 40px); }
  .idx-hero__side p { margin-top: var(--s-2); font-size: var(--t-body-sm); line-height: 1.45; }
  .idx-hero__links { gap: var(--s-1) var(--s-4); margin-top: var(--s-3); }
  .idx-hero__links .sys-link { font-size: 12px; letter-spacing: 0.1em; }
  .idx-hero__img figcaption { padding-top: var(--s-1); }
  .tray-grid { margin-top: var(--s-3); }
  /* The first screen goes to the samples: the hero's jump links and the tray's lead paragraph wait for desktop. */
  .idx-hero__links a[href="#tray-h"], .idx-hero__links a[href="#liste"], .idx-hero__links a[href="#list"], .tray-head p { display: none; }
}

@media (min-width: 900px) {
  .idx-hero__copy { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--s-7); align-items: end;
    max-width: 1320px; margin: 0 auto; padding-top: var(--s-6); box-sizing: border-box; }
  .idx-hero__img img { aspect-ratio: auto; height: clamp(360px, calc(100svh - var(--nav) - 300px), 760px); object-position: 30% 50%; }   /* the headline stays in the first view */
  .idx-hero__side p { margin-top: 0; }
  .idx-hero + .tray { padding-top: var(--s-9); }
  .idx-hero__copy h1 { font-size: clamp(52px, 5.4vw, 84px); }
}
@media (min-width: 901px) { .idx-hero__links .sys-link { display: none; } }   /* the nav carries the same request from here up */
@media (min-width: 1100px) {
  /* the hero copy spans exactly the tray's width, so the headline and the tray heading share one left edge */
  .idx-hero { --s: max(232px, min(calc((100cqw - var(--aside) - 2 * var(--gut) - 2 * var(--gap) - 48px) / 3),
                                calc((100svh - var(--nav) - var(--s-6) - var(--gap) - 2 * var(--label)) / 2))); }
  .idx-hero__copy { max-width: calc(var(--aside) + 48px + 3 * var(--s) + 2 * var(--gap)); padding-left: 0; padding-right: 0; }
  .idx-hero__img figcaption { padding-left: var(--gut); padding-right: var(--gut); }
  .idx-hero + .tray { padding-top: 160px; }
  .tray-head h2 { font-size: 30px; }
}
