/* LUMI. A room at dusk, with light as the material.
   One display face (Jost, light weights), one UI face (Lexend). The only accent is lamp light itself:
   warm glows, frosted diffusers, and a page whose own light follows the lamps on screen. */
@property --k { syntax: '<color>'; inherits: true; initial-value: rgb(255,169,87); }
@property --amb { syntax: '<color>'; inherits: true; initial-value: rgb(255,169,87); }
:root {
  --dusk-hi: #3b3456;     /* violet sky through the window */
  --dusk: #3d2d3c;        /* the room wall at dusk */
  --dusk-lo: #2e2129;     /* floor shadow */
  --ink: #fbefe3;
  --muted: #d2b9ae;
  --faint: #a88f8f;
  --glow: #ffd29a;        /* lamp light, the one accent */
  --glow-ink: #3a2410;
  --frost: rgba(255, 236, 222, .075);
  --frost-2: rgba(255, 236, 222, .12);
  --frost-line: rgba(255, 226, 205, .17);
  --bad: #ff9f8a;
  --good: #c5e7a4;
  --amb: rgb(255,169,87);
  --amb-a: .2;
  --display: 'Jost', 'Futura', system-ui, sans-serif;
  --ui: 'Lexend', system-ui, sans-serif;
  --side: clamp(20px, 6vw, 104px);
  /* --zoom: the interface's scale, set from the screen size by the script at the top of the page: up to 1.6 on big
     screens so the text stays readable, a little under 1 on narrow phones so everything fits */
  --zoom: 1;
  --kgrad: linear-gradient(90deg, rgb(255,147,44), rgb(255,180,107) 22%, rgb(255,209,163) 40%, rgb(255,236,224) 62%, rgb(255,249,253) 82%, rgb(230,235,255));
}
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth; -webkit-text-size-adjust: 100%;
  background: linear-gradient(180deg, var(--dusk-hi) 0, var(--dusk) 100vh, var(--dusk) 70%, var(--dusk-lo) 100%) var(--dusk);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--ink); font: 300 16px/1.55 var(--ui); overflow-x: hidden; background: transparent;
}
body.is-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 300; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the page's own light: a pool in the colour and strength of the lamps on screen */
.ambient {
  position: fixed; inset: -20vh -20vw; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 55% 50% at 50% 58%, color-mix(in srgb, var(--amb) calc(var(--amb-a) * 100%), transparent), transparent 70%);
  transition: --amb 1.2s ease;
}

/* logo: the dot of the i is a lamp running through LUMI's range */
.logo {
  --k: rgb(255,169,87);
  position: absolute; z-index: 20; top: calc(26px * var(--zoom)); left: var(--side);
  font: 400 calc(30px * var(--zoom))/1 var(--display); letter-spacing: .02em; text-decoration: none;
}
.logo-i { position: relative; display: inline-block; background: linear-gradient(180deg, var(--k) 38%, var(--ink) 92%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-dot {
  position: absolute; left: 50%; top: .11em; width: .16em; height: .16em; border-radius: 50%; transform: translateX(-50%);
  background: var(--k); box-shadow: 0 0 .22em .05em var(--k), 0 .35em .5em -.1em var(--k);
}
@media (prefers-reduced-motion: no-preference) { .logo { animation: logo-kelvin 14s ease-in-out infinite; } }
@keyframes logo-kelvin {
  0%, 100% { --k: rgb(255,147,44); }
  20% { --k: rgb(255,169,87); }
  40% { --k: rgb(255,196,137); }
  60% { --k: rgb(255,228,206); }
  75% { --k: rgb(255,250,244); }
}

/* navigation is a wall switch plate, fixed at the bottom */
.plate {
  position: fixed; z-index: 40; left: 50%; bottom: calc(18px * var(--zoom)); transform: translateX(-50%);
  display: flex; gap: 2px; padding: calc(5px * var(--zoom)); border-radius: calc(14px * var(--zoom));
  background: rgba(54, 40, 52, .72); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--frost-line); box-shadow: 0 10px 30px rgba(20, 10, 20, .35);
}
.plate a {
  display: flex; align-items: center; gap: calc(9px * var(--zoom)); padding: calc(9px * var(--zoom)) calc(15px * var(--zoom)); border-radius: calc(10px * var(--zoom));
  text-decoration: none; font: 400 calc(14px * var(--zoom))/1 var(--ui); color: var(--muted); white-space: nowrap;
}
.plate a i { width: calc(7px * var(--zoom)); height: calc(7px * var(--zoom)); border-radius: 50%; background: rgba(255,226,205,.25); transition: background-color .4s, box-shadow .4s; }
.plate a:hover { color: var(--ink); background: var(--frost); }
.plate a.on { color: var(--ink); }
.plate a.on i { background: var(--glow); box-shadow: 0 0 8px 1px var(--glow); }

/* buttons: a frosted diffuser with a lens that lights */
.btn {
  display: inline-flex; align-items: center; gap: 12px; cursor: pointer; text-decoration: none;
  font: 400 15px/1 var(--ui); letter-spacing: .01em; color: var(--ink);
  padding: 15px 22px 15px 16px; border-radius: 6px; border: 1px solid var(--frost-line);
  background: linear-gradient(180deg, rgba(255,236,222,.16), rgba(255,236,222,.06));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background-color .25s, border-color .25s;
}
.btn .lens { width: 14px; height: 14px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 6px 1px rgba(255,210,154,.6); transition: box-shadow .3s; }
.btn:hover { border-color: rgba(255,226,205,.4); }
.btn:hover .lens { box-shadow: 0 0 14px 5px rgba(255,210,154,.75); }
.btn-small { padding: 10px 16px; font-size: 14px; }
.tool {
  display: inline-flex; align-items: center; cursor: pointer; border: 0; background: none; padding: 10px 2px;
  font: 400 14px/1 var(--ui); color: var(--muted); text-decoration: underline; text-decoration-color: rgba(255,226,205,.3); text-underline-offset: 5px;
}
.tool:hover { color: var(--ink); text-decoration-color: var(--glow); }

/* hero: the room fills the first screen, the promise across its top */
/* the first screen is always the whole screen, so nothing of the next section shows under it */
.hero { position: relative; height: 100svh; min-height: 660px; }
.hero .view { position: absolute; inset: 0; }
.view { position: relative; width: 100%; }
.view-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.hero-copy { position: absolute; z-index: 2; left: var(--side); right: var(--side); top: calc(44px * var(--zoom)); pointer-events: none; }
/* wide screens: the promise on two centred lines, the changing word alone on the second, centred on its own middle.
   Sized so the first line ("Light your room like a", 8.6 em) fits with the logo clear of it */
.hero h1 { font-size: min(calc(100px * var(--zoom)), calc((100vw - 2 * var(--side) - 200px * var(--zoom)) / 8.75)); line-height: 1.04; letter-spacing: -.01em; white-space: nowrap; text-align: center; }
/* the headline's last word changes with the light; each letter of the word is lit by the room (js/app.js) */
.h1-line { display: block; }
.a-narrow { display: none; }
.word { display: inline-grid; justify-items: center; white-space: nowrap; }
.word > .w { grid-area: 1 / 1; }
.word > .w:empty { display: none; }
/* each letter is filled with the room's light across its own width (set from js/app.js) */
.word > .w.lit > span { color: transparent; -webkit-background-clip: text; background-clip: text; }
.hero-foot { position: absolute; z-index: 2; left: var(--side); right: var(--side); bottom: calc(92px * var(--zoom)); display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.hero-act { max-width: 25em; }
.lead { color: var(--muted); font-size: 16px; margin-bottom: 22px; }
.mood-caption { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; }
.mood-name { color: var(--ink); font: 400 20px/1 var(--display); min-width: 4.6em; text-align: right; }
.mood-k { min-width: 4.6em; font-variant-numeric: tabular-nums; }
.kscale { position: relative; width: 170px; height: 2px; border-radius: 1px; background: var(--kgrad); }
.kscale-pin {
  position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%);
  box-shadow: 0 0 10px 2px currentColor; color: rgba(255,210,154,.6); transition: left 1.4s ease, background-color 1.4s;
}

/* section heads */
.sec-head { padding: 0 var(--side); max-width: calc(1000px * var(--zoom)); }
.sec-head > *, .hero-act, .mood-caption, .levels > li, .panel, .lamps > li, .foot p { zoom: var(--zoom); }
.sec-head h2 { font-size: clamp(34px, 3.8vw, 58px); line-height: 1.05; }
.sec-head p { margin-top: 12px; color: var(--muted); font-size: 16px; max-width: 36em; }
.app, .relight { padding: 120px 0 40px; }
.kit { padding: 120px 0 80px; }

/* stage: the room is the page; the app floats over it as a frosted panel */
/* the room and the panel share one grid cell, so the stage is as tall as the taller of the two:
   the panel shows all its controls and never scrolls on its own */
.stage { position: relative; margin-top: 8px; display: grid; }
.stage > * { grid-area: 1 / 1; min-width: 0; }
.stage-view { position: relative; }
.stage .view { height: 100%; min-height: min(88vh, 880px); }
.panel {
  position: relative; z-index: 4; align-self: start; width: 392px;
  padding: 22px; border-radius: 18px; scrollbar-width: thin; scrollbar-color: rgba(255,226,205,.25) transparent;
  background: linear-gradient(180deg, rgba(255,236,222,.1), rgba(255,236,222,.05));
  backdrop-filter: blur(22px) saturate(1.15); -webkit-backdrop-filter: blur(22px) saturate(1.15);
  border: 1px solid var(--frost-line); box-shadow: inset 0 1px 0 rgba(255,240,228,.18), 0 20px 50px rgba(20,10,20,.25);
}
/* the panels are zoomed, so offsets that should stay on the page's gutter are divided back out */
#appPanel { justify-self: end; margin-right: calc(clamp(16px, 2.5vw, 48px) / var(--zoom)); }
#gamePanel { justify-self: start; margin-left: calc(var(--side) / var(--zoom)); }
.panel-head h3 { font: 400 26px/1.1 var(--display); }
.stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.stat-k::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--kc); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 6px var(--kc); }

/* moods: each one is a lamp lens, lit in its colour and strength */
.moods { margin-top: 20px; }
.moods-row { display: flex; flex-wrap: wrap; gap: 14px 6px; }
.mood-chip-wrap { position: relative; display: inline-flex; }
.mood-chip {
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: 62px; cursor: pointer;
  background: none; border: 0; padding: 0; font: 400 12px/1.1 var(--ui); color: var(--muted);
}
.mood-chip i {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--frost-line);
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--kc) calc(30% + var(--lv) * 70%), transparent), rgba(255,236,222,.05) 72%);
  box-shadow: 0 0 calc(var(--lv) * 18px) calc(var(--lv) * 2px) color-mix(in srgb, var(--kc) 55%, transparent);
  transition: transform .2s;
}
.mood-chip:hover i { transform: scale(1.06); }
.mood-chip[aria-pressed="true"] { color: var(--ink); }
.mood-chip[aria-pressed="true"] i { border-color: var(--glow); outline: 1px solid rgba(255,210,154,.5); outline-offset: 3px; }
.mood-del {
  position: absolute; top: -4px; right: 2px; width: 18px; height: 18px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1px solid var(--frost-line); background: #4a3646; color: var(--muted); font-size: 12px; line-height: 1;
}
.mood-del:hover { color: var(--ink); }
.mood-add i { background: none; border-style: dashed; box-shadow: none; display: grid; place-items: center; }
.mood-add i::after { content: '+'; font: 300 22px/1 var(--display); color: var(--muted); }
.save-mood { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.save-mood input { flex: 1; min-width: 0; background: rgba(30,20,28,.35); border: 1px solid var(--frost-line); border-radius: 6px; padding: 9px 12px; font-size: 14px; }
.save-mood[hidden] { display: none; }

/* lamp rows */
.fixtures { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 2px; }
.fx { --kc: #fff; padding: 12px 12px 8px; border-radius: 10px; border: 1px solid transparent; }
.fx + .fx { border-top-color: rgba(255,226,205,.08); }
.fx.selected { background: var(--frost); border-color: rgba(255,210,154,.45); }
.fx-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fx-name { all: unset; cursor: pointer; font: 400 18px/1.15 var(--display); display: flex; flex-direction: column; }
.fx-name small { font: 300 12px/1.4 var(--ui); color: var(--faint); }
.fx-name:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; border-radius: 4px; }
/* a rocker switch whose lens lights in the lamp's colour */
.switch { position: relative; width: 46px; height: 26px; border-radius: 6px; border: 1px solid var(--frost-line); background: rgba(30,20,28,.35); cursor: pointer; flex: none; }
.switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 4px; background: rgba(255,226,205,.28); transition: transform .2s, background-color .2s, box-shadow .2s; }
.switch[aria-checked="true"] span { transform: translateX(20px); background: var(--kc); box-shadow: 0 0 10px 2px color-mix(in srgb, var(--kc) 60%, transparent); }
.slider { display: grid; grid-template-columns: 70px 1fr 54px; align-items: center; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--faint); }
.slider output { text-align: right; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.fx.off .slider output.o-b { color: var(--faint); }
/* sliders are filaments: a thin line that glows as far as it is lit */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; cursor: pointer; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; border-radius: 1px; background: linear-gradient(90deg, var(--glow, #fff) var(--fill, 50%), rgba(255,226,205,.18) var(--fill, 50%)); box-shadow: 0 0 6px -1px var(--glow, transparent); }
input[type=range]::-moz-range-track { height: 2px; border-radius: 1px; background: linear-gradient(90deg, var(--glow, #fff) var(--fill, 50%), rgba(255,226,205,.18) var(--fill, 50%)); }
input[type=range].kelvin::-webkit-slider-runnable-track { background: var(--kgrad); box-shadow: none; }
input[type=range].kelvin::-moz-range-track { background: var(--kgrad); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; border-radius: 50%; background: #fff8ef; box-shadow: 0 0 0 4px rgba(61,45,60,.9), 0 0 10px 2px rgba(255,236,222,.4); }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff8ef; box-shadow: 0 0 0 4px rgba(61,45,60,.9); }
.fx.off input.r-b::-webkit-slider-runnable-track { background: rgba(255,226,205,.18); box-shadow: none; }
.fx.off input.r-b::-moz-range-track { background: rgba(255,226,205,.18); }

/* Relight */
.levels { list-style: none; display: flex; gap: calc(28px * var(--zoom)); padding: calc(26px * var(--zoom)) var(--side) 0; margin: 0; overflow-x: auto; scrollbar-width: none; }
.levels::-webkit-scrollbar { display: none; }
.level {
  display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: left; white-space: nowrap;
  background: none; border: 0; padding: 6px 0; color: var(--muted);
}
.level::before { content: ''; width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--frost-line); flex: none; }
.level.current { color: var(--ink); }
.level.current::before { background: var(--glow); border-color: var(--glow); box-shadow: 0 0 10px 2px rgba(255,210,154,.6); }
.level:disabled { cursor: default; opacity: .45; }
.level-name { font: 400 18px/1.1 var(--display); }
.level-stars { display: flex; gap: 4px; font-size: 12px; color: var(--faint); }
.star { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--faint); }
.star.on { background: var(--glow); border-color: var(--glow); box-shadow: 0 0 6px var(--glow); }
/* the photo: the same room, small and without a frame, at the top right (placed from js/app.js) */
.target {
  position: absolute; z-index: 3; left: 0; top: 0; display: flex; flex-direction: column; align-items: flex-end;
  padding: 0; border: 0; color: inherit; background: none; cursor: zoom-in;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.target img { display: block; width: 100%; pointer-events: none; }
.target span { height: calc(24px * var(--zoom)); padding-top: calc(4px * var(--zoom)); font-size: calc(12px * var(--zoom)); line-height: calc(20px * var(--zoom)); color: var(--muted); white-space: nowrap; }
.target span em { font-style: normal; }
.target.pressed { opacity: 0; }
.target-full { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.view.comparing > .view-canvas { visibility: hidden; }
.brief { margin-top: 8px; color: var(--muted); font-size: 14px; }
.game-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 16px; }
.game-actions .btn[hidden], .result-actions .btn[hidden] { display: none; }
.result { margin-top: 16px; padding: 16px; border-radius: 10px; background: rgba(255,210,154,.1); border: 1px solid rgba(255,210,154,.35); }
.result[hidden] { display: none; }
.result-score { font: 300 34px/1.1 var(--display); }
.result-stars { display: flex; gap: 6px; margin: 8px 0; }
.result-stars .star { width: 12px; height: 12px; }
.result-actions { display: flex; gap: 16px; align-items: center; margin-top: 14px; }

/* the lamps, each drawn as the light it gives */
.lamps { list-style: none; margin: calc(44px * var(--zoom)) 0 0; padding: 0 var(--side); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: calc(28px * var(--zoom)); }
.lamp h3 { font: 400 22px/1.15 var(--display); margin-top: 18px; }
.lamp p { color: var(--muted); font-size: 14px; margin-top: 6px; min-height: 3.1em; }
.lamp dl { margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: 13px; }
.lamp dl div { border-top: 1px solid rgba(255,226,205,.12); padding-top: 6px; }
.lamp dt { color: var(--faint); font-size: 11px; }
.lamp dd { margin: 0; font-variant-numeric: tabular-nums; }
.beam { position: relative; display: block; height: 150px; border-radius: 8px; overflow: hidden; background: rgba(30,20,28,.3); border: 1px solid rgba(255,226,205,.08); }
.beam i {
  position: absolute; inset: 0; display: block;
  background: radial-gradient(ellipse 70% 95% at 50% 6%, rgba(255,214,160,.85), rgba(255,190,120,.25) 55%, transparent 80%);
  clip-path: polygon(50% 6%, calc(50% - var(--half)) 100%, calc(50% + var(--half)) 100%);
}
.beam::before { content: ''; position: absolute; z-index: 1; left: 50%; top: 6%; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); background: #fff4e2; box-shadow: 0 0 14px 4px rgba(255,214,160,.8); }
.lamp-table .beam i { clip-path: none; background: radial-gradient(circle at 50% 50%, rgba(255,214,160,.8), rgba(255,190,120,.22) 38%, transparent 62%); }
.lamp-table .beam::before { top: 50%; }
.lamp-strip .beam i { clip-path: none; background: radial-gradient(ellipse 90% 85% at 50% 6%, rgba(255,214,160,.8), rgba(255,190,120,.2) 50%, transparent 78%); }
.lamp-strip .beam::before { width: 70%; height: 4px; border-radius: 2px; }

.foot { padding: 40px var(--side) 110px; color: var(--faint); font-size: 13px; }

/* ---------- wide screens: the app and Relight each fit one screen ----------
   the room fills the whole section and the heading, the levels and the panel float over it. The section is one
   screen tall and only grows when a panel needs more height than the screen has */
@media (min-width: 961px) {
  .app, .relight { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; min-height: 100svh; padding: calc(28px * var(--zoom)) 0 16px; }
  .app .stage, .relight .stage { display: contents; }
  .app .stage-view, .relight .stage-view { grid-area: auto; position: absolute; inset: 0; }
  .app .stage .view, .relight .stage .view { height: 100%; min-height: 0; }
  .app .sec-head, .relight .sec-head, .levels { position: relative; z-index: 3; pointer-events: none; }
  .levels button { pointer-events: auto; }
  .levels { padding-top: calc(14px * var(--zoom)); }
  /* the app panel sits on the left under the heading, its left edge on the page's gutter, as in Relight */
  #appPanel { grid-area: auto; justify-self: start; margin: 16px 0 0 calc(var(--side) / var(--zoom)); }
  #gamePanel { grid-area: auto; margin-top: 8px; }
  /* compact lamp rows and one row of moods, so a whole panel fits beside the room */
  .panel { padding: 20px; }
  .moods { margin-top: 16px; }
  .moods-row { gap: 12px 6px; }
  .mood-chip { width: 52px; }
  .fixtures { margin-top: 12px; }
  .fx { padding: 8px 12px 4px; }
  .fx-name { flex-direction: row; align-items: baseline; gap: 8px; }
  .slider { margin-top: 0; }
  .fx input[type=range] { height: 22px; }
  .game-actions { margin-top: 12px; }
  /* once scored, the score takes the lamps' place; Keep adjusting brings them back */
  #gamePanel.scored .fixtures, #gamePanel.scored .game-actions { display: none; }
}
/* short wide screens (768 px laptops): a little less air around the heading and in the lamp rows */
@media (min-width: 961px) and (max-height: 820px) {
  .app, .relight { padding-top: calc(18px * var(--zoom)); }
  .app .sec-head h2, .relight .sec-head h2 { font-size: clamp(30px, 3.2vw, 48px); }
  .app .sec-head p, .relight .sec-head p { margin-top: 6px; font-size: 15px; }
  #appPanel { margin-top: 10px; }
  .levels { padding-top: calc(8px * var(--zoom)); }
  .panel { padding: 16px; }
  .fx { padding: 6px 12px 2px; }
}

/* ---------- narrower screens: the room above, the app below it ---------- */
@media (max-width: 1200px) {
  .lamps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 44px; }
}
@media (max-width: 960px) {
  .hero-copy { top: 92px; }
  .hero h1 { font-size: clamp(42px, 6.2vw, 60px); white-space: normal; max-width: 15em; text-align: left; }
  .a-wide { display: none; }
  .a-narrow { display: inline; }
  .word { justify-items: start; }
  .stage { display: block; }
  .stage .view { height: auto; min-height: 0; aspect-ratio: 4 / 3; }
  /* the app's room is cut to the room's own shape (the front view is wide and low), so the panel gets more of the screen */
  #appView { aspect-ratio: 16 / 9; }
  /* the room stays in normal flow (no backdrop behind it, so the page's gradient runs on unbroken);
     the panel under it scrolls on its own, so room and controls fit on one screen together (zoomed: divided back out) */
  .panel { width: auto; margin: 8px calc(var(--side) / var(--zoom)) 0;
    max-height: calc(max(300px, 100svh - 75vw - 110px) / var(--zoom)); overflow: auto; overscroll-behavior: contain; }
  #appPanel { max-height: calc(max(300px, 100svh - 56.25vw - 110px) / var(--zoom)); }
}
@media (max-width: 600px) {
  .logo { top: calc(20px * var(--zoom)); font-size: calc(27px * var(--zoom)); }
  .hero { min-height: 540px; }
  .hero-copy { top: 70px; }
  .hero h1 { font-size: calc(42px * var(--zoom)); }
  .lead { font-size: 15px; margin-bottom: 16px; }
  .hero-foot { flex-direction: column-reverse; align-items: flex-start; gap: 16px; bottom: 96px; }
  .target span em { display: none; }
  .mood-name { min-width: 0; text-align: left; font-size: 17px; }
  .kscale { width: 110px; }
  .app, .relight, .kit { padding-top: 84px; }
  .sec-head h2 { font-size: 32px; }
  .sec-head p { font-size: 15px; }
  .panel { padding: 16px; border-radius: 14px; }
  .slider { grid-template-columns: 64px 1fr 50px; }
  /* phones: compact lamp rows (the product name beside the lamp's) and all the moods on one row */
  .moods { margin-top: 12px; }
  .moods-row { flex-wrap: nowrap; justify-content: space-between; gap: 6px; }
  .mood-chip { width: 46px; gap: 6px; }
  .mood-chip i { width: 40px; height: 40px; }
  .fixtures { margin-top: 10px; }
  .fx { padding: 6px 8px 2px; }
  .fx-name { flex-direction: row; align-items: baseline; gap: 8px; }
  .slider { margin-top: 0; }
  .fx input[type=range] { height: 22px; }
  .game-actions { margin-top: 10px; }
  /* the photos to recreate in two columns, so none is cut off at the edge */
  .levels { display: grid; grid-template-columns: 1fr 1fr; gap: calc(4px * var(--zoom)) calc(16px * var(--zoom)); overflow: visible; }
  .level { white-space: normal; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
  .level::before { align-self: center; }
  .level-name { font-size: 16px; flex: 1; }
  .level-stars { flex-basis: 100%; padding-left: 20px; }
  .lamps { grid-template-columns: 1fr 1fr; gap: 32px 16px; }
  .beam { height: 110px; }
  .plate { bottom: 12px; width: calc(100% - 24px); justify-content: space-between; }
  .plate a { padding: calc(9px * var(--zoom)) calc(10px * var(--zoom)); font-size: calc(13px * var(--zoom)); gap: calc(7px * var(--zoom)); }
}
