/* The CTRL brand (official logo and merch, 28 Nov 2026; CTRL.md "Logo").
   The logo is the same on every theme: white, flat, never recoloured. The techwear details
   (glitch bars, circuit traces, the cyan light strip) belong to the CTRL theme only, so a player
   on Matrix or Amber keeps the look they picked. Everything here stays off the middle of the screen. */

/* ---------- the logo in the top bar ---------- */
.logo .logo-mark { width: auto; height: 34px; color: var(--ink-hi); filter: none; flex: none; }
.logo small { display: flex; align-items: center; gap: 6px; }
.logo .logo-word { width: auto; height: 8px; color: var(--ink); opacity: .85; filter: none; }
@media (max-width: 560px) { .logo .logo-mark { width: auto; height: 30px; } }

/* ---------- the tag patch: the wing mark in a small square, like the patches on the hoodie ---------- */
.ctrl-tag {
  display: inline-grid; place-items: center; flex: none;
  width: 22px; height: 22px; padding: 3px;
  background: #0a0b0d; border: 1px solid rgba(255,255,255,.22);
  color: #fff;
}
.ctrl-tag svg { width: auto; height: 100%; display: block; }

/* ---------- footer ---------- */
.foot-brand { display: inline-flex; align-items: center; gap: 8px; }
.foot-brand .foot-word { width: auto; height: 9px; color: var(--ink); }

/* ---------- loading: the mark with a scan line under it ---------- */
.loading-state.brand-load { flex-direction: column; gap: 14px; }
.loading-state.brand-load::after { content: none; }
.brand-load svg { height: 44px; width: auto; color: var(--ink-hi); opacity: .9; }
.brand-load .bl-bar { position: relative; width: 120px; height: 2px; background: rgba(var(--accent-rgb),.15); overflow: hidden; }
.brand-load .bl-bar::after { content: ""; position: absolute; inset: 0; width: 36%; background: var(--accent); animation: bl-scan 1.1s linear infinite; }
@keyframes bl-scan { from { transform: translateX(-100%); } to { transform: translateX(280%); } }
@media (prefers-reduced-motion: reduce) { .brand-load .bl-bar::after { animation: none; width: 100%; opacity: .5; } }

/* =====================  the two CTRL themes only  ===================== */

/* the matte look: less glow, the logo-white for headings, the scanlines lighter */
:root[data-theme^="ctrl"] body::after { opacity: .3; }
:root[data-theme^="ctrl"] .panel { box-shadow: none; }
:root[data-theme^="ctrl"] .panel::after { filter: none; opacity: .9; }
:root[data-theme^="ctrl"] .title-block h1 { color: var(--ink-hi); text-shadow: none; }

/* the cyan light strip along the edge of the top bar, under the logo, like the one on the hood */
:root[data-theme^="ctrl"] .top-in { position: relative; }
:root[data-theme^="ctrl"] .top-in::after {
  content: ""; position: absolute; left: 12px; bottom: -1px; width: min(300px, 40vw); height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent) 18%, var(--accent) 72%, transparent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb),.55);
}
:root[data-theme^="ctrl"].top-fight .top-in::after { width: 150px; }

/* panel corners as circuit traces: a line that bends 45 degrees and ends in a node, in place of the brackets */
:root[data-theme^="ctrl"] .panel::after {
  background:
    linear-gradient(var(--accent), var(--accent)) top right / 26px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top right / 1px 10px no-repeat,
    radial-gradient(circle, var(--accent) 0 1.6px, transparent 2.2px) right 0 top 10px / 5px 5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom left / 26px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom left / 1px 10px no-repeat,
    radial-gradient(circle, var(--accent) 0 1.6px, transparent 2.2px) left -2px bottom 9px / 5px 5px no-repeat;
}

/* glitch bars: two thin slices that jump across a nav link or a button for a moment on hover, and
   sit still under the page you're on */
:root[data-theme^="ctrl"] .quick a[aria-current="page"]::after {
  background: linear-gradient(90deg, var(--accent) 0 62%, transparent 62% 68%, var(--accent) 68% 80%, transparent 80% 86%, #fff 86%);
  box-shadow: 0 0 6px rgba(var(--accent-rgb),.6);
}
:root[data-theme^="ctrl"] .quick a[aria-current="page"] { text-shadow: none; color: var(--ink-hi); }
:root[data-theme^="ctrl"] .quick a::before,
:root[data-theme^="ctrl"] .btn::before {
  content: ""; position: absolute; left: 0; right: 0; top: 30%; height: 40%; pointer-events: none; opacity: 0;
  background:
    linear-gradient(var(--accent), var(--accent)) 8% 0 / 34% 1px no-repeat,
    linear-gradient(#fff, #fff) 60% 100% / 22% 1px no-repeat;
}
:root[data-theme^="ctrl"] .btn { position: relative; }
:root[data-theme^="ctrl"] .quick a:hover::before,
:root[data-theme^="ctrl"] .btn:hover::before { animation: ctrl-glitch 260ms steps(4) 1; }
@keyframes ctrl-glitch {
  0% { opacity: 1; transform: translateX(-6px); }
  33% { opacity: 1; transform: translateX(5px); background-position: 40% 0, 20% 100%; }
  66% { opacity: .8; transform: translateX(-3px); background-position: 70% 0, 50% 100%; }
  100% { opacity: 0; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  :root[data-theme^="ctrl"] .quick a:hover::before, :root[data-theme^="ctrl"] .btn:hover::before { animation: none; }
}

/* =====================  the way in (js/app/entry.js)  =====================
   A CTRL network window over the ops map. Colours are the site's own: white text, the accent for
   what the visitor lights up, cyan for data, nothing washed in green. */
.entry {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; overflow: hidden;
  background: rgba(5,6,7,.94); opacity: 0; transition: opacity .25s ease-out;
  font-family: var(--f-head); color: var(--ink);
}
.entry.on { opacity: 1; }
.en-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.en-win {
  position: relative; width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - 24px); overflow: hidden;
  display: flex; flex-direction: column;
  background: rgba(9,10,12,.92); border: 1px solid rgba(255,255,255,.13);
  transform: scale(.985); opacity: 0; transition: transform .35s cubic-bezier(.2,.7,.2,1), opacity .25s;
  transform-origin: 74% 46%;
}
.entry.on .en-win { transform: none; opacity: 1; }
/* corner brackets in the accent, the window's only colour until the check */
.en-win::before, .en-win::after {
  content: ""; position: absolute; width: 18px; height: 18px; pointer-events: none; border: 0 solid var(--accent);
}
.en-win::before { left: -1px; top: -1px; border-left-width: 2px; border-top-width: 2px; }
.en-win::after { right: -1px; bottom: -1px; border-right-width: 2px; border-bottom-width: 2px; }
.en-bar, .en-status {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  font: 400 12px/1.2 var(--f-label); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2);
  padding: 11px 18px;
}
.en-bar { border-bottom: 1px solid rgba(255,255,255,.08); }
.en-status { border-top: 1px solid rgba(255,255,255,.08); justify-content: flex-start; gap: 10px 28px; opacity: 0; transition: opacity .3s; }
.entry.st-on .en-status { opacity: 1; }
.en-status b { font: 400 12px/1 var(--f-mono); letter-spacing: .06em; color: var(--ink-hi); margin-left: 8px; font-variant-numeric: tabular-nums; }
.en-status .st-a i { display: inline-block; width: 7px; height: 7px; margin-right: 9px; background: var(--cyan); vertical-align: 1px; }
.en-status .st-n { margin-left: auto; }
.en-body { display: grid; gap: clamp(14px, 2.4vh, 24px); padding: clamp(18px, 3.4vh, 34px) clamp(18px, 4vw, 52px); }
.en-head { text-align: center; opacity: 0; transition: opacity .3s; }
.entry.head-on .en-head { opacity: 1; }
.en-kick, .en-sub { font: 400 12px/1 var(--f-label); letter-spacing: .42em; text-transform: uppercase; color: var(--ink-2); margin: 0; }
.en-title {
  margin: 10px 0 12px; font: 700 clamp(40px, 7vw, 88px)/.95 var(--f-head); letter-spacing: .03em; color: var(--ink-hi);
  transform: skewX(-9deg); font-variant-numeric: tabular-nums; text-shadow: none;
}
.en-main { display: grid; grid-template-columns: 1fr auto; gap: clamp(20px, 4vw, 56px); align-items: center; }
.en-lines { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 1px solid rgba(255,255,255,.1); font: 400 clamp(14px, 1.35vw, 17px)/1.95 var(--f-mono); color: var(--ink); min-height: 9.75em; }
.en-lines li { white-space: pre-wrap; }
.en-p { color: var(--ink-3); }
.en-id { display: inline-block; padding: 0 7px; margin-left: 2px; border: 1px solid rgba(255,255,255,.4); color: var(--ink-hi); font-weight: 400; line-height: 1.5; }
.en-id.ok { border-color: var(--accent); color: var(--accent); }
.en-ok { color: var(--accent); font-weight: 400; }
.en-cur { display: inline-block; width: .55em; height: 1.05em; margin-left: 4px; vertical-align: -3px; background: var(--accent); animation: blink 1s steps(1) infinite; }
.en-logo { position: relative; width: clamp(150px, 17vw, 220px); aspect-ratio: 1; }
.en-logo canvas { position: absolute; inset: 10%; width: 80%; height: 80%; }
/* a bracket frame round the lockup */
.en-logo::before, .en-logo::after, .en-logo i::before, .en-logo i::after { content: ""; position: absolute; width: 16px; height: 16px; border: 0 solid rgba(255,255,255,.35); }
.en-logo::before { left: 0; top: 0; border-left-width: 1px; border-top-width: 1px; }
.en-logo::after { right: 0; top: 0; border-right-width: 1px; border-top-width: 1px; }
.en-logo i::before { left: 0; bottom: 0; border-left-width: 1px; border-bottom-width: 1px; }
.en-logo i::after { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }
.en-logo i { position: absolute; inset: 0; }
.en-strong { margin: 0; min-height: 1.3em; font: 600 clamp(17px, 1.7vw, 22px)/1.3 var(--f-head); color: var(--ink-hi); letter-spacing: .01em; }
.en-check { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.02); padding: 14px 18px 12px; animation: en-in .3s ease-out; }
@keyframes en-in { from { opacity: 0; transform: translateY(6px); } }
.en-check-h, .en-check-f { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font: 400 12px/1.3 var(--f-label); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.en-live { font: 400 13px/1 var(--f-mono); letter-spacing: 0; color: var(--cyan); text-transform: none; font-variant-numeric: tabular-nums; }
.en-phrase { margin: 10px 0 12px; font: 400 clamp(19px, 2.1vw, 28px)/1.45 var(--f-mono); color: var(--ink-3); cursor: text; word-break: break-word; }
.en-phrase span { transition: color .08s; }
.en-phrase span.ok { color: var(--accent); }
.en-phrase span.at { color: var(--ink-hi); box-shadow: inset 0 -2px 0 var(--accent); }
.en-phrase span.err { color: var(--red); box-shadow: inset 0 -2px 0 var(--red); animation: en-shake .18s; }
@keyframes en-shake { 33% { transform: translateX(-2px); } 66% { transform: translateX(2px); } }
.en-check-f { text-transform: none; letter-spacing: .04em; font-size: 13px; }
.en-pass, .en-auth { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.25); }
.en-pass:hover, .en-auth:hover { color: var(--ink-hi); }
.entry.passed .en-check-f { display: none; }
.en-result { margin: -6px 0 0; font: 400 clamp(15px, 1.5vw, 19px)/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.en-skip {
  position: absolute; right: 20px; bottom: 18px; z-index: 2; cursor: pointer;
  font: 400 13px/1 var(--f-label); letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-2); background: rgba(10,11,13,.7); border: 1px solid rgba(255,255,255,.16); border-radius: var(--r); padding: 9px 13px;
}
.en-skip:hover, .en-skip:focus-visible { color: var(--ink-hi); border-color: var(--accent); }
.en-in { position: fixed; left: 0; top: 40%; width: 1px; height: 1px; opacity: 0; font-size: 16px; border: 0; padding: 0; }
/* the short visit: no title or check, the window is smaller */
.entry.short .en-strong, .entry.short .en-check { display: none; }
.entry.short .en-win { width: min(760px, calc(100vw - 32px)); }
.entry.short .en-lines { min-height: 0; }
.entry.short .en-title { font-size: clamp(32px, 5vw, 58px); }
/* leaving */
.entry.out-dive { background: rgba(5,6,7,0); transition: background .55s ease-in .1s; }
.entry.out-dive .en-win { transform: scale(2.6); opacity: 0; transition: transform .62s cubic-bezier(.55,0,.8,.2), opacity .4s ease-in .2s; }
.entry.out-dive .en-skip { opacity: 0; }
.entry.out-fast { opacity: 0; transition: opacity .25s; }
.entry.out-calm { opacity: 0; transition: opacity .4s; }
.entry.calm .en-win, .entry.calm .en-head, .entry.calm .en-status { transition: none; }
@media (max-width: 680px) {
  .en-main { grid-template-columns: 1fr; gap: 14px; }
  .en-logo { order: -1; width: 112px; margin: 0 auto; }
  .en-lines { min-height: 0; font-size: 14px; line-height: 1.8; }
  .en-body { padding: 16px 16px 18px; gap: 14px; }
  .en-kick, .en-sub { letter-spacing: .26em; font-size: 11px; }
  .en-title { margin: 8px 0 8px; }
  .en-status { gap: 6px 18px; padding: 10px 14px; }
  .en-status .st-n { margin-left: 0; }
  .en-bar { padding: 10px 14px; }
  .en-check { padding: 12px 12px 10px; }
  .en-check-f { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (max-height: 700px) and (min-width: 681px) {
  .en-title { font-size: clamp(40px, 5.4vw, 64px); margin: 6px 0 8px; }
  .en-lines { line-height: 1.7; min-height: 8.5em; }
  .en-logo { width: 150px; }
}
@media (prefers-reduced-motion: reduce) { .en-cur, .en-phrase span.err { animation: none; } }

/* the visitor's node on the ops map */
.en-ping { position: absolute; inset: 0; pointer-events: none; z-index: 4; transition: opacity 1s; }
.en-ping.gone { opacity: 0; }
.en-ping svg { position: absolute; inset: 0; overflow: visible; }
.en-ping .pl { fill: none; stroke: var(--cyan); stroke-width: 1.3; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .85; animation: en-draw .8s var(--d) ease-out forwards; }
.en-ping .pp { fill: var(--cyan); opacity: 0; animation: en-pop .4s var(--d) ease-out forwards; }
.en-ping .pr { fill: none; stroke: var(--accent); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; opacity: 0; animation: en-ring 1.6s ease-out 3; }
.en-ping .pr.two { animation-delay: .55s; }
.en-ping .pc { fill: var(--accent); }
.en-ping .pt {
  position: absolute; transform: translate(12px, -140%); white-space: nowrap;
  font: 400 12px/1 var(--f-label); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-hi);
  background: rgba(5,6,7,.78); border: 1px solid var(--accent); padding: 4px 7px;
}
@keyframes en-draw { to { stroke-dashoffset: 0; } }
@keyframes en-pop { from { opacity: 0; } to { opacity: 1; } }
@keyframes en-ring { from { transform: scale(.4); opacity: 1; } to { transform: scale(3.4); opacity: 0; } }
.en-ping.calm .pl { animation: none; stroke-dashoffset: 0; }
.en-ping.calm .pp { animation: none; opacity: 1; }
.en-ping.calm .pr { animation: none; opacity: .6; }

/* the result window's label carries the wing mark */
.gg-mark { width: auto; height: 14px; margin-right: 8px; vertical-align: -2px; color: var(--ink-hi); }

/* the ops map's top line and the Operator ID card carry the logo */
.hm-brand .hm-word { width: auto; height: 10px; vertical-align: -1px; color: var(--ink-hi); }
.op-brand { display: inline-flex; align-items: center; gap: 8px; }
.op-brand .ctrl-tag { width: 20px; height: 20px; }
