/* --- Nemesis theme -------------------------------------------------------------
   Awaken Realms gave permission for the name and the artwork (2026-09-29).
   Everything is scoped to [data-theme="nemesis"]; base styles stay in site.css.

   LOAD ORDER IS PART OF THE CONTRACT. _Layout links site.css, then every theme
   file, then themes/_shared.css. Theme rules carry an extra attribute selector,
   so they outrank base styles wherever they land - but do not reorder the links
   without re-reading _shared.css, which wins by POSITION rather than weight.

   THE BRIEF (owner 2026-09-29): "feel like LayerUp is running on a damaged
   spaceship's crew terminal ... cold industrial metal, dim teal lighting, and
   occasional amber warnings, with alien growth creeping into the edges."

   SECOND CUT, THE OWNER'S PALETTE (same day). The first cut made teal the accent;
   the owner then supplied their own roles - hull, bulkhead panels, riveted seams,
   "alarm red, bright enough for text", hazard amber, cryo blue, intruder slime -
   and the pages became their pictures: a riveted bulkhead wall behind the content
   and a corridor floor with a grate and resin in the footer. Mapped onto the
   site's variables:
       alarm red   -> --amber, the ACCENT: keys, links, the logo, the active nav
       hazard amber-> --cyan, the SECONDARY: hazard tape, divider tags, focus, flags
       cryo blue   -> --cryo, the LIGHTING only: the strip light under the nav, the
                      status-light bullets, a card's edge when you point at it -
                      the colour of the tube lights in the owner's wall picture
       slime       -> --green, success
   The teal cut is in git (9d84c3fd) if the red is not the answer.

   Mechanically dark (dark Bootstrap controls, light ink), Dark bucket.

   MEASURED, worst of --bg/--bg2/--bg3/--surface/--amber-bg: text 10.7, mid 6.7,
   faint 4.78, red as ink 4.79, amber 7.3 - all AA, so the red is its own ink and
   needs no darker shade for words. Two numbers moved from the owner's list to get
   there: the ladder they gave had one panel colour and the site needs four, and the
   two made up here (--bg3, --surface) are held dark enough for the faint tier; and
   the muted grey went from #7d8a95 (4.16 on the lightest panel) to #82909b.
   Keys: derived black ink 7.5 at the top of the red key, 5.1 at the foot. Nav: ink
   11.7, red 5.5. The two pictures are measured below, each under its veil. */
[data-theme="nemesis"] {
    /* -- PAGE: hull, bulkhead panels, riveted seams. -- */
    --bg: #0d1013;
    --bg2: #171c21;
    --bg3: #1a2025;
    --surface: #1e242a;
    --border: #2a323a;
    --border2: #36404a;
    --text: #d6dde3;
    --text-mid: #a7b1ba;
    --text-dim: #82909b;

    /* -- ACCENT: alarm red. -- */
    --amber: #ff4d4d;
    --amber-dim: oklch(0.50 0.17 25);
    --amber-bg: #2a1414;

    /* -- SECONDARY: hazard amber. site.css paints this colour in about twenty
       small places (saved states, flags, a focus outline), which is the
       "occasional" in the brief without any rule here having to ration it. -- */
    --cyan: #f2a900;
    --cyan-dim: rgba(242, 169, 0, 0.25);

    /* -- SUCCESS: intruder slime. -- */
    --green: #9bd44a;

    /* -- LIGHTING: cryo blue, used by this file only. -- */
    --cryo: #7fd6e8;

    /* -- NAV: the terminal's header bar, a shade up from the hull. -- */
    --nav-bg: #12171b;
    --nav-border: #07090b;
    --nav-fg: #c9d1d8;
    --nav-fg-dim: #95a1ab;
    --nav-fg-strong: #eef2f5;
    --nav-accent: #ff4d4d;
    --nav-accent-dim: rgba(255, 77, 77, 0.5);
    --nav-accent-bg: rgba(255, 77, 77, 0.10);
    --nav-btn-border: rgba(201, 209, 216, 0.3);
    /* Faint scanlines over a panel lit from above. Both layers take the box's
       own size, so the one --nav-texture-size serves them. */
    --nav-texture:
        repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 0 1px, rgba(255, 255, 255, 0) 1px 3px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 70%);
    --nav-texture-size: auto;
    /* THE STRIP LIGHT under the nav: a cryo tube brightest in the middle, with a
       dead section two thirds along. The ship is damaged; one tube is out. The
       glow is on .site-nav::after below. */
    --nav-gradient: linear-gradient(to right,
        rgba(127, 214, 232, 0.25) 0%, #4fa9bb 18%, #c4f1fa 45%, #4fa9bb 64%,
        #1b2a30 66.5%, #1b2a30 70.5%, #4fa9bb 73%, #4fa9bb 84%, rgba(127, 214, 232, 0.25) 100%);

    /* -- FOOTER: the corridor floor (owner's picture). -- */
    --footer-bg: #0b0e11;
    --footer-border: #07090b;
    --footer-fg: #aab4bd;
    --footer-accent: #ff4d4d;
    /* Three layers, front to back: the HAZARD TAPE along the top edge, a hull veil,
       and the owner's corridor - a riveted wall meeting a floor grate, resin up both
       sides. Pinned to the BOTTOM so the grate always shows; a short footer crops the
       top of the wall instead. MEASURED over the whole picture at the 95th
       percentile, veil 0.40: footer ink 7.37, red links 4.75, faint 4.74. */
    --footer-texture:
        repeating-linear-gradient(-45deg, #f2a900 0 8px, #0b0e11 8px 16px),
        linear-gradient(rgba(13, 16, 19, 0.40), rgba(13, 16, 19, 0.40)),
        url("/images/nemesis-footer.webp");
    --footer-texture-repeat: no-repeat, no-repeat, no-repeat;
    --footer-texture-position: left top, center, center bottom;
    --footer-texture-size: 100% 8px, auto, cover;

    /* THE STATUS LIGHT as the list bullet, the way Wingspan's lists take an egg and
       Sleeping Gods' a hex token: a lit cryo square in a dark bezel. The colours
       are written into the SVG because a data URI cannot read a variable. */
    --led: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cdefs%3E%3CradialGradient id='l' cx='0.4' cy='0.4' r='0.7'%3E%3Cstop offset='0' stop-color='%23e8fbff'/%3E%3Cstop offset='0.45' stop-color='%237fd6e8'/%3E%3Cstop offset='1' stop-color='%232c6f7c'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect x='0.5' y='0.5' width='9' height='9' rx='2' fill='%230a0d10' stroke='%233a4550'/%3E%3Crect x='2.5' y='2.5' width='5' height='5' rx='1' fill='url(%23l)'/%3E%3C/svg%3E");
}

/* The strip light glows onto the page under it. */
[data-theme="nemesis"] .site-nav::after {
    box-shadow: 0 0 10px 1px rgba(127, 214, 232, 0.40);
}

/* THE BULKHEAD WALL (owner's picture): riveted plates down the middle, machinery,
   cryo tubes and amber lamps down both sides. It stays put while the page scrolls,
   so the machinery holds the gutters and the plates sit behind the content.
   MEASURED over the whole picture at the 95th percentile - the tube lights are the
   bright tail - under a hull veil at 0.45: faint text 4.80, red 4.81, body 11.5. */
[data-theme="nemesis"] body {
    background-image:
        linear-gradient(rgba(13, 16, 19, 0.45), rgba(13, 16, 19, 0.45)),
        url("/images/nemesis-page.webp");
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    background-size: auto, cover;
    background-attachment: scroll, fixed;
}
/* Phones: a fixed picture is janky-to-broken on mobile browsers and the screen
   needs its pixels for content, so a phone gets the flat hull. */
@media (max-width: 767px) {
    [data-theme="nemesis"] body { background-image: none; }
}

/* Status lights on every bulleted list in main. Same exclusion list as Wingspan's
   eggs and Sleeping Gods' tokens, for the same reason: those three lists show no
   marker on purpose, `list-style: none` loses to this selector, and the carousel
   is a <ul> of photos. */
[data-theme="nemesis"] main ul:not(.lu-fil-list):not(.lu-unbox-lead-list):not(.lu-carousel-track) > li {
    list-style-image: var(--led);
}
[data-theme="nemesis"] .lu-resources-row::before {
    content: "";
    flex: 0 0 22px;
    width: 14px;
    height: 14px;
    background-image: var(--led);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
/* "Before you print" trades its ticks for the light, painted onto the .ck box: the
   rows are flex items and a flex item never renders a ::marker. */
[data-theme="nemesis"] .lu-pd-check-item .ck {
    font-size: 0;
    width: 10px;
    height: 10px;
    align-self: flex-start;
    margin-top: 4px;
    background-image: var(--led);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* THE ALARM KEYS. The controls that are solid accent when chosen are console keys:
   a top-lit red gradient, a highlight along the top edge, a darker lip below.
   Ink is --on-amber, which site.css derives from --amber as black: 7.5 at the top
   of the key, 5.1 at the foot. Hover lights the key rather than dimming it
   (black 8.3 to 5.6). */
[data-theme="nemesis"] .lu-btn-solid,
[data-theme="nemesis"] .lu-btn-secondary.is-on,
[data-theme="nemesis"] .lu-chip-active,
[data-theme="nemesis"] .lu-window-opt.is-on,
[data-theme="nemesis"] .lu-gs-catbox-tab.is-on,
[data-theme="nemesis"] .lu-gs-mode.active,
[data-theme="nemesis"] .lu-fil-mat.selected,
[data-theme="nemesis"] .lu-cover-chip-current,
[data-theme="nemesis"] .lu-featured-ribbon,
[data-theme="nemesis"] .lu-rec-tag-hot {
    background: linear-gradient(to bottom, #ff6a64 0%, #ff4d4d 55%, #e63d3d 100%);
    border-color: #b82e2e;
    color: var(--on-amber);
    box-shadow: inset 0 1px 0 rgba(255, 205, 200, 0.5), inset 0 -1px 0 rgba(90, 15, 15, 0.5);
}
[data-theme="nemesis"] .lu-btn-solid:hover,
[data-theme="nemesis"] .lu-btn-secondary.is-on:hover,
[data-theme="nemesis"] .lu-chip-active:hover,
[data-theme="nemesis"] .lu-window-opt.is-on:hover,
[data-theme="nemesis"] .lu-gs-mode.active:hover {
    background: linear-gradient(to bottom, #ff7b75 0%, #ff5a55 55%, #ee4444 100%);
    border-color: #c83333;
    color: var(--on-amber);
    opacity: 1;
    box-shadow: inset 0 1px 0 rgba(255, 220, 215, 0.6), 0 0 12px rgba(255, 77, 77, 0.35);
}
/* Progress is a lit bar in a groove. */
[data-theme="nemesis"] .lu-meter > span,
[data-theme="nemesis"] .lu-admin-av-bar > span {
    background: linear-gradient(to bottom, #ff6a64 0%, #ff4d4d 60%, #e63d3d 100%);
    box-shadow: 0 0 8px rgba(255, 77, 77, 0.35);
}

/* BULKHEAD PLATES. A card is a machined panel: a seam round it and a highlight
   along its top edge. On hover the seam lights cryo blue, which is the terminal
   telling you what you are pointing at; the lift and drop shadow are site.css's own. */
[data-theme="nemesis"] .lu-card {
    border-radius: 3px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 0 0 1px var(--border);
}
[data-theme="nemesis"] .lu-card:hover {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(127, 214, 232, 0.45),
        0 6px 22px rgba(0, 0, 0, 0.55), 0 0 16px rgba(127, 214, 232, 0.14);
}

/* A SECTION HEADING is a terminal label: a seam under it with a short lit segment
   at the start, like the indicator beside a readout. */
[data-theme="nemesis"] .lu-section-title {
    padding-bottom: 7px;
    background-image:
        linear-gradient(var(--amber), var(--amber)),
        linear-gradient(var(--border2), var(--border2));
    background-repeat: no-repeat, no-repeat;
    background-position: left bottom, left bottom;
    background-size: 26px 2px, 100% 1px;
}

/* DIVIDERS: a seam with a hazard tag at its centre, one of the few amber marks.
   `hr:not([class])` because a classed <hr> is somebody's component (the shelf
   menu's .lu-gs-menu-sep is one) and this selector would outrank it. */
[data-theme="nemesis"] .lu-divider,
[data-theme="nemesis"] main hr:not([class]) {
    height: 6px;
    border: 0;
    opacity: 1;
    background-color: transparent;
    background-image:
        repeating-linear-gradient(-45deg, #f2a900 0 4px, #0d1013 4px 8px),
        linear-gradient(var(--border2), var(--border2));
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    background-size: 44px 6px, 100% 1px;
}

/* --- THE GROWTH -----------------------------------------------------------------
   "Alien growth creeping into the edges": Intruder resin crusted up the left wall
   from the floor, and the same growth turned over, hanging from the ceiling down
   the right wall. Both are SVG drawn for this theme by tools/nemesis-growth.js
   (ribbed runners, a crust with a glossy rim, eggs lit from the base). Root
   pseudo-elements, fixed, BEHIND the page (z-index -1, the Calico lesson in
   ThemeCornerArtTests) but in front of the wall picture, which is painted on the
   canvas beneath everything: the growth covers the machinery in the gutters and
   never lies over a word or a swatch. */
[data-theme="nemesis"]::before,
[data-theme="nemesis"]::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: -1;
    /* Drawn at 240x560, shown a touch smaller: a 1920 screen has about 310px of gutter each
       side of the widest column, so this stays out in it. */
    width: 220px;
    height: 513px;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.9;
}
/* Top right, hanging from just under the nav. */
[data-theme="nemesis"]::before {
    top: 58px;
    right: 0;
    background-image: url("/images/nemesis-tr.svg");
    background-position: right top;
}
/* Bottom left, on the floor. */
[data-theme="nemesis"]::after {
    left: 0;
    bottom: 0;
    background-image: url("/images/nemesis-bl.svg");
    background-position: left bottom;
}
/* Narrower than the widest column plus its gutters, the growth reaches under
   content, so it goes faint - the same threshold as Wingspan's birds. */
@media (max-width: 1699px) {
    [data-theme="nemesis"]::before,
    [data-theme="nemesis"]::after { width: 150px; height: 350px; opacity: 0.35; }
}
/* Phones: gone, so the content owns the screen. */
@media (max-width: 767px) {
    [data-theme="nemesis"]::before,
    [data-theme="nemesis"]::after { display: none; }
}
