/* Cinematic look test (2026-11-11): one object in empty space, text small in the corners, colour only as light. Desktop first. */
:root {
  --ink: oklch(24% 0.03 290);
  --ink-2: oklch(42% 0.03 290);
  --ground: oklch(91% 0.018 295);
  --glass: oklch(97% 0.008 295 / 0.82);
  --rule: oklch(24% 0.03 290 / 0.16);
  --font: "Manrope", ui-sans-serif, sans-serif;
  --edge: clamp(20px, 2.6vw, 40px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
:root[data-theme="dark"] {
  --ink: oklch(94% 0.015 295);
  --ink-2: oklch(72% 0.03 295);
  --ground: oklch(10% 0.04 285);
  --glass: oklch(14% 0.045 285 / 0.78);
  --rule: oklch(94% 0.015 295 / 0.14);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: oklch(94% 0.015 295); --ink-2: oklch(72% 0.03 295); --ground: oklch(10% 0.04 285);
    --glass: oklch(14% 0.045 285 / 0.78); --rule: oklch(94% 0.015 295 / 0.14);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: clip; background: var(--ground); color: var(--ink); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a, button { color: inherit; font: inherit; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

.stage { position: fixed; inset: 0; }
.stage canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.stage canvas.is-hovering { cursor: pointer; }

.corner { position: fixed; z-index: 2; margin: 0; }
.corner--tl { top: var(--edge); left: var(--edge); }
.corner--tr { top: var(--edge); right: var(--edge); display: flex; align-items: baseline; gap: 28px; }
.corner--bl { bottom: var(--edge); left: var(--edge); }
.corner--br { bottom: var(--edge); right: var(--edge); text-align: right; }

.name { font-weight: 600; font-size: 17px; text-decoration: none; letter-spacing: -0.01em; }
.corner--tl p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.corner--tr a, .corner--tr button { background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: none; font-size: 14px; font-weight: 500; }
.corner--tr a:hover, .corner--tr button:hover { text-decoration: underline; text-underline-offset: 5px; }

.hero { max-width: 30rem; transition: opacity 400ms var(--ease); }
.hero h1 { margin: 0; font-weight: 600; font-size: clamp(2.8rem, 5vw, 4.6rem); line-height: 0.98; letter-spacing: -0.035em; }
.intro { margin: 14px 0 0; max-width: 26rem; font-size: clamp(1.05rem, 1.3vw, 1.2rem); line-height: 1.4; color: var(--ink-2); text-wrap: pretty; }
.is-focused .hero, .is-focused .index, .is-focused .hint { opacity: 0; pointer-events: none; }

.hint { color: var(--ink-2); font-size: 13px; line-height: 1.45; transition: opacity 400ms var(--ease); }

.index { position: fixed; z-index: 2; right: var(--edge); top: 50%; transform: translateY(-50%); transition: opacity 400ms var(--ease); }
.index ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; justify-items: end; }
.index button { background: none; border: 0; padding: 4px 0; cursor: pointer; font-size: 13px; color: var(--ink-2); white-space: nowrap; text-shadow: 0 0 2px var(--ground), 0 0 8px var(--ground), 0 0 16px var(--ground); }
.index button:hover, .index button[aria-current="true"] { color: var(--ink); }
.index .swatch { display: none; }

.panel {
  position: fixed; z-index: 3; top: 50%; right: var(--edge); transform: translateY(-50%);
  width: min(26rem, 38vw); max-height: calc(100% - 2 * var(--edge) - 80px); overflow: auto;
  padding: 28px 30px; background: var(--glass); backdrop-filter: blur(14px);
  border: 1px solid var(--rule); border-radius: 4px; animation: in 450ms var(--ease) both;
}
@keyframes in { from { opacity: 0; transform: translate(12px, -50%); } }
.panel__close { display: block; margin-left: auto; background: none; border: 0; padding: 0; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.panel__close:hover { color: var(--ink); }
.panel h2 { margin: 0; font-weight: 600; font-size: 1.4rem; letter-spacing: -0.015em; }
.panel h2::before { content: ""; display: block; width: 28px; height: 2px; margin-bottom: 14px; background: var(--swatch); }
.panel__lead { margin: 10px 0 0; color: var(--ink-2); }
.panel__proof { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 12px; font-size: 14px; }
.panel__proof li { padding-top: 12px; border-top: 1px solid var(--rule); }

.tip { position: fixed; z-index: 4; pointer-events: none; padding: 4px 8px; font-size: 12px; background: var(--ink); color: var(--ground); transform: translate(14px, 14px); }
.whiteout { position: fixed; inset: 0; z-index: 9; background: var(--ground); opacity: 0; pointer-events: none; transition: opacity 600ms var(--ease); }
.whiteout.is-on { opacity: 1; }

/* Poster mode: a clean frame for the phone still */
.poster-mode .corner, .poster-mode .index, .poster-mode .tip { display: none; }

/* Phone: a clean page, no WebGL */
.lite-poster, .lite-list, .lite-foot { display: none; }
html:has(body.lite), body.lite { height: auto; overflow: visible; overflow-x: clip; }
.lite .stage, .lite .index, .lite .hint, .lite .panel { display: none; }
.lite .corner { position: static; }
.lite .corner--tl { padding: 24px 150px 0 20px; }
.lite .corner--tr { position: absolute; top: 24px; right: 20px; }
.lite .lite-poster { display: block; margin: 24px 0 0; }
.lite .lite-poster img { display: block; width: 100%; height: auto; }
.lite .hero { padding: 76px 20px 8px; max-width: none; }
.lite .hero h1 { font-size: 2.6rem; }
.lite .lite-list { display: block; padding: 8px 20px 0; }
.lite .lite-list section { padding: 28px 0; border-top: 1px solid var(--rule); }
.lite .lite-list h2 { margin: 0; font-weight: 600; font-size: 1.3rem; letter-spacing: -0.015em; }
.lite .lite-list h2::before { content: ""; display: block; width: 28px; height: 2px; margin-bottom: 14px; background: var(--swatch); }
.lite .lite-list p { margin: 8px 0 0; color: var(--ink-2); }
.lite .lite-list ul { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.lite .lite-list li { padding-left: 12px; border-left: 1px solid var(--rule); }
.lite .lite-foot { display: flex; gap: 28px; padding: 28px 20px 48px; border-top: 1px solid var(--rule); margin: 0 20px; padding-inline: 0; font-weight: 500; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* v8: extra nav links live in the footer on phones */
.lite .corner--tr .desk-only { display: none; }
.lite .lite-foot { flex-wrap: wrap; row-gap: 14px; }

/* Phones and narrow screens: the 3D world stays; the card floats over the top of the screen
   so the building sits in the lower half. Scrolls by touch, no visible scrollbar. */
@media (max-width: 56.25rem) {
  .corner--tr { gap: 20px; }
  .hint { display: none; }
  .panel {
    top: calc(var(--edge) + 40px); left: 12px; right: 12px; width: auto; transform: none;
    max-height: 44svh; padding: 20px 22px 36px; border-radius: 14px;
    overscroll-behavior: contain; scrollbar-width: none; touch-action: pan-y;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent);
            mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent);
    animation-name: in-top;
  }
  .panel::-webkit-scrollbar { display: none; }
  .panel__close { position: sticky; top: 0; z-index: 1; padding: 6px 14px; margin: -4px -6px 0 auto; border-radius: 999px; background: var(--ground); border: 1px solid var(--rule); }
  .panel h2 { margin-top: -18px; font-size: 1.25rem; }
  .panel__proof { margin-top: 16px; gap: 10px; }
  .panel__proof li { padding-top: 10px; }
}
@keyframes in-top { from { opacity: 0; transform: translateY(-10px); } }

/* Sky switch: the sun is eclipsed into a moon as the time-lapse runs. --t is set by world.js (0 noon, 1 night). */
.sky { background: none; border: 0; padding: 4px; margin: -4px; width: 44px; height: 44px; cursor: grab; touch-action: none; color: var(--ink); }
.sky:active { cursor: grabbing; }
.sky svg { display: block; width: 100%; height: 100%; overflow: visible; }
.sky__disc { fill: currentColor; }
.sky__shadow { fill: var(--ground); opacity: min(1, calc(var(--t, 0) * 6)); transform: translate(calc((1 - var(--t, 0)) * 16px), calc((1 - var(--t, 0)) * -6px)); }
.sky__rays { stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; opacity: calc(1 - var(--t, 0) * 1.6); transform-origin: 16px 16px; transform: rotate(calc(var(--t, 0) * 90deg)) scale(calc(1 - var(--t, 0) * 0.3)); }
.sky:hover .sky__rays { opacity: calc(1 - var(--t, 0) * 1.6); }
.is-focused .sky { opacity: 0; pointer-events: none; }
.sky { transition: opacity 400ms var(--ease); }
.lite .sky { display: none; }
body, .panel, .corner--tr a, .index button, .hero, .hint, .sky__shadow { transition: color 900ms var(--ease), background-color 900ms var(--ease), border-color 900ms var(--ease), text-shadow 900ms var(--ease), fill 900ms var(--ease); }

.hero h1, .hero .intro, .corner--tr a, .hint { text-shadow: 0 0 2px var(--ground), 0 0 10px var(--ground), 0 0 22px var(--ground); }


/* The title takes focus for screen readers; no visible box on tap. */
.panel h2:focus, .panel h2:focus-visible { outline: none; }
.index button:focus:not(:focus-visible) { outline: none; }

/* Pager: step through the buildings while a card is open (buttons, swipe, arrow keys). */
.pager {
  position: fixed; z-index: 3; bottom: var(--edge); right: calc(var(--edge) + min(26rem, 38vw) / 2); transform: translateX(50%);
  display: flex; align-items: center; gap: 2px; padding: 3px; font-size: 13px; color: var(--ink-2);
  background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--rule); border-radius: 999px;
  animation: pager-in 450ms var(--ease) both;
}
.pager[hidden] { display: none; }
.pager button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--ink); cursor: pointer; }
.pager button:hover { background: var(--rule); }
.pager span { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.pager.is-hint #pg-next svg { animation: nudge-r 900ms ease-in-out 3; }
.pager.is-hint #pg-prev svg { animation: nudge-l 900ms ease-in-out 3; }
@keyframes nudge-r { 50% { transform: translateX(4px); } }
@keyframes nudge-l { 50% { transform: translateX(-4px); } }
@keyframes pager-in { from { opacity: 0; } }
@media (max-width: 56.25rem) {
  .pager { left: 50%; right: auto; transform: translateX(-50%); bottom: calc(var(--edge) + 6px + env(safe-area-inset-bottom, 0px)); }
  .pager button { width: 46px; height: 46px; }
}

/* Time-of-day scrubber: appears under the sun while you slide it; the knob follows --t from world.js. */
.scrub {
  position: fixed; z-index: 4; top: calc(var(--edge) + 50px); left: calc(var(--edge) - 6px); width: 220px; height: 44px;
  display: flex; align-items: center; gap: 10px; padding: 0 12px; touch-action: none; cursor: ew-resize;
  background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--rule); border-radius: 999px;
  opacity: 0; transform: translateY(-6px); transition: opacity 260ms var(--ease), transform 260ms var(--ease);
}
.scrub[hidden] { display: none; }
.scrub.is-on { opacity: 1; transform: none; }
.scrub svg { flex: none; width: 16px; height: 16px; fill: var(--ink); stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; }
.scrub__moon { stroke: none !important; }
.scrub__track { position: relative; flex: 1; height: 2px; border-radius: 2px; background: var(--rule); }
.scrub__fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--t, 0) * 100%); border-radius: 2px; background: var(--ink-2); }
.scrub__knob { position: absolute; top: 50%; left: calc(var(--t, 0) * 100%); width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px var(--ground); }
.is-focused .scrub { display: none; }

/* Loader: the island's plan draws itself in fine lines while the models load, then fades as the city builds itself. */
.loader { position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 28px; background: var(--ground);
  transition: opacity 900ms var(--ease), visibility 900ms; }
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader__plan { width: min(58vw, 260px); height: auto; overflow: visible; }
.loader__plan .lp { fill: none; stroke: var(--ink); stroke-width: 0.7; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: lp-draw 1100ms cubic-bezier(.6, .1, .2, 1) var(--d, 0ms) forwards; opacity: 0.85; }
.loader__plan .lp-rim { stroke-width: 0.5; opacity: 0.45; }
.loader__plan .lp-bld { stroke-width: 0.9; }
@keyframes lp-draw { to { stroke-dashoffset: 0; } }
.loader__bar { width: 120px; height: 1px; background: var(--rule); overflow: hidden; }
.loader__bar span { display: block; height: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0.04); transition: transform 400ms var(--ease); }
@media (prefers-reduced-motion: reduce) { .loader__plan .lp { animation: none; stroke-dashoffset: 0; } }

/* Sound: a glass pill bottom right; five hairline bars dance when on and rest as dots when off. */
.snd { position: fixed; z-index: 4; right: var(--edge); bottom: var(--edge); display: inline-flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 16px 0 14px; border: 1px solid var(--rule); border-radius: 999px; background: var(--glass); backdrop-filter: blur(14px);
  color: var(--ink); font: 500 11px/1 var(--font); letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer;
  transition: opacity 400ms var(--ease), border-color 300ms var(--ease), transform 300ms var(--ease); }
.snd:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.snd__bars { display: inline-flex; align-items: center; gap: 3px; height: 14px; }
.snd__bars i { display: block; width: 2px; height: 2px; border-radius: 2px; background: currentColor; transition: height 400ms var(--ease); }
.snd.is-on .snd__bars i { animation: snd-eq 1.1s ease-in-out infinite alternate; }
.snd.is-on .snd__bars i:nth-child(2) { animation-duration: 0.8s; animation-delay: -0.3s; }
.snd.is-on .snd__bars i:nth-child(3) { animation-duration: 1.3s; animation-delay: -0.6s; }
.snd.is-on .snd__bars i:nth-child(4) { animation-duration: 0.9s; animation-delay: -0.1s; }
.snd.is-on .snd__bars i:nth-child(5) { animation-duration: 1.2s; animation-delay: -0.8s; }
@keyframes snd-eq { 0% { height: 3px; } 100% { height: 14px; } }
.snd__label { min-width: 62px; text-align: left; color: var(--ink-2); }
.snd.is-on .snd__label { color: var(--ink); }
.corner--br.hint { bottom: calc(var(--edge) + 52px); }
.is-focused .snd { opacity: 0; pointer-events: none; }
.lite .snd { display: none; }
@media (max-width: 56.25rem) { .snd { height: 34px; padding: 0 12px 0 11px; bottom: calc(var(--edge) + 50px + env(safe-area-inset-bottom, 0px)); } .snd__label { display: none; } }
@media (prefers-reduced-motion: reduce) { .snd.is-on .snd__bars i { animation: none; height: 9px; } }

/* Neighbor island link: a small glass pill that rides above the island it names. */
.nb-label { position: fixed; left: 0; top: 0; z-index: 3; display: inline-flex; align-items: center; gap: 7px; margin-top: -6px;
  padding: 6px 11px; border: 1px solid var(--rule); border-radius: 999px; background: var(--glass); backdrop-filter: blur(12px);
  color: var(--ink); font: 500 10px/1 var(--font); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 500ms var(--ease), border-color 300ms var(--ease); will-change: transform; }
.nb-label i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.nb-label span { color: var(--ink-2); }
.is-ready .nb-label.is-visible { opacity: 1; pointer-events: auto; }
.nb-label:hover, .nb-label.is-hot { border-color: var(--ink-2); }
.is-focused .nb-label, .poster-mode .nb-label, .lite .nb-label { opacity: 0 !important; pointer-events: none !important; }

/* Phones: the building list sits below the island, not over it. */
@media (max-width: 40rem) {
  .index { top: auto; bottom: calc(var(--edge) + 132px + env(safe-area-inset-bottom, 0px)); transform: none; }
  .index ol { gap: 4px; }
  .index button { font-size: 12px; padding: 3px 0; }
}
