/* Cybercore, for /worlds/star-wars/, /holocron/ and /elmallah/ (style: cybercore).

   The first great computer screen in film: the targeting computer on the
   trench run in 1977, a vector wireframe on black. A vector display draws
   lines and nothing else, so that is the whole material here: single lines
   (the crawl's yellow on the world page and the world buttons, each
   archive's own blue inside the interfaces), no fills, no glow, no shading, hard square
   brackets for corners, and readouts in JetBrains Mono. The signature is the
   lock-on: every section heading carries the reticle, which closes on it as
   it scrolls in while a range readout counts down to zero (under Reduce
   Motion it is already locked, the range already zero). What the page draws
   as content keeps its own light: the galaxy, the planets, the kyber
   blades, the photographs.

   Three pages, one set. The world page is the quiet one: its own galaxy and
   crawl, with the line drawn in the crawl's yellow and E.L.M.A.L.L.A.H.'s
   own Saira for its headings (its one display face, taken from the
   interface). A green phosphor takeover with a trench behind the hero was
   tried and judged too much. The two interfaces keep their concepts, their
   faces and their colours, and are remade in the same line: the Holocron's
   hall becomes a perspective wireframe, its cube a
   wire cube, its panels line frames;
   the holotable's room loses its glow and its crests become vector outlines.
   On both, the world button is a piece of the cockpit it leads to.

   HOW FAR THE HOLOCRON'S BLUE MOVES: not at all, in hue. On that page the
   blue is not decoration but state. The page's own words call it "projector
   blue"; the eras are told apart by it (the Republic blue, the Empire red,
   the New Republic green), and bonding one of seven crystals re-tints the
   whole archive through the same one value. A phosphor default would
   collide with the New Republic and the green crystal and make two of its
   states one. So the hue stays the archive's, and everything else moves:
   the line, the corners, the reticle and the readout. One thing even gets
   closer to the page's intent: the hall was drawn in a fixed blue, and here
   it is drawn from that one value, so an era or a crystal now re-lights the
   hall too, as the page's own comments always said it did.

   Everything is scoped to :root[data-style="cybercore"]. Material rules on
   shared components use :where() for that scope, so they weigh what the
   rule they restyle weighs and each page's own states still win. */

/* ── 1. shared: the phosphor, the line, the reticle ─────────────────────── */
@property --cy-r { syntax: "<integer>"; inherits: true; initial-value: 0; }
@counter-style cy-range { system: extends decimal; pad: 5 "0"; }

:root[data-style="cybercore"] {
  --cy-g: #4dff88;                         /* P31-ish phosphor, 16:1 on black */
  --cy-line: rgba(77, 255, 136, .36);      /* a frame, at rest */
  --cy-edge: rgba(77, 255, 136, .55);      /* a control's edge: over 3:1 */
  --cy-k: var(--cy-g);                     /* bracket and reticle ink; each page re-sets it */

  /* the shared components read these (base.css) */
  --s-surface: #000;
  --s-surface-hi: #000;
  --s-edge: var(--cy-line);
  --s-bw: 1px;
  --s-r: 0px;
  --s-r-sm: 0px;
  --s-shadow: none;
  --s-shadow-hi: none;
  --s-lift: -2px;
  --s-display: "Saira", var(--mono, monospace);   /* an interface defines no --mono on :root */
  --s-display-w: 700;
  --s-display-ls: 0.04em;
  --s-focus: var(--cy-g);

  /* the bars: black glass gone opaque, edged in one phosphor line */
  --s-bar: #000;
  --s-bar-edge: rgba(77, 255, 136, .32);
  --s-bar-r: 0px;
  --s-bar-blur: none;
  --s-bar-shadow: none;

  /* a vector screen has no film grain, no raster and no circuit field */
  --s-grain: 0;
  --s-vignette: 0;
  --s-field: 0;
}
@media (prefers-contrast: more) {
  :root[data-style="cybercore"] { --cy-line: rgba(77, 255, 136, .7); }
}

/* Corners: two square brackets, top left and bottom right, drawn over the
   frame's own line the way a targeting display boxes what it has found.
   One rule for all three pages; each sets --cy-k to its own ink. The
   longhands sit at full weight so a hover that resets `background` keeps
   them, while its colour change still applies. */
:root[data-style="cybercore"] :is(.fan-card, .fan-tile, .fan-film, .fan-rankrow, .fan-linkcard, .fan-quote,
  .fan-cf-side, .fan-era, .fan-land, .fan-peek, .fan-iface, .fan-cross-btn, .fan-saber, .fan-shot, .pl-card,
  .fan-intro-when, .wsib-i a, .hc-panel, .hc-gate, .hc-rec, .hc-face, .el-fac-h, .iw) {
  background-image:
    linear-gradient(var(--cy-k) 0 0), linear-gradient(var(--cy-k) 0 0),
    linear-gradient(var(--cy-k) 0 0), linear-gradient(var(--cy-k) 0 0);
  background-size: 12px 2px, 2px 12px, 12px 2px, 2px 12px;
  background-position: 0 0, 0 0, 100% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-origin: border-box;
}

/* The lock-on. The reticle is four corners and a pip; the readout is the
   range to the heading, five figures, in the label face. Their still state
   is the locked one: what Reduce Motion and every browser without
   scroll-driven animation shows. */
:root[data-style="cybercore"] :is(.subsec--fan, .hc-h, .el-h) {
  counter-reset: cy var(--cy-r);
  view-timeline: --cy-h block;
}
:root[data-style="cybercore"] :is(.subsec--fan, .hc-h, .el-h)::before {
  content: ""; flex: none; align-self: center; display: inline-block; vertical-align: -0.12em;
  width: 0.9em; height: 0.9em;
  --t: linear-gradient(var(--cy-k) 0 0);
  background: var(--t) 0 0 / 32% 2px, var(--t) 0 0 / 2px 32%, var(--t) 100% 0 / 32% 2px, var(--t) 100% 0 / 2px 32%,
    var(--t) 0 100% / 32% 2px, var(--t) 0 100% / 2px 32%, var(--t) 100% 100% / 32% 2px, var(--t) 100% 100% / 2px 32%,
    var(--t) 50% 50% / 2px 2px;
  background-repeat: no-repeat;
}
:root[data-style="cybercore"] :is(.subsec--fan, .hc-h, .el-h)::after {
  content: counter(cy, cy-range);
  font: 400 0.7rem/1 var(--mono, "JetBrains Mono", monospace); letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums; text-transform: none; color: var(--cy-k);
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    :root[data-style="cybercore"] :is(.subsec--fan, .hc-h, .el-h) {
      animation: cy-range linear both; animation-timeline: --cy-h; animation-range: entry 0% cover 40%;
    }
    :root[data-style="cybercore"] :is(.subsec--fan, .hc-h, .el-h)::before {
      animation: cy-lock linear both; animation-timeline: --cy-h; animation-range: entry 0% cover 40%;
    }
  }
}
@keyframes cy-range { from { --cy-r: 29000; } to { --cy-r: 0; } }
@keyframes cy-lock {
  from { transform: scale(3) rotate(45deg); opacity: 0; }
  60% { opacity: 1; }
  to { transform: none; opacity: 1; }
}

/* ── 2. the world page: the cockpit ─────────────────────────────────────── */

/* Quieter by request (2026-10-18): the phosphor takeover and the trench
   were too much. The world page keeps its own galaxy, its blue opening
   line, its crawl and its saber, and draws the cockpit's line in the
   crawl's yellow instead of green: square frames, bracket corners, Saira
   headings and the lock-on. The HUD lattice, scan and sweep stay off. */
:root[data-style="cybercore"] body[data-fan="sw"] {
  --cy-g: #ffe81f;
  --cy-line: rgba(255, 232, 31, .26);
  --cy-edge: rgba(255, 232, 31, .55);
  --cy-k: rgba(255, 232, 31, .8);
  --s-edge: var(--cy-line); --s-focus: var(--cy-g); --s-bar-edge: rgba(255, 232, 31, .22);
  --hud-grid: transparent; --hud-scan: transparent; --hud-sweep: transparent;
  --hud-lit: rgba(255, 232, 31, .14); --hud-halo: transparent;
}
@media (prefers-contrast: more) {
  :root[data-style="cybercore"] body[data-fan="sw"] { --cy-line: rgba(255, 232, 31, .6); }
}

/* The frames: the ground itself inside one phosphor line (the tokens do
   the shared ones), square, unlit. */
:where(:root[data-style="cybercore"]) :is(.fan-film, .fan-cf-side, .fan-era, .fan-saber, .fan-quote, .pl-card, .fan-intro-when, .fan-iface, .fan-cross-btn, .fan-shot, .fan-tile, .fan-rankrow, .fan-land) {
  background-color: #000; box-shadow: none;
}
:where(:root[data-style="cybercore"]) :is(.fan-film, .fan-cf-side, .pl-card, .fan-shot) { border-color: var(--cy-line); }
:root[data-style="cybercore"] main :is(.fan-film, .fan-tile, .fan-shot, .fan-cf-side, .fan-cf-tab, .fan-saber, .pl-card, .fan-iface-a,
  .fan-cross-btn, .fan-cross-a, .fan-swatch, .fan-tag, .fan-sortbtn, .fan-tally, .fan-rate, .fan-done, .fan-fin, .fan-proj, .fan-tileshot,
  .chip, .pl-count, .fp-bar, .fan-peek-dot, .fan-quote, .fan-rankrow, .fan-land, .fan-era, .fan-era-dot, .wsib-i a) { border-radius: 0; }
:where(:root[data-style="cybercore"]) main :is(.fan-tick, .fan-cf-name)::before { border-radius: 0; box-shadow: none; }
:root[data-style="cybercore"] .fan-peek { --cy-k: var(--pk); }
/* the play bar's slots: line squares, the chosen one boxed in its colour */
:where(:root[data-style="cybercore"]) .fp-bar { background: #000; }
:where(:root[data-style="cybercore"]) .fp-slot { color: var(--ink); background: #000; border: 1px solid var(--cy-line); box-shadow: none; }
:where(:root[data-style="cybercore"]) .fp-slot u { color: var(--mute); }
:where(:root[data-style="cybercore"]) .fp-slot.is-sel { border-color: var(--c); box-shadow: 0 0 0 1px var(--c); }
:where(:root[data-style="cybercore"]) .fan-peek-dot { box-shadow: none; }
:root[data-style="cybercore"] :is(.fan-era, .fan-film) { background-color: #000; }
:root[data-style="cybercore"] .fan-rail-track::before { box-shadow: none; height: 1px; opacity: 1; background: var(--cy-line); }
:root[data-style="cybercore"] .fan-stat b { text-shadow: none; }
@media (hover: hover) {
  :where(:root[data-style="cybercore"]) :is(.fan-film, .pl-card, .fan-shot, .fan-tile):hover {
    border-color: var(--cy-g); box-shadow: none;
  }
}

/* the films' episode numbers, hollow: a vector display draws a numeral as
   its outline. Pointing at a film brightens its numeral. */
:root[data-style="cybercore"] .fan-film-num {
  font-family: var(--s-display); font-weight: 600; font-stretch: 125%;
  -webkit-text-fill-color: transparent; -webkit-text-stroke: 1.5px currentColor; opacity: .5;
}
@media (hover: hover) {
  :root[data-style="cybercore"] .fan-film:hover .fan-film-num { opacity: .85; }
}
/* the place line at a film's foot shares the corner with the wide numerals
   (III, VII, VIII), so it clears its own strip of the frame, the way a
   label breaks the line it is printed on: the stroke stops at the words
   instead of running through them. The black is the frame's own ground. */
:root[data-style="cybercore"] .fan-film .fan-meta {
  position: relative; align-self: flex-start; padding-right: 0.5rem; background: #000;
}

/* every item's own colour (a film's, a blade's, a show's) lifted a quarter
   toward white, so the darker ones hold on the black */
:root[data-style="cybercore"] :is(.fan-tiletext i, :is(.fan-card, .fan-film) .fan-sub, .fan-num, .saber-text i, .fan-shot figcaption b) {
  color: color-mix(in srgb, var(--a) 75%, #fff); opacity: 1;
}
:where(:root[data-style="cybercore"]) :is(.fan-tag, .fan-visit, .fan-hear) { color: color-mix(in srgb, var(--a) 75%, #fff); }

/* controls: square, edged bright enough to read as controls */
:where(:root[data-style="cybercore"]) :is(.fan-link, .fan-chips > *, .chip) { border-color: var(--cy-edge); background-color: #000; }
:root[data-style="cybercore"] .chip--sw.is-active { background: var(--cy-g); border-color: var(--cy-g); color: #000; }
:root[data-style="cybercore"] .chip--sw:not(.is-active) em { color: var(--mute); }

/* Headings in Saira, E.L.M.A.L.L.A.H.'s face: the title wide in the
   crawl's yellow, the section heads as targets, the item names a step
   down. Reading text stays Inter and labels stay JetBrains Mono. */
:root[data-style="cybercore"] .fan-title {
  font-family: var(--s-display); font-weight: 700; font-stretch: 125%;
  letter-spacing: 0.06em; color: var(--cy-g); text-shadow: none;
}
:root[data-style="cybercore"] .subsec--fan {
  font-family: var(--s-display); font-weight: 600; font-stretch: 118%;
  font-size: clamp(1.02rem, 2.1vw, 1.3rem); letter-spacing: 0.08em;
}
:root[data-style="cybercore"] .subsec--fan .subsec-yr {
  font-family: var(--mono); font-weight: 400; font-stretch: 100%; font-size: 0.7rem; letter-spacing: 0.1em; color: var(--mute);
}
:root[data-style="cybercore"] .subsec--fan::after {
  flex: 1 1 7rem; height: auto; min-width: 6ch; text-align: right;
  background: linear-gradient(var(--line) 0 0) 0 50% / calc(100% - 7ch) 1px no-repeat;
}
/* the lightsaber builder's heading (fan-play.js) is a section head in all
   but its tag, so it takes the same face, capitals, tracking and yellow;
   it has no range to read out, so no reticle */
:root[data-style="cybercore"] .fp-head :is(h2, h3) {
  font-family: var(--s-display); font-weight: 600; font-stretch: 118%;
  font-size: clamp(1.02rem, 2.1vw, 1.3rem); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--s-accent, var(--a, var(--gold)));
}
:root[data-style="cybercore"] :is(.fan-card :is(h2, h3, h4, h5), .fan-film :is(h2, h3, h4, h5), .fan-era :is(h2, h3, h4, h5),
  .fan-rankhead b, .fan-tiletext b, .fan-land-head :is(h3, b), .fan-num, .fan-cf-name-h, .fan-what b, .saber-text b,
  .pl-titlerow :is(h3, h4), .fan-linkhead b, .fan-shot figcaption b, .wsib-h b) {
  font-family: var(--s-display); font-stretch: 108%; letter-spacing: 0.02em;
}

/* ── 3. the interfaces ──────────────────────────────────────────────────── */

/* the world button on both: a piece of the page it leads to, a black
   frame in the crawl's yellow, square, with its brackets */
:root[data-style="cybercore"] .iw {
  --iw-a: #ffe81f; --s-focus: #ffe81f; --cy-k: #ffe81f;
  border-radius: 0; background-color: #000; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
:root[data-style="cybercore"] .iw-i { border-radius: 0; background: none; box-shadow: inset 0 0 0 1px rgba(255, 232, 31, .5); }
:root[data-style="cybercore"] .iw:focus-visible { outline-color: var(--s-focus); }
@media (hover: hover) and (pointer: fine) {
  :root[data-style="cybercore"] .iw:hover { background-color: #000; box-shadow: none; }
}

/* ── the Holocron: the archive, in the same line ──
   --holo is the archive's light, whichever era and crystal it is in, so
   every line below is drawn from it. */
:root[data-style="cybercore"] .hc { --cy-k: var(--holo); --s-focus: var(--holo); --line: rgba(var(--holo-rgb), .34); }
:root[data-style="cybercore"] .hc-hall { background: var(--bg); }
/* the stacks as uprights and shelves, one line each, with a single scan
   line travelling along them where the soft band of light was */
:root[data-style="cybercore"] .hc-wall {
  background:
    linear-gradient(90deg, transparent 0 49.94%, rgba(var(--holo-rgb), .4) 0 50.06%, transparent 0) 0 0 / 300% 100%,
    repeating-linear-gradient(90deg, rgba(var(--holo-rgb), .42) 0 1px, transparent 1px 90px),
    repeating-linear-gradient(0deg, rgba(var(--holo-rgb), .16) 0 1px, transparent 1px 46px),
    linear-gradient(transparent, transparent);
}
:root[data-style="cybercore"] .hc-floor {
  background:
    repeating-linear-gradient(90deg, rgba(var(--holo-rgb), .2) 0 1px, transparent 1px 120px),
    repeating-linear-gradient(0deg, rgba(var(--holo-rgb), .14) 0 1px, transparent 1px 120px);
}
:root[data-style="cybercore"] .hc-haze { background: linear-gradient(180deg, transparent 35%, var(--bg)); }

/* the holocron, a wire cube: its edges, its corner brackets and the seal,
   with nothing in the faces; the light at its heart a wire globe */
:root[data-style="cybercore"] .hc-face {
  --cy-k: var(--holo-2);
  background-color: transparent; box-shadow: none; border: 1.5px solid rgba(var(--holo-rgb), .9);
}
:root[data-style="cybercore"] .hc-face::after { box-shadow: none; border-width: 1.5px; }
:root[data-style="cybercore"] .hc-core {
  filter: none; border: 1.5px solid var(--holo);
  background:
    radial-gradient(closest-side, transparent 90%, var(--holo) 93% 100%, transparent 0) 50% 50% / 44% 100% no-repeat,
    linear-gradient(var(--holo) 0 0) 50% 50% / 100% 1.5px no-repeat;
}
:root[data-style="cybercore"] .hc-beam { background: repeating-linear-gradient(0deg, rgba(var(--holo-rgb), .5) 0 1px, transparent 1px 7px); }
:root[data-style="cybercore"] .hc-plinth { background: none; box-shadow: none; border: 1.5px solid var(--holo); }
:root[data-style="cybercore"] :is(.hc-title, .hc-done-t) { text-shadow: none; }

/* the panels, the gatekeeper and the records: line frames on the ground,
   square, no glass and no glow (a vector screen has neither) */
:root[data-style="cybercore"] .hc :is(.hc-panel, .hc-gate, .hc-rec) {
  background-color: var(--bg); border-radius: 0; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
:root[data-style="cybercore"] .hc-rec::before { border-radius: 0; box-shadow: none; height: 1px; }
:root[data-style="cybercore"] .hc :is(.hc-btn, .hc-era-tab, .hc-ky, .hc-ask, .hc-ky > span) { border-radius: 0; box-shadow: none; }
:where(:root[data-style="cybercore"]) .hc-btn { background: transparent; }
:root[data-style="cybercore"] .hc-btn--ghost { border-color: rgba(var(--holo-rgb), .5); }
:root[data-style="cybercore"] .hc :is(.hc-era-tab, .hc-ky, .hc-ask) { background-color: var(--bg); }
:root[data-style="cybercore"] .hc-kyber span { filter: none; }
@media (hover: hover) {
  :root[data-style="cybercore"] .hc .hc-rec:hover { border-color: var(--holo); }
}
/* rings, which three of the archive's controls never had: 2px, in the
   archive's light, and a crystal's own colour on its own label */
:root[data-style="cybercore"] .hc :focus-visible:not(.vh) { outline: 2px solid var(--s-focus); outline-offset: 2px; }
:root[data-style="cybercore"] .hc-ky { --s-focus: var(--c); }
:root[data-style="cybercore"] .hc :is(.hc-ky, .hc-era-tab):focus-within { outline-color: var(--s-focus); }
:root[data-style="cybercore"] .hc-h { display: flex; align-items: center; flex-wrap: wrap; gap: 0 0.6em; }
:root[data-style="cybercore"] .hc-h::after { margin-left: auto; padding-left: 1rem; }

/* ── E.L.M.A.L.L.A.H.: the war room, in the same line ──
   Its own palette stays (Republic blue, Imperial red, gold for the target,
   green for go); the glow goes, the gradients go, and the crests are drawn
   as their outlines. The holotable itself is the room's light and is left
   exactly as it draws. */
:root[data-style="cybercore"] .el { --s-focus: var(--gold); --cy-k: var(--gold); }
:root[data-style="cybercore"] .el-more-s { --s-focus: var(--rep); }
:root[data-style="cybercore"] .el-pool { background: none; }
:root[data-style="cybercore"] .el-top { background: var(--bg); }
:root[data-style="cybercore"] :is(.el-title, .el-brief-name, .el-vs-name, .el-fac-name, .el-jump-to) { text-shadow: none; }
:root[data-style="cybercore"] :is(.el-kicker i, .el-sw) { box-shadow: none; }
:root[data-style="cybercore"] .el-legend li::before { box-shadow: none; }
:root[data-style="cybercore"] .el-legend-f svg { filter: none; }
:root[data-style="cybercore"] .el-brief-in { background: var(--bg); }
:root[data-style="cybercore"] .el-pin { background: rgba(0, 0, 0, .82); }
:root[data-style="cybercore"] .el-vs-side::before { content: none; }
:root[data-style="cybercore"] .el-vs-x { filter: none; }
:root[data-style="cybercore"] :is(.el-vs-crest, .el-fac-crest, .el-fac-mark, .el-here-mark) {
  fill: none; stroke: var(--f, var(--rep)); stroke-width: 1.3; filter: none;
}
:root[data-style="cybercore"] :is(.el-fac-mark, .el-here-mark) { opacity: .2; stroke-width: .8; }
:root[data-style="cybercore"] .el-vs-bar span { height: 2px; box-shadow: none; }
:root[data-style="cybercore"] .el-vs-bar span:first-child { background: var(--rep); }
:root[data-style="cybercore"] .el-vs-bar span:last-child { background: var(--emp); }
:root[data-style="cybercore"] .el-vs-bar i { box-shadow: none; animation: none; }
:root[data-style="cybercore"] .el-fac-h {
  --cy-k: var(--f); background-color: var(--bg);
  border-left-width: 1px; border-color: color-mix(in srgb, var(--f) 50%, transparent);
}
:root[data-style="cybercore"] .el :is(.el-world, .el-here) { background-color: var(--bg); background-image: none; }
:root[data-style="cybercore"] .el-more-s { border-radius: 0; background: var(--bg); }
@media (hover: hover) {
  :root[data-style="cybercore"] .el .el-sys.el-world:hover { background: var(--bg); border-color: var(--c); }
}
:root[data-style="cybercore"] .el-h::after { margin-left: auto; align-self: center; }
