/* transfer-tapestry.css
 * Transfer Center — the Illuminated Loom surface (2026-07-29)
 *
 * WHY this file exists: the Episode Tapestry's visual language was first
 * ported as the flag-gated, data-keyed loom (transfer-loom.css) — which
 * renders nothing when the queue is untiered (production: urgency_tier set on
 * 7 of 408 workspaces). A visual grammar keyed to empty columns is invisible
 * by construction. This file carries the STRUCTURAL half of the tapestry —
 * the part that does not depend on a single populated column — and makes it
 * THE surface, not a toggle.
 *
 * PRECEDENCE (decided 2026-07-29): on /transfer the tapestry WINS over the
 * roast-ladder account theme. The Transfer Center is a clinical instrument,
 * not a themed dashboard — the doctor asked for the tapestry here, full stop.
 * This sheet is loaded AFTER roast-ladder.css / roast-ladder-light.css and
 * re-asserts the base .tc-page tokens unconditionally (no :not() guard), so
 * it resolves by the cascade regardless of data-roast-theme.
 *
 * The ONE escape hatch that still beats it: the named-skin cycle
 * (body[data-tc-skin="night-dispatch"|"phosphor-pure"]). Those token blocks
 * carry equal-or-higher specificity and are the doctor's explicit, per-page
 * pick — choosing a candidate skin is meant to reskin this exact surface, so
 * it must win. Every rule below is therefore scoped
 * body.tc-page:not([data-tc-skin]).
 *
 * Contracts kept:
 * - No structural richness keyed to queue data. The woven queue, grain, gilt
 *   frame and serif masthead render on an EMPTY queue — that is the point.
 *   Tier/state banding stays in transfer-loom.css, layering on top when data
 *   exists.
 * - No animation introduced; nothing to kill under prefers-reduced-motion.
 * - The roast ladder is untouched on every OTHER surface (census, admissions,
 *   help, …). Only /transfer opts out, and only through load order — the
 *   shared partials and roast-ladder.js are not edited.
 */

body.tc-page[data-page="transfer"]:not([data-tc-skin]) {
    /* Illuminated Loom palette (token parity with the data-tc-skin block in
       transfer-loom.css, so the default and the named skin read as one). */
    --term-bg-void:       #0D0805;
    --term-bg-surface:    #130D08;
    --term-bg-elevated:   #1B130C;
    --term-bg-header:     #0F0A06;
    --term-bg-input:      #100B07;

    --term-fg-primary:    #FFF7EE;
    --term-fg-secondary:  #B9A88F;
    --term-fg-muted:      #8B7355;
    --term-fg-inverse:    #130D08;

    --term-border-subtle:  rgba(107, 86, 74, .22);
    --term-border-default: rgba(90, 69, 58, .4);
    --term-border-strong:  rgba(107, 86, 74, .58);
    /* Load-bearing interactive edge (WCAG 1.4.11 3:1) — brass, not gray. */
    --term-boundary:       #8B7355;

    /* T5 roles preserved: gold = chrome/labels (brass), teal = live,
       amber = decision. One color = one meaning. */
    --term-gold:          #BFA162;
    --term-gold-dim:      rgba(191, 161, 98, 0.35);
    --term-gold-subtle:   rgba(191, 161, 98, 0.10);
    --term-gold-ghost:    rgba(191, 161, 98, 0.05);

    --term-accent:        #4CC4B4;
    --term-accent-dim:    rgba(76, 196, 180, 0.40);
    --term-accent-subtle: rgba(76, 196, 180, 0.10);
    --term-accent-ghost:  rgba(76, 196, 180, 0.05);
    --term-live:          #4CC4B4;
    --term-live-dim:      rgba(76, 196, 180, 0.40);
    --term-live-subtle:   rgba(76, 196, 180, 0.10);
    --term-live-ghost:    rgba(76, 196, 180, 0.05);
    --term-glow-accent:         0 0 8px rgba(76, 196, 180, 0.22), 0 0 24px rgba(76, 196, 180, 0.08);
    --term-glow-accent-intense: 0 0 12px rgba(76, 196, 180, 0.36), 0 0 36px rgba(76, 196, 180, 0.12);
    --term-glow-gold:           0 0 10px rgba(191, 161, 98, 0.16), 0 0 24px rgba(191, 161, 98, 0.06);

    --term-status-editing:    #E69A4C;
    --term-status-warning:    #E69A4C;
    --term-status-error:      #C44C4C;
    --term-status-critical:   #C44C4C;
    --term-status-generating: #4CC4B4;

    /* The tapestry's serif voice for chrome/display type. Body/data type
       stays in the existing mono/sans — only display reads serif. */
    --term-font-display: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Georgia, 'Times New Roman', serif;

    /* Re-assert the void on the element itself: a roast theme paints
       background directly on .tc-page, and this sheet loads after it. */
    background: var(--term-bg-void);
    color: var(--term-fg-primary);
}

/* ==========================================================================
   1 · VELLUM GRAIN — the existing .tc-grain-overlay hook is an unstyled
   no-op in the base theme; wire it so the surface has tooth, not flat void.
   ========================================================================== */
body.tc-page:not([data-tc-skin]) .tc-grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 1; /* above the void, below every panel (panels sit at z>=2) */
    pointer-events: none;
    background-image: var(--term-grain);
    opacity: 1;
}

/* ==========================================================================
   2 · GILT FRAME — a restrained brass inner keyline around the whole surface,
   the tapestry's illuminated-border rule. box-shadow inset so it never takes
   layout space or clips content.
   ========================================================================== */
body.tc-page:not([data-tc-skin])::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(191, 161, 98, 0.10);
}

/* ==========================================================================
   3 · SERIF MASTHEAD — the header reads as an illuminated title, not a
   toolbar. Serif display voice + a brass rule under the header that resolves
   the existing single gold hairline into the tapestry's gilt rule.
   ========================================================================== */
body.tc-page:not([data-tc-skin]) .tc-header {
    background: var(--term-bg-header);
    border-bottom: 1px solid var(--term-gold-dim);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

body.tc-page:not([data-tc-skin]) .tc-logo-link {
    font-family: var(--term-font-display);
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--term-fg-primary);
}

body.tc-page:not([data-tc-skin]) .tc-logo-accent {
    color: var(--term-gold);
    font-weight: 600;
}

body.tc-page:not([data-tc-skin]) .tc-logo-mark {
    color: var(--term-gold);
    text-shadow: var(--term-glow-gold);
}

/* ==========================================================================
   4 · WOVEN QUEUE — the warp-thread backdrop behind the queue lanes. This is
   the STRUCTURAL loom: it renders on an EMPTY/untiered queue, unlike the
   data-keyed tier bands in transfer-loom.css. A background, so it can never
   intercept pointer events.
   ========================================================================== */
body.tc-page:not([data-tc-skin]) .tc-transfer-list {
    background: repeating-linear-gradient(
        to right,
        transparent,
        transparent 15px,
        rgba(107, 86, 74, .12) 16px,
        transparent 17px
    );
}

/* Cards read as raised vellum tiles against the void, not outlined holes. */
body.tc-page:not([data-tc-skin]) .tc-transfer-card {
    background: var(--term-bg-surface);
    border: 1px solid var(--term-border-default);
    border-radius: 4px;
}

/* The empty-guide title reads as an illuminated heading, not a label. */
body.tc-page:not([data-tc-skin]) .tc-empty-guide-title {
    font-family: var(--term-font-display);
    color: var(--term-gold);
    letter-spacing: 0.04em;
}
