:root {
  color-scheme: dark;
  --ink: #f2f5ef;
  --muted: #9aa69f;
  --carbon: #111714;
  --carbon-2: #18201c;
  --line: rgba(225, 235, 227, .16);
  --green: #b6ed76;
  --orange: #f15a38;
  font-family: "Familjen Grotesk", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--carbon); color: var(--ink); }
body { overflow: hidden; }
button, a { font: inherit; }
button { color: inherit; }

.skip { position: fixed; left: 1rem; top: -5rem; z-index: 20; padding: .75rem 1rem; background: var(--ink); color: var(--carbon); }
.skip:focus { top: 1rem; }

.experience { min-height: 100dvh; }
.topbar { position: fixed; z-index: 10; inset: 0 0 auto; height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 34px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(17, 23, 20, .92), rgba(17, 23, 20, .62)); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 13px; width: max-content; color: var(--ink); text-decoration: none; font-weight: 600; }
.brand svg { width: 49px; fill: currentColor; }
.doc-id, .eyebrow, .spec-rail span, .spec-rail small, .hint, .status { font-family: "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.doc-id { color: var(--muted); font-size: 11px; }
.back-link { justify-self: end; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 3px; font-size: 14px; }

.stage { position: relative; width: 100vw; height: 100dvh; min-height: 620px; overflow: hidden; background: radial-gradient(circle at 62% 43%, #29362f 0, #18201c 33%, #101512 72%); }
.stage::before { content: ""; position: absolute; inset: 72px 0 0; pointer-events: none; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 54px 54px; opacity: .16; mask-image: linear-gradient(90deg, #000, transparent 30%, transparent 72%, #000); }
canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--green); }

.intro { position: absolute; z-index: 2; left: 34px; top: 126px; width: min(410px, 34vw); pointer-events: none; }
.eyebrow { margin: 0 0 18px; color: #c8d0ca; font-size: 10px; }
.eyebrow i { display: inline-block; width: 25px; height: 1px; margin: 0 8px 3px 0; background: var(--green); }
h1 { margin: 0; font-size: clamp(40px, 4.8vw, 76px); line-height: .94; letter-spacing: -.052em; font-weight: 600; }
h1 em { color: var(--green); font-style: normal; }
.intro > p:last-child { width: 330px; max-width: 100%; margin: 22px 0 0; color: var(--muted); line-height: 1.5; font-size: 15px; }

.spec-rail { position: absolute; z-index: 2; top: 112px; right: 34px; width: 190px; border-top: 1px solid var(--line); }
.spec-rail div { padding: 15px 0 14px; display: grid; grid-template-columns: 1fr auto; align-items: end; border-bottom: 1px solid var(--line); }
.spec-rail span { grid-column: 1 / -1; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.spec-rail strong { font-size: 22px; font-weight: 500; letter-spacing: -.025em; }
.spec-rail small { color: var(--muted); font-size: 8px; }

.controls { position: absolute; z-index: 3; left: 34px; right: 34px; bottom: 34px; display: flex; justify-content: space-between; gap: 16px; pointer-events: none; }
.zone-controls, .view-controls { display: flex; gap: 6px; pointer-events: auto; }
.controls button { min-height: 39px; padding: 0 14px; border: 1px solid var(--line); border-radius: 1px; background: rgba(17, 23, 20, .72); backdrop-filter: blur(12px); cursor: pointer; font-size: 12px; transition: border-color .2s, background .2s, color .2s; }
.controls button:hover, .controls button:focus-visible { border-color: rgba(129, 215, 66, .68); outline: none; }
.controls button.active, .controls button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #0c130e; }

.hint { position: absolute; z-index: 2; left: 50%; bottom: 44px; transform: translateX(-50%); color: #717d76; font-size: 9px; pointer-events: none; }
.hint span { color: #bdc8c0; }
.status { position: absolute; z-index: 2; right: 34px; bottom: 94px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }

.loading, .fallback { position: absolute; z-index: 7; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 7px; background: var(--carbon); transition: opacity .45s ease, visibility .45s; }
.loading.done { opacity: 0; visibility: hidden; }
.loading span { width: 34px; height: 34px; border: 1px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .9s linear infinite; }
.loading b, .fallback strong { margin-top: 8px; font-size: 14px; font-weight: 500; }
.loading small, .fallback span { color: var(--muted); font: 10px "IBM Plex Mono", monospace; }
.fallback[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
  body { overflow: auto; }
  .topbar { height: 62px; padding: 0 18px; grid-template-columns: 1fr auto; }
  .doc-id { display: none; }
  .brand span { font-size: 14px; }
  .back-link { font-size: 12px; }
  .stage { min-height: 760px; }
  .intro { top: 94px; left: 18px; width: calc(100% - 36px); }
  .intro > p:last-child { width: min(330px, 82vw); }
  h1 { font-size: clamp(40px, 12vw, 58px); }
  .spec-rail { top: auto; right: 18px; left: 18px; bottom: 156px; width: auto; display: grid; grid-template-columns: repeat(3, 1fr); }
  .spec-rail div { padding-right: 10px; }
  .spec-rail strong { font-size: 16px; }
  .controls { left: 18px; right: 18px; bottom: 18px; flex-direction: column; }
  .zone-controls, .view-controls { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .controls button { padding: 0 8px; }
  .hint, .status { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- Ujednolicony lockup marki STATIO (znak 2 × 2 + nazwa + etykieta strony) ---- */
.brand { gap: 10px; }
.brand svg, .brand .brand-mark { width: 20px; height: 20px; fill: currentColor; }
.brand strong { color: inherit; font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.brand span { font-size: 13px; font-weight: 500; opacity: .6; }
