/* Cyberfem Networks — early-web, hand-built. */

:root {
  --bg: #08080a;
  --panel: #121217;
  --panel-2: #1b1b22;
  --ink: #f1eee7;
  --dim: #a29eab;
  --magenta: #ff2bd6;
  --green: #39ff14;
  --cyan: #00e5ff;
  --identity: var(--magenta);
  --resistance: var(--green);
  --bodies: var(--cyan);
  --bevel-hi: #5d5b68;
  --bevel-lo: #050506;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --pixel: 'VT323', ui-monospace, monospace;
  --chrome-h: 76px;
  --status-h: 28px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--mono);
  padding-bottom: var(--status-h);
  /* The original exhibition's dotted grid, slowed down */
  background-image:
    radial-gradient(rgba(57, 255, 20, .55) 1px, transparent 1.4px),
    radial-gradient(rgba(255, 43, 214, .55) 1px, transparent 1.4px);
  background-size: 48px 48px;
  background-position: 0 0, 24px 24px;
  animation: drift 40s linear infinite;
}
body.still, body.still * { animation: none !important; transition: none !important; }

@keyframes drift {
  to { background-position: 96px 96px, 120px 120px; }
}

a { color: var(--cyan); }
a:hover { color: var(--green); }
em { font-style: italic; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px dashed var(--green); outline-offset: 3px; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 999;
  background: var(--green); color: #000; padding: 4px 10px;
}
.skip:focus { left: 8px; }

/* ---------- Browser chrome ---------- */
.chrome {
  position: sticky; top: 0; z-index: 50;
  background: var(--panel-2);
  border-bottom: 2px solid var(--bevel-lo);
  box-shadow: inset 0 -1px 0 var(--bevel-hi);
}
.chrome-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px;
}
.lights { display: flex; gap: 6px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; display: block; background: var(--magenta); }
.lights i:nth-child(2) { background: #ffd23a; }
.lights i:nth-child(3) { background: var(--green); }

.location {
  flex: 1; min-width: 0;
  background: #000; color: var(--green);
  border: 2px solid; border-color: var(--bevel-lo) var(--bevel-hi) var(--bevel-hi) var(--bevel-lo);
  padding: 2px 10px;
  font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.location .proto { color: var(--dim); }
.caret { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.sound {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--pixel); font-size: 20px; line-height: 1;
  padding: 4px 10px;
  background: var(--panel); color: var(--dim);
  border: 2px solid; border-color: var(--bevel-hi) var(--bevel-lo) var(--bevel-lo) var(--bevel-hi);
}
.sound[aria-pressed="true"] { color: var(--green); border-color: var(--bevel-lo) var(--bevel-hi) var(--bevel-hi) var(--bevel-lo); }
.sound-icon { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.sound-icon i { width: 3px; height: 3px; background: currentColor; }
.sound[data-live="true"] .sound-icon i { animation: level .9s ease-in-out infinite alternate; }
.sound-icon i:nth-child(2) { animation-delay: -.3s !important; }
.sound-icon i:nth-child(3) { animation-delay: -.6s !important; }
.sound-icon i:nth-child(4) { animation-delay: -.15s !important; }
@keyframes level { from { height: 3px; } to { height: 12px; } }

.views { display: flex; }
.views button {
  font-family: var(--pixel); font-size: 20px; line-height: 1;
  padding: 4px 12px;
  background: var(--panel);
  border: 2px solid; border-color: var(--bevel-hi) var(--bevel-lo) var(--bevel-lo) var(--bevel-hi);
}
.views button[aria-pressed="true"] {
  background: var(--magenta); color: #000;
  border-color: var(--bevel-lo) var(--bevel-hi) var(--bevel-hi) var(--bevel-lo);
}

.ticker {
  overflow: hidden; white-space: nowrap;
  border-top: 1px dotted #33323b;
  font-family: var(--pixel); font-size: 18px; color: var(--magenta);
  padding: 2px 0;
}
.ticker-track { display: inline-block; animation: tick 70s linear infinite; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- Intro ---------- */
.intro { padding: 28px 24px 0; }
h1, h2 { font-family: var(--pixel); font-weight: 400; letter-spacing: .02em; }
h1 {
  margin: 0;
  font-size: clamp(44px, 7vw, 88px); line-height: .9;
  color: var(--magenta);
}
.glow { text-shadow: 0 0 10px rgba(255, 43, 214, .8), 0 0 26px rgba(57, 255, 20, .35); }
.subtitle { margin: 6px 0 0; font-family: var(--pixel); font-size: 28px; color: var(--green); line-height: 1.1; }
.byline { margin: 4px 0 0; color: var(--dim); font-size: 13px; }
.intro-row { display: flex; align-items: flex-start; gap: 24px; margin-top: 14px; }
.lede { margin: 0; max-width: 620px; background: rgba(8, 8, 10, .85); }

/* Desktop icon */
.icon {
  flex: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: 0; padding: 4px;
}
.icon-img {
  width: 34px; height: 42px; position: relative;
  background: repeating-linear-gradient(#fff 0 2px, #fff 2px 6px, #bdbdbd 6px 7px);
  background-color: #fff;
  clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%);
  border: 0;
}
.icon-label { font-family: var(--pixel); font-size: 18px; line-height: 1; padding: 1px 4px; }
.icon:hover .icon-label, .icon:focus-visible .icon-label { background: var(--magenta); color: #000; }
body[data-view="index"] .icon { display: none; }

/* ---------- Statement ---------- */
.statement {
  max-width: 760px;
  margin: 24px;
  padding: 18px 22px;
  background: rgba(10, 10, 13, .92);
  border-left: 3px solid var(--green);
}
.statement h2 { margin: 0 0 8px; font-size: 30px; color: var(--green); }
.statement p { margin: 0 0 1em; }
.howto { color: var(--dim); border-top: 1px dotted #3a3942; padding-top: .8em; }

/* ---------- Network ---------- */
.network {
  position: relative;
  height: max(620px, calc(100vh - var(--chrome-h) - 90px));
  margin: 8px 24px 0;
}
.wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wire { stroke-width: 1.2; stroke-dasharray: 4 5; opacity: .45; transition: opacity .2s, stroke-width .2s; animation: flow 3s linear infinite; }
.wire-identity { stroke: var(--identity); }
.wire-resistance { stroke: var(--resistance); }
.wire-bodies { stroke: var(--bodies); }
.wire-bond { stroke: #ffd23a; stroke-dasharray: 1 6; stroke-width: 2; stroke-linecap: round; }
.wire.hot, .wire.lit { opacity: 1; stroke-width: 2.4; }
body[data-theme]:not([data-theme=""]) .wire:not(.lit) { opacity: .1; }
@keyframes flow { to { stroke-dashoffset: -18; } }

.hub, .node {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
}
.hub {
  background: rgba(8, 8, 10, .9);
  border: 0; padding: 6px 10px;
  max-width: 230px;
}
.hub-label { display: block; font-family: var(--pixel); font-size: 30px; line-height: 1; white-space: nowrap; }
.hub-blurb { display: block; font-size: 11px; color: var(--dim); line-height: 1.4; margin-top: 4px; }
.hub-identity .hub-label { color: var(--identity); }
.hub-resistance .hub-label { color: var(--resistance); }
.hub-bodies .hub-label { color: var(--bodies); }
.hub[aria-pressed="true"] { outline: 1px solid currentColor; }
.hub[aria-pressed="true"] .hub-label { text-shadow: 0 0 12px currentColor; }

.node {
  width: 156px;
  padding: 6px 6px 8px;
  background: var(--panel);
  border: 2px solid; border-color: var(--bevel-hi) var(--bevel-lo) var(--bevel-lo) var(--bevel-hi);
  transition: transform .18s, box-shadow .18s, opacity .2s;
}
.node:hover, .node:focus-visible, .node.hot {
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 0 0 1px var(--magenta), 0 0 22px rgba(255, 43, 214, .55);
  z-index: 2;
}
.node.dim, tr.dim { opacity: .18; }
.thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #000; margin-bottom: 6px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.85) contrast(1.05); }
.node-artist { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.node-title { display: block; font-size: 13px; line-height: 1.25; font-style: italic; }
.node-year { display: block; font-size: 11px; color: var(--green); }
.node-dots { display: flex; justify-content: center; gap: 4px; margin-top: 4px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.node-dots .dot { margin: 0; }
.dot-identity { background: var(--identity); }
.dot-resistance { background: var(--resistance); }
.dot-bodies { background: var(--bodies); }

/* ---------- Timeline ---------- */
.timeline { margin: 8px 24px 32px; padding: 34px 0 26px; }
.timeline-axis { position: relative; height: 2px; background: repeating-linear-gradient(90deg, var(--dim) 0 4px, transparent 4px 8px); margin: 0 18px; }
.year-mark { position: absolute; top: 10px; transform: translateX(-50%); font-size: 11px; color: var(--dim); }
.tick {
  position: absolute; bottom: 4px;
  transform: translate(-50%, calc(var(--stack) * -22px));
  padding: 0 4px; border: 1px solid var(--magenta);
  background: var(--bg); color: var(--magenta);
  font-family: var(--pixel); font-size: 16px; line-height: 18px;
}
.tick.hot, .tick:hover, .tick:focus-visible { background: var(--magenta); color: #000; }

/* ---------- Index (directory listing) ---------- */
.listing { margin: 24px; max-width: 1100px; }
.listing h2 { font-size: 34px; margin: 0 0 10px; color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter { background: none; border: 0; padding: 0; color: var(--dim); }
.filter[aria-pressed="true"] { color: var(--ink); text-decoration: underline; }
.filter-identity[aria-pressed="true"] { color: var(--identity); }
.filter-resistance[aria-pressed="true"] { color: var(--resistance); }
.filter-bodies[aria-pressed="true"] { color: var(--bodies); }
.listing table { width: 100%; border-collapse: collapse; background: rgba(8, 8, 10, .92); }
.listing th { text-align: left; font-weight: 600; border-bottom: 1px solid var(--dim); padding: 6px 10px; }
.listing td { padding: 8px 10px; border-bottom: 1px dotted #33323b; vertical-align: top; font-size: 14px; }
.listing tr[data-work] { transition: opacity .2s; }
.listing tr[data-work]:hover { background: #17161d; }
.listing td:nth-child(3) { color: var(--dim); white-space: nowrap; }
.listing .file { white-space: nowrap; }
.listing address { margin-top: 14px; color: var(--dim); font-style: italic; font-size: 13px; border-top: 1px solid var(--dim); padding-top: 8px; }

/* ---------- View switching ---------- */
body[data-view="network"] .listing { display: none; }
body[data-view="network"] .statement { display: none; }
body[data-view="index"] .network,
body[data-view="index"] .timeline { display: none; }

/* ---------- Windows ---------- */
.win {
  position: fixed;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 130px);
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 2px solid; border-color: var(--bevel-hi) var(--bevel-lo) var(--bevel-lo) var(--bevel-hi);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .7);
  animation: pop .14s steps(3);
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.win.dragging { opacity: .9; }
.win-readme { width: min(440px, calc(100vw - 32px)); }

.win-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 4px 3px 10px;
  background: linear-gradient(90deg, #c4119f, #4b1a8c);
  cursor: grab; user-select: none; touch-action: none;
}
.win.dragging .win-bar { cursor: grabbing; }
.win-readme .win-bar { background: linear-gradient(90deg, #1f8f12, #0c4a52); }
.win-title { flex: 1; font-family: var(--pixel); font-size: 20px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-btns { display: flex; gap: 3px; }
.win-btns i, .win-close {
  width: 22px; height: 20px; display: grid; place-items: center;
  font-style: normal; font-size: 14px; line-height: 1;
  background: var(--panel-2); color: var(--ink);
  border: 2px solid; border-color: var(--bevel-hi) var(--bevel-lo) var(--bevel-lo) var(--bevel-hi);
  padding: 0;
}
.win-close { font-size: 18px; }
.win-close:active { border-color: var(--bevel-lo) var(--bevel-hi) var(--bevel-hi) var(--bevel-lo); }

.win-body { padding: 14px 16px 16px; overflow: auto; font-size: 14px; }
.win-body p { margin: 0 0 .9em; }
.win-img { display: block; border: 1px solid var(--green); background: #000; }
.win-img img { display: block; width: 100%; height: auto; }
.win-img:hover { box-shadow: 0 0 14px rgba(57, 255, 20, .5); }
.win-meta { margin-top: 12px !important; }
.win-meta span { color: var(--green); font-weight: 600; }
.win-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: none; border: 1px solid; padding: 0 8px; font-family: var(--pixel); font-size: 17px; }
.chip-identity { color: var(--identity); }
.chip-resistance { color: var(--resistance); }
.chip-bodies { color: var(--bodies); }
.note { color: #ffd23a; font-size: 12px; }
.visit { font-weight: 600; }

/* ---------- Status bar ---------- */
.status {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: var(--status-h);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 0 12px;
  background: var(--panel-2);
  border-top: 2px solid var(--bevel-hi);
  font-size: 12px; color: var(--dim);
}
.status span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Small screens: the network becomes a stack ---------- */
@media (max-width: 820px) {
  .chrome-row { padding: 8px 16px; gap: 8px; }
  .lights, .status-right { display: none; }
  .sound { padding: 4px 8px; font-size: 0; gap: 0; }
  .sound .sound-icon { height: 14px; }
  .intro { padding: 22px 16px 0; }
  .statement { margin: 18px 16px; padding: 14px 16px; }
  .intro-row { flex-direction: column; gap: 10px; }
  .icon { flex-direction: row; padding: 0; }
  .icon-img { width: 22px; height: 27px; }

  .network { height: auto; margin: 0 16px; }
  .wires { display: none; }
  .hubs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; position: sticky; top: var(--chrome-h); z-index: 5; background: var(--bg); padding: 8px 0; }
  .hub, .node { position: static; transform: none; }
  .hub { padding: 2px 6px; max-width: none; border: 1px solid #33323b; }
  .hub-label { font-size: 20px; }
  .hub-blurb { display: none; }
  .nodes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .node { width: auto; }
  .node:hover, .node:focus-visible, .node.hot { transform: none; }

  /* Too cramped to read at this width; the index view is chronological */
  .timeline { display: none; }
  .nodes { margin-bottom: 32px; }
  .win-btns { display: none; }

  .listing { margin: 16px; }
  .listing thead { display: none; }
  .listing tr { display: grid; grid-template-columns: 1fr auto; padding: 8px 0; border-bottom: 1px dotted #33323b; }
  .listing td { border: 0; padding: 2px 6px; }
  .listing td:nth-child(3) { grid-column: 1 / -1; }
  .listing td:nth-child(4) { grid-column: 1 / -1; }
  .listing tr.parent td { grid-column: 1 / -1; }

  /* Windows open as full-screen sheets */
  .win {
    inset: var(--chrome-h) 0 var(--status-h) 0 !important;
    width: auto; max-height: none;
    box-shadow: none;
  }
  .win-bar { cursor: default; }
}

/* ---------- Splash: the dial-up gateway ---------- */
body.locked { overflow: hidden; }
.splash {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(rgba(57, 255, 20, .5) 1px, transparent 1.4px) 0 0 / 48px 48px,
    radial-gradient(rgba(255, 43, 214, .5) 1px, transparent 1.4px) 24px 24px / 48px 48px,
    #050506;
  transition: opacity .5s steps(5), visibility 0s .5s;
}
.splash.gone { opacity: 0; visibility: hidden; }
.splash::after { /* scanlines */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .28) 2px 4px);
}
.splash-inner { position: relative; z-index: 1; text-align: center; max-width: 640px; }
.splash-kicker { margin: 0; font-family: var(--pixel); font-size: 22px; color: var(--dim); letter-spacing: .2em; text-transform: uppercase; }
.splash-title { margin: 6px 0 0; color: var(--magenta); font-size: clamp(52px, 11vw, 112px); line-height: .85; }
.splash-sub { margin: 14px 0 0; font-family: var(--pixel); font-size: clamp(22px, 4vw, 30px); color: var(--green); line-height: 1.1; }
.splash-by { margin: 8px 0 0; font-size: 13px; color: var(--dim); }

.splash-enter {
  display: block; margin: 40px auto 0;
  font-family: var(--pixel); font-size: 44px; line-height: 1;
  padding: 10px 28px;
  color: var(--magenta); background: #000;
  border: 2px solid var(--magenta);
  box-shadow: 0 0 0 1px #000, 0 0 24px rgba(255, 43, 214, .45);
  animation: blink 1.1s steps(1) infinite;
}
.splash-enter:hover { background: var(--magenta); color: #000; animation: none; }
.splash-quiet {
  display: block; margin: 16px auto 0;
  background: none; border: 0; padding: 4px;
  font-size: 12px; color: var(--dim); text-decoration: underline;
}
.splash-quiet:hover { color: var(--cyan); }

.splash-log {
  min-height: 0; margin: 0 auto; width: max-content; max-width: 100%;
  font: 15px/1.5 var(--mono); color: var(--green); text-align: left;
  white-space: pre-wrap;
}
.splash.dialing .splash-enter, .splash.dialing .splash-quiet { display: none; }
.splash.dialing .splash-log { margin-top: 36px; min-height: 7.5em; }

.splash-badge {
  display: inline-flex; flex-direction: column; margin: 40px 0 0;
  font-family: var(--pixel); font-size: 13px; line-height: 1.05; letter-spacing: .06em;
  padding: 3px 8px; color: #000; background: var(--green);
  border: 2px solid; border-color: #b6ff9e #136b00 #136b00 #b6ff9e;
}
.splash.dialing .splash-badge { visibility: hidden; }
