
  /* Layout: a painted green wall. Two arched niches sit side by side, each with a moulded
     plaster surround, thin wooden shelves, a stone sill, a brass name plate below and a
     brass picture lamp above that lights up in the evening. Free places on the shelves
     wait for the next apps. A slim wainscot closes the wall at the bottom. */
  :root {
    --wall: #627f6b;
    --wall-hi: #7a9783;
    --wall-lo: #4d6857;
    --mould: #7f9c87;
    --niche-top: #283a2f;
    --niche: #3b5545;
    --ink: #fbf7ee;
    --ink-soft: rgb(251 247 238 / 0.74);
    --ink-faint: rgb(251 247 238 / 0.5);
    --plank-back: #b07a48;
    --plank-front: #c99060;
    --edge: #f0c898;
    --lip-top: #a46f3e;
    --lip-bottom: #6e4724;
    --stone-hi: #efe9dc;
    --stone-lo: #bdb4a3;
    --brass-hi: #f7e2a6;
    --brass: #caa155;
    --brass-lo: #7d5b20;
    --brass-ink: #3e2b0c;
    --panel-wood: #3f2a1b;
    --panel-wood-hi: #5f432c;
    --panel: #fbf6ef;
    --panel-text: #2b1d12;
    --panel-soft: #7a6655;
    --panel-line: rgb(43 29 18 / 0.14);
    --glow: rgb(255 220 160 / 0.6);
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-text: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --icon: 64px;
    --col: calc(var(--icon) + 52px);
    --row: calc(var(--icon) + 64px);
    --plank: 14px;
    --lip: 12px;
    --pad: 24px;
    --arch: 150px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --wall: #1f2c26; --wall-hi: #283830; --wall-lo: #141c18; --mould: #2c3d35;
      --niche-top: #0d130f; --niche: #17211b;
      --plank-back: #6a4528; --plank-front: #7d5230; --edge: #a8774c; --lip-top: #5a3a20; --lip-bottom: #34210f;
      --stone-hi: #9a9488; --stone-lo: #6a655b;
      --panel-wood: #22160d; --panel-wood-hi: #382618;
      --panel: #1f150e; --panel-text: #f5ece2; --panel-soft: #b5a493; --panel-line: rgb(245 236 226 / 0.14);
      color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --wall: #1f2c26; --wall-hi: #283830; --wall-lo: #141c18; --mould: #2c3d35;
    --niche-top: #0d130f; --niche: #17211b;
    --plank-back: #6a4528; --plank-front: #7d5230; --edge: #a8774c; --lip-top: #5a3a20; --lip-bottom: #34210f;
    --stone-hi: #9a9488; --stone-lo: #6a655b;
    --panel-wood: #22160d; --panel-wood-hi: #382618;
    --panel: #1f150e; --panel-text: #f5ece2; --panel-soft: #b5a493; --panel-line: rgb(245 236 226 / 0.14);
    color-scheme: dark;
  }

  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  html { background: var(--wall); }
  body {
    margin: 0;
    background: var(--wall);
    color: var(--ink);
    font: 16px/1.5 var(--font-text);
    -webkit-font-smoothing: antialiased;
    transition: background 0.8s var(--ease);
  }

  /* ---------- Room ---------- */
  .room {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
  }
  .wall {
    position: relative;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    padding-block: 28px 30px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    /* Ceiling wash, roller-painted plaster, darker corners. */
    background:
      radial-gradient(70% 45% at 50% -10%, rgb(255 238 205 / 0.16), transparent 70%),
      radial-gradient(140% 100% at 50% 45%, transparent 58%, rgb(0 0 0 / 0.24) 100%),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.011 0.032' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E") 0 0 / 420px 420px,
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 220px 220px,
      linear-gradient(var(--wall-hi), var(--wall) 45%, var(--wall-lo));
  }

  /* ---------- Title ---------- */
  .expo { text-align: center; animation: rise 1s var(--ease) backwards; }
  .expo__kicker {
    margin: 0 0 8px;
    color: var(--ink-soft);
    font-size: 11px; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase;
  }
  .expo__title {
    margin: 0;
    font: 300 clamp(30px, 3.2vw, 44px)/1.05 var(--font-display);
    letter-spacing: -0.01em;
    text-wrap: balance;
  }
  .expo__title em { font-style: italic; font-weight: 400; }

  /* ---------- Niches ---------- */
  .hang {
    flex: 1 0 auto;
    display: grid;
    justify-content: center;
    align-content: center;
    gap: 64px;
    padding-top: 26px;
  }
  .piece {
    position: relative;
    display: grid;
    justify-items: center;
    margin: 0;
    padding-top: 36px; /* room for the lamp */
    --delay: 0.25s;
  }
  .piece--cargo { --delay: 0.4s; }

  /* Warm pool of light the lamp throws on the wall around the niche. */
  .piece::before {
    content: "";
    position: absolute; top: -60px; left: 50%;
    width: 150%; height: 95%;
    transform: translateX(-50%);
    /* closest-side keeps the glow inside its box, so no edge ever shows. */
    background: radial-gradient(closest-side at 50% 36%, rgb(255 220 160 / 0.3), rgb(255 220 160 / 0.08) 60%, transparent);
    pointer-events: none;
    transition: opacity 0.5s var(--ease);
    animation: lamp-on 1.4s steps(1) backwards;
  }

  /* Basket-handle arch: a tall ellipse that leaves the side walls smoothly. It reaches into
     the free space above the top row of icons, so it adds no height. */
  .niche {
    position: relative;
    isolation: isolate;
    padding: 50px var(--pad) 38px;
    border-radius: 50% 50% 6px 6px / var(--arch) var(--arch) 6px 6px;
    /* Recess with real depth: a soffit shadow under the arch, two side walls with a crisp
       edge where they meet the back wall, and a floor catching a little light. */
    background:
      linear-gradient(rgb(0 0 0 / 0.5), rgb(0 0 0 / 0.18) 46px, transparent 120px),
      linear-gradient(90deg, rgb(255 255 255 / 0.07), rgb(255 255 255 / 0.02) 15px, rgb(0 0 0 / 0.38) 16px, transparent 46px),
      linear-gradient(270deg, rgb(0 0 0 / 0.26), rgb(0 0 0 / 0.16) 15px, rgb(0 0 0 / 0.42) 16px, transparent 46px),
      linear-gradient(to top, rgb(255 255 255 / 0.07), rgb(0 0 0 / 0.32) 16px, transparent 36px),
      linear-gradient(var(--niche-top), var(--niche) 40%),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 260px 260px;
    background-blend-mode: normal, normal, normal, normal, normal, normal;
    /* Moulded plaster surround in relief, following the arch. */
    box-shadow:
      inset 0 30px 40px -14px rgb(0 0 0 / 0.62),
      inset 18px 0 24px -12px rgb(0 0 0 / 0.4),
      inset -18px 0 24px -12px rgb(0 0 0 / 0.34),
      inset 0 -14px 20px -12px rgb(0 0 0 / 0.4),
      0 0 0 1px rgb(0 0 0 / 0.4),
      0 0 0 10px var(--mould),
      /* Bevelled surround: lit on the upper left, shaded on the lower right. */
      -1px -2px 0 10px rgb(255 255 255 / 0.18),
      1px 2px 0 10px rgb(0 0 0 / 0.22),
      0 0 0 11px rgb(0 0 0 / 0.22),
      0 0 0 14px rgb(255 255 255 / 0.05),
      0 34px 44px -26px rgb(0 0 0 / 0.6);
    transition: background 0.8s var(--ease), box-shadow 0.8s var(--ease);
    animation: rise 0.9s var(--ease) backwards;
    animation-delay: var(--delay);
  }
  /* Light falling into the niche from the lamp. */
  .niche::after {
    content: "";
    position: absolute; inset: 0;
    z-index: 3;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(62% 70% at 50% 0%, var(--glow), rgb(255 220 160 / 0.1) 60%, transparent 100%);
    mix-blend-mode: soft-light;
    transition: opacity 0.5s var(--ease);
    animation: lamp-on 1.4s steps(1) backwards;
  }

  /* Stone sill under each niche, then a brass name plate fixed to the wall. */
  .sill {
    position: relative; z-index: 2;
    width: calc(100% + 42px);
    height: 15px;
    margin-top: -6px;
    border-radius: 2px;
    background: linear-gradient(var(--stone-hi), var(--stone-lo));
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.5), 0 8px 12px -4px rgb(0 0 0 / 0.38);
    transition: background 0.8s var(--ease);
    animation: rise 0.9s var(--ease) backwards;
    animation-delay: var(--delay);
  }
  .plaque {
    position: relative;
    margin: 16px 0 0;
    padding: 5px 24px 6px;
    border-radius: 3px;
    background:
      linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 0.32) 46%, transparent 60%),
      linear-gradient(var(--brass-hi), var(--brass) 55%, var(--brass-lo));
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.55), inset 0 -1px 0 rgb(0 0 0 / 0.25), 0 2px 3px rgb(0 0 0 / 0.3), 0 8px 16px rgb(0 0 0 / 0.18);
    color: var(--brass-ink);
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
    text-shadow: 0 1px 0 rgb(255 240 200 / 0.6);
    white-space: nowrap;
    animation: rise 0.9s var(--ease) backwards;
    animation-delay: calc(var(--delay) + 0.15s);
  }
  .plaque::before, .plaque::after {
    content: "";
    position: absolute; top: 50%;
    width: 5px; height: 5px; margin-top: -2.5px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff3cf, #9a783a 70%);
    box-shadow: 0 0.5px 1px rgb(0 0 0 / 0.4);
  }
  .plaque::before { left: 8px; }
  .plaque::after { right: 8px; }

  /* ---------- Shelves inside a niche ---------- */
  .shelf {
    position: relative;
    z-index: 1;
    list-style: none;
    margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(3, var(--col));
    grid-auto-rows: var(--row);
  }
  /* One tile per row: bare back wall, then the plank top (darker at the back), its lit
     front edge, the front lip and its hard underside. Planks run wall to wall. */
  .shelf__planks, .shelf__shade {
    position: absolute;
    left: calc(-1 * var(--pad)); right: calc(-1 * var(--pad));
    pointer-events: none;
    z-index: -1;
  }
  .shelf__planks {
    top: 0; bottom: 0;
    background:
      linear-gradient(90deg, rgb(0 0 0 / 0.42), transparent 4%, transparent 96%, rgb(0 0 0 / 0.42)),
      linear-gradient(to bottom,
        transparent 0,
        transparent calc(var(--row) - var(--lip) - var(--plank) - 10px),
        rgb(0 0 0 / 0.22) calc(var(--row) - var(--lip) - var(--plank)),
        var(--plank-back) calc(var(--row) - var(--lip) - var(--plank)),
        var(--plank-front) calc(var(--row) - var(--lip) - 1px),
        var(--edge) calc(var(--row) - var(--lip) - 1px),
        var(--edge) calc(var(--row) - var(--lip)),
        var(--lip-top) calc(var(--row) - var(--lip)),
        var(--lip-bottom) calc(var(--row) - 1px),
        rgb(0 0 0 / 0.55) calc(var(--row) - 1px)
      ) 0 0 / 100% var(--row) repeat-y;
    -webkit-mask: linear-gradient(to bottom, transparent calc(var(--row) - var(--lip) - var(--plank) - 10px), #000 calc(var(--row) - var(--lip) - var(--plank) - 10px)) 0 0 / 100% var(--row) repeat-y;
    mask: linear-gradient(to bottom, transparent calc(var(--row) - var(--lip) - var(--plank) - 10px), #000 calc(var(--row) - var(--lip) - var(--plank) - 10px)) 0 0 / 100% var(--row) repeat-y;
  }
  /* Grain on the planks. */
  .shelf__planks::after {
    content: "";
    position: absolute; inset: 0;
    opacity: 0.5;
    mix-blend-mode: multiply;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.003 0.2' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.25 0 0 0 0 0.12 0.9 0 0 0 -0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E") 0 0 / 1600px 300px;
  }
  /* Shadow each plank casts on the back wall below it, from the second row down. */
  .shelf__shade {
    top: var(--row); bottom: -18px;
    background: linear-gradient(rgb(0 0 0 / 0.5), rgb(0 0 0 / 0.16) 10px, transparent 30px) 0 0 / 100% var(--row) repeat-y;
  }

  .slot {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: calc(var(--lip) + var(--plank) * 0.75);
  }
  .slot:not(.slot--empty)::after {
    content: "";
    position: absolute; left: 50%;
    bottom: calc(var(--lip) + var(--plank) * 0.75 - 4px);
    width: calc(var(--icon) * 1.04); height: 8px;
    transform: translateX(-50%);
    background: radial-gradient(closest-side, rgb(0 0 0 / 0.55), transparent);
    transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
    animation: fade 0.6s var(--ease) backwards;
    animation-delay: calc(0.7s + var(--i, 0) * 60ms);
  }
  .app {
    position: relative; z-index: 4;
    display: block;
    width: var(--icon);
    aspect-ratio: 1 / 1;
    border-radius: 22.5%;
    overflow: hidden;
    background: #1b130c;
    box-shadow: 0 1px 1px rgb(0 0 0 / 0.3), 0 2px 5px rgb(0 0 0 / 0.22);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.55s var(--ease), box-shadow 0.55s var(--ease);
    animation: drop 0.7s var(--ease) backwards;
    animation-delay: calc(0.7s + var(--i, 0) * 60ms);
  }
  .app img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); }
  .app::after {
    content: "";
    position: absolute; inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 0.2), inset 0 1px 0 rgb(255 255 255 / 0.16);
    pointer-events: none;
  }
  @media (hover: hover) {
    .app:hover {
      transform: translateY(-10px);
      box-shadow: 0 2px 4px rgb(0 0 0 / 0.2), 0 28px 32px -18px rgb(0 0 0 / 0.6);
    }
    .slot:has(.app:hover)::after { opacity: 0.75; transform: translateX(-50%) scale(0.86, 1.5); }
  }
  .app:active { transform: scale(0.95); transition-duration: 0.15s; }
  .app:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }

  .slot__name {
    position: absolute; left: 0; right: 0;
    top: calc(100% + 8px);
    z-index: 4;
    padding-inline: 2px;
    color: var(--ink-soft);
    font-size: 11.5px; font-weight: 500; line-height: 1.2;
    text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    pointer-events: none;
    animation: fade 0.6s var(--ease) backwards;
    animation-delay: calc(0.85s + var(--i, 0) * 60ms);
  }

  .tip {
    position: absolute; z-index: 8;
    bottom: calc(100% - 20px); left: 50%;
    width: max-content; max-width: 230px;
    transform: translate(-50%, 6px);
    padding: 10px 13px;
    border-radius: 12px;
    background: var(--panel); color: var(--panel-text);
    box-shadow: 0 12px 30px rgb(0 0 0 / 0.32);
    font-size: 12.5px; line-height: 1.45;
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
    pointer-events: none;
  }
  .tip strong { display: block; font-size: 13.5px; font-weight: 600; }
  .tip span { display: block; color: var(--panel-soft); }
  .slot:has(.app:hover) .tip, .slot:has(.app:focus-visible) .tip { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

  /* ---------- Brass picture lamp above each niche ---------- */
  .lamp {
    position: absolute; z-index: 6;
    top: 6px; left: 50%;
    width: 120px; height: 24px;
    transform: translateX(-50%);
    pointer-events: none;
  }
  .lamp::before {
    content: "";
    position: absolute; left: 50%; top: 0;
    width: 20px; height: 10px; margin-left: -10px;
    border-radius: 5px;
    background: linear-gradient(var(--brass-hi), var(--brass-lo));
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.35);
  }
  .lamp__arm {
    position: absolute; left: 50%; top: 7px;
    width: 4px; height: 8px; margin-left: -2px;
    background: linear-gradient(90deg, var(--brass-lo), var(--brass-hi), var(--brass));
  }
  .lamp__shade {
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 11px;
    border-radius: 6px 6px 3px 3px;
    background: linear-gradient(var(--brass-hi), var(--brass) 50%, var(--brass-lo));
    box-shadow: 0 2px 4px rgb(0 0 0 / 0.35), inset 0 1px 0 rgb(255 255 255 / 0.55);
  }
  .lamp__shade::after {
    content: "";
    position: absolute; left: 10%; right: 10%; bottom: -2px;
    height: 2px; border-radius: 0 0 2px 2px;
    background: #fff3d2;
    box-shadow: 0 0 8px 2px var(--glow);
    transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
    animation: bulb 1.4s steps(1) backwards;
  }
  /* Cone of light from the shade, widening down into the niche with soft edges. */
  .lamp__beam {
    position: absolute;
    top: 14px; left: 50%;
    width: 520px; height: 460px;
    transform: translateX(-50%);
    background: radial-gradient(60% 80% at 50% 0%, var(--glow), rgb(255 220 160 / 0.14) 60%, transparent 100%);
    -webkit-mask: conic-gradient(from 132deg at 50% -24px, transparent 0deg, #000 20deg, #000 76deg, transparent 96deg);
    mask: conic-gradient(from 132deg at 50% -24px, transparent 0deg, #000 20deg, #000 76deg, transparent 96deg);
    mix-blend-mode: screen;
    pointer-events: none;
    transition: opacity 0.5s var(--ease);
    animation: lamp-on 1.4s steps(1) backwards;
  }
  /* A few specks of dust drifting in the light. */
  .dust { position: absolute; top: 30px; left: 50%; width: 220px; height: 280px; margin-left: -110px; overflow: hidden; pointer-events: none; z-index: 5; transition: opacity 0.5s var(--ease); }
  .dust span { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: rgb(255 240 210 / 0.85); animation: drift 10s linear infinite; }
  .dust span:nth-child(1) { left: 22%; top: 18%; animation-delay: -1s; }
  .dust span:nth-child(2) { left: 48%; top: 52%; animation-delay: -5s; animation-duration: 13s; }
  .dust span:nth-child(3) { left: 70%; top: 26%; animation-delay: -7s; }
  .dust span:nth-child(4) { left: 60%; top: 70%; animation-delay: -3s; animation-duration: 15s; }

  /* Lamps off in daylight: no beam, no glow, grey bulb. */
  :root[data-lamps="off"] .lamp__beam,
  :root[data-lamps="off"] .niche::after,
  :root[data-lamps="off"] .piece::before,
  :root[data-lamps="off"] .dust { opacity: 0; animation: none; }
  :root[data-lamps="off"] .lamp__shade::after { background: #9a9283; box-shadow: none; animation: none; }
  :root.lamps-flicker .lamp__beam,
  :root.lamps-flicker .niche::after,
  :root.lamps-flicker .piece::before { animation: lamp-on 0.9s steps(1) backwards; }
  :root.lamps-flicker .lamp__shade::after { animation: bulb 0.9s steps(1) backwards; }

  /* ---------- Wainscot and controls ---------- */
  .wainscot {
    padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
    border-top: 6px solid transparent;
    border-image: linear-gradient(var(--panel-wood-hi), #8a6443 35%, var(--panel-wood)) 1;
    background:
      linear-gradient(rgb(0 0 0 / 0.35), transparent 10px),
      repeating-linear-gradient(90deg, rgb(255 255 255 / 0.025) 0 3px, transparent 3px 9px),
      linear-gradient(var(--panel-wood-hi), var(--panel-wood));
    transition: background 0.8s var(--ease);
  }
  .wainscot__panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; max-width: 1300px; margin: 0 auto; }
  .wainscot__panel {
    height: 20px;
    border-radius: 2px;
    box-shadow: inset 1px 1px 0 rgb(255 255 255 / 0.1), inset -1px -1px 0 rgb(0 0 0 / 0.4), inset 0 0 0 4px var(--panel-wood), inset 5px 5px 0 0 rgb(0 0 0 / 0.28);
  }
  .skirting { height: 10px; background: linear-gradient(#1c120a, var(--panel-wood) 40%, #1c120a); }
  .floor {
    height: 16px;
    background:
      linear-gradient(rgb(0 0 0 / 0.45), transparent 12px),
      repeating-linear-gradient(90deg, transparent 0 118px, rgb(0 0 0 / 0.35) 118px 120px),
      linear-gradient(#8a5d36, #5f3d1f);
  }

  .controls {
    position: fixed; z-index: 15;
    right: max(18px, env(safe-area-inset-right, 0px));
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    display: flex; align-items: flex-end; gap: 14px;
  }
  .chip {
    width: 32px; height: 32px;
    margin-bottom: 18px;
    border: 0; border-radius: 50%;
    background: rgb(0 0 0 / 0.28);
    color: var(--ink-soft);
    font: 600 13px/1 var(--font-text);
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.3s var(--ease), color 0.3s var(--ease);
  }
  .chip:hover { background: rgb(0 0 0 / 0.42); color: var(--ink); }
  .chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
  .switch { display: grid; justify-items: center; gap: 7px; }
  /* Aged brass plate, bevelled and screwed to the wall, with a period toggle lever. */
  .switch__plate {
    position: relative;
    width: 46px; height: 76px;
    display: grid; place-items: center;
    border-radius: 7px;
    background:
      repeating-linear-gradient(90deg, rgb(255 255 255 / 0.05) 0 1px, transparent 1px 3px),
      linear-gradient(100deg, transparent 25%, rgb(255 255 255 / 0.28) 45%, transparent 60%),
      linear-gradient(var(--brass-hi), var(--brass) 55%, var(--brass-lo));
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 0.6),
      inset 0 -1px 0 rgb(0 0 0 / 0.3),
      inset 0 0 0 3px rgb(255 255 255 / 0.08),
      0 0 0 1px rgb(60 40 10 / 0.35),
      0 2px 3px rgb(0 0 0 / 0.3),
      0 10px 20px rgb(0 0 0 / 0.28);
    transition: box-shadow 0.5s var(--ease);
  }
  /* Slotted screws top and bottom. */
  .switch__plate::before, .switch__plate::after {
    content: "";
    position: absolute; left: 50%;
    width: 6px; height: 6px; margin-left: -3px;
    border-radius: 50%;
    background:
      linear-gradient(35deg, transparent 43%, rgb(60 40 10 / 0.75) 43% 57%, transparent 57%),
      radial-gradient(circle at 35% 30%, #fff4d2, #9c7a3a 72%);
    box-shadow: 0 0.5px 1px rgb(0 0 0 / 0.45);
  }
  .switch__plate::before { top: 7px; }
  .switch__plate::after { bottom: 7px; }
  /* Evening: a faint warm reflection on the plate. */
  :root:not([data-lamps="off"]) .switch__plate {
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 0.6),
      inset 0 -1px 0 rgb(0 0 0 / 0.3),
      inset 0 0 0 3px rgb(255 255 255 / 0.08),
      0 0 0 1px rgb(60 40 10 / 0.35),
      0 2px 3px rgb(0 0 0 / 0.3),
      0 0 22px rgb(255 210 140 / 0.22);
  }
  .toggle {
    position: relative;
    width: 26px; height: 40px;
    padding: 0; border: 0; background: none;
    cursor: pointer;
    perspective: 90px;
    -webkit-tap-highlight-color: transparent;
  }
  /* Round boss the lever pivots in. */
  .toggle__boss {
    position: absolute; left: 50%; top: 50%;
    width: 14px; height: 14px; margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, var(--brass-hi), var(--brass) 55%, var(--brass-lo));
    box-shadow: inset 0 -1px 1px rgb(0 0 0 / 0.35), 0 1px 2px rgb(0 0 0 / 0.4), 0 0 0 1.5px rgb(60 40 10 / 0.35);
  }
  /* Lever with an ivory tip: up in daylight, flipped down for the evening. */
  .toggle__lever {
    position: absolute; left: 50%; bottom: 50%;
    width: 4px; height: 15px; margin-left: -2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--brass-lo), var(--brass-hi) 45%, var(--brass));
    transform-origin: 50% 100%;
    transition: transform 0.28s cubic-bezier(0.5, 1.6, 0.4, 1);
    box-shadow: 1px 2px 2px rgb(0 0 0 / 0.3);
  }
  .toggle__lever::after {
    content: "";
    position: absolute; left: 50%; top: -5px;
    width: 9px; height: 9px; margin-left: -4.5px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fffdf6, #e9dfc9 60%, #b9ab8f);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.4);
  }
  .toggle[aria-pressed="true"] .toggle__lever { transform: rotateX(18deg); }
  .toggle[aria-pressed="false"] .toggle__lever { transform: rotateX(162deg); }
  .toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; border-radius: 6px; }
  .switch__label { color: var(--ink-faint); font-size: 9px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }

  /* ---------- Sheets ---------- */
  .sheet {
    position: fixed; inset: 0; z-index: 20;
    display: grid; place-items: center;
    padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    background: rgb(10 14 12 / 0.55);
    backdrop-filter: blur(8px);
    animation: fade 0.25s var(--ease) both;
  }
  .sheet__card {
    width: min(100%, 440px); max-height: 100%; overflow-y: auto;
    padding: 22px 22px 18px;
    border-radius: 20px;
    background: var(--panel); color: var(--panel-text);
    box-shadow: 0 24px 60px rgb(0 0 0 / 0.4);
    animation: pop 0.4s var(--ease) both;
  }
  .sheet__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
  .sheet__title { margin: 0; font: 500 21px/1.2 var(--font-display); }
  .sheet__close { border: 0; background: none; color: var(--panel-soft); font: 500 14px/1 var(--font-text); cursor: pointer; padding: 6px; }
  .sheet__close:focus-visible { outline: 2px solid var(--panel-text); border-radius: 6px; }
  .list { list-style: none; margin: 0; padding: 0; }
  .list__group { margin: 14px 0 4px; color: var(--panel-soft); font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
  .list__item { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--panel-line); color: inherit; text-decoration: none; }
  .list__item:hover .list__name { text-decoration: underline; }
  .list__item:focus-visible { outline: 2px solid var(--panel-text); outline-offset: 2px; border-radius: 8px; }
  .list__item img { width: 40px; height: 40px; border-radius: 22.5%; display: block; }
  .list__name { display: block; font-weight: 600; font-size: 15px; }
  .list__desc { display: block; color: var(--panel-soft); font-size: 13px; line-height: 1.4; }
  .listing { width: min(100%, 640px); padding: 26px 26px 22px; }
  /* Screenshot strip, scrolled sideways like an app store gallery. */
  .gallery {
    display: flex; gap: 12px;
    margin: 20px -26px 0; padding: 2px 26px 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 26px;
    scrollbar-width: thin;
  }
  .gallery img {
    flex: none;
    height: 340px; width: auto;
    border-radius: 18px;
    border: 1px solid var(--panel-line);
    box-shadow: 0 6px 18px rgb(0 0 0 / 0.12);
    scroll-snap-align: start;
    background: var(--panel-line);
  }
  .gallery:focus-visible { outline: 2px solid var(--panel-text); outline-offset: -2px; border-radius: 12px; }
  .gallery__note { margin: 4px 0 0; color: var(--panel-soft); font-size: 12px; }
  .listing__actions--top { margin-top: 16px; align-items: center; }
  .listing__host { color: var(--panel-soft); font-size: 13px; }
  .listing__top { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 18px; align-items: center; }
  .listing__icon { width: 104px; height: 104px; border-radius: 22.5%; display: block; box-shadow: 0 1px 2px rgb(0 0 0 / 0.2), 0 6px 16px rgb(0 0 0 / 0.14); }
  .listing__name { margin: 0; font: 500 25px/1.15 var(--font-display); text-wrap: balance; }
  .listing__sub { margin: 4px 0 0; color: var(--panel-soft); font-size: 15px; }
  .listing__badge { display: inline-block; margin-top: 10px; padding: 4px 10px; border-radius: 999px; background: var(--panel-line); color: var(--panel-soft); font-size: 12px; font-weight: 600; }
  .facts { list-style: none; margin: 22px 0 0; padding: 14px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--panel-line); }
  .facts li { display: grid; justify-items: center; gap: 2px; padding-inline: 6px; text-align: center; min-width: 0; }
  .facts li + li { border-left: 1px solid var(--panel-line); }
  .facts__label { color: var(--panel-soft); font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
  .facts__value { font: 500 20px/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
  .facts__note { color: var(--panel-soft); font-size: 11.5px; line-height: 1.3; }
  .listing__intro { margin: 18px 0 0; font-size: 15px; line-height: 1.55; }
  .listing__section { margin-top: 16px; }
  .listing__section h3 { margin: 0 0 3px; color: var(--panel-soft); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
  .listing__section p { margin: 0; font-size: 14.5px; line-height: 1.55; }
  .listing__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
  .listing__btn { display: inline-flex; align-items: center; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--panel-line); color: var(--panel-text); font-size: 14px; font-weight: 600; text-decoration: none; }
  .listing__btn--main { background: var(--panel-text); color: var(--panel); border-color: transparent; }
  .listing__btn:focus-visible { outline: 2px solid var(--panel-text); outline-offset: 2px; }
  .listing__note { margin: 10px 0 0; color: var(--panel-soft); font-size: 12.5px; }

  /* ---------- Motion ---------- */
  @keyframes drop { 0% { opacity: 0; transform: translateY(-18px); } }
  @keyframes rise { 0% { opacity: 0; transform: translateY(12px); } }
  @keyframes fade { 0% { opacity: 0; } }
  @keyframes pop { 0% { opacity: 0; transform: translateY(12px) scale(0.97); } }
  /* The lamps stutter on, like old picture lights. */
  @keyframes lamp-on { 0% { opacity: 0; } 30% { opacity: 0.5; } 36% { opacity: 0.1; } 48% { opacity: 0.7; } 54% { opacity: 0.25; } 70% { opacity: 1; } 100% { opacity: 1; } }
  @keyframes bulb { 0% { opacity: 0.2; } 30% { opacity: 1; } 36% { opacity: 0.3; } 48% { opacity: 1; } 54% { opacity: 0.4; } 70% { opacity: 1; } }
  @keyframes drift { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 0.9; } 50% { transform: translate(12px, 70px); } 85% { opacity: 0.6; } 100% { transform: translate(-6px, 150px); opacity: 0; } }

  @media (max-width: 1039px) {
    :root { --icon: clamp(54px, 15vw, 66px); --pad: 16px; --col: minmax(0, 1fr); --arch: 120px; }
    .hang { gap: 52px; grid-template-columns: minmax(0, 470px); }
    .piece { width: 100%; }
    .niche { width: min(100%, 460px); }
    .sill { width: min(calc(100% + 24px), 484px); }
    .wall { padding-bottom: 96px; }
    .tip { display: none; }
    .listing__top { grid-template-columns: 80px minmax(0, 1fr); gap: 14px; }
    .listing__icon { width: 80px; height: 80px; }
    .listing__name { font-size: 21px; }
    .listing { padding: 22px 18px 20px; }
    .gallery { margin-inline: -18px; padding-inline: 18px; scroll-padding-inline: 18px; }
    .gallery img { height: 300px; }
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
    .facts li:nth-child(3) { border-left: 0; }
    /* On phones the name is a small brass tag screwed on the plank's lip, so it belongs to its shelf. */
    :root { --row: calc(var(--icon) + 50px); }
    .slot__name {
      left: 50%; right: auto;
      top: calc(100% - var(--lip) - 2px);
      max-width: none; overflow: visible;
      padding: 2px 7px 3px;
      transform: translateX(-50%);
      border-radius: 2px;
      background: linear-gradient(var(--brass-hi), var(--brass) 55%, var(--brass-lo));
      box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.55), inset 0 -1px 0 rgb(0 0 0 / 0.2), 0 1px 2px rgb(0 0 0 / 0.5);
      color: var(--brass-ink);
      font-size: 9.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
      text-shadow: 0 1px 0 rgb(255 240 200 / 0.5);
    }
  }

  /* Desktop: the two niches side by side, same height. Icons shrink with the screen height
     and width so the whole wall stays on one screen with room to breathe. */
  @media (min-width: 1040px) {
    :root {
      --icon: clamp(48px, min(calc((100svh - 594px) / 3), calc((100vw - 300px) / 7 - 52px)), 72px);
    }
    .hang { grid-template-columns: auto auto; align-items: end; column-gap: clamp(72px, 9vw, 140px); }
    .piece--perso .shelf { grid-template-columns: repeat(4, var(--col)); }
    .piece--cargo .shelf { grid-template-columns: repeat(3, var(--col)); }
  }
  @media (min-width: 1040px) and (max-height: 760px) {
    .expo__kicker { display: none; }
    :root { --icon: clamp(44px, min(calc((100svh - 567px) / 3), calc((100vw - 300px) / 7 - 52px)), 72px); }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
  }
