/* ALF97 PLUS — Constructivist Bauhaus paper + eYe2 / 2adv controls. Tokens from fcb/redpaper. */

@import url('https://fonts.googleapis.com/css2?family=Darker+Grotesque:wght@500..900&family=Oswald:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
  /* theme (swap this block to restyle PLUS) — redpaper */
  --paper: #fafafa;
  --ink: #000;
  --dim: #222;
  --faint: #555;
  --red: #ff3300;
  --blue: #0033ff;
  --yellow: #ffaa00;
  --hi: #faff00;
  --danger: #cc0000;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --disp: "Darker Grotesque", system-ui, sans-serif;

  --font-disp: var(--disp);
  --font-osw: "Oswald", var(--disp), sans-serif;
  --font-mono: var(--mono);
  --rule: 2px solid var(--ink);
  --rule-thin: 1.5px solid var(--ink);

  /* eYe2 / 2adv geometry keeps clip-paths; colors follow theme */
  --void: var(--paper);
  --void2: #fff;
  --panel: #fff;
  --edge: var(--ink);
  --edge2: var(--dim);
  --cyan: var(--blue);
  --cyan-deep: var(--blue);
  --cyan-glow: transparent;
  --amber: var(--red);
  --amber-deep: var(--danger);
  --txt: var(--ink);
  --txt2: var(--dim);
  --txt3: var(--faint);

  --bau-paper: var(--paper);
  --bau-white: #fff;
  --bau-ink: var(--ink);
  --bau-dim: var(--dim);
  --bau-red: var(--red);
  --bau-blue: var(--blue);
  --bau-yellow: var(--yellow);
  --bau-hi: var(--hi);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bau-paper);
  color: var(--bau-ink);
  font-family: var(--font-mono);
  overflow: hidden;
}
::selection { background: var(--bau-red); color: var(--bau-white); }

.viewport {
  position: absolute; inset: 0; overflow: hidden;
  background: var(--bau-paper);
}
.color-block-red {
  position: absolute; left: 18px; top: 18px; width: 110px; height: 14px;
  background: var(--bau-red); border: 3px solid var(--bau-ink); z-index: 2;
}
.color-block-yellow {
  position: absolute; right: 18px; bottom: 88px; width: 52px; height: 52px;
  background: var(--bau-yellow); border: 4px solid var(--bau-ink); z-index: 2;
}
.color-block-blue {
  position: absolute; left: 118px; bottom: 0; width: 14px; height: 160px;
  background: var(--bau-blue); z-index: 2;
}
.partition-v {
  position: absolute; top: 42px; bottom: 0; left: 248px; width: 2px;
  background: var(--ink); z-index: 4;
}
.watermark {
  position: absolute; right: 24px; top: 64px; z-index: 1; pointer-events: none;
  font-family: var(--font-disp); font-weight: 900; font-size: clamp(72px, 14vw, 160px);
  line-height: 0.78; letter-spacing: -0.04em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: flex-end; opacity: 0.12;
}
.watermark .outline {
  -webkit-text-stroke: 2px var(--bau-ink);
  -webkit-text-fill-color: transparent; color: transparent;
}
.watermark .filled { color: var(--bau-red); }

/* SwarmModelPicker header: LABEL ◢ | section | filter | rescan */
.swarm-head {
  position: absolute; top: 0; left: 0; right: 0; height: 42px; z-index: 20;
  display: flex; align-items: stretch; gap: 0;
  padding: 0;
  border-bottom: var(--rule);
  background: var(--paper);
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
}
.swarm-head .mark {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; color: #000; background: var(--red);
  padding: 9px 14px; border-right: var(--rule); display: flex; align-items: center;
}
.swarm-head .sec {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em;
  color: var(--dim); text-transform: uppercase;
  padding: 9px 14px; display: flex; align-items: center; gap: 16px; flex: 1;
}
.swarm-head .sec b { color: var(--ink); }
.swarm-head input[type="text"] {
  margin-left: auto; background: #fff; border: 0; border-left: var(--rule);
  color: var(--ink); font: 400 11px/1 var(--font-mono);
  padding: 0 14px; width: 160px; outline: none; border-radius: 0;
}
.swarm-head input:focus { background: var(--hi); }
.swarm-head .rescan {
  background: var(--blue); border: 0; border-left: var(--rule); color: #fff;
  font: 700 11px/1 var(--font-mono); letter-spacing: 0.04em; padding: 0 14px;
  cursor: pointer; border-radius: 0; text-transform: uppercase;
}
.swarm-head .rescan:hover { background: var(--ink); color: var(--paper); }

/* 2adv tab strip geometry, redpaper colors */
.navbar {
  position: absolute; top: 42px; left: 248px; right: 0; z-index: 15;
  display: flex; align-items: stretch;
  background: var(--paper);
  border-bottom: var(--rule);
}
.navbar .tab {
  position: relative; padding: 10px 16px; cursor: pointer; border: none;
  background: #fff; color: var(--faint);
  font-family: var(--font-mono); font-weight: 700; font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase;
  border-right: var(--rule);
  display: flex; align-items: center; gap: 7px;
}
.navbar .tab .arr { opacity: 0; transform: translateX(-4px); color: #000; }
.navbar .tab:hover { color: #000; background: var(--hi); }
.navbar .tab.active { color: #000; background: var(--red); }
.navbar .tab.active .arr { opacity: 1; transform: translateX(0); }
.navbar .tab.active::after { display: none; }
.navbar .spacer { flex: 1; background: var(--paper); }
.navbar .tab.sys { font-family: var(--font-mono); font-size: 9px; letter-spacing: .14em; color: var(--faint); background: var(--paper); }

/* left backend column — overflow visible so 4px ink drop-shadow is not clipped */
.nodes {
  position: absolute; top: 42px; left: 0; bottom: 0; width: 248px;
  padding: 16px 20px 24px 14px; overflow: visible;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--paper);
  border-right: var(--rule);
}

/* eYe2 DOCK SPINE — clip-path eats box-shadow; use drop-shadow for the boxed offset */
.spine {
  --accent: var(--red); --accent-glow: transparent;
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  padding: 11px 16px 11px 14px; min-width: 210px; cursor: pointer; border: 2px solid var(--ink);
  font-family: var(--font-osw); color: var(--ink); text-align: left;
  background: #fff;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  box-shadow:
    inset 2px 2px 0 #fff,
    inset -2px -2px 0 #000;
  filter: drop-shadow(4px 4px 0 var(--ink));
}
.spine .clamp {
  width: 5px; align-self: stretch; flex: none;
  background: var(--ink);
}
.spine .ports { display: flex; gap: 3px; flex: none; }
.spine .ports i {
  width: 4px; height: 13px; border-radius: 1px; background: var(--accent);
  box-shadow: 0 0 5px var(--accent-glow), inset 0 0 2px #fff;
  opacity: .85; animation: flick 2.6s steps(1) infinite;
}
.spine .ports i:nth-child(2) { animation-delay: .4s; opacity: .65; }
.spine .ports i:nth-child(3) { animation-delay: .9s; }
.spine .ports i:nth-child(4) { animation-delay: 1.5s; opacity: .5; }
@keyframes flick { 0%,92%{filter:none} 93%{filter:brightness(.4)} 94%,100%{filter:none} }
.spine .lbl {
  font-weight: 600; font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  flex: 1; white-space: nowrap;
}
.spine .tip {
  width: 7px; height: 7px; flex: none; background: var(--yellow); border: 2px solid var(--ink);
}
.spine:hover { background: var(--hi); }
.spine:active { transform: translate(3px, 3px); filter: drop-shadow(1px 1px 0 var(--ink)); }
.spine.on { background: var(--red); color: #000; }
.spine.armed { --accent: var(--blue); }

/* eYe2 DRONE NODE */
.drone {
  position: relative; display: inline-flex; align-items: center; gap: 13px; cursor: pointer;
  padding: 12px 18px 12px 12px; min-width: 210px; font-family: var(--font-osw); color: var(--ink);
  background: #fff; border: 2px solid var(--ink);
  box-shadow:
    inset 2px 2px 0 #fff,
    inset -2px -2px 0 #000,
    4px 4px 0 var(--ink);
}
.drone .saucer { position: relative; width: 30px; height: 30px; flex: none; }
.drone .saucer .disc {
  position: absolute; left: 0; right: 0; top: 9px; height: 12px; border-radius: 50%;
  background: var(--ink); border: 2px solid var(--ink);
}
.drone .saucer .dome {
  position: absolute; left: 8px; right: 8px; top: 4px; height: 11px; border-radius: 50% 50% 40% 40%;
  background: var(--dim); border: 2px solid var(--ink);
}
.drone .saucer .eye {
  position: absolute; left: 50%; top: 14px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%;
  background: var(--red); animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:.6} 50%{opacity:1} }
.drone .meta { display: flex; flex-direction: column; gap: 3px; flex: 1; text-align: left; }
.drone .meta b { font-weight: 600; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
.drone .meta span { font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .12em; color: var(--txt3); text-transform: uppercase; }
.drone .bay {
  font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em; color: var(--cyan); flex: none;
  padding-left: 11px; border-left: 1px solid var(--edge2); align-self: stretch; display: flex; align-items: center;
}
.drone:hover { background: var(--hi); }
.drone:active { transform: translate(3px, 3px); box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #000, 1px 1px 0 var(--ink); }
.drone.on { background: var(--blue); color: #fff; box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #000, 4px 4px 0 var(--ink); }
.drone.on .bay { color: var(--yellow); border-left-color: #fff; }
.drone.on .meta span { color: #fff; }

/* eYe2 VOID PANEL */
.void {
  position: relative; cursor: pointer; min-width: 210px;
  padding: 13px 16px; font-family: var(--font-osw); font-weight: 500; font-size: 11px;
  letter-spacing: .24em; text-transform: uppercase; color: var(--ink); text-align: left;
  background: #fff; border: 2px solid var(--ink);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  box-shadow:
    inset 2px 2px 0 #fff,
    inset -2px -2px 0 #000;
  filter: drop-shadow(4px 4px 0 var(--ink));
}
.void .bolt { position: absolute; width: 3px; height: 3px; background: var(--ink); }
.void .bolt.a { left: 7px; top: 7px; } .void .bolt.b { right: 7px; top: 7px; }
.void .bolt.c { left: 7px; bottom: 7px; } .void .bolt.d { right: 7px; bottom: 7px; }
.void .edge { position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--red); opacity: 1; }
.void:hover { background: var(--hi); }
.void:active { transform: translate(3px, 3px); filter: drop-shadow(1px 1px 0 var(--ink)); }
.void.on { background: var(--yellow); color: #000; }

/* eYe2 BEAM — clip/sweep kept; fill from theme */
.beam {
  position: relative; cursor: pointer; min-width: 200px; overflow: hidden;
  padding: 14px 18px; font-family: var(--font-osw); font-weight: 600; font-size: 11px;
  letter-spacing: .22em; text-transform: uppercase; color: var(--ink); text-align: center;
  background: #fff;
  border: 2px solid var(--ink); border-bottom: 4px solid var(--blue);
  text-decoration: none; display: inline-block;
  box-shadow: 4px 4px 0 var(--ink);
}
.beam .col {
  position: absolute; top: -40%; bottom: -40%; width: 30px;
  background: linear-gradient(180deg, transparent, var(--yellow), transparent);
  filter: blur(4px); transform: skewX(-12deg) translateX(-200%); opacity: 0;
}
.beam:hover { letter-spacing: .3em; background: var(--hi); }
.beam:hover .col { opacity: 1; transform: skewX(-12deg) translateX(900%); }
.beam .label { position: relative; z-index: 2; }

/* eYe2 CRANE — chamfered knob on a 3-tick track (4 detents). Colors from theme. */
.crane { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.crane .track {
  position: relative; width: 62px; height: 24px; flex: none; border: 2px solid var(--ink);
  background: #fff;
  clip-path: polygon(0 5px, 5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%);
}
.crane .track i { position: absolute; top: 50%; width: 1px; height: 9px; margin-top: -4.5px; background: var(--ink); opacity: .4; pointer-events: none; }
.crane .track i:nth-child(1) { left: 16px; } .crane .track i:nth-child(2) { left: 31px; } .crane .track i:nth-child(3) { left: 46px; }
.crane .knob {
  position: absolute; top: 2px; left: 2px; width: 22px; height: 18px;
  background: var(--ink);
  clip-path: polygon(0 3px, 3px 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) 100%, 0 100%);
  transition: left .22s cubic-bezier(.19,1,.22,1), background .22s !important;
}
.crane .knob::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px;
  background: #fff;
}
.crane.on .knob,
.crane[data-pos="3"] .knob { left: 38px; background: var(--red); }
.crane[data-pos="0"] .knob { left: 2px; background: var(--ink); }
.crane[data-pos="1"] .knob { left: 14px; background: var(--blue); }
.crane[data-pos="2"] .knob { left: 26px; background: var(--red); }
.crane .ctxt {
  font-family: var(--font-osw); font-weight: 600; font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--dim); text-decoration: none;
}
.crane.on .ctxt,
.crane[data-pos="1"] .ctxt,
.crane[data-pos="2"] .ctxt { color: var(--blue); }
.crane[data-pos="3"] .ctxt { color: var(--danger); }

/* 2adv HALFTONE — dot screen kept; fill from theme */
.halftone {
  position: relative; cursor: pointer; border: 2px solid var(--ink); overflow: hidden;
  padding: 11px 20px; min-width: 160px; text-align: center; text-decoration: none; display: inline-block;
  font-family: var(--font-osw); font-weight: 600; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink);
  background: #fff;
  box-shadow: 4px 4px 0 var(--ink);
}
.halftone::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: radial-gradient(var(--ink) 1px, transparent 1.4px); background-size: 4px 4px;
}
.halftone:hover { background: var(--hi); }
a.halftone { color: var(--ink); }

/* 2adv RETICLE */
.reticle { display: inline-flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; background: none; border: none; text-decoration: none; color: inherit; }
.reticle .ring {
  width: 34px; height: 34px; position: relative;
  border: 2px solid var(--ink); background: #fff;
}
.reticle .ring::before { content: ""; position: absolute; inset: 6px; border: 2px solid var(--ink); opacity: .7; }
.reticle .ring::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px;
  background: var(--red);
}
.reticle .ring .tick { position: absolute; background: var(--ink); }
.reticle .ring .tick.n { left: 50%; top: -3px; width: 1px; height: 5px; margin-left: -.5px; }
.reticle .ring .tick.s { left: 50%; bottom: -3px; width: 1px; height: 5px; margin-left: -.5px; }
.reticle .ring .tick.e { right: -3px; top: 50%; height: 1px; width: 5px; margin-top: -.5px; }
.reticle .ring .tick.w { left: -3px; top: 50%; height: 1px; width: 5px; margin-top: -.5px; }
.reticle .plus { font-family: var(--font-mono); font-size: 9px; color: var(--dim); border: 2px solid var(--ink); padding: 0 4px; }
.reticle:hover .ring { background: var(--hi); transform: rotate(45deg); }

/* 02 FTP — 2adv reticle as a labeled 4-stop compass. Click a name or OPEN. */
.reticle.ftp {
  display: grid;
  grid-template-columns: 1fr 72px 1fr;
  grid-template-rows: auto 72px auto auto;
  grid-template-areas:
    ". n ."
    "w ring e"
    ". s ."
    "go go go";
  align-items: center; justify-items: center;
  gap: 4px 6px; width: 100%; max-width: 220px; margin: 0 auto;
  cursor: default; user-select: none;
}
.reticle.ftp .ring {
  grid-area: ring; width: 64px; height: 64px; cursor: grab;
  transform: rotate(calc(var(--ftp-rot, 0) * 1deg));
  transition: transform .22s cubic-bezier(.19,1,.22,1), background .15s !important;
  box-shadow: 3px 3px 0 var(--ink);
}
.reticle.ftp .ring:active { cursor: grabbing; }
.reticle.ftp[data-pos="0"] { --ftp-rot: 0; }
.reticle.ftp[data-pos="1"] { --ftp-rot: 90; }
.reticle.ftp[data-pos="2"] { --ftp-rot: 180; }
.reticle.ftp[data-pos="3"] { --ftp-rot: 270; }
.reticle.ftp:hover .ring {
  background: #fff;
  transform: rotate(calc(var(--ftp-rot, 0) * 1deg));
}
.reticle.ftp[data-pos="1"] .ring::after { background: var(--blue); }
.reticle.ftp[data-pos="2"] .ring::after { background: var(--red); }
.reticle.ftp[data-pos="3"] .ring::after { background: var(--yellow); }
.reticle.ftp .spoke {
  border: 2px solid var(--ink); background: #fff; color: var(--ink);
  font: 700 9px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 7px; cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}
.reticle.ftp .spoke.n { grid-area: n; }
.reticle.ftp .spoke.e { grid-area: e; }
.reticle.ftp .spoke.s { grid-area: s; }
.reticle.ftp .spoke.w { grid-area: w; }
.reticle.ftp .spoke:hover { background: var(--hi); }
.reticle.ftp[data-pos="0"] .spoke.n,
.reticle.ftp[data-pos="1"] .spoke.e,
.reticle.ftp[data-pos="2"] .spoke.s,
.reticle.ftp[data-pos="3"] .spoke.w {
  background: var(--red); color: #000;
}
.reticle.ftp .plus {
  grid-area: go; display: block; width: 100%;
  text-decoration: none; color: #000; text-align: center;
  letter-spacing: .14em; text-transform: uppercase;
  font: 800 11px/1 var(--font-mono);
  background: var(--blue); color: #fff;
  border: 2px solid var(--ink); padding: 8px 10px;
  box-shadow: 4px 4px 0 var(--ink);
}
.reticle.ftp .plus:hover { background: var(--ink); color: var(--paper); }
.reticle.ftp .plus:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* 2adv SYSTOG */
.systog {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none;
  padding: 6px 11px; background: #fff; border: 2px solid var(--ink);
}
.systog .box { width: 11px; height: 11px; flex: none; background: #fff; border: 2px solid var(--ink); position: relative; }
.systog .box::after { content: ""; position: absolute; inset: 2px; background: var(--red); opacity: 0; }
.systog.on .box::after { opacity: 1; }
.systog .t { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.systog.on .t { color: var(--ink); }

/* 2adv SUBMIT GROUP */
.submit-grp { display: inline-flex; align-items: stretch; border: 2px solid var(--ink); }
.submit-grp .field {
  padding: 9px 12px; min-width: 130px; background: #fff;
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .12em; color: var(--faint); text-transform: uppercase;
  display: flex; align-items: center;
}
.submit-grp .field input {
  all: unset; width: 100%; color: var(--ink); font: 400 10px/1 var(--font-mono); letter-spacing: .08em;
}
.submit-grp .go {
  padding: 9px 16px; cursor: pointer; border: none; border-left: 2px solid var(--ink);
  font-family: var(--font-osw); font-weight: 600; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #000;
  background: var(--red);
}
.submit-grp .go:hover { background: var(--hi); }

.work { position: absolute; top: 78px; left: 248px; right: 0; bottom: 0; overflow: auto; z-index: 5; background: var(--paper); }
/* compact spec strip — kit .hero/.wm stay, size comes from the theme sheet loaded last */
.work .hero { padding: 6px 14px 6px !important; min-height: 0; }
.work .wm { font-size: clamp(18px, 2.2vw, 26px) !important; line-height: 1; }
.work .ghost { display: none !important; }
.work .sub { margin: 2px 0 0; font-size: 10px; }
.panel { display: none; }
.panel.on { display: block; }
.work a.btn { text-decoration: none; text-align: center; }
.work a.dd-item { text-decoration: none; }
.work a.rb { text-decoration: none; text-align: center; }

svg.tendrils { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: visible; }
svg.tendrils path { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: square; }
svg.tendrils circle { fill: var(--ink); }
