/* pink noise — style.css
   Layout only. Every size, colour and timing comes from manager.js and
   arrives here as CSS variables (set by js/app.js).

   layers (z-index): page backdrop -1 · projects 1…480 · fog 500 · hovered project 900 · logo 950 ·
   windows 1000+ · maximised panel 4000 · nav bar + dropdowns 5000 · mouse-over box + cursor top */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--page-bg, #FFFFFF); -webkit-text-size-adjust: 100%; }
html.no-scrollbar { scrollbar-width: none; }
html.no-scrollbar::-webkit-scrollbar { display: none; }
body {
  background: transparent;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* custom cursor: hide the system cursor everywhere */
html.pn-cursor, html.pn-cursor * { cursor: none !important; }


/* ---------------------------------------------------------------- text
   every text style of manager.js (text_style_…) has its class here */
.t-ui, .t-ui-bold, .t-small, .t-default, .t-bold, .t-hover, .t-about { line-height: var(--lh, 1.2); }
.t-ui         { font-family: var(--ts-ui-family);       font-size: var(--ts-ui-size);       color: var(--ts-ui-color);       font-weight: var(--ts-ui-weight);       font-style: var(--ts-ui-style); }
.t-ui-bold    { font-family: var(--ts-uibold-family);   font-size: var(--ts-uibold-size);   color: var(--ts-uibold-color);   font-weight: var(--ts-uibold-weight);   font-style: var(--ts-uibold-style); }
.t-small      { font-family: var(--ts-small-family);    font-size: var(--ts-small-size);    color: var(--ts-small-color);    font-weight: var(--ts-small-weight);    font-style: var(--ts-small-style); }
.t-viewport   { font-family: var(--ts-viewport-family); font-size: var(--ts-viewport-size); color: var(--ts-viewport-color); font-weight: var(--ts-viewport-weight); font-style: var(--ts-viewport-style); line-height: 1.2; }
.t-default    { font-family: var(--ts-default-family);  font-size: var(--ts-default-size);  color: var(--ts-default-color);  font-weight: var(--ts-default-weight);  font-style: var(--ts-default-style); }
.t-bold       { font-family: var(--ts-bold-family);     font-size: var(--ts-bold-size);     color: var(--ts-bold-color);     font-weight: var(--ts-bold-weight);     font-style: var(--ts-bold-style); }
.t-pink-noise { font-family: var(--ts-pinknoise-family); font-size: var(--ts-pinknoise-size); color: var(--ts-pinknoise-color); font-weight: var(--ts-pinknoise-weight); font-style: var(--ts-pinknoise-style); line-height: 1; }
.t-hover      { font-family: var(--ts-hover-family);    font-size: var(--ts-hover-size);    color: var(--ts-hover-color);    font-weight: var(--ts-hover-weight);    font-style: var(--ts-hover-style); }
.t-about      { font-family: var(--ts-about-family);    font-size: var(--ts-about-size);    color: var(--ts-about-color);    font-weight: var(--ts-about-weight);    font-style: var(--ts-about-style); }
.t-tool       { font-family: var(--ts-tool-family);     font-size: var(--ts-tool-size);     color: var(--ts-tool-color);     font-weight: var(--ts-tool-weight);     font-style: var(--ts-tool-style); line-height: 1.2; }
.t-tool-bold  { font-family: var(--ts-toolbold-family); font-size: var(--ts-toolbold-size); color: var(--ts-toolbold-color); font-weight: var(--ts-toolbold-weight); font-style: var(--ts-toolbold-style); line-height: 1.2; }

/* ------------------------------------------------- page backdrop + fog */
#backdrop { position: fixed; inset: 0; z-index: -1; background: var(--page-gradient); pointer-events: none; }
/* the fog over the lower half of the window (projects fade into it). app.js cuts it off above the video */
#fog {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 50vh;
  z-index: 500;
  background: var(--fog);
  pointer-events: none;
}
html.no-fog #fog { display: none; }

/* --------------------------------------------------------------- banner */
#page { width: 100%; }
#banner {
  position: relative;
  height: var(--banner-h);
  background: #b9b9bd center / cover no-repeat;
  overflow: hidden;
}
#banner-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: var(--banner-fit, cover);
  object-position: var(--banner-focus, center);
  display: block;
}
html:not(.is-portfolio) #banner, html:not(.is-portfolio) #work { display: none; }

html:not(.is-portfolio) #banner, html:not(.is-portfolio) #work { display: none; }

/* -------------------------------------------------------------- nav bar */
/* sits under the video, moves up with the scroll and stays at the top. WORK · ABOUT · UPDATE · SPECTRUM */
#nav {
  position: -webkit-sticky; position: sticky; top: 0;
  z-index: 5000;
  height: var(--nav-h);
  pointer-events: none;                   /* the empty bar lets clicks through (windows below it stay usable) … */
}
#nav-items { pointer-events: auto; }      /* … only the labels and their dropdowns catch the mouse */
html.nav-on-video #nav { margin-top: calc(-1 * var(--nav-h)); }
#nav-items {
  position: absolute; left: var(--nav-left); top: var(--nav-top);
  display: flex; align-items: flex-start; gap: var(--nav-gap);
  white-space: nowrap;
}
.nav-item { position: relative; flex: none; transition: width var(--nav-trans) cubic-bezier(.3, .8, .25, 1); }
.nav-label {
  appearance: none; -webkit-appearance: none;
  position: relative; z-index: 2;
  display: block;
  height: var(--nav-hover-h);
  margin: calc((var(--nav-hover-h) - 1em) / -2) calc(-1 * var(--nav-hover-pad));
  padding: 0 var(--nav-hover-pad);
  border: 0;
  background: transparent;
  line-height: var(--nav-hover-h);
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease;
}
.nav-label:hover, .nav-label:focus-visible, .nav-item.is-active .nav-label { background: var(--nav-hover-bg); color: var(--nav-hover-text); }
/* an open dropdown: the label is its heading */
.nav-item.is-open .nav-label, .nav-item.is-open .nav-label:hover {
  background: transparent; color: var(--ts-uibold-color);
  font-family: var(--ts-uibold-family); font-weight: var(--ts-uibold-weight);
}

/* ------------------------------------------------------------ dropdowns */
.nav-drop {
  position: absolute; left: calc(-1 * var(--nav-pad-x)); top: calc(-1 * var(--nav-pad-y));
  z-index: 1;
  display: flex;
  border-radius: var(--drop-r);
  background: var(--drop-bg);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--drop-blur);
  backdrop-filter: var(--drop-blur);
  overflow: hidden;
  opacity: 0; visibility: hidden;
  transform-origin: 0 0; scale: 0.985;
  transition: opacity var(--nav-trans) ease, scale var(--nav-trans) cubic-bezier(.3, .8, .25, 1), visibility 0s linear var(--nav-trans);
  white-space: normal;
}
.nav-item.is-open .nav-drop { opacity: 1; visibility: visible; scale: 1; transition: opacity var(--nav-trans) ease, scale var(--nav-trans) cubic-bezier(.3, .8, .25, 1), visibility 0s; }
.drop-body {
  position: relative;
  flex: 1; min-width: 0;
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: calc(var(--nav-pad-y) + 2.6em) var(--nav-pad-x) var(--nav-pad-x);
}
.drop-body::-webkit-scrollbar { display: none; }
.drop-close {
  appearance: none; -webkit-appearance: none;
  position: absolute; right: var(--drop-close-x); top: var(--drop-close-y); z-index: 3;
  width: var(--drop-close); height: var(--drop-close);
  margin: 0; padding: 0; border: 0;
  background: none;
  color: var(--blue);
}
.drop-close::after { content: ""; position: absolute; inset: -8px; }
.drop-close svg { display: block; width: 100%; height: 100%; overflow: visible; }
.drop-close svg * { fill: none; stroke: currentColor; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.drop-close:hover { opacity: 0.6; }
.drop-text { max-width: 36em; }

/* WORK: rows title · type · year (the blue bar: mouse-over in the dynamic gallery, playback bar in the horizontal one) */
.drop-work .drop-body { padding: var(--work-top) 0 0; display: flex; flex-direction: column; }
.work-list { display: flex; flex-direction: column; gap: max(0px, calc(var(--work-row) - var(--tab-h))); padding: 0 calc(var(--work-c1) - var(--nav-hover-pad)); }
.work-row { width: 100%; cursor: default; }
.work-row .c-title { left: var(--nav-hover-pad); }
.work-row .c-type { left: calc(var(--work-c2) - var(--work-c1) + var(--nav-hover-pad)); }
.work-row .c-year { right: calc(var(--work-c3) - var(--work-c1) + var(--nav-hover-pad)); }
html.gal-dynamic .work-row:hover .pbar-on, html.gal-dynamic .work-row:focus-visible .pbar-on { clip-path: inset(0); }
html.gal-horizontal .work-row:hover { outline: 1px dashed var(--blue); outline-offset: -1px; }
.work-switch {
  appearance: none; -webkit-appearance: none;
  align-self: flex-end;
  margin: calc(var(--work-row) * 1.6) var(--drop-close-x) calc(var(--nav-pad-x) * 1.2) 0;
  padding: 0; border: 0; background: none;
  text-decoration: underline; text-underline-offset: 0.2em;
  white-space: nowrap;
}
.work-switch:hover { background: var(--nav-hover-bg); color: var(--nav-hover-text); }

/* ABOUT: buttons, dashed divider, the text of the shown button below, picture frame on the right.
   mouse-over shows a button, a click locks it (.is-locked), mouse-over of another one shows that one meanwhile */
.drop-about .drop-body { display: flex; flex-direction: column; overflow: hidden; padding: calc(var(--about-top) - 0.79 * var(--ts-ui-size)) var(--nav-pad-x) 0; }
.about-img {
  position: relative; order: 2; flex: none; width: var(--about-img-w); background: var(--ph-color);
  /* 1px past the right + bottom edge (clipped by the rounded panel): at fractional sizes the last pixel row / column
     would otherwise blend with the white panel underneath – a thin light line along the picture's edges */
  margin: -1px -1px -1px 0;
}
.drop-about.no-img .about-img { display: none; }
.about-pic { position: absolute; inset: 0; opacity: 0; transition: opacity 260ms ease; }
.about-pic.is-on { opacity: 1; }
.about-media { display: block; width: 100%; height: 100%; object-fit: cover; }
.about-pic .placeholder { height: 100%; aspect-ratio: auto; border-radius: 0; }
/* UPDATE calendar (update_calendar): the drawing over the blue frame, the big square centred */
.upd-cal svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.about-pic:not(.is-on) { pointer-events: none; }

/* ABOUT map (about.js → image: [map]): OSM tiles through the duotone filter #pn-map-duo */
.about-map { position: absolute; inset: 0; overflow: hidden; background: var(--map-color); touch-action: none; user-select: none; -webkit-user-select: none; }
.about-map.is-live { cursor: grab; }
.about-map.is-drag { cursor: grabbing; }
.map-tiles, .map-layer { position: absolute; inset: 0; }
.map-tile { position: absolute; left: 0; top: 0; max-width: none; opacity: 0; transition: opacity 220ms ease; transform-origin: 0 0; pointer-events: none; }
.map-tile.is-in { opacity: 1; }
.map-pin {
  position: absolute; left: 0; top: 0; width: var(--map-pin-size); height: var(--map-pin-size);
  margin: calc(var(--map-pin-size) / -2) 0 0 calc(var(--map-pin-size) / -2);
  border-radius: 50%; background: var(--map-pin); box-shadow: 0 0 0 calc(var(--map-pin-size) * 0.22) var(--map-pin-ring);
}
.map-pin::after {                          /* a slow ring around the pin */
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--map-pin);
  animation: map-pulse 2.4s ease-out infinite;
}
@keyframes map-pulse { from { transform: scale(1); opacity: 0.9; } to { transform: scale(3.2); opacity: 0; } }
.map-zoom { position: absolute; left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.map-zoom button {
  width: 26px; height: 26px; padding: 0; line-height: 1; border-radius: 3px; cursor: pointer;
  border: 1.6px solid var(--map-ui); background: var(--map-color); color: var(--map-ui);
}
.map-zoom button:hover, .map-zoom button:focus-visible { background: var(--map-ui); color: var(--map-color); outline: none; }
.map-attr { position: absolute; right: 0; bottom: 0; padding: 3px 7px; background: var(--map-color); color: var(--map-ui); }
.map-attr a { color: inherit; }
.map-consent {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.7em;
  border: 0; padding: 0 12%; background: var(--map-color); color: var(--map-ui); cursor: pointer; text-align: center;
}
.map-consent .t-ui, .map-consent .t-tool { color: inherit; }
.map-consent:hover .t-ui, .map-consent:focus-visible .t-ui { text-decoration: underline; }
.drop-about .drop-close { color: var(--white); }
.drop-about.no-img .drop-close { color: var(--blue); }
.about-list { flex: none; display: flex; flex-direction: column; align-items: flex-start; }
.about-item { cursor: default; outline: none; white-space: nowrap; flex: none; }   /* a button never breaks into two lines */
.about-item + .about-item { margin-top: max(0px, calc(var(--about-gap) - var(--lh, 1.2) * 1em)); }
.about-label { padding: 0.12em 0.25em; margin: 0 -0.25em; transition: background-color 140ms ease, color 140ms ease; }
.about-item.is-open .about-label { background: var(--nav-hover-bg); color: var(--nav-hover-text); box-shadow: 0 0 0 1px var(--white); }
.about-item.is-locked:not(.is-open) .about-label { outline: 1px dashed var(--blue); outline-offset: -1px; }   /* locked, another one under the mouse */
.about-item:focus-visible .about-label { outline: 1px dashed var(--blue); outline-offset: 2px; }
.about-rule { flex: none; width: min(100%, var(--about-rule-w)); margin-top: calc(var(--about-rule-gap) - 0.21 * var(--ts-ui-size)); border-top: 1px dashed var(--blue); }
.about-rule[hidden] { display: block; visibility: hidden; }
.about-texts {
  flex: 1; min-height: 0;
  margin-top: max(0.55 * var(--ts-about-size), calc(var(--about-text-top) - 0.94 * var(--ts-about-size)));   /* (to the first baseline; a minimum for phones) */
  padding-bottom: var(--nav-pad-x);
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(0, 14, 70, 0.3) transparent;
  user-select: text; -webkit-user-select: text;
}
.about-text { display: none; max-width: var(--about-text-w); overflow-wrap: break-word; }
.about-text.is-on { display: block; }
.about-text a { text-decoration: underline; }

/* UPDATE (update/update.js): two-line entries left, the picture frame right (the ABOUT frame), hover shows, click locks */
.drop-update .about-img { width: var(--upd-img-w); }
.upd-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: var(--upd-gap);
  margin: 0 calc(-0.45em - 2px); padding: 2px calc(0.45em + 2px) var(--nav-pad-x);
  scrollbar-width: thin; scrollbar-color: var(--blue) transparent;
}
.upd-item {
  flex: none; cursor: default; outline: none;
  padding: 0.28em 0.45em 0.32em; margin: 0 -0.45em;
  transition: background-color 140ms ease;
}
.upd-item.has-link { cursor: pointer; }
.upd-title { text-transform: uppercase; }        /* line 1: the title in capitals */
.upd-meta { margin-top: 0.12em; }                 /* line 2: date · location · type, as written */
.upd-sep { white-space: pre; }
.upd-arrow { margin-left: 0.6em; }
.upd-item .t-ui, .upd-item .t-small { transition: color 140ms ease; }
.upd-item.is-open { background: var(--nav-hover-bg); box-shadow: 0 0 0 1px var(--white); }
.upd-item.is-open .t-ui, .upd-item.is-open .t-small { color: var(--nav-hover-text); }
.upd-item.is-locked:not(.is-open) { outline: 1px dashed var(--blue); outline-offset: -1px; }
.upd-item:focus-visible { outline: 1px dashed var(--blue); outline-offset: 2px; }
.upd-none { opacity: 0.6; }

/* ---------------------------------------------------------------- bars
   a box with text columns, filled blue from the left (--f, 0 … 1); the text is white where it is filled */
.pbar { position: relative; flex: none; height: var(--tab-h); }
.pbar-txt { position: absolute; inset: 0; white-space: nowrap; pointer-events: none; }
.pbar-txt > span { position: absolute; top: 0; line-height: calc(var(--tab-h) - 2px); }
.pbar-on {
  position: absolute; inset: 0;
  background: var(--nav-hover-bg);
  clip-path: inset(0 calc((1 - var(--f, 0)) * 100%) 0 0);
  transition: clip-path 300ms cubic-bezier(.3, .8, .25, 1);
  pointer-events: none;
}
.pbar-on .pbar-txt { color: var(--nav-hover-text); }
.hg-bar .pbar-on, .work-row.is-playing .pbar-on { transition: none; }

/* ----------------------------------------------------------------- logo */
/* two identical layers: white (on the video) + blue (on the page), see logo_transition */
#logo {
  position: fixed; left: 0; top: 0;
  z-index: 950;
  display: grid;
  pointer-events: none;
  will-change: transform;
}
#logo[hidden] { display: none; }
.logo-layer { grid-area: 1 / 1; opacity: calc(var(--k, 1) * var(--op, 1)); }
.logo-layer.is-start { --op: var(--logo-start-op, 0.8); }
.logo-layer.is-start, .logo-layer.is-start * { color: var(--logo-start-color) !important; }
.logo-layer.is-end { --op: var(--logo-end-op, 1); }
.lg-row { display: flex; align-items: flex-end; align-items: last baseline; column-gap: var(--logo-gap); white-space: nowrap; }
.lg-logo { display: block; font-size: calc(var(--ts-pinknoise-size) * var(--logo-k, 1) * var(--logo-mk, 1) * var(--logo-s, 1)); line-height: 1; white-space: nowrap; }
#logo .lg-line.t-default { font-size: calc(var(--ts-default-size) * var(--logo-lk, 1) * var(--logo-s, 1)); }   /* modes[].logo_lines_size · logo_scale */
#logo .lg-line.t-bold { font-size: calc(var(--ts-bold-size) * var(--logo-lk, 1) * var(--logo-s, 1)); }
#logo .lg-line a { color: inherit; text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 0.06em; }
.lg-probe { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.lg-lines { display: block; }
.lg-line { display: block; min-height: calc(var(--lh, 1.2) * 1em); white-space: nowrap; }
.lg-lines a { pointer-events: auto; }
.lg-lines[hidden] { display: none; }
html.is-mobile #logo.lines-below-on-phones .lg-row { flex-direction: column; align-items: flex-start; row-gap: calc(var(--logo-gap) * 0.2); }
/* imprint / gdpr (manager.js → legal_lines): at the very bottom right of the page (in #work, scrolls with the page),
   above the fog, under the logo; buttons right-aligned, texts left-aligned. app.js sets --legal-right / --legal-bottom
   (bottom "logo" = at the end of the scroll its last line sits on the line of the last logo line) */
#legal { position: absolute; right: var(--legal-right, 55px); bottom: var(--legal-bottom, 68px); z-index: 940; }
html.is-preview #legal { display: none; }
.lg-legal { display: grid; grid-template-columns: auto auto; column-gap: var(--legal-col-gap, 1.5em);
            row-gap: calc(var(--legal-lines, 1) * var(--lh, 1.2) * 1em); line-height: var(--lh, 1.2); white-space: nowrap;
            font-size: calc(var(--ts-default-size) * var(--legal-k, var(--logo-lk, 1)) * var(--logo-s, 1)); }
.lg-legal-btn { justify-self: end; appearance: none; -webkit-appearance: none; margin: 0; padding: 0; border: 0; background: none;
                font: inherit; color: inherit; line-height: inherit; cursor: pointer; pointer-events: auto; text-underline-offset: 0.18em; text-decoration-thickness: 0.06em; }
.lg-legal-btn:hover, .lg-legal-btn:focus-visible { text-decoration: underline; outline: none; }
.lg-legal-txt { justify-self: start; }
/* phones: "buttons" = only the buttons, side by side · "none" = hidden · "full" = the whole block */
html.is-mobile .lg-legal.is-mobile-buttons { grid-auto-flow: column; grid-template-columns: none; }
html.is-mobile .lg-legal.is-mobile-buttons .lg-legal-txt { display: none; }
html.is-mobile .lg-legal.is-mobile-none { display: none; }

/* ------------------------------------------------------- project page */
#work { position: relative; }
#collage { position: relative; width: 100%; }
.tile {
  appearance: none; -webkit-appearance: none;
  position: absolute;
  display: block;
  margin: 0; padding: 0; border: 0;
  border-radius: var(--tile-r);
  overflow: visible;                       /* the picture is clipped by .tile-clip – the mouse-over frame + buttons lie outside */
  isolation: isolate;
  background: transparent;
  z-index: var(--z, 1);
  box-shadow: var(--tile-shadow);
  transition: scale var(--tile-trans) cubic-bezier(.2, .8, .2, 1), box-shadow var(--tile-trans) ease, opacity 500ms ease,
              z-index 0s linear var(--tile-trans);
  will-change: translate, scale;
}
/* slight drift, every project with its own rhythm (manager.js → projects_drift…) */
.tile.drifts { animation: pn-drift var(--drift-dur, 16s) ease-in-out var(--drift-delay, 0s) infinite; }
.tile.drifts.is-offscreen { animation-play-state: paused; }
html.has-window .tile.drifts, html.has-maxed .tile.drifts { animation-play-state: paused; }   /* a window is open: the gallery holds still */
.tile.drifts.is-hover, .tile.drifts.is-highlight { animation-play-state: paused; }   /* the hovered project holds still */
@keyframes pn-drift {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  25% { translate: calc(var(--d1x) * var(--drift-k, 1) * 1px) calc(var(--d1y) * var(--drift-k, 1) * 1px); rotate: var(--r1); }
  50% { translate: calc(var(--d2x) * var(--drift-k, 1) * 1px) calc(var(--d2y) * var(--drift-k, 1) * 1px); rotate: var(--r2); }
  75% { translate: calc(var(--d3x) * var(--drift-k, 1) * 1px) calc(var(--d3y) * var(--drift-k, 1) * 1px); rotate: var(--r3); }
}
/* mouse-over: to the front (also out of the fog), a little bigger */
.tile.is-hover, .tile.is-highlight, .tile:focus-visible {
  z-index: var(--tile-hover-z, 900);
  scale: var(--tile-scale, 1.05);
  box-shadow: var(--tile-hover-shadow);
  transition: scale var(--tile-trans) cubic-bezier(.2, .8, .2, 1), box-shadow var(--tile-trans) ease, opacity 500ms ease, z-index 0s;
}
.tile.is-highlight { z-index: calc(var(--tile-hover-z, 900) + 1); }   /* chosen in WORK: in front of a tile the mouse happens to be on */
.tile.is-loading { opacity: 0; box-shadow: none; }
.tile.is-missing { cursor: default; }
.tile-media {
  display: block;
  width: 100%; height: 100%;
  object-fit: var(--thumb-fit, cover);
  border-radius: 0;
  opacity: var(--tile-op, 1);
  transition: opacity var(--tile-vis-trans) ease;
}
.tile.is-hover .tile-media, .tile.is-highlight .tile-media, .tile:focus-visible .tile-media { opacity: var(--tile-op-hover, 1); }
@media (hover: none) { .tile .tile-media { opacity: var(--tile-op-touch, 1); } }
.tile-clip { position: absolute; inset: 0; display: block; overflow: hidden; border-radius: inherit; isolation: isolate; }
/* not in focus: an even white veil on top (manager.js → gallery_rest_veil) – the hovered / chosen one shows the picture as it is */
.tile-clip::after, .hg-tile::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit;
  background: var(--gal-veil-color, #fff); opacity: var(--gal-veil, 0);
  transition: opacity var(--tile-trans) ease;
}
.tile.is-hover .tile-clip::after, .tile.is-highlight .tile-clip::after, .tile:focus-visible .tile-clip::after,
.hg-item.is-center .hg-tile::after { opacity: 0; }
.tile:focus-visible { outline: none; }
/* mouse-over frame: an outline at a distance around the picture (manager.js → projects_hover_frame…) */
.tile-frame {
  position: absolute; left: calc(-1 * var(--hf-off)); top: calc(-1 * var(--hf-off));
  width: calc(100% + 2 * var(--hf-off)); height: calc(100% + 2 * var(--hf-off));
  overflow: visible; pointer-events: none; z-index: 3;
  opacity: 0; transition: opacity var(--tile-trans) ease;
}
.tile-frame rect { fill: none; stroke: var(--hf-color, #fff); stroke-width: var(--hf-w, 1.5px); stroke-dasharray: var(--hf-dash, none);
  stroke-linecap: var(--hf-cap, butt); rx: var(--hf-r, 0); ry: var(--hf-r, 0); }
.tile.is-hover .tile-frame, .tile.is-highlight .tile-frame, .tile:focus-visible .tile-frame { opacity: 1; }
/* the mouse-over area grows to the frame (so the buttons below can be reached) */
.tile-hit { position: absolute; inset: calc(-1 * var(--hf-off, 0px) - var(--hf-w, 0px)); pointer-events: none; }
.tile.is-hover .tile-hit { pointer-events: auto; }
/* buttons below the frame, bottom right: MORE · PLAY – the size of the mouse-over box, colours inverted */
.tile-actions {
  position: absolute; right: calc(-1 * var(--hf-off, 0px) - var(--hf-w, 0px) / 2); top: calc(100% + var(--hf-off, 0px) + var(--hf-w, 0px) / 2);
  display: flex; gap: var(--ha-gap, 6px); padding-top: var(--ha-gap, 6px);
  scale: calc(1 / var(--tile-scale, 1)); transform-origin: 100% 0;    /* screen size, also on the grown project */
  opacity: 0; pointer-events: none; z-index: 3;
  transition: opacity var(--tile-trans) ease;
}
.tile.is-hover .tile-actions { opacity: 1; pointer-events: auto; }
.tile-btn {
  display: block; white-space: nowrap; line-height: 1; cursor: pointer;
  font-size: calc(var(--ts-hover-size) * var(--hbtn-k, 1));
  padding: calc(var(--hb-pad-y) * var(--hbtn-k, 1)) calc(var(--hb-pad-x) * var(--hbtn-k, 1));
  border-radius: var(--hb-r);
  background: var(--hbtn-bg, #fff); color: var(--hbtn-color, #000E46);
  box-shadow: var(--shadow);
  transition: background-color 150ms ease, color 150ms ease;
}
.tile-btn:hover { background: var(--hbtn-color, #000E46); color: var(--hbtn-bg, #fff); }
@media (hover: none) { .tile-frame, .tile-actions { display: none; } }
.tile .placeholder { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
/* still thumbnail + the project's video above it, seen only while it plays (mouse-over / gallery centre) */
.has-video { position: relative; overflow: hidden; }
.has-video > .sv-still, .has-video > .sv-video {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: var(--thumb-fit, cover); border-radius: 0;
}
.has-video > .sv-video { opacity: 0; transition: opacity 260ms ease; }
.has-video.is-playing > .sv-video { opacity: 1; }

/* CRT mouse-over (old TV): layers on top of the hovered project, the picture itself runs through #pn-crt */
.tile-media.crt-on { transform: scale(1.035); }
.tile.crt-active { background: var(--crt-edge, transparent); }
.crt { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; border-radius: inherit; opacity: 0; }
.crt > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.crt-noise { mix-blend-mode: overlay; opacity: var(--crt-noise-a, 0.15); }
.crt-mask {                                   /* RGB phosphor stripes */
  background: repeating-linear-gradient(90deg, rgb(255, 60, 110) 0 1px, rgb(60, 255, 150) 1px 2px, rgb(70, 110, 255) 2px 3px);
  mix-blend-mode: overlay; opacity: var(--crt-mask-a, 0.3);
}
.crt-lines {                                  /* scanlines, interlace flicker */
  inset: -2px 0 0 0; height: calc(100% + 2px);
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, var(--crt-line-a, 0.35)) 0 1px, transparent 1px var(--crt-pitch, 3px));
  mix-blend-mode: multiply;
  animation: crt-interlace calc(90ms / var(--crt-speed, 1)) steps(2) infinite;
}
.crt-bar {                                    /* rolling refresh bar */
  top: -45%; height: 45%;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, var(--crt-bar-a, 0.12)) 60%, transparent);
  mix-blend-mode: screen;
  animation: crt-bar calc(3.4s / var(--crt-speed, 1)) linear infinite;
}
.crt-vignette { background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, var(--crt-vig-a, 0.35)) 100%); }
@keyframes crt-interlace { from { transform: translateY(0); } to { transform: translateY(2px); } }
@keyframes crt-bar { from { transform: translateY(0); } to { transform: translateY(330%); } }

/* live tuner for the CRT effect (index.html#tune) */
#crt-tuner {
  position: fixed; right: 16px; top: 16px; z-index: 2147483500;
  width: 300px; padding: 14px 16px;
  border-radius: 12px;
  background: var(--panel-bg); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  font-family: var(--ts-default-family); font-size: 13px; color: var(--panel-text, #000E46);
}
#crt-tuner .ct-head { font-size: 15px; margin-bottom: 8px; color: var(--panel-text, #000E46); }
#crt-tuner .ct-row { display: grid; grid-template-columns: 74px 1fr 38px; align-items: center; gap: 8px; margin: 4px 0; }
#crt-tuner .ct-pin { display: flex; gap: 8px; margin-top: 8px; }
#crt-tuner input[type=range] { width: 100%; accent-color: var(--blue); }
#crt-tuner .ct-val { text-align: right; }
#crt-tuner .ct-out { margin: 10px 0 0; padding: 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.6); font: inherit; font-size: 11px; white-space: pre; user-select: text; -webkit-user-select: text; }

/* ---------------------------------------------------------- hover box */
#hover-box {
  position: fixed; left: 0; top: 0;
  z-index: 2147483000;
  pointer-events: none;
  white-space: nowrap;
  padding: var(--hb-pad-y) var(--hb-pad-x);
  border-radius: var(--hb-r);
  background: var(--hb-bg);
  color: var(--hb-color);
  text-align: right;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--hb-blur);
  backdrop-filter: var(--hb-blur);
  line-height: 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--hb-trans) ease, visibility 0s linear var(--hb-trans);
  will-change: transform;
}
#hover-box.on { opacity: 1; visibility: visible; transition: opacity var(--hb-trans) ease, visibility 0s; }
#hover-box.on.is-over-btn { opacity: 0; }   /* on the MORE / PLAY buttons below a project */


/* ------------------------------------------------- horizontal gallery */
#hgallery { display: none; position: relative; height: 100%; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
html.gal-horizontal #hgallery { display: block; }
html.gal-horizontal #collage { display: none; }
html.gal-horizontal #fog { display: none; }              /* the fog lies behind the pictures here (page backdrop) */
html.gal-horizontal.at-projects #logo .is-end .lg-logo { pointer-events: auto; }   /* the logo leads back up */
.hg-item {
  position: absolute;
  left: calc(50% - var(--hg-w) / 2); top: calc(var(--hg-cy) - var(--hg-h) / 2);
  width: var(--hg-w);
  will-change: transform;
}
.hg-tile {
  position: relative;
  width: var(--hg-w); height: var(--hg-h);
  border-radius: var(--gal-r);
  overflow: hidden;
  background: rgba(0, 14, 70, 0.06);
  box-shadow: var(--gal-shadow);
}
.hg-media { display: block; width: 100%; height: 100%; object-fit: cover; }
.hg-tile .placeholder { height: 100%; aspect-ratio: auto; border-radius: 0; }
.hg-bar { margin: var(--gal-bar-gap) var(--gal-bar-inset) 0; border: var(--tab-line); border-color: transparent; }
.hg-item.is-center .hg-bar { border-color: var(--blue); }
.hg-bar .c-title { left: var(--hg-c1); }
.hg-bar .c-type { left: var(--hg-c2); }
.hg-bar .c-year { right: var(--hg-c3); }
.hg-info {
  appearance: none; -webkit-appearance: none;
  display: none; align-items: center; gap: 0.55em;
  margin: 0.45em 0 0 calc(var(--gal-bar-inset) + var(--hg-c1) - 0.25em);
  padding: 0.1em 0.25em; border: 0;
  background: none;
  white-space: nowrap;
}
.hg-item.is-center .hg-info { display: inline-flex; }
.hg-info svg { width: 0.95em; height: 0.55em; overflow: visible; }
.hg-info svg path { fill: none; stroke: currentColor; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.hg-info:hover, .hg-info:focus-visible { background: var(--nav-hover-bg); color: var(--nav-hover-text); }

/* blue placeholder for empty / missing media */
.placeholder {
  position: relative;
  display: flex; align-items: flex-end;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--img-r);
  background: var(--ph-color);
  color: var(--white);
  overflow: hidden;
}
.placeholder .ph-label {
  padding: 0.6em 0.8em;
  font-family: var(--ts-ui-family);
  font-size: var(--ts-ui-size);
  opacity: 0.85;
  word-break: break-all;
}

/* ------------------------------------------------------------ panels */
.panel {
  position: fixed; left: 0; top: 0;
  border-radius: var(--panel-r);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--panel-blur);   /* milky glass (project_panel_blur) */
  backdrop-filter: var(--panel-blur);
  user-select: none; -webkit-user-select: none;
  touch-action: none;
  opacity: 0;
  scale: 0.97;
  transition: opacity var(--panel-trans) ease, scale var(--panel-trans) cubic-bezier(.25, .8, .25, 1);
}
.panel.is-open { opacity: 1; scale: 1; }
.panel.is-dragging { transition: none; }
.panel.is-animating { transition: opacity var(--panel-trans) ease, scale var(--panel-trans) ease, translate 320ms cubic-bezier(.3, .8, .25, 1); }
.panel.is-away { visibility: hidden; pointer-events: none; }   /* belongs to another mode */
.pp-head {
  position: absolute; left: var(--pp-title-x); top: var(--pp-title-y);
  right: calc(var(--pc-right) + 2 * var(--pc-size) + var(--pc-gap) + 12px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.2;
}
.pp-place { margin-left: 0.6em; }
.pp-controls { position: absolute; right: var(--pc-right); top: var(--pc-top); z-index: 5; display: flex; gap: var(--pc-gap); line-height: 0; }
.pc {
  appearance: none; -webkit-appearance: none;
  position: relative;
  width: var(--pc-size); height: var(--pc-size);
  margin: 0; padding: 0; border: 0;
  background: none;
  color: var(--blue);
  transition: color 140ms ease;
}
.pc::before { content: ""; position: absolute; inset: -4px; background: var(--nav-hover-bg); opacity: 0; transition: opacity 140ms ease; }
.pc::after { content: ""; position: absolute; inset: -6px; }          /* bigger hit area */
.pc svg { position: relative; display: block; width: 100%; height: 100%; overflow: visible; }
.pc svg * { fill: none; stroke: currentColor; stroke-width: var(--pc-line); vector-effect: non-scaling-stroke; stroke-linecap: butt; }
.pc:hover, .pc:focus-visible { color: var(--nav-hover-text); }
.pc:hover::before, .pc:focus-visible::before { opacity: 1; }

/* the parts: one shown, the strip slides (window) */
.pp-stage { position: absolute; left: 0; right: 0; top: var(--pp-top); bottom: var(--pp-bottom); overflow: hidden; touch-action: pan-y; }
.pp-piece { position: absolute; transform-origin: 50% 50%; will-change: transform, opacity; }
.pp-frame { width: 100%; height: 100%; border-radius: var(--img-r); overflow: hidden; background: rgba(0, 14, 70, 0.05); }
.pp-media { display: block; width: 100%; height: 100%; object-fit: var(--img-fit, cover); }
/* image_fit "fit": the frame takes the picture's own shape (--ar = width / height, set by app.js once it is known),
   as large as fits into the part's box, centred – nothing cropped, corners + shadow on the picture itself */
html.img-own-shape .pp-piece.is-img, html.img-own-shape .pp-piece.is-video { container-type: size; display: grid; place-items: center; }
html.img-own-shape .pp-frame.has-ar { width: min(100cqw, calc(100cqh * var(--ar))); height: min(100cqh, calc(100cqw / var(--ar))); }
/* picture caption (project file → caption, e.g. the design studio): centred below the picture, in the room
   layoutProject keeps free under the part. "fit": right under the picture's own lower edge (--ar on the part) */
.pp-caption { position: absolute; left: 0; right: 0; top: calc(100% + var(--cap-gap, 10px)); text-align: center;
              line-height: 1.2; padding-bottom: 0.25em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
html.img-own-shape .pp-piece.has-ar .pp-caption { top: calc(50% + min(50cqh, 50cqw / var(--ar)) + var(--cap-gap, 10px)); }
.pp-caption a { color: inherit; text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1px; pointer-events: auto; }
.pp-caption a:hover { text-decoration-thickness: 2px; }
.pp-frame .placeholder { height: 100%; aspect-ratio: auto; border-radius: 0; }
.pp-frame.is-viewer { position: relative; display: grid; place-items: center; background: transparent; }
.pp-frame.is-viewer .viewer { position: absolute; inset: 0; }
.pp-frame.has-viewer .pp-vp { visibility: hidden; }
.pp-vp { text-align: center; pointer-events: none; }
.pp-card {
  display: flex; flex-direction: column;
  width: 100%; height: 100%;
  border-radius: var(--img-r);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pp-card .t-ui, .pp-card .t-ui-bold { color: var(--card-text); }
.pp-card-head { flex: none; padding: var(--card-pad) var(--card-pad) 0; }
.pp-card-body {
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 2.4em var(--card-pad) var(--card-pad);
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
  user-select: text; -webkit-user-select: text;
  touch-action: pan-y;
}
.pp-card-text { white-space: pre-line; overflow-wrap: break-word; }
.pp-card-text a, .pp-field-value a { text-decoration: underline; }
.pp-field { margin-top: 2.4em; }
.pp-field-value { white-space: pre-line; }
/* tabs: dashed boxes, the shown part filled (with several pictures: how far along) */
.pp-tabs { position: absolute; left: 0; right: 0; bottom: var(--tabs-bottom); display: flex; justify-content: center; gap: var(--tab-gap); }
.pp-tab { border: var(--tab-line); cursor: default; }
.pp-tab .c-label { left: var(--tab-pad); }
.pp-tab:hover .pbar-on, .pp-tab:focus-visible .pbar-on { clip-path: inset(0); }
.panel-resize { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; touch-action: none; }

/* maximised: the part in the middle, the neighbours ghosted at the sides, the page faded behind */
.panel.is-project.is-max {
  border-radius: 0;
  background: var(--maxed-bg);
  box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  animation: pn-max-in 240ms ease;
}
@keyframes pn-max-in { from { opacity: 0; } }
.panel.is-max .pp-stage { inset: 0; overflow: visible; }
.panel.is-max .pp-head { left: 0; right: 0; top: calc(var(--mx-top) - var(--mx-title-gap) - 1em); text-align: center; overflow: visible; }
.panel.is-max .pp-controls { right: var(--mx-ctrl-right); top: calc(var(--mx-top) - var(--mx-title-gap) - 1em); }
.panel.is-max .pp-tabs { bottom: auto; top: calc(var(--mx-bottom) + var(--mx-tabs-gap)); }
.panel.is-max .panel-resize { display: none; }
.panel.is-max .pp-piece.is-img .pp-frame, .panel.is-max .pp-piece.is-video .pp-frame { box-shadow: var(--shadow); }
.panel.is-max .pp-frame.is-viewer { background: var(--viewer-frame); box-shadow: var(--shadow); }
.panel.is-max .pp-piece:not(.is-current) { cursor: default; }
html.has-maxed #hover-box { display: none; }
html.has-maxed #collage, html.has-maxed #hgallery, html.has-maxed .panel.is-project:not(.is-max) { visibility: hidden; }   /* maximised: only the page + the faint logo behind */

/* tool windows (spectrum): same look, file loaders */
.panel.is-tool .tool-content {
  position: absolute;
  top: var(--tool-top); left: var(--tool-left); right: var(--tool-right); bottom: var(--tool-left);
  overflow-x: hidden; overflow-y: auto;
  scrollbar-width: none;
  touch-action: pan-y;
}
.tool-content::-webkit-scrollbar { display: none; }
.tool-text { margin-bottom: var(--tool-field-gap); white-space: pre-line; user-select: text; -webkit-user-select: text; }
.tool-loader + .tool-loader { margin-top: var(--tool-item-gap); }
/* the imprint / gdpr window (legal/legal.js): ABOUT text size, bold headings, a dashed line before the gdpr part */
.legal-text { line-height: 1.45; user-select: text; -webkit-user-select: text; overflow-wrap: anywhere; padding-bottom: 1.5em; }
.legal-text h2, .legal-text h3, .legal-text h4 { font-family: var(--ts-uibold-family); font-weight: var(--ts-uibold-weight); font-style: normal; color: inherit; }
.legal-text h2 { font-size: var(--ts-uibold-size); text-transform: uppercase; margin: 0 0 1.1em; }
.legal-text h3 { font-size: 1em; text-transform: uppercase; margin: 2.2em 0 0.8em; }
.legal-text h4 { font-size: 1em; margin: 1.5em 0 0.35em; }
.legal-text h2 + h3, .legal-text h2 + h4, .legal-text h3 + h4 { margin-top: 0; }
.legal-text p { margin: 0 0 0.8em; }
.legal-text ul { margin: 0 0 0.8em; padding-left: 1.4em; }
.legal-text a { color: inherit; text-decoration: underline; text-underline-offset: 0.18em; }
.legal-text [data-legal] + [data-legal] { margin-top: 2.5em; padding-top: 2em; border-top: var(--tab-line, 1px dashed currentColor); }
.tool-btn, .tool-field {
  display: block;
  height: var(--tab-h);
  padding: 0 var(--tab-pad);
  border: var(--tab-line);
  background: transparent;
  line-height: calc(var(--tab-h) - 4px);
  white-space: nowrap;
}
.tool-btn {
  appearance: none; -webkit-appearance: none;
  min-width: var(--tool-btn-w); max-width: 100%;
  margin: 0;
  text-align: left;
  transition: background-color 140ms ease, color 140ms ease;
}
.tool-btn:hover, .tool-btn:focus-visible { background: var(--nav-hover-bg); color: var(--nav-hover-text); }
.tool-field { margin-top: var(--tool-field-gap); overflow: hidden; text-overflow: ellipsis; transition: background-color 140ms ease; }
.tool-field.is-drop { background: rgba(0, 14, 70, 0.1); }

.viewer {
  position: relative;
  width: 100%; height: 100%;
  border-radius: var(--img-r);
  background: var(--viewer-frame);
  overflow: hidden;
  isolation: isolate;
}
.viewer-msg {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--ts-ui-family);
  font-size: var(--ts-ui-size);
  color: var(--blue);
  opacity: 0.7;
  pointer-events: none;
}
.viewer canvas { position: relative; z-index: 0; cursor: grab; }
.viewer canvas:active { cursor: grabbing; }
/* how to steer (viewer_hint) – fades out once the model is touched */
.viewer-hint {
  position: absolute; left: 0.9em; bottom: 0.75em; z-index: 1;
  padding: 0.15em 0.45em;
  background: rgba(255, 255, 255, 0.72);
  color: var(--blue);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 600ms ease;
}
.viewer-hint.is-off { opacity: 0; }
.viewer[data-look="right"] canvas, .viewer[data-look="right"] canvas:active { cursor: default; }
/* splat sliders at the bottom right of the 3D view: LOD (streaming splats, viewer_lod_…) + camera speed (viewer_speed_…) */
.viewer-tools {
  position: absolute; right: 0.9em; bottom: 0.75em; z-index: 1;
  display: flex; align-items: center; gap: 0.9em;
  padding: 0.15em 0.55em;
  background: rgba(255, 255, 255, 0.72);
  color: var(--blue);
  cursor: default;
}
.pp-piece:not(.is-current) .viewer-tools { opacity: 0; pointer-events: none; }
.viewer-slider { display: flex; align-items: center; gap: 0.6em; }
.viewer-slider .vs-value:empty { display: none; }
.viewer-slider .vs-value { min-width: 1ch; text-align: right; }
.viewer-slider input {
  -webkit-appearance: none; appearance: none;
  width: 7.5em; height: 14px; margin: 0; padding: 0; background: transparent; cursor: pointer;
}
.viewer-lod input { width: 6em; }
.viewer-slider input:focus { outline: none; }
.viewer-slider input::-webkit-slider-runnable-track {
  height: 6px; border: 1.2px dashed var(--blue); border-radius: 1px;
  background: linear-gradient(to right, var(--blue) calc(var(--vs-f, 0.5) * 100%), transparent 0);
}
.viewer-slider input::-moz-range-track { height: 6px; border: 1.2px dashed var(--blue); border-radius: 1px; background: transparent; }
.viewer-slider input::-moz-range-progress { height: 6px; background: var(--blue); }
.viewer-slider input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 4px; height: 14px; margin-top: -5px; border: 0; border-radius: 1px; background: var(--blue);
}
.viewer-slider input::-moz-range-thumb { width: 4px; height: 14px; border: 0; border-radius: 1px; background: var(--blue); }
.viewer-slider input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--white), 0 0 0 3.5px var(--blue); }
.pp-piece:not(.is-current) .viewer-hint { opacity: 0; }
.viewer .placeholder { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; align-items: center; justify-content: center; text-align: center; }
.viewer .placeholder .ph-label { max-width: 80%; word-break: normal; }

/* -------------------------------------------------------------- cursor */
#cursor {
  position: fixed; left: 0; top: 0;
  width: 0; height: 0;
  z-index: 2147483647;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
}
#cursor.on { opacity: 1; }
#cursor svg { position: absolute; left: 0; top: 0; overflow: visible; display: block; }
#cursor .arrow {
  transform-origin: 0 0;
  transform: rotate(var(--c-rot)) scale(var(--c-kx), var(--c-ky));
  fill: var(--c-fill);
  fill-opacity: var(--c-op);
  stroke: var(--c-stroke);
  stroke-width: var(--c-sw);
  stroke-linejoin: round;
  paint-order: stroke fill;
  vector-effect: non-scaling-stroke;
}


@media (prefers-reduced-motion: reduce) {
  .tile, .tile-media, .panel, #hover-box, .nav-item, .nav-drop, .pbar-on, .about-pic { transition-duration: 1ms !important; }
  .tile.drifts { animation: none !important; }
  .crt-lines, .crt-bar { animation: none !important; }
}

/* ===================================================== project preview
   projects/project_[n]/preview.html: only the project panel (maximised) + a check box on the left */
html.is-preview #page, html.is-preview #fog, html.is-preview #logo, html.is-preview #hover-box,
html.is-preview .pc-close { display: none !important; }
html.is-preview, html.is-preview body { overflow: hidden; height: 100%; }
#preview-box {
  position: fixed; left: 16px; top: 16px; z-index: 4500;   /* above the maximised panel (4000), below the nav (5000) */
  width: min(300px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  padding: 12px 14px 14px; border-radius: 10px; box-sizing: border-box;
  background: var(--panel-bg); box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--panel-blur); backdrop-filter: var(--panel-blur);
  color: var(--blue); line-height: 1.35; user-select: text; -webkit-user-select: text;
}
#preview-box.is-folded { width: auto; }
#preview-box.is-folded .pv-body { display: none; }
#preview-box .pv-head { display: flex; gap: 8px; align-items: baseline; }
#preview-box .pv-file { flex: 1; }
#preview-box .pv-fold { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0 2px; line-height: 1; }
#preview-box .pv-sec { margin: 12px 0 4px; font-weight: 700; letter-spacing: .02em; }
#preview-box .pv-row { display: flex; gap: 8px; padding: 2px 0; }
#preview-box .pv-k { flex: 0 0 76px; opacity: .65; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#preview-box .pv-v { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#preview-box .pv-item { cursor: pointer; border-radius: 4px; padding: 2px 4px; margin: 0 -4px; }
#preview-box .pv-item:hover { background: rgba(0, 14, 70, .07); }
#preview-box .pv-item.is-start .pv-k { opacity: 1; font-weight: 700; }
#preview-box .is-ok .pv-v, #preview-box .pv-state.is-ok { color: #1c7a3c; }
#preview-box .is-bad .pv-v, #preview-box .pv-bad, #preview-box .pv-state.is-bad { color: var(--red, #FF0000); }
#preview-box .pv-state { font-style: normal; }
#preview-box .pv-dim { opacity: .6; }
#preview-box .pv-bad { padding: 2px 0; }
#preview-box .pv-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#preview-box figure { margin: 0; }
#preview-box .pv-pic { aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: rgba(0, 14, 70, .08); display: grid; place-items: center; }
#preview-box .pv-pic.is-empty { opacity: .6; }
#preview-box .pv-media { width: 100%; height: 100%; object-fit: cover; display: block; }
#preview-box figcaption { margin-top: 3px; opacity: .65; }
#preview-box .pv-foot { margin-top: 12px; }
#preview-box .pv-pose { margin: 2px 0 6px 1.2em; }
#preview-box .pv-pose { margin-left: 0; }
#preview-box .pv-pose pre { margin: 3px 0 0; padding: 4px 6px; background: rgba(0, 14, 70, 0.06); font: inherit; font-size: 0.92em; white-space: pre; overflow-x: auto; user-select: text; -webkit-user-select: text; }

/* ======================================================= spectrum (sketch spctrum.svg)
   the glass bar in the nav (SPECTRUM · DATA · TOOLBOX · VIEW · X) and the windows TOOLBOX + DATA.
   sizes = the sketch at 1920 px × --s (the page scale). texts: text_style_tool / text_style_tool_bold */
.nav-sub {
  position: relative; display: flex; align-items: center; gap: var(--nav-gap);
  margin: calc((var(--sub-h) - 1em) / -2) 0 0 calc(-1 * var(--sub-pad-l));
  padding: calc((var(--sub-h) - 1em) / 2) var(--sub-pad-r) calc((var(--sub-h) - 1em) / 2) var(--sub-pad-l);
  height: var(--sub-h); box-sizing: border-box;
  border-radius: var(--drop-r); background: var(--sub-bg); box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--drop-blur); backdrop-filter: var(--drop-blur);
}
.nav-sub .nav-item.is-extra.is-active .nav-label:not(:hover):not(:focus-visible) { background: transparent; color: var(--ts-ui-color); }   /* (sketch: only the page name is filled) */
.nav-sub-close {
  appearance: none; -webkit-appearance: none; position: relative;
  width: calc(12px * var(--s)); height: calc(12px * var(--s)); min-width: 9px; min-height: 9px;
  margin: 0 0 0 calc(-8px * var(--s)); padding: 0; border: 0; background: none; color: var(--blue); cursor: pointer;
}
.nav-sub-close::after { content: ""; position: absolute; inset: -8px; }
.nav-sub-close svg { display: block; width: 100%; height: 100%; overflow: visible; }
.nav-sub-close svg * { fill: none; stroke: currentColor; stroke-width: 1.4px; vector-effect: non-scaling-stroke; }
.nav-sub-close:hover, .nav-sub-close:focus-visible { color: var(--red, #FF0000); }

/* windows: title 12pt at 14 px, a small X, content from 40 px (TOOLBOX 255 px wide, DATA 371 px) */
.panel.is-data, .panel.is-toolbox, .panel.is-tool { --pp-title-x: calc(14px * var(--ss)); --pp-title-y: calc(13px * var(--ss)); }
.panel.is-tool .pp-controls { right: calc(16px * var(--ss)); top: calc(12px * var(--ss)); }
.panel.is-tool .pc { width: calc(12.5px * var(--ss)); height: calc(12.5px * var(--ss)); min-width: 10px; min-height: 10px; }
.panel.is-data .tool-content, .panel.is-toolbox .tool-content { top: calc(40px * var(--ss)); left: 0; right: 0; bottom: 0; }
.tool-inner { display: flow-root; }   /* (the first margin stays inside: measured for "auto" heights) */
.panel.is-data .tool-inner { padding: 0 calc(11.5px * var(--ss)) calc(12.7px * var(--ss)); }
.panel.is-toolbox .tool-inner { padding: 0 calc(22px * var(--ss)) calc(34px * var(--ss)) calc(15px * var(--ss)); }

.sq-btn {
  appearance: none; -webkit-appearance: none; flex: none;
  width: calc(36.6px * var(--ss)); height: calc(36.6px * var(--ss)); min-width: 24px; min-height: 24px;
  margin: 0; padding: 0; display: grid; place-items: center;
  border: 1px solid rgba(0, 14, 70, 0.55); border-radius: calc(4.6px * var(--ss));
  background: var(--white); color: var(--blue); box-shadow: 0 1px 4px rgba(0, 14, 70, 0.12);
  cursor: pointer; transition: background-color 140ms ease, color 140ms ease;
}
.sq-btn svg { width: 58%; height: 58%; overflow: visible; }
.sq-btn svg * { fill: none; stroke: currentColor; stroke-width: 1.3px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.sq-btn:hover, .sq-btn:focus-visible, .sq-btn.is-on { background: var(--nav-hover-bg); color: var(--nav-hover-text); border-color: var(--nav-hover-bg); }
.sq-btn.is-on:hover { opacity: 0.85; }

/* TOOLBOX */
.tb-row { display: flex; gap: calc(20.3px * var(--ss)); padding-left: calc(2.3px * var(--ss)); }
.tb-tools { margin-top: calc(33.5px * var(--ss)); }
.tb-title { margin: calc(41.6px * var(--ss)) 0 0 calc(7.9px * var(--ss)); }
.tb-text { margin: calc(7.8px * var(--ss)) 0 0 calc(7.9px * var(--ss)); }
.sec-list {
  margin-top: calc(2.6px * var(--ss)); padding: calc(6.3px * var(--ss)) calc(5.8px * var(--ss));
  min-height: calc(153.4px * var(--ss)); box-sizing: border-box;
  border: 1px dashed var(--blue);
}
.sec-row {
  appearance: none; -webkit-appearance: none; display: block; width: 100%;
  height: calc(28.5px * var(--ss)); min-height: 18px; margin: 0 0 calc(0.8px * var(--ss)); padding: 0 calc(7px * var(--ss));
  border: 0; border-radius: calc(4px * var(--ss)); background: transparent; text-align: left; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background-color 140ms ease, color 140ms ease;
}
.sec-row:hover { background: rgba(0, 14, 70, 0.08); }
.sec-row.is-on { background: var(--nav-hover-bg); color: var(--nav-hover-text); }
.tb-gizmo { margin-top: calc(13.9px * var(--ss)); }

/* DATA: one card per layer */
.dl-layer + .dl-layer { margin-top: calc(36.8px * var(--ss)); }
.dl-title { margin: calc(5.9px * var(--ss)) 0 calc(2.8px * var(--ss)) calc(7.7px * var(--ss)); }
.dl-card { padding: calc(5px * var(--ss)) calc(5.3px * var(--ss)) calc(18.9px * var(--ss)); border: 1px dashed var(--blue); transition: background-color 140ms ease; }
.dl-info { padding-left: calc(1px * var(--ss)); }
.dl-field { height: calc(19px * var(--ss)); min-height: 14px; line-height: calc(19px * var(--ss)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-drop {
  appearance: none; -webkit-appearance: none; display: block; width: 100%;
  height: calc(45.7px * var(--ss)); min-height: 26px; margin: calc(6px * var(--ss)) 0 0; padding: 0 calc(10px * var(--ss));
  border: 1px solid rgba(0, 14, 70, 0.55); border-radius: calc(4.6px * var(--ss));
  background: var(--white); color: rgba(0, 14, 70, 0.5); text-align: center; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background-color 140ms ease, color 140ms ease, height 200ms ease;
}
.dl-layer.is-active .dl-drop { height: calc(28.5px * var(--ss)); min-height: 18px; }
.dl-layer.is-active .dl-drop, .dl-layer.is-drag .dl-drop, .dl-drop:hover, .dl-drop:focus-visible {
  background: var(--nav-hover-bg); color: var(--nav-hover-text); border-color: var(--nav-hover-bg);
}
.dl-layer.is-drag .dl-card { background: rgba(0, 14, 70, 0.06); }
.dl-row { display: flex; align-items: center; margin-top: calc(8.4px * var(--ss)); }
.dl-align { width: calc(155.5px * var(--ss)); min-width: 96px; }
.dl-squares { display: flex; gap: calc(20.3px * var(--ss)); margin-left: auto; padding-right: calc(4.6px * var(--ss)); }
.dl-add { margin: calc(14.7px * var(--ss)) 0 0 calc(4.6px * var(--ss)); width: calc(46.8px * var(--ss)); height: calc(45.7px * var(--ss)); }
.dl-add svg { width: 52%; height: 52%; }
.dl-add svg * { stroke-width: 1px; }
