    @property --primary-color {
      syntax: '<color>';
      inherits: true;
      initial-value: #ffffff;
    }
    :root {
      --primary-color: #fff;
      --bg-color: #000;
      --dim: color-mix(in srgb, var(--primary-color) 55%, transparent);
      --faint: color-mix(in srgb, var(--primary-color) 28%, transparent);
      --glow: color-mix(in srgb, var(--primary-color) 45%, transparent);
    }
    body.theme-green { --primary-color: #33ff33; }
    body.theme-red   { --primary-color: #ff3333; }
    body.theme-blue  { --primary-color: #0099ff; }

    * { box-sizing: border-box; margin: 0; padding: 0; }

    /* The content area scrolls on its own; the page itself is always exactly one screen tall */
    html, body { height: 100%; overflow: hidden; }
    body {
      background: var(--bg-color);
      color: var(--primary-color);
      font-family: 'VT323', monospace;
    }
    /* smooth theme sweep: the accent color itself interpolates (JS adds .ready after first paint) */
    body.ready { transition: --primary-color 0.35s ease; }

    ::selection { background: var(--primary-color); color: var(--bg-color); }

    a { color: inherit; }

    /* ---------- CRT layers ---------- */
    /* animated film-grain noise */
    .crt-noise {
      position: fixed;
      inset: -60px;
      background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E") repeat;
      opacity: 0.045;
      pointer-events: none;
      z-index: 41;
      animation: noise-shift 0.5s steps(4) infinite;
    }
    @keyframes noise-shift {
      0%   { transform: translate(0, 0); }
      25%  { transform: translate(-18px, 12px); }
      50%  { transform: translate(14px, -20px); }
      75%  { transform: translate(-10px, -14px); }
      100% { transform: translate(16px, 18px); }
    }
    .crt-vignette {
      position: fixed;
      inset: 0;
      background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,0.38) 88%, rgba(0,0,0,0.72) 100%);
      pointer-events: none;
      z-index: 43;
    }

    /* ---------- screen ---------- */
    #screen { transition: filter 0.22s; animation: flicker 6s steps(1) infinite; }
    @keyframes flicker {
      0%, 41.9%, 43.1%, 78.9%, 80.1%, 100% { opacity: 1; }
      42% { opacity: 0.96; }
      79% { opacity: 0.98; }
    }

    /* ---------- theme squares, top right (like Low Res 2 window controls) ---------- */
    .theme-controls {
      position: fixed;
      top: 16px;
      right: 24px;
      display: flex;
      gap: 10px;
      z-index: 7;
    }
    .control-btn {
      width: 16px;
      height: 16px;
      border: 1px solid var(--dim);
      padding: 0;
      cursor: pointer;
      transition: opacity 0.2s;
    }
    .control-btn:hover { opacity: 0.8; }
    .control-btn.t-white { background: #fff; }
    .control-btn.t-green { background: #33ff33; }
    .control-btn.t-red   { background: #ff3333; }
    .control-btn.t-blue  { background: #0099ff; }
    .control-btn.active { box-shadow: 0 0 0 1px var(--bg-color), 0 0 0 2px var(--primary-color); }

    /* ---------- fixed left column ---------- */
    nav {
      position: fixed;
      top: 16px;
      left: 16px;
      width: 244px;
      height: calc(100vh - 32px);
      overflow-y: auto;
      scrollbar-width: none;
      z-index: 6;
    }
    nav::-webkit-scrollbar { display: none; }

    /* ---------- DOS tree menu (like Low Res 2 projects pane) ---------- */
    #tree {
      font-family: 'VT323', monospace;
      font-size: 17px;
      line-height: 22px;
    }
    #tree .t-root { margin-top: 14px; user-select: none; }
    #tree .t-root:first-child { margin-top: 0; }
    #tree .t-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #tree .t-line a {
      display: inline-block;
      padding: 0 5px;
      margin-left: -5px;
      text-decoration: none;
    }
    #tree .t-line a:hover,
    #tree .t-line a:focus-visible {
      background: var(--primary-color);
      color: var(--bg-color);
      outline: none;
    }
    #tree .t-line a.on { background: color-mix(in srgb, var(--primary-color) 14%, transparent); }
    #tree .t-line a.on:hover { background: var(--primary-color); color: var(--bg-color); }

    /* ---------- main view ---------- */
    main {
      position: fixed;
      top: 0;
      right: 0;
      bottom: 0;
      left: 276px;
      overflow-y: auto;
      scrollbar-width: none;
      padding: 54px 24px 24px 8px;
      z-index: 6;
    }
    main::-webkit-scrollbar { display: none; }

    .view { display: flex; flex-direction: column; height: 100%; position: relative; }

    /* slideshow viewer */
    .stage {
      position: relative;
      flex: 1;
      min-height: 260px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0;
    }
    #stage-img {
      display: block;
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
      image-rendering: pixelated;
    }
    /* minimal viewer: image + hairline hud */
    .hud {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px 14px;
      padding-top: 12px;
      font-family: 'Roboto Mono', monospace;
      font-size: 11px;
      letter-spacing: 1px;
      text-transform: uppercase;
      flex-shrink: 0;
    }
    #hud-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #hud-title::before { content: '\25B6 '; color: var(--dim); }
    #hud-pos { color: var(--dim); }
    .hud-right { display: flex; flex: 1; min-width: 0; justify-content: flex-end; align-items: center; gap: 10px; }
    .hud-controls { display: flex; gap: 14px; margin: 0 auto; }
    .hud-controls button, #grid-toggle {
      background: none;
      border: none;
      color: var(--dim);
      font-family: inherit;
      font-size: inherit;
      letter-spacing: inherit;
      text-transform: uppercase;
      padding: 2px 4px;
      cursor: pointer;
    }
    .hud-controls button:hover, .hud-controls button:focus-visible,
    #grid-toggle:hover, #grid-toggle:focus-visible {
      background: var(--primary-color);
      color: var(--bg-color);
      outline: none;
    }

    /* works index drawer */
    #grid-overlay {
      position: absolute;
      inset: 0;
      z-index: 7;
      display: flex;
      flex-direction: column;
      background: var(--bg-color);
      transform: translateY(102%);
      visibility: hidden;
      transition: transform .28s ease, visibility .28s;
    }
    #grid-overlay.open { transform: translateY(0); visibility: visible; }
    .gx-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 14px;
      padding: 10px 0;
      border-bottom: 1px solid var(--faint);
      font-family: 'Roboto Mono', monospace;
      font-size: 11px;
      letter-spacing: 1px;
      text-transform: uppercase;
      color: var(--dim);
      flex-shrink: 0;
    }
    .gx-head button {
      background: none;
      border: none;
      color: var(--dim);
      font-family: inherit;
      font-size: inherit;
      letter-spacing: inherit;
      padding: 2px 4px;
      cursor: pointer;
    }
    .gx-head button:hover, .gx-head button:focus-visible {
      background: var(--primary-color);
      color: var(--bg-color);
      outline: none;
    }
    .gx-grid {
      flex: 1;
      overflow-y: auto;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
      gap: 10px;
      align-content: start;
      padding: 14px 0;
      scrollbar-width: thin;
    }
    .gx-item {
      background: none;
      border: 1px solid var(--faint);
      padding: 6px;
      cursor: pointer;
      color: var(--primary-color);
      font-family: 'Roboto Mono', monospace;
      font-size: 10px;
      letter-spacing: 1px;
      text-transform: uppercase;
      text-align: left;
      content-visibility: auto;
      contain-intrinsic-size: auto 170px;
    }
    .gx-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; image-rendering: pixelated; }
    .gx-item span { display: block; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--dim); }
    .gx-item:hover, .gx-item:focus-visible { background: var(--primary-color); color: var(--bg-color); outline: none; }
    .gx-item:hover span, .gx-item:focus-visible span { color: var(--bg-color); }
    .gx-item.on { border-color: var(--primary-color); }
    .gx-item.on span { color: var(--primary-color); }

    /* home view */
    .home h1.glitch {
      position: relative;
      display: inline-block;
      font-size: clamp(56px, 10vw, 128px);
      line-height: 0.9;
      font-weight: 400;
      letter-spacing: 6px;
      text-shadow: 0 0 10px var(--glow), 0 0 42px color-mix(in srgb, var(--primary-color) 18%, transparent);
      margin: 12px 0 18px;
    }
    .glitch::before, .glitch::after {
      content: attr(data-text);
      position: absolute;
      inset: 0;
      letter-spacing: inherit;
      opacity: 0;
      pointer-events: none;
    }
    .glitch::before { color: #0ff; animation: gl-a 5.2s steps(1) infinite; }
    .glitch::after  { color: #f0f; animation: gl-b 6.7s steps(1) infinite; }
    @keyframes gl-a {
      0%, 91.9%, 94%, 100% { opacity: 0; }
      92% { opacity: 0.8; clip-path: inset(12% 0 58% 0); transform: translate(-5px, -2px); }
      93% { opacity: 0.8; clip-path: inset(62% 0 8% 0);  transform: translate(4px, 2px); }
    }
    @keyframes gl-b {
      0%, 55.9%, 58%, 100% { opacity: 0; }
      56% { opacity: 0.7; clip-path: inset(38% 0 32% 0); transform: translate(5px, 1px); }
      57% { opacity: 0.7; clip-path: inset(4% 0 78% 0);  transform: translate(-4px, -1px); }
    }
    .statement {
      font-size: clamp(20px, 3vw, 28px);
      text-shadow: 0 0 8px var(--glow);
      margin-bottom: 28px;
    }
    .statement::before { content: '> '; color: var(--dim); }
    .cursor { animation: blink 1.06s steps(1) infinite; }
    @keyframes blink { 50% { opacity: 0; } }
    .text {
      max-width: 68ch;
      font-family: 'Roboto Mono', monospace;
      font-size: 12px;
      line-height: 1.7;
    }
    .text p + p { margin-top: 1.4em; }
    .text .serieslist { color: var(--dim); }

    /* dimmed work art behind the home text */
    .home { position: relative; }
    .home-bg {
      position: absolute;
      inset: 0;
      background-position: center;
      background-size: cover;
      image-rendering: pixelated;
      opacity: 0.14;
      filter: saturate(0.55) contrast(1.05);
      pointer-events: none;
    }
    .home > *:not(.home-bg) { position: relative; z-index: 1; }

    /* links view */
    .links-list { font-family: 'Roboto Mono', monospace; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
    .links-list p { margin-bottom: 14px; }
    .links-list a { text-decoration: none; }
    .links-list a:hover { background: var(--primary-color); color: var(--bg-color); }
    .links-list .sub { color: var(--dim); margin-top: 20px; }
    .foot-note { color: var(--dim); margin-top: 28px; font-family: 'Roboto Mono', monospace; font-size: 11px; }

    /* exhibitions view */
    .exhibitions { gap: 28px; }
    .exhibit { flex-shrink: 0; }
    .exhibit video {
      display: block;
      width: 100%;
      max-height: 72vh;
      background: #000;
      border: 1px solid var(--faint);
    }
    .exhibit-cap {
      margin-top: 8px;
      font-family: 'Roboto Mono', monospace;
      font-size: 11px;
      letter-spacing: 1px;
      text-transform: uppercase;
    }
    .exhibit-cap span { color: var(--dim); margin-left: 10px; }

    /* works data source — read by JS; shown as a plain grid only without JS */
    #works-source { display: none; }

    /* ---------- boot overlay (z-30: under the CRT noise/vignette layers) ---------- */
    #boot {
      position: fixed;
      inset: 0;
      z-index: 30;
      background: var(--bg-color);
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      justify-content: flex-start;
      padding: 4vh 4vw;
      cursor: pointer;
      transition: opacity 0.4s;
    }
    #boot.done { opacity: 0; pointer-events: none; }
    #boot-log {
      font-family: 'VT323', monospace;
      font-size: clamp(12px, 1.6vw, 16px);
      line-height: 1.45;
      white-space: pre-wrap;
      text-shadow: 0 0 6px var(--glow);
    }
    .boot-skip {
      position: absolute;
      bottom: 4vh;
      left: 4vw;
      font-family: 'Roboto Mono', monospace;
      font-size: 9px;
      letter-spacing: 2px;
      color: var(--dim);
      animation: blink 1.2s steps(1) infinite;
    }

    /* ---------- mobile top bar + tree overlay ---------- */
    #mobilebar { display: none; }
    #menu-close { display: none; }

    @media (max-width: 640px) {
      html, body { height: auto; overflow: auto; }
      body.menu-open { overflow: hidden; }

      body > .theme-controls { display: none; }
      #mobilebar {
        display: flex;
        align-items: center;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 8;
        background: var(--bg-color);
        border-bottom: 1px solid var(--faint);
        padding: 10px 12px;
        font-family: 'Roboto Mono', monospace;
        font-size: 11px;
        letter-spacing: 1px;
      }
      .mb-logo { font-family: 'VT323', monospace; font-size: 26px; letter-spacing: 2px; }
      .mb-spacer { flex: 1; }
      #mobilebar .theme-controls { position: static; display: flex; gap: 8px; }
      #menu-open, #menu-close {
        background: none;
        border: 1px solid var(--faint);
        color: var(--primary-color);
        font-family: inherit;
        font-size: inherit;
        letter-spacing: inherit;
        text-transform: uppercase;
        padding: 3px 10px;
        cursor: pointer;
      }
      #menu-open:hover, #menu-close:hover {
        background: var(--primary-color);
        color: var(--bg-color);
      }

      /* tree becomes a full-screen terminal overlay */
      nav {
        position: fixed;
        inset: 0;
        z-index: 35;
        width: auto;
        height: auto;
        padding: 12px 16px;
        background: var(--bg-color);
        display: none;
        overflow-y: auto;
      }
      nav.open { display: block; }
      body.menu-open #mobilebar { display: none; }
      #menu-close { display: block; margin: 0 0 10px auto; }
      #tree { margin-top: 6px; font-size: 19px; line-height: 26px; }

      main { position: static; overflow: visible; padding: 12px; }
      .view { height: calc(100vh - 80px); height: calc(100svh - 80px); overflow-y: auto; }
      .stage { flex: 1 1 auto; height: auto; min-height: 220px; }
      .gx-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
      body.grid-open .view { overflow: hidden; }

      /* mobile viewer: title above the image, controls pinned below — no jumping between works */
      .view.viewer {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto minmax(0, 1fr) auto;
        grid-template-areas:
          "title title"
          "stage stage"
          "controls pos";
        row-gap: 10px;
      }
      .view.viewer .hud { display: contents; }
      .view.viewer #hud-title { grid-area: title; min-width: 0; }
      .view.viewer .stage { grid-area: stage; }
      .view.viewer .hud-controls { grid-area: controls; justify-self: start; margin: 0; }
      .view.viewer .hud-right { grid-area: pos; justify-self: end; align-self: center; }
    }

    @media (prefers-reduced-motion: reduce) {
      #screen, .crt-noise, .glitch::before, .glitch::after,
      .cursor, .boot-skip { animation: none !important; }
      #grid-overlay { transition: none !important; }
    }
