/* ---------- Sky backdrop (drawn by fx/sky.js; this is the static fallback) ---------- */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, var(--sky-top), var(--sky-bottom) 70%, var(--bg) 100%); }
.sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: color-mix(in srgb, var(--bg-deep) 82%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 0 0 var(--line); }
.site-header__row { height: 100%; display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex-shrink: 0; }
.brand__icon { width: 32px; height: 32px; }
.brand__name { font: 400 12px/1 var(--font-pixel); letter-spacing: .06em; }
@media (max-width: 380px) { .brand__name { display: none; } }

/* Floor indicator — the elevator's LED display. */
.floor-display { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; min-width: 64px; justify-content: center;
  background: #07051a; color: var(--amber); box-shadow: inset 0 0 0 2px #2a2366;
  font: 400 12px/1 var(--font-pixel); text-shadow: 0 0 6px color-mix(in srgb, var(--amber) 60%, transparent); }
.floor-display__arrow { font-size: 9px; opacity: .35; transition: opacity var(--dur-hover) ease, transform var(--dur-hover) var(--ease-out); }
.floor-display[data-moving="up"] .floor-display__arrow { opacity: 1; transform: none; }
.floor-display[data-moving="down"] .floor-display__arrow { opacity: 1; transform: rotate(180deg); }
.floor-display__num { min-width: 2.2ch; text-align: center; }

/* Desktop elevator panel: floor buttons. */
.elevator { margin-left: auto; display: none; }
.elevator__floors, .sheet__floors { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.floor-btn { position: relative; display: inline-flex; white-space: nowrap; align-items: center; gap: 8px; min-height: 40px; padding: 8px 10px;
  color: var(--text-muted); text-decoration: none; font: 400 9px/1.2 var(--font-pixel); letter-spacing: .03em;
  transition: color var(--dur-hover) ease; }
.floor-btn__num { display: inline-grid; place-items: center; width: 22px; height: 22px; background: var(--surface-2); color: var(--text);
  box-shadow: inset 0 -2px 0 0 rgba(0,0,0,.35); font-size: 9px; transition: background var(--dur-hover) ease, box-shadow var(--dur-hover) ease; }
.floor-btn[aria-current="page"] { color: var(--text); }
.floor-btn[aria-current="page"] .floor-btn__num { background: var(--amber); color: var(--night-0);
  box-shadow: inset 0 -2px 0 0 rgba(0,0,0,.25), 0 0 10px color-mix(in srgb, var(--amber) 55%, transparent); }
@media (hover: hover) and (pointer: fine) { .floor-btn:hover { color: var(--text); } .floor-btn:hover .floor-btn__num { background: var(--violet-0); color: #fff; } }
.floor-btn:active .floor-btn__num { transform: translateY(1px); }
@media (min-width: 1080px) { .elevator { display: block; } .tool-btn--call { display: none !important; } }
/* Labels only where eight of them fit; otherwise a pixel tooltip on hover/focus. */
@media (max-width: 1679px) {
  .elevator .floor-btn { padding-inline: 5px; }
  .elevator .floor-btn__label { position: absolute; top: calc(100% + 6px); left: 50%; transform: translate(-50%, -4px); white-space: nowrap;
    padding: 6px 8px; background: var(--bg-deep); color: var(--text); box-shadow: inset 0 0 0 2px var(--line);
    opacity: 0; pointer-events: none; transition: opacity var(--dur-hover) ease, transform var(--dur-hover) var(--ease-out); }
  .elevator .floor-btn:focus-visible .floor-btn__label { opacity: 1; transform: translate(-50%, 0); }
}
@media (max-width: 1679px) and (hover: hover) and (pointer: fine) {
  .elevator .floor-btn:hover .floor-btn__label { opacity: 1; transform: translate(-50%, 0); }
}

.site-header__tools { display: inline-flex; gap: 6px; margin-left: auto; }
@media (min-width: 1080px) { .site-header__tools { margin-left: 8px; } }
.tool-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; cursor: pointer;
  background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 2px var(--line);
  font: 400 9px/1 var(--font-pixel); transition: background var(--dur-hover) ease; }
@media (hover: hover) and (pointer: fine) { .tool-btn:hover { background: var(--surface-2); } }
.tool-btn:active { transform: translateY(1px); }
/* Theme glyph: a pixel moon (dark) / sun (light) built from box-shadows. */
.tool-btn__glyph { width: 4px; height: 4px; background: transparent;
  box-shadow: 4px 0 var(--amber), 8px 0 var(--amber), 0 4px var(--amber), 0 8px var(--amber), 4px 12px var(--amber), 8px 12px var(--amber), 12px 8px var(--amber);
  transform: translate(-6px, -6px); }
:root[data-theme="light"] .tool-btn__glyph { box-shadow: 4px 0 var(--amber), 0 4px var(--amber), 4px 4px var(--amber), 8px 4px var(--amber), 4px 8px var(--amber), -4px 4px var(--amber), 4px -4px var(--amber), 12px 4px var(--amber), 4px 12px var(--amber); transform: translate(-4px, -4px); }
.call-glyph { display: grid; grid-template-columns: 1fr; gap: 4px; }
.call-glyph i { display: block; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; }
.call-glyph i:first-child { border-bottom: 7px solid var(--text); }
.call-glyph i:last-child { border-top: 7px solid var(--text); }

/* ---------- Mobile bottom sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet[hidden] { display: none; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(6, 4, 20, .6); opacity: 0; transition: opacity var(--dur-menu) ease; }
.sheet__panel { position: absolute; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); max-height: 80dvh; overflow: auto;
  background: var(--bg-deep); padding: 18px 16px 12px; box-shadow: inset 0 0 0 2px var(--line);
  transform: translateY(24px); opacity: 0; transition: transform var(--dur-menu) var(--ease-out), opacity var(--dur-menu) var(--ease-out); }
.sheet.is-open .sheet__scrim { opacity: 1; }
.sheet.is-open .sheet__panel { transform: none; opacity: 1; }
.sheet__floors { flex-direction: column; gap: 2px; margin-top: 10px; }
.sheet__floors .floor-btn { width: 100%; min-height: 48px; font-size: 10px; }
.sheet__floors .floor-btn__num { width: 28px; height: 28px; font-size: 10px; }
.sheet__floors li { opacity: 0; transform: translateY(8px); transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out); transition-delay: calc(var(--i, 0) * 35ms); }
.sheet.is-open .sheet__floors li { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .sheet__panel, .sheet__floors li { transform: none !important; } }

/* ---------- Stage & elevator doors ---------- */
.stage { position: relative; min-height: calc(100dvh - var(--header-h) - 80px); outline: none; }
.doors { position: fixed; left: 0; right: 0; top: var(--header-h); bottom: 0; z-index: 30; pointer-events: none; display: flex; visibility: hidden; }
.doors.is-active { visibility: visible; pointer-events: auto; }
.door { position: relative; z-index: 1; flex: 1; height: 100%; will-change: transform;
  --rivet: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='12' shape-rendering='crispEdges'%3E%3Crect x='9' y='3' width='6' height='6' fill='%231e1850'/%3E%3Crect x='9' y='3' width='4' height='4' fill='%235745ad'/%3E%3Crect x='9' y='3' width='2' height='2' fill='%23c9c2ff'/%3E%3C/svg%3E");
  background:
    linear-gradient(to bottom, transparent calc(100% - 44px), var(--night-2) calc(100% - 44px) calc(100% - 42px), var(--night-3) calc(100% - 42px)),
    repeating-linear-gradient(to bottom, transparent 0 22px, rgba(0,0,0,.18) 22px 24px),
    linear-gradient(to right, var(--night-3), var(--night-4) 50%, var(--night-3));
  box-shadow: inset 0 0 0 4px var(--night-2); }
/* Riveted inner panels (top and bottom), drawn with a crisp pixel-rivet tile. */
.door::before { content: ""; position: absolute; left: 12%; right: 12%; top: 7%; bottom: 58px; pointer-events: none;
  box-shadow: inset 0 0 0 2px var(--night-2), inset 2px 2px 0 2px color-mix(in srgb, var(--violet-1) 35%, transparent);
  background: var(--rivet) 0 0 / 24px 12px repeat-x, var(--rivet) 0 100% / 24px 12px repeat-x,
    linear-gradient(to bottom, transparent calc(50% - 1px), var(--night-2) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)); }
/* Dithered shadow along the meeting seam. */
.door::after { content: ""; position: absolute; top: 0; bottom: 0; width: 8px; opacity: .45; pointer-events: none;
  background: repeating-conic-gradient(var(--night-0) 0 25%, transparent 0 50%) 0 0 / 4px 4px; }
.door--l { transform: translateX(-100%); box-shadow: inset 0 0 0 4px var(--night-2), inset -6px 0 0 0 var(--violet-0); }
.door--r { transform: translateX(100%); box-shadow: inset 0 0 0 4px var(--night-2), inset 6px 0 0 0 var(--violet-0); }
.door--l::after { right: 6px; } .door--r::after { left: 6px; transform: scaleX(-1); }
.door__window { position: absolute; z-index: 1; top: 28%; width: 34%; height: 18%; background: color-mix(in srgb, var(--mint-2) 40%, var(--night-2));
  box-shadow: inset 0 0 0 4px var(--night-1), inset 8px 8px 0 0 color-mix(in srgb, white 18%, transparent); }
.door--l .door__window { right: 16%; } .door--r .door__window { left: 16%; }
.doors__ding { position: absolute; z-index: 2; left: 50%; top: 14px; width: 12px; height: 12px; margin-left: -6px; background: var(--amber); opacity: 0;
  box-shadow: 0 0 16px var(--amber); }
/* Floor plate on the lintel: follows the LED display while the doors are shut. */
.doors__plate { position: absolute; z-index: 2; left: 50%; top: 34px; min-width: 44px; padding: 6px 8px; transform: translateX(-50%);
  font: 400 12px/1 var(--font-pixel); text-align: center; color: var(--amber); background: #07051a;
  box-shadow: inset 0 0 0 2px var(--night-4), 0 0 0 2px var(--night-1), 0 4px 0 2px rgba(6, 4, 20, .5);
  text-shadow: 0 0 6px color-mix(in srgb, var(--amber) 60%, transparent); }
/* Light from the new floor spilling through the opening gap. */
.doors__spill { position: absolute; z-index: 0; left: 50%; top: 0; bottom: 0; width: 36vw; margin-left: -18vw; opacity: 0; pointer-events: none;
  background: linear-gradient(to right, transparent 0 8%, color-mix(in srgb, var(--amber) 14%, transparent) 8% 22%,
    color-mix(in srgb, var(--paper-0) 30%, transparent) 22% 40%, color-mix(in srgb, var(--paper-0) 55%, transparent) 40% 60%,
    color-mix(in srgb, var(--paper-0) 30%, transparent) 60% 78%, color-mix(in srgb, var(--amber) 14%, transparent) 78% 92%, transparent 92%); }
.doors.is-reduced .door, .doors.is-reduced .doors__plate, .doors.is-reduced .doors__spill { display: none; }
.doors.is-reduced { background: var(--bg); opacity: 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; background: var(--bg-deep); box-shadow: 0 -2px 0 0 var(--line); }
.site-footer__row { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; padding-block: 22px calc(22px + env(safe-area-inset-bottom)); }
.site-footer__legal { margin: 0; font-size: 13px; color: var(--text-muted); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; }
@media (min-width: 1680px) { .elevator .floor-btn { padding-inline: 6px; gap: 6px; } .elevator__floors { gap: 2px; } }
