/* nirus lab - levels 1 to 4. font: barlow (OFL), lives in fonts/ */

@font-face { font-family: "Barlow"; font-weight: 300; font-display: swap; src: url("fonts/barlow-300.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("fonts/barlow-700.woff2") format("woff2"); }

:root:lang(en) { --announce-label: "◉ ANNOUNCEMENT   "; }
:root:lang(fr) { --announce-label: "◉ ANNONCE   "; }
:root {
  --announce-label: "◉ DURCHSAGE   ";
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --t-small: .78rem;
  --t-text: 1.05rem;
  --t-lead: 1.2rem;
  --t-h3: 1.15rem;
  --t-h2: .95rem;
  --t-h1: clamp(2.1rem, 5vw, 3.3rem);
  --t-number: 4.4rem; /* chamber numbers */

  --blue: #00acff;
  --blue-deep: #0077b8;
  --blue-glow: rgba(0, 172, 255, .35);
  --green: #2fbf71;
  --orange: #ff9a00;
  --radius: 4px;
  --width: 1120px;
  --tile-px: 200px; /* same as TILE in lab.js! */
}

/* level 1 */
html {
  --wall: #3b4246;
  --joint: rgba(0, 0, 0, .32);
  --panel: #2a3034;
  --panel-edge: #475157;
  --text: #e6ebee;
  --text-muted: #a3afb5;
  --sign: #dde1e1;
  --sign-filter: none;
  --light: radial-gradient(ellipse 1100px 600px at 50% -200px, rgba(215, 235, 250, .14), transparent 70%);
  --stains: linear-gradient(transparent, transparent);
  color-scheme: dark;
}

/* level 2 - water stains */
html[data-level="2"] {
  --wall: #32383b;
  --joint: rgba(0, 0, 0, .42);
  --panel: #252a2d;
  --panel-edge: #40494e;
  --text: #e2e7e9;
  --text-muted: #9aa6ac;
  --sign: #d6d9d6;
  --light: radial-gradient(ellipse 1000px 520px at 50% -180px, rgba(200, 225, 245, .1), transparent 70%);
  /* each stain has a darker dried rim just inside its edge, like a real one */
  --stains:
    radial-gradient(ellipse 90px 300px at 16.5% 0%, rgba(140, 100, 40, .12), transparent 75%),
    radial-gradient(ellipse 160px 520px at 18% 0%, rgba(140, 100, 40, .16) 0, rgba(140, 100, 40, .2) 50%, rgba(95, 65, 22, .32) 60%, transparent 72%),
    radial-gradient(ellipse 120px 360px at 81% 0%, rgba(140, 100, 40, .14) 0, rgba(140, 100, 40, .18) 50%, rgba(95, 65, 22, .28) 60%, transparent 72%),
    radial-gradient(ellipse 760px 260px at 50% 100%, rgba(110, 82, 34, .2) 0, rgba(110, 82, 34, .24) 50%, rgba(70, 50, 18, .32) 60%, transparent 72%);
}

/* level 3 - emergency light */
html[data-level="3"] {
  --wall: #262b2d;
  --joint: rgba(0, 0, 0, .55);
  --panel: #1b1f21;
  --panel-edge: #384146;
  --text: #e0e5e3;
  --text-muted: #93a09e;
  --sign: #e9e6dc;
  --sign-filter: sepia(.2) brightness(.93);
  --light:
    radial-gradient(ellipse 800px 460px at 50% -160px, rgba(205, 230, 245, .16), transparent 70%),
    radial-gradient(circle 520px at 100% 30%, rgba(255, 120, 40, .13), transparent 70%);
  --stains:
    radial-gradient(ellipse 150px 420px at 18% 0%, rgba(90, 70, 30, .3), transparent 70%),
    radial-gradient(circle 300px at 0% 100%, rgba(55, 82, 32, .55), transparent 70%),
    radial-gradient(circle 220px at 100% 85%, rgba(55, 82, 32, .4), transparent 70%);
  color-scheme: dark;
}

/* level 4 - decayed */
html[data-level="4"] {
  --wall: #1d1f1a;
  --joint: rgba(0, 0, 0, .62);
  --panel: #181a16;
  --panel-edge: #393b32;
  --text: #e4dfd0;
  --text-muted: #9c998b;
  --sign: #ddd6c2;
  --sign-filter: sepia(.45) brightness(.85) contrast(.95);
  --light: radial-gradient(ellipse 900px 500px at 50% -200px, rgba(255, 230, 170, .07), transparent 70%);
  --stains:
    repeating-linear-gradient(90deg, transparent 0 194px, rgba(110, 55, 20, .22) 194px 206px, transparent 206px 400px),
    radial-gradient(circle 420px at 0% 0%, rgba(42, 64, 24, .75), transparent 70%),
    radial-gradient(circle 380px at 100% 40%, rgba(42, 64, 24, .6), transparent 70%),
    radial-gradient(circle 340px at 25% 100%, rgba(42, 64, 24, .6), transparent 70%),
    radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .55) 100%);
  color-scheme: dark;
}

/* basics */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* decoration hanging over the edge (archive vines on a full-width photo) must not make the phone page swipe sideways */
html, body { overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-text);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  background-color: var(--wall);
}
/* the wall is a fixed layer of its own: background-attachment: fixed is ignored on iOS, so the joints scrolled
   while light, holes and cracks stayed put. lvh = tall enough while the browser toolbar slides away */
html::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100lvh;
  z-index: -1; pointer-events: none;
  background-image:
    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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(90deg, var(--joint) 0 2px, transparent 2px),
    linear-gradient(0deg, var(--joint) 0 2px, transparent 2px);
  background-size: 220px 220px, var(--tile-px) var(--tile-px), var(--tile-px) var(--tile-px);
}
/* light + stains */
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100lvh; pointer-events: none; z-index: 0;
  background: var(--light), var(--stains);
}
.site-head, main, .site-footer { position: relative; z-index: 2; }
/* footer always at the bottom, also on short pages */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body > main { flex: 1 0 auto; width: 100%; }
[id] { scroll-margin-top: calc(var(--head, 72px) + 24px); }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

a { color: var(--blue); }
img { max-width: 100%; height: auto; display: block; }
code { font-family: var(--mono); font-size: .92em; }

.wrap { max-width: var(--width); margin: 0 auto; padding: 0 16px; }

/* header */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--panel-edge);
}
.site-head .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 34px; height: 34px; }
.brand b { font-size: 1.05rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; display: block; line-height: 1.1; }
.brand span { display: block; font-size: var(--t-small); letter-spacing: .3em; color: var(--text-muted); text-transform: uppercase; }

.floor-buttons { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.floor-buttons a {
  display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text);
  font-size: .95rem; font-weight: 500; padding: 5px 10px 5px 5px; border-radius: var(--radius);
}
.floor-buttons a:hover { background: var(--blue-glow); }
.floor-buttons a b {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: .78rem; font-weight: 700; border: 1.5px solid var(--panel-edge); color: var(--text-muted);
}
.floor-buttons a[aria-current] b { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 10px var(--blue); }
.floor-buttons a.extra { padding-left: 10px; color: var(--text-muted); }

/* floor indicator */
.floor {
  display: flex; align-items: center; gap: 10px; padding: 5px 12px; border-radius: 3px;
  background: #0c0f10; color: #7fd6ff; border: 1px solid #2b3236;
  font-size: var(--t-small); letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
}
.floor strong { font-size: 1.15rem; letter-spacing: .04em; color: var(--blue); text-shadow: 0 0 8px var(--blue-glow); }

/* language switch: three small keys next to the floor indicator */
.languages { display: flex; gap: 2px; }
.languages a {
  font-size: var(--t-small); font-weight: 600; letter-spacing: .1em; text-decoration: none; color: var(--text-muted);
  padding: 4px 6px; border-radius: var(--radius); border: 1px solid transparent;
}
.languages a:hover { color: var(--text); background: var(--blue-glow); }
.languages a[aria-current] { color: var(--blue); border-color: var(--panel-edge); }

/* page head */
.page-head { padding: 64px 0 36px; display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: center; }
.page-head.single-column { grid-template-columns: 1fr; }
h1 { font-size: var(--t-h1); line-height: 1.05; font-weight: 700; margin: 12px 0 16px; letter-spacing: -.01em; }
h1 em { font-style: normal; color: var(--blue); }
.lead { font-size: var(--t-lead); color: var(--text-muted); max-width: 52ch; margin: 0; }

.announcement { font-size: var(--t-small); color: var(--text-muted); min-height: 1.6em; margin: 0; letter-spacing: .04em; }
.announcement::before { content: var(--announce-label); color: var(--blue); letter-spacing: .16em; font-weight: 600; }
/* with js: every sentence sits invisibly on top of each other, so the box is as tall as the longest one. otherwise the page jumps when lines wrap */
.announcement.fixed { display: grid; }
.announcement.fixed::before { content: none; }
.announcement.fixed > span { grid-area: 1 / 1; }
.announcement.fixed > span::before { content: var(--announce-label); color: var(--blue); letter-spacing: .16em; font-weight: 600; }
.announcement .ghost { visibility: hidden; }
.announcement .cursor { display: inline-block; width: .5em; background: var(--blue); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.aperture { justify-self: center; width: min(320px, 70vw); filter: drop-shadow(0 0 40px var(--blue-glow)); animation: spin 120s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* section titles */
.section-title { margin: 0 0 18px; display: flex; align-items: center; gap: 14px; }
.section-title h2 { margin: 0; font-size: var(--t-h2); font-weight: 700; letter-spacing: .24em; text-transform: uppercase; }
.section-title::after { content: ""; flex: 1; height: 2px; background: var(--joint); }

/* panels */
.panel {
  position: relative; background: var(--panel); border: 1px solid var(--panel-edge);
  border-radius: var(--radius); padding: 22px 24px;
}
.panel h3 { margin: 0 0 8px; font-size: var(--t-h3); font-weight: 600; }
.panel p { margin: 0 0 10px; }
.panel p:last-child { margin-bottom: 0; }
.muted { color: var(--text-muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-bottom: 56px; }
.button {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 6px;
  background: var(--blue); color: #fff !important; text-decoration: none; font-weight: 600;
  padding: 10px 16px; border-radius: var(--radius);
}
.button:hover { background: var(--blue-deep); }
.preview { border-radius: 3px; margin-bottom: 14px; width: 100%; aspect-ratio: 16 / 6; object-fit: cover; filter: sepia(.35) brightness(.8); }

/* status */
.status {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--panel-edge); border: 1px solid var(--panel-edge); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 56px;
}
.status > div { background: var(--panel); padding: 16px 18px; }
.label { display: block; font-size: var(--t-small); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.value { font-size: 1.7rem; font-weight: 600; line-height: 1.3; }
.value.ok::before { content: "● "; color: var(--green); font-size: .8em; }
.value.large { font-size: 2.6rem; color: var(--blue); }
.note { font-size: var(--t-small); color: var(--text-muted); }
/* small second line under a value, e.g. "49 internal · 4 external" */
.sub { display: block; font-size: var(--t-small); color: var(--text-muted); letter-spacing: .04em; }
.status .note { grid-column: 1 / -1; padding: 6px 18px; }
.status:not(.with-facts) .facts-note { display: none; }

/* signs */
.chambers { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-bottom: 56px; }
.sign {
  position: relative; display: flex; flex-direction: column; min-height: 300px;
  background: var(--sign); color: #1c2226; border-radius: var(--radius); padding: 22px 22px 18px;
  text-decoration: none; filter: var(--sign-filter);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 10px 24px rgba(0,0,0,.2);
  transition: transform .18s ease, box-shadow .18s ease;
}
a.sign:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--blue), 0 16px 30px rgba(0,0,0,.25); }
.sign .number { font-size: var(--t-number); line-height: .9; font-weight: 300; letter-spacing: -.02em; }
.sign .of { font-size: var(--t-small); color: #6b767c; letter-spacing: .12em; }
.sign .bars { display: flex; gap: 3px; margin: 12px 0 14px; }
.sign .bars i { flex: 1; height: 5px; background: #1c2226; opacity: .15; }
.sign .bars i.on { opacity: 1; }
.sign h3 { margin: 0 0 6px; font-size: var(--t-h3); font-weight: 600; }
.sign p { margin: 0 0 14px; font-size: .95rem; color: #4d585e; }
.sign .icons { margin-top: auto; display: flex; gap: 8px; }
.sign .icons span { width: 34px; height: 34px; border-radius: 3px; background: #1c2226; color: #fbfbfa; display: grid; place-items: center; }
.sign .icons svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sign .icons span.off { background: transparent; color: #1c2226; outline: 1.5px solid #1c2226; opacity: .4; }
.sign .state {
  position: absolute; top: 18px; right: 18px; font-size: .7rem; font-weight: 700; letter-spacing: .12em;
  padding: 3px 7px; border-radius: 2px; background: var(--blue); color: #fff;
}
.sign.planned .state { background: #8a959b; }
.sign.planned { opacity: .85; }
/* NEW: a rubber stamp over the top left corner of a sign; lab.js removes it after data-new-until */
.sign .new-stamp {
  position: absolute; top: -11px; left: -9px; z-index: 1; transform: rotate(-9deg);
  padding: 3px 10px 2px; border: 2.5px solid #c2410c; border-radius: 3px;
  background: #fbfbfa; color: #c2410c; font-size: .8rem; font-weight: 800; letter-spacing: .22em;
  box-shadow: 0 3px 8px rgba(0,0,0,.25);
}
/* lobby: the newest chambers as small signs */
.new-chambers > .muted { margin: -6px 0 16px; }
.chambers.compact { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 16px; }
.chambers.compact .sign { min-height: 150px; padding: 18px 16px 16px; }
.chambers.compact .sign .number { font-size: 2.6rem; }
/* the small signs are too narrow for UNDER CONSTRUCTION next to the number: the state goes above it */
.chambers.compact .sign .state { position: static; align-self: flex-start; margin: 0 0 10px; }
/* chamber 14: kuma groups as a list of lamps, without the single monitors */
.facility-summary { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 18px; }
.facility-summary li { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--panel-edge); padding: 7px 0; }
.facility-summary .lamp { margin: 0; flex: none; }
.facility-summary .group-name { flex: 1; font-weight: 600; }
/* scratches from level 2, water from 3, tilted on 4 */
body[data-level="2"] .sign::after, body[data-level="3"] .sign::after, body[data-level="4"] .sign::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(118deg, transparent 0 62%, rgba(0,0,0,.1) 62.2%, transparent 62.6%),
    linear-gradient(104deg, transparent 0 30%, rgba(0,0,0,.08) 30.1%, transparent 30.4%);
}
body[data-level="3"] .sign::after, body[data-level="4"] .sign::after {
  background:
    radial-gradient(ellipse 120px 60px at 80% 100%, rgba(110, 80, 30, .28), transparent 70%),
    linear-gradient(118deg, transparent 0 62%, rgba(0,0,0,.14) 62.2%, transparent 62.6%),
    linear-gradient(104deg, transparent 0 30%, rgba(0,0,0,.12) 30.1%, transparent 30.4%);
}
body[data-level="4"] .sign { transform: rotate(-1.4deg); }

/* chamber page */
.chamber-head { display: grid; grid-template-columns: 260px 1fr; gap: 36px; padding: 56px 0 32px; align-items: start; }
.chamber-head .sign { min-height: 0; }
.readings { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 22px 0 8px; }
.readings .panel { padding: 14px 16px; }
.readings .wide { grid-column: span 2; }
.readings.dense { grid-auto-flow: row dense; } /* small tiles fill the gap next to wide ones */
.readings.three { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } /* three equal columns, e.g. download/upload/ping */
.text { max-width: 70ch; margin-bottom: 56px; }
.text h2 { font-size: var(--t-h2); font-weight: 700; letter-spacing: .24em; text-transform: uppercase; margin: 2.2em 0 .8em; }
.text h3 { font-size: 1.05rem; font-weight: 600; margin: 1.6em 0 .4em; }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: grid; grid-template-columns: 56px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--joint); }
.steps li > b { color: var(--blue); font-size: 1.15rem; font-weight: 700; }
.steps li strong { font-weight: 600; }
.todo { background: rgba(255, 154, 0, .2); outline: 1px dashed var(--orange); padding: 0 4px; font-size: .9em; }

/* control room */
.lamp { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #6b767c; margin-left: 8px; vertical-align: middle; }
.lamp.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.lamp.off { background: var(--orange); box-shadow: 0 0 8px var(--orange); animation: blink-hard 1.2s steps(2) infinite; }
@keyframes blink-hard { 50% { opacity: .25; } }
.address {
  display: flex; align-items: center; gap: 6px; margin: 10px 0 6px;
  background: rgba(0,0,0,.35); border: 1px solid var(--panel-edge); border-radius: 3px; padding: 8px 10px;
}
.links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
/* buttons, links and addresses sit at the bottom of the panel, however long the text is (lobby, archive, control room) */
.grid > .panel { display: flex; flex-direction: column; }
.grid > .panel > :last-child:is(a, .panel-foot) { margin-top: auto; }
.grid > .panel > a:last-child { align-self: flex-start; }
.panel-foot .links { margin: 0; }
.address code { flex: 1; min-width: 0; color: #bfe9ff; font-size: .86em; }
button.copy { flex: none;
  font: inherit; font-size: var(--t-small); font-weight: 600; cursor: pointer; color: var(--text);
  background: transparent; border: 1px solid var(--panel-edge); border-radius: 3px; padding: 3px 8px; white-space: nowrap;
}
button.copy:hover { background: var(--blue-deep); color: #fff; }
button.copy { display: grid; place-items: center; padding: 4px 6px; line-height: 0; }
button.copy.copied svg { visibility: hidden; }
button.copy.copied::after { content: "✓"; position: absolute; line-height: 1; color: var(--green); }
button.copy { position: relative; }
.facility { margin-bottom: 56px; }
.facility-head { font-size: var(--t-h3); }
.facility-head .lamp { margin: 0 8px 0 0; }
.facility-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; margin-top: 14px; align-items: start; }
.facility-groups details { border-top: 1px solid var(--panel-edge); padding: 7px 0; }
.facility-groups summary { cursor: pointer; display: flex; align-items: center; gap: 8px; list-style: none; }
.facility-groups summary::-webkit-details-marker { display: none; }
.facility-groups summary .lamp { margin: 0; flex: none; }
.facility-groups .group-name { flex: 1; font-weight: 600; }
.facility-groups ul { list-style: none; margin: 6px 0 2px; padding: 0 0 0 17px; font-size: var(--t-small); color: var(--text-muted); }
.facility-groups li { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.facility-groups li .lamp { margin: 0; width: 7px; height: 7px; flex: none; }
/* staff ID card of the lab director */
.badge {
  display: grid; grid-template-columns: 148px 1fr; max-width: 560px; margin-bottom: 56px; color: inherit; text-decoration: none;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--radius); overflow: hidden; position: relative;
}
.page-head .badge { margin-bottom: 0; }
a.badge:hover, a.badge:focus-visible { border-color: var(--blue); }
.badge .strip { background: var(--blue-deep); display: flex; flex-direction: column; align-items: center; gap: 0; padding: 14px; }
.badge .portrait { display: block; width: 100%; flex: 1 1 0; min-height: 0; object-fit: cover; object-position: 50% 30%; border: 2px solid rgba(255,255,255,.85); border-radius: 2px; } /* fills the strip, no empty blue below */
/* the logo is stamped over the photo's corner, white so it does not drown in the blue strip */
.badge .stamp {
  align-self: flex-end; width: 64px; height: 64px; margin: -40px -4px 0 0; padding: 9px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.9); outline: 1px dashed rgba(255,255,255,.6); outline-offset: -7px;
  background: rgba(0, 40, 80, .35); transform: rotate(-14deg); position: relative;
}
.badge .stamp img { display: block; width: 100%; filter: brightness(0) invert(1); opacity: .92; }
@media (max-width: 420px) { .badge { grid-template-columns: 112px 1fr; } .badge .strip { padding: 10px; } .badge .fields { padding: 14px 14px 16px; } }
.badge .fields { padding: 16px 20px 18px; }
.badge .name { display: block; font-size: 1.6rem; font-weight: 700; margin: 6px 0 0; }
.badge dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 12px 0 0; }
.badge dt { font-size: var(--t-small); letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); padding-top: .2em; }
.badge dd { margin: 0; }
.badge .more { display: block; margin-top: 14px; color: var(--blue); }
.panel.accent { border-left: 3px solid var(--blue); }
.panel.accent-orange { border-left: 3px solid var(--orange); }

/* redacted */
.blackout { display: block; height: .95em; margin: .45em 0; background: #050606; border-radius: 1px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.panel h3 .blackout { height: 1.05em; margin: 0; }
.redacted .address { padding: 10px; }
.redacted .address .blackout { margin: 0; }
.stamp {
  grid-column: 1 / -1; justify-self: start; margin: 0; padding: 8px 14px; transform: rotate(-1.2deg);
  border: 2px solid var(--orange); border-radius: 3px; color: var(--orange); font-size: var(--t-small); letter-spacing: .06em;
}
.stamp b { font-weight: 700; letter-spacing: .24em; text-transform: uppercase; margin-right: 10px; }

/* archive */
.title-photo { margin: 0; padding: 10px; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--radius); }
.title-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; filter: sepia(.3) brightness(.85); }
/* own photos in the chambers, one row, click = lightbox */
.services { list-style: none; padding: 0; display: grid; gap: 10px; }
.services li { display: grid; grid-template-columns: 11rem 1fr; gap: 12px; }
.services b { font-size: .75em; letter-spacing: .1em; text-transform: uppercase; opacity: .7; padding-top: .25em; }
@media (max-width: 600px) { .services li { grid-template-columns: 1fr; gap: 2px; } }
.sayings { list-style: none; padding: 0; display: grid; gap: 8px; }
.sayings li { font-style: italic; }
.sayings span { font-style: normal; font-size: .75em; letter-spacing: .08em; text-transform: uppercase; opacity: .6; margin-left: 6px; }
.photo-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; } /* 150: two side by side on a phone */
.photo-row figure { margin: 0; }
.photo-row img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--panel-edge); filter: brightness(.9); transition: filter .2s; }
.photo-row a:hover img, .photo-row a:focus-visible img { filter: none; }
.photo-row figcaption { font-size: var(--t-small); color: var(--text-muted); margin-top: 6px; }
.video { margin: 0; max-width: 340px; }
.video video { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--panel-edge); background: #000; }
.video figcaption { font-size: var(--t-small); color: var(--text-muted); margin-top: 6px; }
.confused { justify-self: center; max-height: min(460px, 60vh); width: auto; border-radius: var(--radius); border: 1px solid var(--panel-edge); rotate: 2deg; box-shadow: 0 10px 24px rgba(0,0,0,.5); }

.photo-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px; margin: 8px 0 56px; }
.photo {
  position: relative; margin: 0; background: #e8e2d2; padding: 10px 10px 12px; color: #2d2a22;
  box-shadow: 0 10px 24px rgba(0,0,0,.55); transform: rotate(var(--tilt, -1.5deg));
}
.photo::before { /* tape */
  content: ""; position: absolute; top: -10px; left: 50%; width: 70px; height: 20px; translate: -50% 0;
  background: rgba(220, 210, 170, .55); rotate: -3deg;
}
.photo:nth-child(2n) { --tilt: 1.8deg; } .photo:nth-child(3n) { --tilt: -.6deg; }
.photo img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; filter: sepia(.4) brightness(.9); }
.photo figcaption { font-size: .95rem; font-weight: 500; margin-top: 8px; text-align: center; }

/* footer */
.site-footer { border-top: 1px solid var(--panel-edge); background: var(--panel); padding: 22px 0 30px; font-size: .9rem; color: var(--text-muted); }
.site-footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.site-footer a { color: var(--text-muted); }

/* surroundings (built by lab.js) */
.surroundings { position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100lvh; pointer-events: none; z-index: 1; overflow: hidden; }
.hole {
  position: absolute; width: var(--tile-px); height: var(--tile-px);
  background:
    linear-gradient(90deg, transparent 0 46%, #1a1d1e 46% 50%, transparent 50%),
    repeating-linear-gradient(0deg, transparent 0 46px, #2e3436 46px 58px, #1d2123 58px 60px, transparent 60px 96px),
    #0a0c0d;
  box-shadow: inset 0 0 30px rgba(0,0,0,.95), inset 0 0 0 2px rgba(0,0,0,.6);
}
.hole.half { clip-path: polygon(0 0, 100% 0, 100% 35%, 62% 52%, 34% 100%, 0 100%); }
.crack { position: absolute; overflow: visible; }
.crack path { fill: none; stroke: rgba(0,0,0,.7); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
body[data-level="3"] .crack path, body[data-level="4"] .crack path { stroke: rgba(0,0,0,.8); stroke-width: 2.2; }
.beam {
  position: absolute; width: 170px; height: 130vh; transform-origin: top center;
  background: linear-gradient(rgba(255, 236, 190, .17), rgba(255, 236, 190, 0) 80%);
  filter: blur(6px);
}
.vines { position: fixed; pointer-events: none; z-index: 1; } /* behind the content (main = 2), in front of the wall */
.vine-small { position: absolute; pointer-events: none; z-index: 3; width: 110px; top: -18px; right: -14px; }

/* emergency light flickers */
body[data-level="3"] .surroundings::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 700px 400px at 50% -80px, rgba(220, 240, 255, .1), transparent 70%);
  animation: flicker 9s infinite;
}
@keyframes flicker { 0%, 61%, 63%, 65%, 100% { opacity: 1; } 62%, 64% { opacity: .1; } 64.5% { opacity: .6; } }

/* elevator */
.elevator { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.elevator .door {
  position: absolute; top: 0; bottom: 0; width: 50.5%;
  background:
    linear-gradient(90deg, rgba(255,255,255,.06), transparent 30%, rgba(0,0,0,.25)),
    repeating-linear-gradient(0deg, #8d9496 0 3px, #868d8f 3px 6px);
  box-shadow: inset 0 0 60px rgba(0,0,0,.35);
  transition: transform .55s cubic-bezier(.7, 0, .3, 1);
}
.elevator .left { left: 0; transform: translateX(-101%); border-right: 2px solid #3d4446; }
.elevator .right { right: 0; transform: translateX(101%); border-left: 2px solid #3d4446; }
.elevator.closed .door { transform: translateX(0); }
.elevator .display {
  position: absolute; top: 18%; left: 50%; translate: -50% 0; z-index: 2; opacity: 0; transition: opacity .2s;
  background: #0c0f10; border: 2px solid #2b3236; border-radius: 4px; padding: 12px 28px; text-align: center;
  color: #7fd6ff; font-family: var(--font); letter-spacing: .16em; text-transform: uppercase; font-weight: 600;
}
.elevator.closed .display { opacity: 1; }
.elevator .display strong { display: block; font-size: 3rem; line-height: 1.1; color: var(--blue); text-shadow: 0 0 14px var(--blue-glow); letter-spacing: .04em; }
.elevator .display span { font-size: .8rem; }
/* arriving: the doors are drawn closed right away, no sliding or fading in */
.elevator.arriving .door, .elevator.arriving .display { transition: none; }
/* keep the old page on screen until the new one is drawn (no blank frame), and swap without a crossfade */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }

/* archive: field trips + photo archive */
.coop .gallery-image { display: block; margin: -22px -24px 16px; }
.coop .gallery-image img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; filter: sepia(.35) brightness(.85); border-radius: var(--radius) var(--radius) 0 0; }
.coop .more { display: inline-block; margin-top: 4px; }
.gallery { margin: 0 0 14px; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--radius); }
.gallery summary { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; cursor: pointer; font-weight: 600; list-style: none; }
.gallery summary::-webkit-details-marker { display: none; }
.gallery summary::before { content: "▸"; color: var(--orange); margin-right: 10px; transition: transform .2s; }
.gallery[open] summary::before { transform: rotate(90deg); }
.gallery summary span:first-of-type { margin-right: auto; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 0 18px 18px; }
.gallery-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; filter: sepia(.25) brightness(.9); transition: filter .2s; }
.gallery-grid a:hover img, .gallery-grid a:focus-visible img { filter: none; }
.photo-archive-end { margin-bottom: 56px; }

/* lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(5, 6, 6, .92); }
.lightbox figure { margin: 0; height: 100%; display: grid; place-items: center; padding: 48px 56px; box-sizing: border-box; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.lightbox figcaption { color: #c9d1d5; font-size: var(--t-small); letter-spacing: .1em; margin-top: 10px; text-align: center; }
.lightbox button { position: fixed; background: rgba(28,34,38,.8); color: #fbfbfa; border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius); font: inherit; font-size: 1.4rem; width: 44px; height: 44px; cursor: pointer; }
.lightbox .close { top: 12px; right: 12px; }
.lightbox .prev { left: 8px; top: 50%; translate: 0 -50%; }
.lightbox .next { right: 8px; top: 50%; translate: 0 -50%; }
@media (max-width: 860px) { .lightbox figure { padding: 56px 8px; } .lightbox .prev, .lightbox .next { top: auto; bottom: 12px; translate: none; } }

/* paging between chambers */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; max-width: 900px; margin: 8px 0 56px; }
.pager a { display: block; padding: 14px 16px; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--radius); text-decoration: none; color: inherit; }
.pager a:hover { box-shadow: 0 0 0 2px var(--blue); }
.pager a span { display: block; font-size: var(--t-small); letter-spacing: .12em; text-transform: uppercase; color: var(--blue); margin-bottom: 4px; }
.pager .next { text-align: right; }
.pager .middle { align-self: center; }

/* cake */
.cake {
  position: fixed; right: 16px; bottom: 16px; max-width: 320px; z-index: 50; display: none;
  background: var(--sign); color: #1c2226; border-radius: var(--radius); padding: 16px 18px;
  box-shadow: 0 0 0 2px var(--orange), 0 16px 30px rgba(0,0,0,.3); font-size: .95rem;
}
.cake.shown { display: block; }

/* phone */
@media (max-width: 860px) {
  .page-head, .chamber-head { grid-template-columns: 1fr; padding-top: 36px; }
  .aperture { width: 170px; grid-row: 1; }
  .confused { max-height: 260px; }
  .status { grid-template-columns: repeat(2, 1fr); }
  .status .facts-note { display: block; } /* own line: on a phone the whole note never fits in one */
  .readings .wide { grid-column: 1 / -1; } /* full row, otherwise e.g. „selbst gebaut“ wraps */
  /* phone: a slim solid bar on top that stays (brand · E1 · languages), the floor buttons sit fixed at the
     bottom edge like an elevator panel. nothing see-through, so content never shows through or gets cut */
  .site-head { background: var(--panel); backdrop-filter: none; } /* backdrop-filter would trap the fixed panel */
  .site-head .wrap { gap: 12px; min-height: 52px; flex-wrap: nowrap; }
  .floor { margin-left: auto; padding: 3px 9px; gap: 0; font-size: 0; justify-content: center; }
  .floor strong { font-size: 1rem; }
  .brand b { font-size: .95rem; }
  .brand span { letter-spacing: .14em; }  /* "SALLE DE CONTRÔLE" must stay on the bar */
  .floor-buttons {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--panel); border-top: 1px solid var(--panel-edge); box-shadow: 0 -6px 18px rgba(0,0,0,.35);
  }
  .floor-buttons a {
    flex-direction: column; justify-content: flex-start; gap: 3px; padding: 4px 2px;
    font-size: .72rem; line-height: 1.15; text-align: center;
  }
  .floor-buttons a.extra { padding-left: 2px; justify-content: center; }
  /* room for the panel at the bottom */
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .cake { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .vines { width: 110px !important; opacity: .6; }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager .middle { grid-column: 1 / -1; grid-row: 2; text-align: center; }
}
/* lobby on desktop: everything on one screen, spacing grows with window height, footer sits at the bottom */
@media (min-width: 861px) {
  body[data-level="1"] main { flex: 1; display: flex; flex-direction: column; }
  body[data-level="1"] .page-head { padding: clamp(14px, 3.4vh, 64px) 0 clamp(12px, 2.6vh, 36px); }
  body[data-level="1"] h1 em { white-space: nowrap; }
  body[data-level="1"] .lead { max-width: 60ch; }
  body[data-level="1"] h1 { font-size: clamp(2.1rem, min(5vw, 6.2vh), 3.3rem); }
  body[data-level="1"] .aperture { width: min(320px, 30vh); }
  /* live notice floats below the bar instead of needing an extra line */
  body[data-level="1"] .status { position: relative; overflow: visible; margin-bottom: clamp(34px, 5vh, 56px); }
  body[data-level="1"] .status .note { position: absolute; top: 100%; left: 0; padding: 4px 0 0; background: none; }
  body[data-level="1"] .grid { margin-bottom: clamp(18px, 3vh, 56px); }
  body[data-level="1"] .site-footer { padding: 12px 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .aperture, .announcement .cursor, body[data-level="3"] .surroundings::after { animation: none; }
  .elevator .door { transition: none; }
}
/* 360° viewer on the director page: flat preview first, the real viewer only after "start" */
.pano { margin: 18px 0 8px; }
.pano-view { position: relative; aspect-ratio: 2 / 1; max-height: 70vh; width: 100%; display: grid; place-items: center;
  background: var(--panel) center / cover no-repeat; border: 1px solid var(--panel-edge); border-radius: var(--radius); overflow: hidden; }
.pano-view.running { display: block; aspect-ratio: auto; height: min(70vh, 520px); }
.pano-switch { display: flex; gap: 8px; margin-top: 10px; }
.pano-switch button { font: inherit; padding: 6px 14px; border-radius: var(--radius); border: 1px solid var(--panel-edge);
  background: var(--panel); color: inherit; cursor: pointer; }
.pano-switch button[aria-pressed="true"] { border-color: var(--blue); color: var(--blue); }
.pano .note { margin-top: 6px; }
.pano-view .button { font: inherit; cursor: pointer; }

/* logos page: one panel per logo colour, preview on a fitting background, download links below */
.logo-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.logo-card { padding: 16px; }
.logo-card .logo-preview { display: grid; place-items: center; height: 150px; margin-bottom: 14px; padding: 16px;
  background: #eef1f3; border-radius: 3px; }
.logo-card .logo-preview.dark { background: #1d2226; }
.logo-card .logo-preview.full { padding: 0; background: none; }
.logo-card .logo-preview.full img { outline: 1px solid var(--panel-edge); }
.logo-card .logo-preview img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.downloads { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto !important; }
.downloads a { font-size: var(--t-small); font-weight: 600; letter-spacing: .06em; text-decoration: none; padding: 4px 8px;
  border: 1px solid var(--panel-edge); border-radius: var(--radius); color: var(--text); }
.downloads a:hover, .downloads a:focus-visible { border-color: var(--blue); color: var(--blue); }
