/* Glassmorphism, for /worlds/the-boys/ and /vought/ (style: glassmorphism).

   Vought sells heroes through polish. Frosted glass is that polish, and the
   red behind it is what the polish is for: Homelander's heat vision, a soft
   glow at the top of the page that comes into focus as you scroll, until by
   the foot it reads as what it is, two beams.

   One file for the pair, in three parts: what both pages share (the palette,
   the glass, the red behind it); the world page, a corporate lobby at night;
   and Vought Tower, whose own reading (the intranet) is the glass. Its other
   reading, Butcher's file, is the truth with no polish on it, so it stays
   paper exactly as it was. The spec: docs/superpowers/specs/2026-10-11-page-
   styles-design.md, section 9, "Round 1, in detail".

   Everything here is scoped to :root[data-style="glassmorphism"], so this
   file does nothing on a page that is not wearing it. Material rules use
   :where() for that scope, so they weigh what the rule they restyle weighs
   and each page's own hover and focus states still win. */

/* ── 1. shared: the palette, the glass, the red behind it ───────────────── */
:root[data-style="glassmorphism"] {
  --gl-gold: #e2b54a;               /* Vought gold, the tower's own */
  --gl-gold-hi: #f6dc94;
  /* the glass: a navy tint dense enough that every word on it holds 4.5:1
     with no help from the blur, a rim, a bright top edge where the light
     catches it with a soft glow under that, and a long drop shadow */
  --gl-tint: rgba(12, 26, 52, .64);
  --gl-tint-hi: rgba(20, 40, 76, .7);
  --gl-frost: blur(18px) saturate(160%);
  --gl-rim: rgba(255, 255, 255, .15);
  --gl-lit: inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 18px 36px -30px rgba(255, 255, 255, .4);
  --gl-drop: 0 26px 50px -30px rgba(0, 0, 0, .85);
  /* the beams' colour; each page sets its strength below */
  --gl-c: rgb(255, 58, 44);

  /* the world page's shared components read these (base.css) */
  --s-surface: var(--gl-tint);
  --s-surface-hi: var(--gl-tint-hi);
  --s-edge: var(--gl-rim);
  --s-bw: 1px;
  --s-r: 20px;
  --s-r-sm: 999px;
  --s-shadow: var(--gl-lit), var(--gl-drop);
  --s-shadow-hi: var(--gl-lit), 0 30px 60px -28px rgba(0, 0, 0, .9), 0 0 0 1px rgba(246, 220, 148, .3);
  --s-lift: -3px;
  --s-display: "Archivo", var(--sans);
  --s-display-w: 900;
  --s-display-ls: 0.03em;
  /* Vought Tower's own ring colour, so the pair share one */
  --s-focus: var(--gl-gold);

  /* the bars: the glass they already were, tinted navy, with a lit edge */
  --s-bar: rgba(8, 18, 36, .5);
  --s-bar-edge: rgba(255, 255, 255, .14);
  --s-bar-blur: blur(24px) saturate(180%);
  --s-bar-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 20px 44px -20px rgba(0, 0, 0, .8);

  /* no film grain on glass and no circuit field; the HUD lattice stays,
     widened and warmed into the mullions of a curtain wall */
  --s-grain: 0;
  --s-field: 0;
  --hud-cell: 120px;
  --hud-grid: rgba(246, 220, 148, .04);
}

/* Glass needs something behind it to frost. Where the browser cannot
   blur, the tint goes nearly solid; where the reader asked for less
   transparency, fully solid with no blur; with Increase Contrast, denser. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root[data-style="glassmorphism"] { --gl-tint: rgba(11, 22, 42, .95); --gl-tint-hi: rgba(18, 34, 64, .96); }
}
@media (prefers-reduced-transparency: reduce) {
  :root[data-style="glassmorphism"] {
    --gl-tint: rgb(11, 22, 42); --gl-tint-hi: rgb(18, 34, 64); --gl-frost: none;
    --s-bar: rgb(8, 18, 36); --s-bar-blur: none;
  }
}
@media (prefers-contrast: more) {
  :root[data-style="glassmorphism"] { --gl-tint: rgba(9, 19, 38, .9); --gl-tint-hi: rgba(16, 31, 58, .92); --gl-rim: rgba(255, 255, 255, .4); }
}

/* The red behind the glass. Two pairs of beams, the way heat vision leaves
   two eyes, drawn twice on the same lines: wide and blurred (::before) and
   thin and hard (::after). Scrolling the page crossfades the first into the
   second. Opacity only, so the compositor does the work. Without scroll-
   driven animation, and under Reduce Motion, both hold at the halfway point. */
:root[data-style="glassmorphism"] :is(.boys-beams, .vt-field)::before,
:root[data-style="glassmorphism"] :is(.boys-beams, .vt-field)::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  --w: 1.5px;
  background:
    linear-gradient(161deg, transparent calc(24% - var(--w)), var(--gl-c) 0 calc(24% + var(--w)),
      transparent 0 calc(25.2% - var(--w)), var(--gl-c) 0 calc(25.2% + var(--w)), transparent 0),
    linear-gradient(199deg, transparent calc(68% - var(--w)), var(--gl-c) 0 calc(68% + var(--w)),
      transparent 0 calc(69.2% - var(--w)), var(--gl-c) 0 calc(69.2% + var(--w)), transparent 0);
  will-change: opacity;
}
:root[data-style="glassmorphism"] :is(.boys-beams, .vt-field)::before { --w: 14px; filter: blur(26px); opacity: .55; }
/* sharp, the beams belong to the margins: behind the reading column they
   fade to a trace, so no hard line ever runs under a heading or a sentence */
:root[data-style="glassmorphism"] :is(.boys-beams, .vt-field)::after {
  opacity: .5;
  -webkit-mask-image: linear-gradient(90deg, #000 0 7%, rgba(0, 0, 0, .18) 24% 76%, #000 93%);
  mask-image: linear-gradient(90deg, #000 0 7%, rgba(0, 0, 0, .18) 24% 76%, #000 93%);
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    :root[data-style="glassmorphism"] :is(.boys-beams, .vt-field)::before { animation: gl-soft linear both; animation-timeline: scroll(root); }
    :root[data-style="glassmorphism"] :is(.boys-beams, .vt-field)::after { animation: gl-sharp linear both; animation-timeline: scroll(root); }
  }
}
@keyframes gl-soft { from { opacity: 1; } to { opacity: .08; } }
@keyframes gl-sharp { from { opacity: 0; } to { opacity: 1; } }

/* ── 2. the world page: a corporate lobby at night ──────────────────────── */

/* the world's colour moves from red to Vought gold, because the red is
   behind the glass now; items that carry their own --a keep theirs */
:root[data-style="glassmorphism"] body[data-fan="boys"] { --a: var(--gl-gold); }
:root[data-style="glassmorphism"] .tabbar { --s-accent: var(--gl-gold-hi); }

/* The night: Vought navy where the red-black was, the city and the tower in
   navy with gold windows, the V still red. The halftone print goes (glass is
   not printed) and the two red cones become the tower's gold searchlights,
   the same pair that sweeps the sky on Vought Tower. The beams stay at full
   strength here: the whole sky is capped at .36 (fanpages.css). */
:root[data-style="glassmorphism"] .boys-sky {
  background: radial-gradient(90% 70% at 50% 0%, #12284c 0%, #081428 46%, #03070f 100%);
}
:root[data-style="glassmorphism"] :is(.boys-sky::before, .boys-dots) { opacity: 0; }
:root[data-style="glassmorphism"] .bys-block { fill: #0c1a33; }
:root[data-style="glassmorphism"] .bys-tower { fill: #12244a; }
:root[data-style="glassmorphism"] :is(.bys-win, .bys-towerwin) { fill: #f6dc94; }
:root[data-style="glassmorphism"] .bys-mast { fill: #8a96b4; }
:root[data-style="glassmorphism"] .boys-beams i {
  background: linear-gradient(to top, rgba(246, 220, 148, .16), transparent 72%);
}

/* the glass itself, on every surface that holds text */
:where(:root[data-style="glassmorphism"]) :is(.fan-card, .fan-linkcard, .fan-tile, .fan-rankrow, .fan-land, .fan-quote, .fan-intro-when, .fan-peek, .boys-memo),
:where(:root[data-style="glassmorphism"]) .fan-art--boys .boys-stage {
  background: var(--gl-tint);
  -webkit-backdrop-filter: var(--gl-frost); backdrop-filter: var(--gl-frost);
  box-shadow: var(--gl-lit), var(--gl-drop);
}
:where(:root[data-style="glassmorphism"]) :is(.fan-rankrow, .fan-land, .boys-memo),
:where(:root[data-style="glassmorphism"]) .fan-art--boys .boys-stage {
  border: 1px solid var(--gl-rim); border-radius: var(--s-r);
}
/* The quote and the "first watched" note are panes like the rest: a rim
   all round and four rounded corners, not a gold stripe down one side.
   Their gold stays in the label and in the lit top edge. */
:where(:root[data-style="glassmorphism"]) :is(.fan-quote, .fan-intro-when) {
  border: 1px solid var(--gl-rim); border-radius: var(--s-r);
  box-shadow: inset 0 1px 0 rgba(246, 220, 148, .42), inset 0 18px 36px -30px rgba(246, 220, 148, .4), var(--gl-drop);
}
@media (hover: hover) {
  :where(:root[data-style="glassmorphism"]) :is(.fan-rankrow, .fan-land, .fan-quote):hover {
    background: var(--gl-tint-hi); box-shadow: var(--s-shadow-hi);
  }
}

/* pills and doors: the same glass, rounder */
:where(:root[data-style="glassmorphism"]) :is(.fan-link, .fan-iface, .wsib-i a) {
  background: rgba(12, 26, 52, .5);
  -webkit-backdrop-filter: var(--gl-frost); backdrop-filter: var(--gl-frost);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
}
@media (hover: hover) {
  :where(:root[data-style="glassmorphism"]) :is(.fan-link, .fan-iface, .wsib-i a):hover { background: var(--gl-tint-hi); }
}

/* the Vought fragment under the title is the tower's own navy, frosted */
:where(:root[data-style="glassmorphism"]) .fan-peek { background: rgba(6, 16, 31, .62); }

/* the memo: a frosted sheet, ruled by the rim */
:where(:root[data-style="glassmorphism"]) .boys-memo-h { border-bottom-color: var(--gl-rim); }

/* the V drawn on glass: the stage's own dark panel gives way to the tint */
:where(:root[data-style="glassmorphism"]) .byh-bg { fill: transparent; }

/* Headings in Vought's own face, Archivo at its widest, which is what ties
   this page to the tower. The title is gilded the way the tower's wordmark
   is; reading text stays Inter and labels stay JetBrains Mono. */
:root[data-style="glassmorphism"] .fan-title {
  display: inline-block; padding-right: 0.06em;
  font-family: var(--s-display); font-weight: var(--s-display-w); letter-spacing: var(--s-display-ls);
  font-stretch: 125%; text-transform: uppercase; transform: none;
  background: linear-gradient(180deg, #fff6d6 0%, #f3d27a 38%, #c8952c 62%, #f6dc94 78%, #8a5d14 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35));
}
:root[data-style="glassmorphism"] :is(.fan-card :is(h2, h3, h4, h5), .fan-rankhead b, .fan-tiletext b, .fan-land-head b) {
  font-family: var(--s-display); font-weight: 800; font-stretch: 112%; letter-spacing: 0.005em;
}
/* An item's own colour (a tile's caption, a card's subtitle, its tag,
   Listen link and Play button) sits on glass that is a shade lighter than
   the old ground, which cost the darker ones (the Boys' red) a little
   contrast. Each is its colour lifted a quarter toward white: still red,
   and back above where it was. :where keeps the shared rules' weight, so
   hovering and playing still win. */
:root[data-style="glassmorphism"] :is(.fan-tiletext i, .fan-card .fan-sub) { color: color-mix(in srgb, var(--a) 75%, #fff); }
:where(:root[data-style="glassmorphism"]) :is(.fan-tag, .fan-visit, .fan-hear) { color: color-mix(in srgb, var(--a) 75%, #fff); }

/* section heads as the tower sets them ("Floor directory"): the name in
   white Archivo, the note beside it in small gold mono */
:root[data-style="glassmorphism"] .subsec--fan {
  font-family: var(--s-display); font-weight: 800; font-stretch: 112%;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem); letter-spacing: 0.01em; text-transform: none; color: var(--ink);
}
:root[data-style="glassmorphism"] .subsec--fan .subsec-yr {
  font-family: var(--mono); font-weight: 400; font-stretch: 100%; font-size: 0.7rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--gl-gold);
}
:root[data-style="glassmorphism"] .subsec--fan::after { background: linear-gradient(90deg, rgba(246, 220, 148, .4), rgba(246, 220, 148, .04)); }
/* the picker's heading is a section head too, set the same weight, size,
   tracking and white; it was Inter and reading faces never move, so it
   keeps Inter */
:root[data-style="glassmorphism"] .fp-head :is(h2, h3) {
  font-family: var(--s-display); font-stretch: 112%;
  font-weight: 800; font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  letter-spacing: 0.01em; text-transform: none; color: var(--ink);
}

/* ── 3. Vought Tower: the intranet in frosted glass ─────────────────────────
   Vought's reading only. Every rule names .vt:not(.is-butcher), so the
   moment the switch opens Butcher's file the page is the manila folder it
   always was, and the beams go with the polish. */
:root[data-style="glassmorphism"] .vt-field { --gl-c: rgba(255, 58, 44, .42); }
:root[data-style="glassmorphism"] .vt.is-butcher .vt-field::before,
:root[data-style="glassmorphism"] .vt.is-butcher .vt-field::after { content: none; }

/* the big panels: frosted, with Vought's gold trim kept as the rim */
:where(:root[data-style="glassmorphism"]) .vt:not(.is-butcher) :is(.vt-dir, .vt-panel, .vt-health) {
  background: var(--gl-tint);
  border-color: rgba(246, 220, 148, .3); border-radius: 22px;
  -webkit-backdrop-filter: var(--gl-frost); backdrop-filter: var(--gl-frost);
  box-shadow: var(--gl-lit), var(--gl-drop);
}
/* the talent card keeps its gold frame and foil, over the glass */
:where(:root[data-style="glassmorphism"]) .vt:not(.is-butcher) .vt-card {
  background:
    linear-gradient(115deg, transparent 30%, rgba(246, 220, 148, .12) 45%, transparent 60%) 0 0 / 300% 100%,
    var(--gl-tint);
  border: 2px solid rgba(226, 181, 74, .55);
}
/* the news crawl: a darker strip of the same glass */
:where(:root[data-style="glassmorphism"]) .vt:not(.is-butcher) .vt-vnn {
  background: rgba(4, 10, 22, .55); border-radius: 999px;
  -webkit-backdrop-filter: var(--gl-frost); backdrop-filter: var(--gl-frost);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
/* the header: a pane of glass across the top of the lobby */
:where(:root[data-style="glassmorphism"]) .vt:not(.is-butcher) .vt-top {
  background: rgba(6, 14, 30, .42);
  -webkit-backdrop-filter: var(--gl-frost); backdrop-filter: var(--gl-frost);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .06);
}
/* the partner tiles sit inside a glass panel, and a blur inside a blur only
   sees the panel, so these are lighter inlays of the same glass instead */
:where(:root[data-style="glassmorphism"]) .vt:not(.is-butcher) .vt-logos a {
  border-radius: 14px; background: rgba(255, 255, 255, .04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09);
}
:where(:root[data-style="glassmorphism"]) .vt:not(.is-butcher) .vt-tag { border-radius: 10px; }
/* the sign-off, and the world button, which the intranet tints gold */
:where(:root[data-style="glassmorphism"]) .vt:not(.is-butcher) :is(.vt-sign, .iw) {
  -webkit-backdrop-filter: var(--gl-frost); backdrop-filter: var(--gl-frost);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 16px 34px -20px rgba(0, 0, 0, .8);
}
:root[data-style="glassmorphism"] .vt:not(.is-butcher) .iw { --iw-a: var(--gl-gold); }
/* and its ring is the tower's, like every other ring on the page */
:root[data-style="glassmorphism"] .vt:not(.is-butcher) .iw:focus-visible { outline-color: var(--s-focus); }
