/* Veritatis Studium — platform home (VS_PLAN Slices 1 and 2).
 *
 * Slice 1 shipped geometry only. Slice 2 adds the identity: the three surface
 * registers (day / dusk / night), the four-layer full-page lighting system
 * driven by the server-rendered `data-lux-*` attributes, and the restrained
 * arrival and long-session motion.
 *
 * Three things in here are load-bearing rather than cosmetic:
 *
 * 1. SCOPING AND SPECIFICITY. Every selector is scoped under
 *    `body.studium-world`, so nothing in this file can reach another surface
 *    and the overrides beat main.css by specificity rather than by !important.
 *    Where main.css reaches an element through `html[data-theme="dark"] X`
 *    — specificity (0,2,1) — Studium answers with `html body.studium-world X`
 *    — (0,2,2) — because equal specificity plus load order is too fragile a
 *    thing to rest the whole page background on. main.css really does force
 *    `background-color: var(--cream)` onto `body`, `.page` AND `.content` in
 *    dark and auto modes.
 *
 * 2. THE main.css ALIASES. `partials/_novedades_bell.html`,
 *    `partials/_flash_messages.html` and `.site-footer` are SHARED markup that
 *    renders inside this shell and reads main.css's generic palette tokens.
 *    Each register therefore re-points those tokens at its own values. Without
 *    that, a night register under `theme=light` would paint the bell and the
 *    footer light-on-dark. This is the same technique main.css already uses to
 *    hold `body.sophia-world` on light tokens. `tests/test_studium_tokens.py`
 *    re-derives the dependency set from the rendered page and fails if a token
 *    this page can actually reach is missing from a register.
 *
 * 3. THE PHASE INTERPOLATION IS CONTINUOUS BY CONSTRUCTION. Each phase declares
 *    `from` and `span` per animated quantity and the value is
 *    `from + span * progress`. Because every phase's endpoint equals the next
 *    phase's start — including night -> dawn across midnight — a boundary
 *    crossing retargets the running transition without the field ever jumping
 *    or reversing. `--lux-progress` itself is NEVER transitioned: it resets to
 *    0 at each boundary, and easing that reset would drag the whole field
 *    backwards through the new phase. The compositor properties (transform,
 *    opacity) carry the motion instead. `tests/test_studium_tokens.py` asserts
 *    the continuity arithmetic for every animated quantity.
 */

/* Registered so an unparseable value falls back to 0 instead of poisoning every
   dependent calc(), and so the scalar is type-checked as a number. NOT so it can
   be transitioned — see note 3 above; nothing transitions this property. */
@property --lux-progress {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

/* The card's own sun and moon (P3.4, light 1D): each body's position across the
   hero, 0 at its left edge and 1 at its right. Registered for the reason
   --lux-progress is not: these two ARE transitioned, on the body, so the minute
   step the one timer writes eases instead of jumping (see the register list in
   §1). Each is `from + span * progress`, so it is continuous at every boundary
   like the fields.

   THE EASING WAS DECIDED BY MEASUREMENT (the owner's answer, P3.4). Easing each
   step over the fields' 70s `--lux-travel` means a transition is always running,
   and because every cast, lit edge and the hero's light read these two numbers,
   Chromium restyles the whole page on every frame: measured at 1366, about 7 ms
   of style recalculation per frame, a third of the main thread. Eased over
   `--lux-register-fade` (2.4s) instead, the step looks the same (about a pixel a
   minute) and the page rests between ticks: about 3% of a frame on average.
   The numbers are in ~/platform-launch/p3/P3.4/README.md. */
@property --lux-sun-u {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

@property --lux-moon-u {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

/* Studium's own faces (P3.5): main.css's EB Garamond files, declared again
   with `font-display: optional` under their own family name, and named by the
   font tokens below. With `swap` a late face redrew every line in a narrower
   cut and the lines under it moved (a layout shift of 0.115 at 390px with the
   faces held back 2 s); with `optional` and the hero's two faces preloaded
   (studium/base.html) the face is there at first paint or, on a slow first
   visit, that page keeps the fallback serif and the next one has the face.
   main.css's own faces, and so Alchemia's, keep `swap`. */
@font-face {
  font-family: "Studium EB Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url("../fonts/eb-garamond-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Studium EB Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: optional;
  src: url("../fonts/eb-garamond-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Studium EB Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: optional;
  src: url("../fonts/eb-garamond-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Studium EB Garamond";
  font-style: normal;
  font-weight: 700;
  font-display: optional;
  src: url("../fonts/eb-garamond-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Studium EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: optional;
  src: url("../fonts/eb-garamond-latin-400-italic.woff2") format("woff2");
}

/* ==========================================================================
 * 1. Tokens
 * ==========================================================================
 *
 * Raw palette (vision §29), shared by all three registers.
 *
 * Vision §29 is explicitly a draft and names more colours than the interface
 * needs, so only the members the registers actually reference are declared —
 * a token nothing consumes is dead weight, not documentation.
 *
 * Vision §29's lunar list includes periwinkle and §6's dusk list includes
 * lavender, mauve and violet; all of them are DROPPED. The user's ruling is
 * that vision §8's card rule — "Dusk should not introduce purple, violet,
 * mauve, or related hues" — governs the whole interface, background veil
 * included. Dusk and dawn are expressed as blue variants instead: slate,
 * blue-gray, silver-blue. `tests/test_studium_tokens.py` measures the hue angle
 * of every colour literal in this file and fails on anything in the violet
 * band.
 */
html body.studium-world {
  /* main.css's stacks with Studium's own faces in EB Garamond's place (above). */
  --font-serif: Garamond, "Studium EB Garamond", "Adobe Garamond Pro", Georgia, "Times New Roman", serif;
  --font-ui: var(--font-serif);

  /* Platform neutrals */
  --vs-pearl: #faf5e9;
  /* Slice 8 retuned this from #f6f1e6, a warm cream, to the pale MINERAL of the
     illuminated atrium: pearl and limestone with a faint warm gold and a very
     desaturated green-grey cast. Retuned rather than renamed — it is still the
     lightest broad field colour and still day's `--vs-atmo-base`, so a rename
     would churn every reference for no gain. */
  --vs-cloud-white: #e4e1d7;
  --vs-blue-gray: #8b96a8;
  --vs-midnight-blue: #0e121a;
  --vs-ink-black: #04060a;

  /* Solar accents */
  --vs-muted-amber: #dcb974;
  --vs-bronze: #5f4317;

  /* Lunar accents (no periwinkle) */
  --vs-moonlit-white: #e9eaee;

  /* ------------------------------------------------------------------------
   * The seven-phase field, derived from the phase table below.
   *
   * `--lux-progress` is a real custom property because CSS cannot read a data-
   * attribute as a number, and every quantity here is `from + span * progress`.
   *
   * THE POSITIONS ARE UNITLESS AND THE UNIT IS APPLIED HERE, ONCE. The phase
   * table declares bare numbers and this block is the single place that turns
   * them into viewport units. Until P3.4 that was so they could be normalised
   * into the light's direction and height (`calc()` cannot divide a length by
   * a length); the card's own sun and moon below now carry those, and the bare
   * positions still feed the wordmark's lunar reflection (§5).
   * ---------------------------------------------------------------------- */
  --lux-solar-nx: calc(var(--lux-solar-from) + var(--lux-solar-span) * var(--lux-progress));
  --lux-solar-x: calc(var(--lux-solar-nx) * 1vw);
  --lux-solar-ny: calc(var(--lux-solar-y-from) + var(--lux-solar-y-span) * var(--lux-progress));
  --lux-solar-y: calc(var(--lux-solar-ny) * 1vh);
  --lux-solar-alpha: calc(var(--lux-solar-alpha-from) + var(--lux-solar-alpha-span) * var(--lux-progress));
  --lux-lunar-nx: calc(var(--lux-lunar-from) + var(--lux-lunar-span) * var(--lux-progress));
  --lux-lunar-x: calc(var(--lux-lunar-nx) * 1vw);
  --lux-lunar-ny: calc(var(--lux-lunar-y-from) + var(--lux-lunar-y-span) * var(--lux-progress));
  --lux-lunar-y: calc(var(--lux-lunar-ny) * 1vh);
  --lux-lunar-alpha: calc(var(--lux-lunar-alpha-from) + var(--lux-lunar-alpha-span) * var(--lux-progress));
  --lux-veil-alpha: calc(var(--lux-veil-alpha-from) + var(--lux-veil-alpha-span) * var(--lux-progress));

  /* ------------------------------------------------------------------------
   * THE CARD'S OWN SUN AND MOON (P3.4, light 1D; P3.2's approved design).
   *
   * Until P3.4 the card took the SKY's direction, which sits hard left until
   * about 09:00, crosses only in the afternoon and swings back left at dusk as
   * the moon enters; that is why its rays read as fixed. The card now has its
   * own two bodies: the sun crosses it from dawn to dusk and travels back unseen
   * at night, and the moon enters as the last light leaves and crosses through
   * the night. They are two more phase-table rows in §2 (`--lux-sun-u-*`,
   * `--lux-moon-u-*`), evaluated here like every other row; still one engine,
   * one table and one clock.
   *
   * Each body's HEIGHT is a parabola of its position, 0 at either edge and 1 at
   * the centre. `--card-weight` and `--card-moon-share` are the sky's own two
   * alphas, so a body the sky has not lit contributes nothing even while it
   * travels; `max(0.02, …)` is the guard for the instant near total darkness
   * where both alphas approach 0.
   * ---------------------------------------------------------------------- */
  --lux-sun-u: calc(var(--lux-sun-u-from) + var(--lux-sun-u-span) * var(--lux-progress));
  --lux-moon-u: calc(var(--lux-moon-u-from) + var(--lux-moon-u-span) * var(--lux-progress));
  --card-sun-h: max(0, calc(4 * var(--lux-sun-u) * (1 - var(--lux-sun-u))));
  --card-moon-h: max(0, calc(4 * var(--lux-moon-u) * (1 - var(--lux-moon-u))));
  --card-weight: max(0.02, calc(var(--lux-solar-alpha) + var(--lux-lunar-alpha)));
  --card-moon-share: calc(var(--lux-lunar-alpha) / var(--card-weight));

  /* ------------------------------------------------------------------------
   * THE ACTIVE LIGHT'S DIRECTION AND ELEVATION, from those two bodies.
   *
   * `--lux-light-dir` is each body's position mapped to -1 (the card's left
   * edge) … +1 (its right edge), blended by the sky's alphas so the dawn and
   * dusk hand-overs, where both are lit, are continuous. `--lux-light-elev` is
   * their heights blended the same way. The world field's source, `--lux-rake`
   * and every `--vs-cast-*` read only these two names, so the whole page turns
   * with the light the hero shows ("shadows follow").
   *
   * Elevation is what makes MIDDAY CENTRED rather than arbitrarily left- or
   * right-lit: it shortens the horizontal cast independently of the direction,
   * so the near-overhead hours read as neutral even though `--lux-light-dir` is
   * not exactly 0 there.
   *
   * `--lux-rake` is a RAKING ANGLE for a linear gradient, read as "which edge
   * the light comes from": 90deg at the far left, 180deg overhead, 270deg at
   * the far right. A gradient at that angle therefore starts on the LIT edge,
   * which lets the material response change sides over the day.
   * ---------------------------------------------------------------------- */
  --lux-light-dir: clamp(-1, calc(
    ((var(--lux-sun-u) - 0.5) * 2 * var(--lux-solar-alpha)
      + (var(--lux-moon-u) - 0.5) * 2 * var(--lux-lunar-alpha))
    / var(--card-weight)), 1);
  --lux-rake: calc((180 + var(--lux-light-dir) * 90) * 1deg);
  --lux-light-elev: clamp(0, calc(
    (var(--card-sun-h) * var(--lux-solar-alpha)
      + var(--card-moon-h) * var(--lux-lunar-alpha))
    / var(--card-weight)), 1);

  /* How much light there is: full by day, about two thirds by moonlight. It
     scales the hero's wash, band and falloff (§6), never the page's fields. */
  --card-amount: clamp(0.35, calc(
    (var(--lux-solar-alpha) + var(--lux-lunar-alpha) * 0.72) / 0.55), 1);

  /* ------------------------------------------------------------------------
   * THE SURFACE-LIGHT MAXIMA (atrium slice 2).
   *
   * The restrained desktop geometry at full strength. `--vs-lift` scales it per
   * surface: hero 1.35, action cards 0.72, search slabs 0.32, and level-0 home
   * information groups do not consume it at all.
   *
   * THE CAST ITSELF IS NOT COMPOSED HERE. A custom property's `var()`s are
   * substituted where the property is DECLARED, not where it is consumed, so a
   * body-level `--vs-cast` would bake in the body's `--vs-lift` and no card
   * could ever scale it. The chain is declared on the lit surfaces themselves —
   * see "the surface-light contract" in §6.
   *
   * NOTHING here is transitioned, and no surface transitions its cast. The light
   * moves because the body eases the two registered positions it is derived
   * from, `--lux-sun-u` and `--lux-moon-u` (the register list below), over 2.4s
   * at each minute's tick; every cast and lit edge follows them, so each step
   * eases instead of jumping and the page rests between ticks. No `box-shadow`
   * transition, no `@keyframes`, no per-card loop, no `backdrop-filter`. A REGISTER change cross-fades the strengths,
   * where every other register colour is — by registering the strength tokens
   * and adding them to `--lux-register-fade`.
   *
   * THE RULE, AS ENFORCED. No rule in this stylesheet may name `box-shadow` — or
   * `all` — as a transition property. Both would animate the cast, and `all`
   * would do it without the word `box-shadow` ever appearing. The hover raise is
   * carried by a transition on the registered `--vs-lift` instead, so the raise
   * eases on its own timing and never on the light's.
   * `tests/test_studium_tokens.py::test_the_surface_light_adds_no_transition_animation_or_timer`
   * is the guard; relaxing it is a decision, not a formality.
   * ---------------------------------------------------------------------- */
  --vs-cast-reach: 12px;
  --vs-cast-drop: 8px;
  --vs-cast-spread: 20px;
  --vs-lift: 1;

  /* How long a field takes to reach a newly computed target. Longer than the
     60s recompute tick on purpose: each tick retargets a transition that is
     still running, which is what makes the travel continuous instead of
     stepped. Nothing here is trackable by eye (vision §7's quality gate). The
     fields move by transform and opacity, on the compositor; the card's sun and
     moon are not given this duration (see their registration, above). */
  --lux-travel: 70s;
  /* Register changes are a colour cross-fade, not a field move. */
  --lux-register-fade: 2400ms;

  /* Motion vocabulary. Foreground surfaces resolve with a pronounced custom
     ease-out while the slower atmosphere continues settling behind them.
     `--vs-ease-atmosphere` keeps the original gentle 2200ms backdrop curve, so
     the two layers stay distinguishable rather than sharing one rhythm.
     ONE set of durations at every width. The earlier per-width split — 680ms on
     phones, 520ms on laptops — was measured the wrong way round: the phone
     branch was the SLOWER one (settling at 1017ms against the laptop's 837ms)
     and the laptop was the one that read as lag. Duration was never what
     separated them; the number of surfaces moving AT ONCE was. So the split
     bought nothing and cost a second set of values to keep in step.
     These durations are the sub-300ms entrance budget. The longest chain is
     `--vs-stagger * 4` plus one `--vs-enter`, so the whole composition is
     settled in 400ms at every width — the page is reached from both domain
     topbars several times a day, and a second of settling is a real cost there.
     `--vs-blur-enter` is deliberately a SMALL fraction of `--vs-enter`. The
     entrance blur is a mask, not a focus pull: it softens the first frames of
     the travel and is gone long before the surface lands. An intermediate
     revision removed the blur outright, on the theory that blurred-to-sharp
     text reads as a slow paint. Removing it did not lift the sluggish feeling
     and made the arrival read worse — a bare slab sliding — so the blur is not
     what costs time here, and it is restored at a duration short enough that it
     can only ever read as a soft edge. The entrance rules in §6 carry the rest.
     It is `--vs-blur-enter`, NOT `--vs-focus-enter` as an earlier revision named
     it: `--vs-focus` is the focus-RING colour, and two unrelated meanings one
     hyphen apart is a trap. */
  --vs-ease-atmosphere: cubic-bezier(0.22, 0.61, 0.36, 1);
  --vs-ease-arrival: cubic-bezier(0.22, 1, 0.36, 1);
  --vs-enter: 240ms;
  --vs-blur-enter: 80ms;
  --vs-stagger: 40ms;
  --vs-press: 140ms;

  --vs-radius: 12px;
  --vs-radius-sm: 8px;

  /* How much of a long program column shows before «Ver más» (the owner's
     answer, P3.4): about two «Pendientes» rows or five calendar rows, so at
     1366×768 the Novedades heading sits one short scroll below the first
     screen. Measured, not guessed: ~/platform-launch/p3/P3.4/README.md. */
  --vs-program-fold: 320px;

  /* Selected states take the gold-leaf button's fill, ink and edge (R14, the
     owner, P4.2c): the current step, a ticked box, a chosen segment, the
     index's mark. Aliases, resolved on the body against the register's button
     tokens, so a selected state can never drift from the button. Studium has no
     selected state yet; P4's pages consume these. */
  --vs-chosen: var(--vs-btn-bg);
  --vs-chosen-ink: var(--vs-btn-ink);
  --vs-chosen-line: var(--vs-btn-edge);

  /* ------------------------------------------------------------------------
   * Page geometry, named once (Slice 8).
   *
   * The gutter and the measure were inline literals in two rules each. They are
   * tokens now because the atrium's lower field has to reach the VIEWPORT edges
   * while the content stays on the measure, which means one grid declares both
   * — and a full-bleed track list cannot restate a value the content column
   * also has to agree with.
   * ---------------------------------------------------------------------- */
  --vs-gutter: clamp(20px, 4vw, 56px);
  --vs-measure: 1120px;

  /* How far above *Tus espacios* the horizon starts, and how long it takes to
     settle. LENGTHS, deliberately not `vh` or a percentage: the horizon belongs
     to the document composition, so it must land near the domain section on a
     phone, on a short page and on a long one alike. */
  --vs-underfield-rise: clamp(64px, 9vw, 132px);
  --vs-underfield-soft: clamp(220px, 30vw, 380px);
}

/* Gradient images are discrete values, so transitioning `background-image`
 * cannot guarantee a cross-fade. These registered colours interpolate inside
 * fixed radial gradients instead. They inherit from the register-bearing body
 * into both the global field and the hero field. */
@property --vs-solar-core {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(246, 219, 165, 0.66);
}

@property --vs-solar-edge {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(246, 219, 165, 0);
}

@property --vs-lunar-core {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(158, 184, 216, 0.38);
}

@property --vs-lunar-edge {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(158, 184, 216, 0);
}

/* The atrium colours are registered for exactly the same reason: each one is a
   stop inside a fixed gradient image, and an image cannot interpolate. Without
   registration the two-plane field and mineral grain would SNAP at every
   register change while the rest of the page cross-faded. */
@property --vs-underfield {
  syntax: "<color>";
  inherits: true;
  initial-value: #d1dbd5;
}

@property --vs-underfield-deep {
  syntax: "<color>";
  inherits: true;
  initial-value: #c5d0c9;
}

@property --vs-grain {
  syntax: "<color>";
  inherits: true;
  initial-value: #b9a578;
}

/* Atrium slice 2's surface-light STRENGTHS, registered for a third reason on
   top of the two above: a shadow is not an image and would not snap for the
   gradient reason, but it is composed inside `color-mix()` and `calc()` from
   values that change at a register boundary. Unregistered, they are token
   streams — uninterpolatable — so the cast and the lit edge would jump at 20:00
   while every colour around them cross-faded over 2.4s. Registered, they
   interpolate and every dependent `box-shadow` is recomputed per frame.

   `--vs-lit-ink` is the colour of light FALLING on a surface, and it is
   a dedicated surface value. Used as a lit edge on the night card surface it
   must remain visible, while the hero's raking wash must still read as light.
   Night's lit light is therefore a pale silver-blue —
   "cooler silver response at night", vision §8 — and its strength is measured
   against the hero's text rather than assumed. */
@property --vs-shadow-ink {
  syntax: "<color>";
  inherits: true;
  initial-value: #584220;
}

@property --vs-lit-ink {
  syntax: "<color>";
  inherits: true;
  initial-value: #fffdf6;
}

/* The hero's two light inks (P3.4, light 1D): the sun's, which is the register's
   lit ink, and the moon's, which is cool (hue ~210°, never violet). The hero
   mixes them by the moon's share of the light (§6); registered so a register
   change cross-fades them like every other register colour. */
@property --vs-lit-sun {
  syntax: "<color>";
  inherits: true;
  initial-value: #fff0c7;
}

@property --vs-lunar-ink {
  syntax: "<color>";
  inherits: true;
  initial-value: #dce7f2;
}

@property --vs-shadow-alpha {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 8%;
}

@property --vs-edge-alpha {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 32%;
}

@property --vs-hero-wash {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 22%;
}

@property --vs-hero-band {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 9%;
}

@property --vs-hero-falloff {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 4%;
}

/* These three strengths are consumed inside fixed gradient images, so they need
   interpolation of their own at a register boundary. Keeping them named makes
   the material calibration auditable without turning either plane into a pile
   of opaque colour literals. */
@property --vs-underfield-material {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 16%;
}

@property --vs-hero-material {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 7%;
}

@property --vs-upper-material {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 17%;
}

/* The one geometry multiplier that is registered, and the only one that needs to
   be. The others (`--vs-cast-reach`, `--vs-cast-drop`, `--vs-cast-spread`) change
   at a BREAKPOINT, where nothing is interpolated; `--vs-lift` is the only value
   on this page that changes ON INTERACTION, and a `<number>` that is registered
   is a number CSS can interpolate rather than a token stream it can only
   substitute.

   That distinction is the whole fix. Transitioning `box-shadow` to ease the
   hover raise would also put every move of the light on the hover's timing —
   the same property carries both — which is exactly what §1 says this page
   does not do. Transitioning `--vs-lift` instead eases only the raise: the
   light reaches the cast through `--lux-light-dir`, which is unregistered and
   follows the body's own eased sun and moon, so the dependent `--vs-cast-*`
   chain re-resolves on the light's timing and never on the card's. */
@property --vs-lift {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}

/* --------------------------------------------------------------------------
 * The three surface families.
 *
 * `data-lux-register` is computed on the SERVER (atmosphere.register_for_theme)
 * so the page is complete with JavaScript disabled and the OS
 * prefers-color-scheme never fights the lighting cycle. `auto` follows the
 * phase; an explicit light or dark pins the family while the field direction
 * and warmth keep advancing with the hour (VS_PLAN decision 9).
 *
 * `--vs-atmo-min` / `--vs-atmo-max` are the declared extremes of the rendered
 * atmosphere for this register: the lightest and darkest opaque backdrop that
 * can appear beneath a translucent surface. The Python contrast test
 * composites every text/surface pair against BOTH and takes the worse result;
 * the browser test samples the real painted pixels at all seven phases and
 * fails if the atmosphere ever leaves this range. Neither number is decorative.
 *
 * Since Slice 8 the atmosphere is TWO planes, and in the two light registers the
 * verdigris floor — not the lit upper field — is the darkest opaque backdrop the
 * page can put behind text. `--vs-atmo-max` is therefore `--vs-underfield-deep`
 * in day and dusk, and the floor's depth was chosen by MEASUREMENT: the day
 * register's `--vs-accent` is the binding constraint at 4.65:1 on the bare floor,
 * so a darker verdigris would have meant retuning inks that are correct
 * everywhere else. Night's floor is a dark verdigris slab that is still lighter
 * than `--vs-ink-black`. Both floor stops remain inside the current night
 * atmosphere range. The floor did not force that range's anchor adjustment;
 * the rendered silver grain did.
 *
 * Every ratio in the comments is recomputed from this file by
 * tests/test_studium_tokens.py — the comments are a reading aid, not the test.
 * -------------------------------------------------------------------------- */

/* DAY — warm ivory, champagne, soft golden borders (vision §8), now lit as
   mineral rather than as cream paper. */
html body.studium-world[data-lux-register="day"] {
  color-scheme: light;

  --vs-atmo-base: var(--vs-cloud-white);
  --vs-atmo-min: var(--vs-pearl);
  --vs-atmo-max: var(--vs-underfield-deep);
  /* The fixed field is environmental light, not the visible sun. The hero now
     carries the stronger local response, so the page-wide core stays quieter. */
  --vs-solar-core: rgba(246, 215, 154, 0.26);
  --vs-solar-edge: rgba(246, 219, 165, 0);
  --vs-lunar-core: rgba(158, 184, 208, 0.14);
  --vs-lunar-edge: rgba(158, 184, 216, 0);
  --vs-veil: #dfe2df;

  /* The lower field: a restrained verdigris (≈158°, saturation ≈0.15), a floor
     rather than a painted landscape. The grain is warm mineral by day. */
  --vs-underfield: #b7c6c0;
  --vs-underfield-deep: #91aaa3;
  --vs-grain: #b69b68;
  --vs-upper-material: 24%;
  --vs-underfield-material: 16%;
  --vs-surface: rgba(250, 246, 235, 0.92);
  --vs-surface-raised: rgba(251, 247, 238, 0.96);
  /* The translucent hero/header family remains warm mineral rather than white.
     The raised surfaces below are calibrated separately so the course cards
     keep their domain's warm/cool identity without breaking the established
     hierarchy. */
  --vs-surface-translucent: rgba(248, 242, 229, 0.84);
  --vs-border: rgba(163, 126, 58, 0.36);
  --vs-border-strong: var(--vs-bronze);
  --vs-ink: #33291c;                /* 11.03:1 worst case */
  --vs-ink-muted: #443624;
  --vs-ink-faint: #463823;
  --vs-accent: #51340d;
  --vs-focus: #5d3f12;
  --vs-shadow: 0 18px 44px rgba(88, 66, 32, 0.14);
  /* Atrium slice 2. `--vs-shadow` above is UNCHANGED and stays static: it is
     what main.css's `--shadow` alias points at, so the Novedades panel, the
     flash region and the footer keep the shadow they have always had. Studium's
     own surfaces move to the directional `--vs-cast`. */
  --vs-shadow-ink: #584220;
  --vs-shadow-alpha: 15%;
  --vs-lit-ink: #fff0c7;            /* hue 43°, warm mineral light */
  --vs-lit-sun: #fff0c7;
  --vs-lunar-ink: #dce7f2;          /* hue 210°, the moon on ivory */
  --vs-edge-alpha: 36%;
  /* The broad wash supplies the pool, the single feathered band makes daylight
     perceptible, and the opposing falloff makes its direction legible. */
  --vs-hero-wash: 26%;
  --vs-hero-band: 42%;
  --vs-hero-falloff: 12%;
  --vs-hero-material: 7%;
  --vs-danger: #67221c;
  /* The warning ink (P4.4, round 3), Studium's since P5.7: what must not be missed, bold in it with its
     glyph, on a surface; its edge and wash beside it (P4.5). tests/test_admissions_public_tokens.py measures them. */
  --vs-warn: #7a4500;
  --vs-warn-edge: #a8691a;
  --vs-warn-wash: rgba(214, 140, 30, 0.13);
  --vs-success: #2e3d1b;
  --vs-badge-bg: #8f3421;
  --vs-badge-ink: #fdf7ea;          /* 7.34:1 on the badge */
  /* P4.2c's gold-leaf main button (R12), for all of Studium (R13): the owner's
     values from P4's page. tests/test_studium_tokens.py measures the ink on the
     fill and the hover, and the edge on every backdrop a button sits on. */
  --vs-btn-bg: #c9a24f;
  --vs-btn-edge: #6e5320;
  --vs-btn-ink: #231a0b;            /* 7.16:1 on the fill */
  --vs-btn-hover: #b58e3b;
  /* The program columns' backing (the owner's note, P3.4): almost transparent
     pearl over the verdigris floor, which stays as it is. */
  --vs-program-backing: rgba(250, 246, 235, 0.38);
  /* Domain identity (Slice 5). The SAME environment interpreted through each
     domain, never two foreign dashboard palettes pasted onto the page: the wash
     is a very low alpha over --vs-surface-raised and its effect is confined to
     the card, so no hover and no register change ever recolours the hero or the
     background. Alchemia is restrained bronze/amber (~38 deg); Sophia is
     silver-blue (~207 deg) — NOT the periwinkle vision §15 names, because the
     standing no-purple ruling governs. */
  --vs-alchemia-accent: #7a5214;
  --vs-alchemia-edge: #8a6524;
  --vs-alchemia-wash: rgba(143, 106, 40, 0.10);
  --vs-sophia-accent: #235078;
  /* One step darker since P3.4: a course card's edge must clear 3:1 against the
     program column's backing as well as against its own wash. */
  --vs-sophia-edge: #3d6a8f;
  --vs-sophia-wash: rgba(38, 85, 127, 0.09);
  /* How much of the registered solar/lunar colour the header surface may carry.
     A PERCENTAGE, not a number, so `color-mix` consumes it directly and the
     painted strength stays `core alpha × tint × live field alpha`. Declared per
     register so night can be quieter or louder than midday; audited (both
     fields at full strength, at the gradients' strongest stop) by
     tests/test_studium_tokens.py::backdrops. */
  --vs-header-tint: 18%;
}

/* DUSK — and dawn, traversed the other way. Deeper cream and sand resolving
   into neutral gray-brown, charcoal-gold and bronze borders. Daylight receding
   from the interface, never a separate twilight colour family (vision §8). */
html body.studium-world[data-lux-register="dusk"] {
  color-scheme: light;

  --vs-atmo-base: #e7dcc6;
  --vs-atmo-min: #eee5cb;
  --vs-atmo-max: var(--vs-underfield-deep);
  --vs-solar-core: rgba(228, 181, 116, 0.28);
  --vs-solar-edge: rgba(228, 181, 116, 0);
  --vs-lunar-core: rgba(142, 166, 197, 0.19);
  --vs-lunar-edge: rgba(142, 166, 197, 0);
  --vs-veil: #b3bac2;

  /* Dusk's floor sits a step deeper than day's; its inks are correspondingly
     darker so the composited floor and surfaces remain comfortably readable. */
  --vs-underfield: #a7b8b0;
  --vs-underfield-deep: #819b93;
  --vs-grain: #ad9161;
  --vs-upper-material: 25%;
  --vs-underfield-material: 18%;
  --vs-surface: rgba(247, 237, 220, 0.92);
  --vs-surface-raised: rgba(250, 242, 227, 0.95);
  --vs-surface-translucent: rgba(242, 230, 210, 0.85);
  --vs-border: rgba(122, 90, 40, 0.42);
  --vs-border-strong: #52370f;
  --vs-ink: #2c251a;                /*  8.97:1 */
  --vs-ink-muted: #332a1e;
  --vs-ink-faint: #352b1f;
  --vs-accent: #402507;
  --vs-focus: #4d2f08;
  --vs-shadow: 0 20px 46px rgba(58, 44, 24, 0.20);
  /* Dusk casts a little deeper and its lit edge a little quieter: the light is
     lower and warmer, so the contrast between lit and unlit sides narrows even
     as the shadows lengthen. */
  --vs-shadow-ink: #3a2c18;
  --vs-shadow-alpha: 17%;
  --vs-lit-ink: #ffe3ad;            /* hue 39°, low-sun mineral light */
  --vs-lit-sun: #ffe3ad;
  --vs-lunar-ink: #cdd9e6;
  --vs-edge-alpha: 34%;
  --vs-hero-wash: 22%;
  --vs-hero-band: 35%;
  --vs-hero-falloff: 13%;
  --vs-hero-material: 7%;
  --vs-danger: #541712;
  /* The warning ink (P4.4, round 3), Studium's since P5.7: what must not be missed, bold in it with its
     glyph, on a surface; its edge and wash beside it (P4.5). tests/test_admissions_public_tokens.py measures them. */
  --vs-warn: #683900;
  --vs-warn-edge: #94591a;
  --vs-warn-wash: rgba(200, 128, 30, 0.15);
  --vs-success: #233019;
  --vs-badge-bg: #83301e;
  --vs-badge-ink: #fbf4e6;          /* 7.97:1 on the badge */
  --vs-btn-bg: #c39a45;
  --vs-btn-edge: #5f4418;
  --vs-btn-ink: #20170a;
  --vs-btn-hover: #ad8632;
  --vs-program-backing: rgba(247, 237, 220, 0.38);
  --vs-alchemia-accent: #5f3f0f;
  --vs-alchemia-edge: #74541e;
  --vs-alchemia-wash: rgba(122, 90, 40, 0.11);
  --vs-sophia-accent: #1f4a70;
  --vs-sophia-edge: #375f82;
  --vs-sophia-wash: rgba(38, 85, 127, 0.10);
  --vs-header-tint: 18%;
}

/* NIGHT — near-black and deep charcoal with a cool blue cast, silver/graphite
   borders, a retained muted gold accent, soft-white and pale-silver inks. Never
   pure white text and never pure #000 surfaces: both read as harsh, and pure
   black smears on OLED while scrolling (vision §8). */
html body.studium-world[data-lux-register="night"] {
  color-scheme: dark;

  --vs-atmo-base: var(--vs-midnight-blue);
  /* Set by measurement rather than taste: the silver material and the one state
     that stacks a full-strength solar field on a pinned dark register paint a
     0.0394 luminance maximum. The anchor is a claim about the final composited
     pixels, so it moves with that restrained night material. */
  --vs-atmo-min: #303746;
  --vs-atmo-max: var(--vs-ink-black);
  --vs-solar-core: rgba(198, 152, 88, 0.14);
  --vs-solar-edge: rgba(198, 152, 88, 0);
  --vs-lunar-core: rgba(126, 156, 196, 0.24);
  --vs-lunar-edge: rgba(126, 156, 196, 0);
  --vs-veil: #0b0f17;

  /* At night the floor is the one thing in the composition that is LIGHTER than
     the field above it — a dark verdigris slab catching what light there is, so
     the horizon still reads without the page gaining a second black. Both stops
     stay inside `--vs-ink-black` … `#303746`, so the floor does not widen the
     measured atmosphere range.
     The grain turns silver (vision: "cooler silver response at night"). */
  --vs-underfield: #1d2a25;
  --vs-underfield-deep: #141f1a;
  --vs-grain: #9fb3c8;
  --vs-upper-material: 12%;
  --vs-underfield-material: 10%;
  --vs-surface: rgba(27, 31, 40, 0.88);
  --vs-surface-raised: rgba(36, 41, 52, 0.93);
  --vs-surface-translucent: rgba(22, 26, 34, 0.80);
  --vs-border: rgba(176, 190, 212, 0.22);
  --vs-border-strong: var(--vs-blue-gray);  /* #8b96a8 — 4.62:1 worst case */
  --vs-ink: var(--vs-moonlit-white);        /* #e9eaee — 11.49:1 worst case */
  --vs-ink-muted: #c2c8d3;          /*  8.22:1 */
  --vs-ink-faint: #a7aebc;          /*  6.20:1 */
  --vs-accent: var(--vs-muted-amber);       /* #dcb974 —  7.39:1 */
  --vs-focus: #e2c689;
  --vs-shadow: 0 1px 0 rgba(210, 224, 246, 0.05), 0 22px 50px rgba(0, 0, 0, 0.46);
  /* Night keeps the cast deeper than the light registers, but its smaller
     geometry and restrained alpha make it separation rather than drama.
     `--vs-lit-ink` is a pale silver-blue (hue 214°), never violet. The hero's
     low-strength wash is measured with its light ink in mind;
     tests/test_studium_tokens.py recomputes the contrast. */
  --vs-shadow-ink: #02040a;
  --vs-shadow-alpha: 22%;
  --vs-lit-ink: #a8bfd8;
  /* At night the sun's ink is already the cool silver-blue, so both are one. */
  --vs-lit-sun: #a8bfd8;
  --vs-lunar-ink: #a8bfd8;
  --vs-edge-alpha: 28%;
  /* Lunar logic is intentionally not the daylight band recoloured blue. The
     band disappears; a cool broad wash and very small falloff remain. */
  --vs-hero-wash: 13%;
  --vs-hero-band: 0%;
  --vs-hero-falloff: 5%;
  --vs-hero-material: 4%;
  --vs-danger: #f0a396;
  /* The warning ink (P4.4, round 3), Studium's since P5.7: what must not be missed, bold in it with its
     glyph, on a surface; its edge and wash beside it (P4.5). tests/test_admissions_public_tokens.py measures them. */
  --vs-warn: #f2a65a;
  --vs-warn-edge: #c47a30;
  --vs-warn-wash: rgba(242, 166, 90, 0.1);
  --vs-success: #b6cd8f;
  --vs-badge-bg: #d98b6a;
  --vs-badge-ink: #1b1f28;          /* 6.17:1 on the badge */
  /* Night keeps the amber for the gold-leaf button, its edge included. */
  --vs-btn-bg: var(--vs-muted-amber);
  --vs-btn-edge: var(--vs-muted-amber);
  --vs-btn-ink: #1b1f28;
  --vs-btn-hover: #e9cd94;
  /* At night the backing is a faint darkening of the floor, so the light inks
     and the course cards' light edges keep their contrast. */
  --vs-program-backing: rgba(14, 18, 26, 0.24);
  /* Night keeps the domain identities but quieter: Alchemia moves to the same
     muted gold the night accent already uses, Sophia to a pale silver-blue. */
  --vs-alchemia-accent: var(--vs-muted-amber);   /* #dcb974 */
  --vs-alchemia-edge: #a37f42;
  --vs-alchemia-wash: rgba(198, 152, 88, 0.07);
  --vs-sophia-accent: #a9c2dd;
  --vs-sophia-edge: #708aa6;
  --vs-sophia-wash: rgba(126, 156, 196, 0.07);
  --vs-header-tint: 30%;
}

/* --------------------------------------------------------------------------
 * main.css aliases — see note 2 in the file header.
 *
 * These names belong to main.css and are consumed by shared markup that renders
 * inside this shell (the Novedades bell, the flash region, the footer) and by
 * main.css's own `body` / `.page` / `.content` background rules. Re-pointing
 * them per register is what keeps that markup legible when the register and the
 * account theme disagree — a night register under `theme=light`, or a day
 * register under an OS dark preference.
 *
 * Declared on <body>, which beats main.css's :root and html[data-theme] blocks
 * for this element and everything inside it regardless of their specificity,
 * because a custom property declared on the element itself always wins over an
 * inherited one.
 * -------------------------------------------------------------------------- */
html body.studium-world[data-lux-register] {
  --cream: var(--vs-atmo-base);
  --paper: var(--vs-surface-raised);
  --line: var(--vs-border);
  --brown: var(--vs-ink);
  --brown-soft: var(--vs-ink-muted);
  --gray: var(--vs-ink-muted);
  --gold: var(--vs-border-strong);
  --danger: var(--vs-danger);
  --success: var(--vs-success);
  --topbar-bg: var(--vs-surface-translucent);
  --sidebar-bg: var(--vs-surface);
  --notif-accent: var(--vs-accent);
  --notif-surface: var(--vs-surface-translucent);
  --notif-border: var(--vs-border);
  --notif-badge-bg: var(--vs-badge-bg);
  --notif-badge-ink: var(--vs-badge-ink);
  --notif-panel-bg: var(--vs-surface-raised);
  --notif-soft-surface: var(--vs-surface-translucent);
  --notif-hover-bg: var(--vs-surface-translucent);
  --notif-ink: var(--vs-ink);
  --notif-muted-ink: var(--vs-ink-faint);
  --notif-subtle-ink: var(--vs-ink-faint);
  --notif-danger: var(--vs-danger);
  --notif-shadow: var(--vs-shadow);
  --notif-control-border: var(--vs-border);
  --notif-focus: var(--vs-accent);

  /* The register cross-fade, and the card's sun and moon (the last two
     entries): each minute's step eases over the same 2.4s, then the page rests
     until the next tick (the easing was decided by measurement; see their
     registration). */
  transition:
    --vs-solar-core var(--lux-register-fade) ease,
    --vs-solar-edge var(--lux-register-fade) ease,
    --vs-lunar-core var(--lux-register-fade) ease,
    --vs-lunar-edge var(--lux-register-fade) ease,
    --vs-underfield var(--lux-register-fade) ease,
    --vs-underfield-deep var(--lux-register-fade) ease,
    --vs-grain var(--lux-register-fade) ease,
    --vs-shadow-ink var(--lux-register-fade) ease,
    --vs-lit-ink var(--lux-register-fade) ease,
    --vs-shadow-alpha var(--lux-register-fade) ease,
    --vs-edge-alpha var(--lux-register-fade) ease,
    --vs-hero-wash var(--lux-register-fade) ease,
    --vs-hero-band var(--lux-register-fade) ease,
    --vs-hero-falloff var(--lux-register-fade) ease,
    --vs-underfield-material var(--lux-register-fade) ease,
    --vs-hero-material var(--lux-register-fade) ease,
    --vs-upper-material var(--lux-register-fade) ease,
    --vs-lit-sun var(--lux-register-fade) ease,
    --vs-lunar-ink var(--lux-register-fade) ease,
    --lux-sun-u var(--lux-register-fade) ease,
    --lux-moon-u var(--lux-register-fade) ease;
}

/* ==========================================================================
 * 2. The seven phases
 * ==========================================================================
 *
 * One row per phase, `from` and `span` for each animated quantity. Every row's
 * endpoint is the next row's start, night wrapping round to dawn, so the field
 * is continuous across all seven boundaries. Where a field is invisible
 * (alpha 0) it still travels, because its position has to arrive back at the
 * next visible phase's starting point — that return trip is what makes the
 * night -> dawn boundary continuous instead of a jump.
 *
 * EVERY QUANTITY HERE IS A BARE NUMBER. The x and y positions read as viewport
 * widths and heights and were written `-75vw` / `30vh` until Slice 8; the unit
 * now lives at the single composition site in §1, because the wordmark's lunar
 * reflection reads the bare positions as percentages. Do not put a unit back on
 * a row: §1 would then multiply a length by a length, and the field would
 * silently stop moving.
 *
 * The last two rows of each phase (P3.4) are the card's own sun and moon: each
 * body's position across the hero, 0 at its left edge and 1 at its right. The
 * sun crosses from dawn to dusk and travels back unseen at night; the moon
 * enters as the last light leaves (so there is no dark hour at 20:00) and
 * crosses through the night. They close at every boundary like every other row.
 */

/* dawn 05:00-07:00 — the lunar field fades as a pale solar glow enters left. */
html body.studium-world[data-lux-phase="dawn"] {
  --lux-solar-from: -75;  --lux-solar-span: 15;
  --lux-solar-y-from: 30; --lux-solar-y-span: -20;
  --lux-solar-alpha-from: 0;      --lux-solar-alpha-span: 0.36;
  --lux-lunar-from: 65;   --lux-lunar-span: 20;
  --lux-lunar-y-from: -18; --lux-lunar-y-span: 33;
  --lux-lunar-alpha-from: 0.48;   --lux-lunar-alpha-span: -0.48;
  --lux-veil-alpha-from: 0.34;    --lux-veil-alpha-span: -0.04;
  --lux-sun-u-from: -0.15; --lux-sun-u-span: 0.15;
  --lux-moon-u-from: 1.02; --lux-moon-u-span: 0.18;
}

/* morning 07:00-12:00 — the solar field moves toward the centre; lucid. */
html body.studium-world[data-lux-phase="morning"] {
  --lux-solar-from: -60;  --lux-solar-span: 40;
  --lux-solar-y-from: 10; --lux-solar-y-span: -30;
  --lux-solar-alpha-from: 0.36;   --lux-solar-alpha-span: 0.19;
  --lux-lunar-from: 85;   --lux-lunar-span: -60;
  --lux-lunar-y-from: 15; --lux-lunar-y-span: 7;
  --lux-lunar-alpha-from: 0;      --lux-lunar-alpha-span: 0;
  --lux-veil-alpha-from: 0.30;    --lux-veil-alpha-span: -0.04;
  --lux-sun-u-from: 0;     --lux-sun-u-span: 0.45;
  --lux-moon-u-from: 1.20; --lux-moon-u-span: -0.50;
}

/* midday 12:00-15:00 — highest clarity, dignified rather than bright. */
html body.studium-world[data-lux-phase="midday"] {
  --lux-solar-from: -20;  --lux-solar-span: 25;
  --lux-solar-y-from: -20; --lux-solar-y-span: -10;
  --lux-solar-alpha-from: 0.55;   --lux-solar-alpha-span: 0;
  --lux-lunar-from: 25;   --lux-lunar-span: -55;
  --lux-lunar-y-from: 22; --lux-lunar-y-span: 4;
  --lux-lunar-alpha-from: 0;      --lux-lunar-alpha-span: 0;
  --lux-veil-alpha-from: 0.26;    --lux-veil-alpha-span: -0.02;
  --lux-sun-u-from: 0.45;  --lux-sun-u-span: 0.17;
  --lux-moon-u-from: 0.70; --lux-moon-u-span: -0.50;
}

/* afternoon 15:00-17:00 — the field warms and starts to descend. */
html body.studium-world[data-lux-phase="afternoon"] {
  --lux-solar-from: 5;    --lux-solar-span: 25;
  --lux-solar-y-from: -30; --lux-solar-y-span: 20;
  --lux-solar-alpha-from: 0.55;   --lux-solar-alpha-span: -0.10;
  --lux-lunar-from: -30;  --lux-lunar-span: -50;
  --lux-lunar-y-from: 26; --lux-lunar-y-span: 4;
  --lux-lunar-alpha-from: 0;      --lux-lunar-alpha-span: 0;
  --lux-veil-alpha-from: 0.24;    --lux-veil-alpha-span: 0.04;
  --lux-sun-u-from: 0.62;  --lux-sun-u-span: 0.23;
  --lux-moon-u-from: 0.20; --lux-moon-u-span: -0.50;
}

/* dusk 17:00-20:00 — the richest state. The solar field leaves right while the
   lunar field enters left, so the two OVERLAP rather than splitting the page. */
html body.studium-world[data-lux-phase="dusk"] {
  --lux-solar-from: 30;   --lux-solar-span: 45;
  --lux-solar-y-from: -10; --lux-solar-y-span: 35;
  --lux-solar-alpha-from: 0.45;   --lux-solar-alpha-span: -0.37;
  --lux-lunar-from: -80;  --lux-lunar-span: 35;
  --lux-lunar-y-from: 30; --lux-lunar-y-span: -25;
  --lux-lunar-alpha-from: 0;      --lux-lunar-alpha-span: 0.30;
  --lux-veil-alpha-from: 0.28;    --lux-veil-alpha-span: 0.08;
  --lux-sun-u-from: 0.85;  --lux-sun-u-span: 0.30;
  --lux-moon-u-from: -0.30; --lux-moon-u-span: 0.25;
}

/* evening 20:00-21:00 — the last warmth goes; the lunar field takes over. */
html body.studium-world[data-lux-phase="evening"] {
  --lux-solar-from: 75;   --lux-solar-span: 15;
  --lux-solar-y-from: 25; --lux-solar-y-span: 10;
  --lux-solar-alpha-from: 0.08;   --lux-solar-alpha-span: -0.08;
  --lux-lunar-from: -45;  --lux-lunar-span: 20;
  --lux-lunar-y-from: 5;  --lux-lunar-y-span: -15;
  --lux-lunar-alpha-from: 0.30;   --lux-lunar-alpha-span: 0.18;
  --lux-veil-alpha-from: 0.36;    --lux-veil-alpha-span: 0.06;
  --lux-sun-u-from: 1.15;  --lux-sun-u-span: 0.10;
  --lux-moon-u-from: -0.05; --lux-moon-u-span: 0.17;
}

/* night 21:00-05:00 — lunar only. The solar field is fully invisible here and
   uses the eight hours to travel back to dawn's starting point off the left
   edge, which is what keeps the night -> dawn boundary continuous. */
html body.studium-world[data-lux-phase="night"] {
  --lux-solar-from: 90;   --lux-solar-span: -165;
  --lux-solar-y-from: 35; --lux-solar-y-span: -5;
  --lux-solar-alpha-from: 0;      --lux-solar-alpha-span: 0;
  --lux-lunar-from: -25;  --lux-lunar-span: 90;
  --lux-lunar-y-from: -10; --lux-lunar-y-span: -8;
  --lux-lunar-alpha-from: 0.48;   --lux-lunar-alpha-span: 0;
  --lux-veil-alpha-from: 0.42;    --lux-veil-alpha-span: -0.08;
  --lux-sun-u-from: 1.25;  --lux-sun-u-span: -1.40;
  --lux-moon-u-from: 0.12; --lux-moon-u-span: 0.90;
}

/* ==========================================================================
 * 3. The four lighting layers
 * ==========================================================================
 *
 * Layer 1 is the container's own background, layers 2-4 are its children. The
 * whole thing is fixed, decorative, aria-hidden and pointer-events:none, and it
 * is NOT a grid item, so `.page` remains the shell's only in-flow child.
 *
 * The fixed atmosphere carries the MINERAL UPPER FIELD only. There is exactly
 * one horizon in this design and it belongs to the document, not the viewport,
 * so the verdigris lower field is painted by `.studium-lower::before` in §6 —
 * see the note there. The grain (`::before`) sits between layer 1 and layer 2;
 * there is deliberately no celestial/star decoration layered above it.
 */
html body.studium-world .studium-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  /* Layer 1. The register colour lives in background-color so it can actually
     cross-fade; the depth comes from a register-INDEPENDENT neutral gradient,
     because a gradient image cannot interpolate and would snap on every
     register change. Together they are never a flat colour (vision §5). */
  background-color: var(--vs-atmo-base);
  background-image:
    radial-gradient(
      ellipse 112% 96% at 50% 8%,
      transparent 50%,
      rgba(44, 51, 47, 0.075) 100%
    ),
    linear-gradient(
      164deg,
      rgba(255, 255, 255, 0.13) 0%,
      rgba(255, 255, 255, 0.025) 36%,
      rgba(53, 61, 56, 0.035) 70%,
      rgba(41, 48, 44, 0.07) 100%
    );
  transition: background-color var(--lux-register-fade) ease;
  /* Arrival (vision §7): a restrained increase in depth and a settling of the
     field. Pure CSS on purpose — see the note in studium_atmosphere.js. */
  animation: studium-lux-arrival 2200ms var(--vs-ease-atmosphere) both;
}

/* THE MINERAL MATERIAL (Slice 8 follow-up). The background has to read as a
   material receiving light rather than as a flat gradient. The former small
   radial tiles had mutually prime periods on paper, but their rectangular
   repetition still became visible as broad blocks in full-page screenshots.
 *
 * These are four box-scale, non-repeating fields instead: two off-axis ellipses
 * and two long value drifts, each resolved once against the atmosphere box.
 * Their overlap produces plaster-scale irregularity around one tiny seamless
 * procedural SVG, with no high-frequency CSS noise. One material colour and
 * one strength remain per register, so the response is warm mineral by day and
 * silver at night and the change cross-fades with everything else. No bitmap,
 * runtime filter, or new element is involved.
 *
 * It is the FIRST child box of the atmosphere, so it paints under the solar and
 * lunar fields and under the veil, i.e. the light falls on the material rather
 * than the material floating over the light. That also means the veil (up to
 * 0.42 alpha at night) mutes it, which is a visual gate rather than an
 * assumption — verified in the Slice 8 screenshot sweep, where the variation is
 * still perceptible at normal viewing distance in all three registers. */
html body.studium-world .studium-atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    url("../images/studium-mineral.svg"),
    radial-gradient(
      ellipse 82% 62% at -8% 17%,
      color-mix(
        in srgb,
        var(--vs-grain) calc(var(--vs-upper-material) * 0.76),
        transparent
      ) 0%,
      transparent 72%
    ),
    radial-gradient(
      ellipse 76% 68% at 108% 78%,
      color-mix(
        in srgb,
        var(--vs-grain) calc(var(--vs-upper-material) * 0.52),
        transparent
      ) 0%,
      transparent 76%
    ),
    linear-gradient(
      112deg,
      color-mix(
        in srgb,
        white calc(var(--vs-upper-material) * 0.34),
        transparent
      ) 0%,
      transparent 43%,
      color-mix(
        in srgb,
        rgb(39, 47, 43) calc(var(--vs-upper-material) * 0.24),
        transparent
      ) 100%
    ),
    linear-gradient(
      18deg,
      transparent 4%,
      color-mix(
        in srgb,
        white calc(var(--vs-upper-material) * 0.22),
        transparent
      ) 48%,
      transparent 84%
    );
  background-size: 620px 620px, auto, auto, auto, auto;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
}

/* Layers 2 and 3 — the solar and lunar fields.
   Very large blurred radial illuminations whose SOURCE stays off-viewport;
   only the effect on the background is ever seen. Moved with translate3d
   rather than background-position so the travel stays compositor-only. */
html body.studium-world .studium-atmosphere__solar,
html body.studium-world .studium-atmosphere__lunar {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 136vw;
  height: 126vh;
  margin: -63vh 0 0 -68vw;
  transition:
    transform var(--lux-travel) linear,
    opacity var(--lux-travel) linear;
}

html body.studium-world .studium-atmosphere__solar {
  background-image: radial-gradient(
    ellipse 62% 58% at 50% 50%,
    var(--vs-solar-core) 0%,
    var(--vs-solar-edge) 74%
  );
  transform: translate3d(var(--lux-solar-x), var(--lux-solar-y), 0);
  opacity: var(--lux-solar-alpha);
}

html body.studium-world .studium-atmosphere__lunar {
  background-image: radial-gradient(
    ellipse 62% 58% at 50% 50%,
    var(--vs-lunar-core) 0%,
    var(--vs-lunar-edge) 74%
  );
  transform: translate3d(var(--lux-lunar-x), var(--lux-lunar-y), 0);
  opacity: var(--lux-lunar-alpha);
}

/* Layer 4 — the harmonising veil. Also the contrast guarantee: it caps how
   strongly either field can reach the text beneath it (vision §8). */
html body.studium-world .studium-atmosphere__veil {
  position: absolute;
  inset: 0;
  background-color: var(--vs-veil);
  opacity: var(--lux-veil-alpha);
  transition:
    opacity var(--lux-travel) linear,
    background-color var(--lux-register-fade) ease;
}

/* A visibility restore is a state correction, not an animation. The runtime
   applies this class only around two forced style resolutions, so a stale
   hidden-tab field lands on the current hour before normal transitions resume. */
html body.studium-world.is-lux-resyncing {
  --lux-travel: 0s;
  --lux-register-fade: 0s;
}

@keyframes studium-lux-arrival {
  from { opacity: 0.55; transform: scale(1.035); }
  to   { opacity: 1;    transform: none; }
}

/* ==========================================================================
 * 4. The sidebar-less shell
 * ==========================================================================
 *
 * REQUIRED, not cosmetic. Authenticated pages render <body class="app-shell">,
 * and main.css sets `grid-template-columns: 280px minmax(0, 1fr)`. Studium
 * empties the `sidebar` block, which leaves `.page` as the only in-flow grid
 * child — and it would land in the 280px track, giving a 280px-wide page with
 * an empty column beside it. Emptying the block is therefore not enough; the
 * track list itself has to collapse to one column.
 *
 * The three things Studium does render inside the `sidebar` block are not grid
 * items: <script> is display:none, and the skip link and the atmosphere are
 * position:fixed.
 * ========================================================================== */
body.app-shell.studium-world {
  grid-template-columns: minmax(0, 1fr);
}

body.app-shell.studium-world > .page {
  grid-column: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* The atmosphere is behind everything, and `.page` / `.content` must be
   transparent so it is visible. main.css forces `background-color: var(--cream)`
   onto both in dark and auto modes at (0,2,1); these are (0,2,2). <body> keeps
   a solid per-register colour underneath, so there is never a white flash
   before the fixed layer paints. */
html body.studium-world {
  background-color: var(--vs-atmo-base);
  color: var(--vs-ink);
  transition: background-color var(--lux-register-fade) ease,
              color var(--lux-register-fade) ease;
}

html body.studium-world > .page {
  position: relative;
  z-index: 1;
  background-color: transparent;
}

html body.studium-world .studium-content {
  flex: 1 1 auto;
  background-color: transparent;
}

/* --------------------------------------------------------------------------
 * Skip link — the first focusable element in the document.
 * The Alchemia shell ships none, so Studium carries its own.
 * -------------------------------------------------------------------------- */
body.studium-world .studium-skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1400;
  /* It rendered at 47px on its padding alone, but a floor that is only a side
     effect of a font size is not a floor. Stated, so a later type change cannot
     quietly take the document's first focusable control below 44px. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 6px;
  background: var(--vs-ink);
  color: var(--vs-atmo-min);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

body.studium-world .studium-skip-link:focus {
  transform: none;
}

/* ==========================================================================
 * 5. Header (vision §9 region 1)
 * ==========================================================================
 *
 * THE HEADER CARRIES THE SAME LIGHT AS THE PAGE, AND IT MUST NOT BECOME A
 * STACKING CONTEXT WHILE DOING SO.
 *
 * The tint is painted as MULTIPLE BACKGROUND LAYERS ON THE HEADER ITSELF —
 * fixed-geometry linear gradients whose stops are the already-registered,
 * already-interpolating `--vs-solar-core` / `--vs-lunar-core` `<color>`
 * properties, with each mix scaled by its corresponding live field alpha, over
 * `--vs-surface-translucent` as the bottom layer. That reuses Slice 2's
 * machinery and obeys its two rules: no `background-image` is ever
 * transitioned (the geometry is fixed), and `--lux-progress` is never
 * transitioned.
 *
 * A `background` layer list paints FIRST-LISTED ON TOP, so lunar is listed
 * before solar to match the hero, whose `::after` (lunar) paints above its
 * `::before` (solar). `tests/test_studium_tokens.py::backdrops` composites the
 * stack in that same order; if this order changes, that test must change too.
 *
 * Painting on the element itself — rather than through pseudo-elements — is a
 * deliberate stacking decision, not a stylistic one. The header contains the
 * Novedades bell, and at <=900px `.novedades-panel` is
 * `position: fixed; z-index: 60` (main.css) while `novedades.js`'s dismiss
 * scrim is a BODY-LEVEL `position: fixed; z-index: 55`. `z-index` only orders
 * siblings within a stacking context, so the moment `.studium-header` becomes
 * one the panel's 60 is sorted inside it and can land beneath the body-level
 * scrim, and the bottom sheet also stops being anchored to the viewport.
 * Therefore this rule must never gain `overflow: hidden`, `transform`,
 * `filter`, `backdrop-filter`, `isolation`, `opacity` below 1, `will-change`,
 * `contain`, or a `z-index` other than `auto`.
 *
 * There is deliberately NO `backdrop-filter`. It would be a visual no-op — the
 * header is not sticky and its backdrop is the fixed, smooth-gradient
 * `.studium-atmosphere` — and it is exactly one of the properties above: a
 * `backdrop-filter` other than `none` establishes a containing block for fixed
 * descendants, which would re-anchor the notification bottom sheet to the
 * header's bottom edge.
 */
body.studium-world .studium-header {
  --vs-header-padding-block: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding: var(--vs-header-padding-block) clamp(20px, 4vw, 56px);
  background:
    linear-gradient(
      270deg,
      color-mix(
        in srgb,
        var(--vs-lunar-core)
          calc(var(--vs-header-tint) * var(--lux-lunar-alpha)),
        transparent
      ) 0%,
      transparent 58%
    ),
    linear-gradient(
      90deg,
      color-mix(
        in srgb,
        var(--vs-solar-core)
          calc(var(--vs-header-tint) * var(--lux-solar-alpha)),
        transparent
      ) 0%,
      transparent 62%
    ),
    var(--vs-surface-translucent);
  border-bottom: 1px solid var(--vs-border);
  transition: background-color var(--lux-register-fade) ease,
              border-color var(--lux-register-fade) ease;
}

body.studium-world .studium-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* The brand as the link home (P3.3). It keeps the header's ink and no
   underline; 2px of padding that a matching negative margin cancels make the
   40px brand row a 44px target without moving the header, and the floor is
   stated as well as reached. Focus is the module baseline (§9). */
body.studium-world a.studium-header-brand {
  min-height: 44px;
  padding-block: 2px;
  margin-block: -2px;
  color: inherit;
  text-decoration: none;
}

/* Spend the existing header padding on the emblem while retaining the original
   40px brand-row footprint. The PNG's transparent side margins are cropped by
   `object-fit: cover`, so the image box itself stays inside the emblem; the
   complete coat of arms stays visible at its natural aspect ratio. */
body.studium-world .studium-brand-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 60px;
  height: calc(40px + 2 * var(--vs-header-padding-block));
  margin-block: calc(-1 * var(--vs-header-padding-block));
  overflow: clip;
  transition: transform 240ms ease-out;
}

/* The coat of arms answers the pointer with a slight zoom (the owner's note
   after P3.7). The emblem scales together with its own clip, so the shield is
   never cut by its frame, and only the emblem is transformed: the header must
   never become a stacking context (above). Hover only, because a touch has no
   hover to end and the zoom would stay after a tap. It stays under reduced
   motion, like every hover here (§9, the owner's rule). */
@media (hover: hover) {
  body.studium-world a.studium-header-brand:hover .studium-brand-emblem {
    transform: scale(1.08);
  }
}

body.studium-world .studium-brand-mark {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  flex: none;
}

body.studium-world .studium-brand-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--vs-ink);
  text-transform: uppercase;
}

/* A lunar reflection driven by the atmosphere's existing minute-by-minute state.
   Require BOTH the night phase and night surfaces: a pinned dark theme during
   daylight, or a pinned light theme at night, keeps the normal wordmark.
   The server supplies these attributes even without JS. Unsupported clipping,
   print and forced-colour modes retain the readable solid ink above. Clipping
   first establishes opaque ink; rejected enhancements can never erase it. */
@supports (background-clip: text) or (-webkit-background-clip: text) {
  @media screen and (forced-colors: none) {
    body.studium-world[data-lux-phase="night"][data-lux-register="night"] .studium-brand-name {
      background-color: var(--vs-ink);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    @supports (color: color-mix(in srgb, white, transparent)) {
      body.studium-world[data-lux-phase="night"][data-lux-register="night"] .studium-brand-name {
        /* Veil changes only strength. The source may pass beyond the letters;
           rake places the broad dim band away from the illuminated edge.
           Every blend stays between readable night inks, never shadow ink. */
        background-image:
          radial-gradient(
            ellipse at calc(50% + var(--lux-lunar-nx) * 1%) calc(50% + var(--lux-lunar-ny) * 1%),
            color-mix(in srgb,
              var(--vs-moonlit-white) clamp(0%, calc(var(--lux-lunar-alpha) * (1 - clamp(0, var(--lux-veil-alpha), 1)) * 100%), 100%),
              transparent) 0%,
            transparent 68%
          ),
          linear-gradient(
            var(--lux-rake),
            var(--vs-ink) 10%,
            color-mix(in srgb,
              var(--vs-ink-muted) clamp(0%, calc(var(--lux-veil-alpha) * 100%), 100%),
              var(--vs-ink)) 72%,
            var(--vs-ink) 100%
          );
      }
    }
  }
}

body.studium-world .studium-eyebrow {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--vs-ink-faint);
}

body.studium-world .studium-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}

/* 44px minimum touch target, met by padding rather than by a fixed height so
   the label can wrap at narrow widths without being clipped. */
body.studium-world .studium-header-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 6px;
  color: var(--vs-ink-muted);
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

/* P1.2: «Cerrar sesión» is a POST, so it is a button (since P3.4 its one copy
   sits in the account panel); this drops the button's own chrome and keeps
   everything the rule above sets. */
body.studium-world button.studium-header-link {
  margin: 0;
  border-width: 0 0 1px;
  background: none;
  font-family: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-align: start;
  cursor: pointer;
}

/* Keyboard parity: the hover affordance was the only one until Slice 3, so a
   Tab-only user got the focus ring and none of the underline. */
body.studium-world .studium-header-link:hover,
body.studium-world .studium-header-link:focus-visible {
  color: var(--vs-ink);
  border-bottom-color: var(--vs-border-strong);
}

/* --------------------------------------------------------------------------
 * The account control (P6.6; P3.4's disclosure, reworked): one in every
 * portal, in Studium's colours here.
 *
 * The shared partial (partials/_account_control.html) keeps this disclosure's
 * classes; main.css lays it out: the initials in a round button that widens
 * to the name over room its slot already holds, and a menu with «Mi cuenta»
 * and «Cerrar sesión». A native <details>, so it opens without JavaScript.
 * The slot's auto margin keeps the menu, `right: 0` against the disclosure,
 * at the header's real right edge at every width (measured at 375/500/650 px
 * by tests/test_cross_domain_topbar_browser.py).
 * -------------------------------------------------------------------------- */
body.studium-world .account-control {
  --ac-edge: var(--vs-border-strong);
  --ac-bg: var(--vs-surface-raised);
  --ac-ink: var(--vs-ink);
  --ac-ini-bg: var(--vs-chosen);
  --ac-ini-ink: var(--vs-chosen-ink);
  --ac-pop: var(--vs-surface-raised);
  --ac-line: var(--vs-border);
  --ac-muted: var(--vs-ink-muted);
  --ac-focus: var(--vs-focus);
  --ac-font: var(--font-ui);
  /* The mark's warning ink (P6.15): /cuenta's approved warning, by register (account.css's --account-warn). */
  --ac-warn: #7a4500;
  margin-inline-start: auto;
}

body.studium-world[data-lux-register="dusk"] .account-control {
  --ac-warn: #683900;
}

body.studium-world[data-lux-register="night"] .account-control {
  --ac-warn: #f2a65a;
}

body.studium-world .studium-header-menu {
  display: block;
}

/* WebKit still needs the pseudo-element form to drop the disclosure triangle. */
body.studium-world .studium-header-menu-toggle::-webkit-details-marker {
  display: none;
}

body.studium-world .account-control-button:hover,
body.studium-world .account-control-button:focus-visible {
  background: color-mix(in srgb, var(--vs-ink) 12%, var(--vs-surface-raised));
}

body.studium-world .account-control-menu {
  gap: 14px;
  box-shadow: var(--vs-shadow);
}

/* The menu's two targets are the header links' classes, drawn as the menu's rows rather than underlined links. */
body.studium-world .account-control .account-control-item.studium-header-link {
  padding: 0 12px;
  border: 0;
  color: var(--vs-ink);
  font-size: 0.95rem;
}

body.studium-world .account-control .account-control-item.studium-header-link:focus-visible {
  outline: 3px solid var(--vs-focus);
  outline-offset: 3px;
}

/* Administración (P4.5): an admin's round button beside the bell, drawn as the
   account button is, its name in a tip in the page's look on hover and focus
   (never the browser's title), and its menu as the account's. On the admin's
   own pages it takes the selected colours (R14). */
body.studium-world .studium-admin {
  position: relative;
  flex: none;
}

body.studium-world .studium-admin-disclosure {
  display: block;
}

body.studium-world .studium-admin-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  border: 1px solid var(--vs-border-strong);
  border-radius: 999px;
  background: var(--vs-surface-raised);
  color: var(--vs-ink);
  list-style: none;
  cursor: pointer;
  transition: background-color 160ms ease-out, border-color 160ms ease-out;
}

/* WebKit still needs the pseudo-element form to drop the disclosure triangle. */
body.studium-world .studium-admin-button::-webkit-details-marker {
  display: none;
}

body.studium-world .studium-admin-button:hover,
body.studium-world .studium-admin-button:focus-visible {
  background: color-mix(in srgb, var(--vs-ink) 12%, var(--vs-surface-raised));
}

body.studium-world .studium-admin-button:focus-visible {
  outline: 3px solid var(--vs-focus);
  outline-offset: 3px;
}

body.studium-world .studium-admin-button.is-here,
body.studium-world .studium-admin-button.is-here:hover {
  background: var(--vs-chosen);
  border-color: var(--vs-chosen-line);
  color: var(--vs-chosen-ink);
}

body.studium-world .studium-admin-glyph {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

body.studium-world .studium-admin-tip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 46;
  padding: 6px 10px;
  border: 1px solid var(--vs-border-strong);
  border-radius: 6px;
  background: var(--vs-surface-raised);
  box-shadow: var(--vs-shadow);
  color: var(--vs-ink);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease-out, visibility 0s linear 160ms;
}

body.studium-world .studium-admin-disclosure:not([open]) .studium-admin-button:hover .studium-admin-tip,
body.studium-world .studium-admin-disclosure:not([open]) .studium-admin-button:focus-visible .studium-admin-tip {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

body.studium-world .studium-admin-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  width: 15rem;
  max-width: calc(100vw - 32px);
  padding: 6px;
  border: 1px solid var(--vs-border-strong);
  border-radius: 8px;
  background: var(--vs-surface-raised);
  box-shadow: var(--vs-shadow);
}

body.studium-world .studium-admin-menu .studium-admin-item {
  display: flex;
  text-decoration: none;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: var(--vs-ink);
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

/* Each row reads as a button, not bare text (round 3's Admisiones 1): its glyph, the row's own box. */
body.studium-world .studium-admin-menu .studium-admin-item {
  gap: 10px;
}

body.studium-world .studium-admin-menu .studium-admin-item + .studium-admin-item {
  margin-top: 2px;
}

body.studium-world .studium-admin-item-glyph {
  flex: none;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

body.studium-world .studium-admin-menu .studium-admin-item:hover {
  background: color-mix(in srgb, var(--vs-ink) 9%, transparent);
}

body.studium-world .studium-admin-menu .studium-admin-item:focus-visible {
  outline: 3px solid var(--vs-focus);
  outline-offset: 3px;
}

body.studium-world .studium-admin-menu .studium-admin-item[aria-current="page"] {
  font-weight: 600;
  box-shadow: inset 4px 0 0 var(--vs-chosen-line);
}

/* «Oferta educativa» and «Plan de estudios» (P11.5a) say what each holds in a tooltip beside the menu, drawn in the
   page's own look: on hover after 0.4 s (leaving early shows nothing), at once on keyboard focus. Its words are the
   row's description; the name stays the row's own words. */
body.studium-world .studium-admin-menu .studium-admin-item {
  position: relative;
}

body.studium-world .studium-admin-item-tip {
  position: absolute;
  top: 50%;
  right: calc(100% + 16px);
  z-index: 47;
  width: max-content;
  max-width: 16rem;
  padding: 8px 12px;
  border: 1px solid var(--vs-border-strong);
  border-radius: 6px;
  background: var(--vs-surface-raised);
  box-shadow: var(--vs-shadow);
  color: var(--vs-ink);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.35;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 160ms ease-out, visibility 0s linear 160ms;
}

body.studium-world .studium-admin-menu .studium-admin-item:hover .studium-admin-item-tip {
  opacity: 1;
  visibility: visible;
  transition: opacity 160ms ease-out 400ms, visibility 0s linear 400ms;
}

body.studium-world .studium-admin-menu .studium-admin-item:focus-visible .studium-admin-item-tip {
  opacity: 1;
  visibility: visible;
  transition: opacity 160ms ease-out, visibility 0s;
}

/* On a phone the bar stays one row (the owner's P6.3 note): the round button
   hides and «Programas» is a row of the account menu, which shows only there
   (the 650 block below). */
body.studium-world .account-control .studium-admin-phone {
  display: none;
}

body.studium-world .account-control .studium-admin-phone[aria-current="page"] {
  font-weight: 600;
}

/* «Generaciones» likewise (lane RF, stage 1; the owner's «B: into the menu», 2026-11-13): with both doors its round
   button left no room in a phone's one row, so there the button hides and this row of the account menu takes its
   place (the 650 block below). */
body.studium-world .account-control .studium-generaciones-phone {
  display: none;
}

body.studium-world .account-control .studium-generaciones-phone[aria-current="page"] {
  font-weight: 600;
}

/* The melt (P6.6; shell_melt.js): arriving from Alchemia or Sophia, a veil in the page you left fades away over
   about a second, above everything and never in the way of a press. The script makes none under reduced motion. */
body.studium-world .shell-melt {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  animation: shell-melt 1000ms ease-out forwards;
}

@keyframes shell-melt {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* The glass, the bell and the account control: one group at the header's right (P6.6). */
body.studium-world .studium-header-end {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* The glass that opens the search on a phone (P6.6); the field shows itself above 650 px. */
body.studium-world .studium-search-toggle {
  display: none;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  color: var(--vs-ink);
  transition: background-color 160ms ease-out;
}

body.studium-world .studium-search-toggle:hover,
body.studium-world .studium-search-toggle[aria-expanded="true"] {
  background: color-mix(in srgb, var(--vs-ink) 12%, transparent);
}

body.studium-world .studium-search-toggle:focus-visible {
  outline: 3px solid var(--vs-focus);
  outline-offset: 3px;
}

body.studium-world .studium-search-submit-glyph {
  display: none;
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* The header search form (Slice 6, vision §33's wireframe order: it sits
   after the heading, beside the account actions it shares the tools group
   with since the owner's note after P3.7). `role="search"` makes it a
   landmark, not a second <nav>.

   `min-width: 0` is load-bearing rather than defensive: a flex item's
   min-content floor is the input's default ~20ch, which overflows a 375px
   viewport and makes the PAGE scroll sideways —
   tests/test_studium_shell_browser.py measures `scrollWidth - clientWidth`. */
body.studium-world .studium-search {
  display: flex;
  align-items: center;
  /* 8px between two 44px targets: the minimum-spacing rule that exists exactly
     for the mis-tap case of controls touching edge to edge. */
  gap: 8px;
  /* A definite width rather than a flexible one, so the tools group (below)
     measures the field at its full size and wraps whole before the field
     could shrink under its placeholder. From 1160 down it fills its row. */
  flex: none;
  width: 380px;
  min-width: 0;
}

/* The search and the account actions (the owner's note after P3.7: the field
   at the right, beside the account). One flex item of the header, so that
   when brand, doors and this group do not fit one row the group takes the
   second row whole, at the right; it can never leave the actions alone on a
   row. Its gap is the one the header used to keep between the two. */
body.studium-world .studium-header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 16px 32px;
  margin-inline-start: auto;
  min-width: 0;
}

/* `width: 0` is what makes the whole page fit a 320px phone, and `min-width: 0`
   alone was not enough to do it.
 *
 * A text input's intrinsic width is its default `size` (~20 characters), which is
 * 218px here. `min-width: 0` lets the flex algorithm SHRINK the input, but the
 * form's min-content size is still computed from that intrinsic width — so
 * `.studium-search` had a 310px min-content, `.studium-header` a 350px one, and the
 * document overflowed horizontally by 10px at 320px no matter what the flex
 * properties said. Measured in Slice 7b: with `width: 0` the header's min-content
 * drops from 350px to 198.6px and the 320px overflow goes to zero, while the
 * rendered field is unchanged at every width where it fits (288px at 1440px, both
 * before and after). `flex-grow` is what gives it its real width.
 *
 * `flex-basis: 0` on its own does NOT fix this — it was measured and it did not. */
body.studium-world .studium-search-input {
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
  min-height: 44px;
  padding: 10px 16px;
  /* WebKit's `searchfield` appearance clips the radius and ignores the padding;
     without this the pill renders as a square field on Safari/iOS. */
  appearance: none;
  background: var(--vs-surface-raised);
  border: 1px solid var(--vs-border-strong);
  border-radius: 999px;
  color: var(--vs-ink);
  /* Inputs do not inherit the document font or size, so both halves are stated.
     main.css sets `html { font-size: 112.5% }`, so 1rem is 18px — above iOS's
     16px zoom-on-focus threshold, which is why this must not be a smaller rem
     value. */
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.4;
  transition: background-color var(--lux-register-fade) ease,
              border-color var(--lux-register-fade) ease;
}

/* Firefox applies a 54% default alpha to placeholder text, which would drag a
   token audited at 6.4:1 down to roughly 2.5:1. `opacity: 1` is the fix. */
body.studium-world .studium-search-input::placeholder {
  color: var(--vs-ink-faint);
  opacity: 1;
}

body.studium-world .studium-search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 44px;
  padding: 10px 18px;
  /* The quiet button (§6): outlined in the page ink, not the brown it had
     until P3.4, so the header does not shout on every visit. */
  border: 1px solid var(--vs-ink);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  /* The fill is a hover's, so it eases at a hover's pace: at the register's
     2.4s it was still invisible when the pointer moved on. Its background is
     transparent at rest, so no register change has a fill to fade. */
  transition: background-color 160ms ease-out,
              border-color var(--lux-register-fade) ease,
              transform var(--vs-press) ease-out;
}

body.studium-world .studium-search-submit:active {
  transform: scale(0.97);
}

/* --------------------------------------------------------------------------
 * The domains' doors (the owner's note after P3.7): «A» and «S».
 *
 * The Alchemia and Sophia topbars' cross-domain pill (main.css `.sophia-link`,
 * sophia.css `.alchemia-link`), in each domain's tint from the course cards'
 * one mapping rule: a lettered disc in a pill that opens to the domain's name
 * and fills with the domain's accent on hover or focus.
 *
 * Opening never moves anything. With a mouse each pill is drawn over its slot
 * (`position: absolute` inside a `position: relative` slot, so the header
 * itself stays unpositioned), and both open rightwards, as Sophia's «A» does
 * (the owner, 2026-10-25: «both open in the same direction»). The slot is as
 * wide as its open pill, so the open name never reaches the other door or the
 * search field. A touch screen has no hover to open them with, so outside the
 * fine-pointer query the names simply stay open, in flow.
 * -------------------------------------------------------------------------- */
/* The pair grows into the space between the brand and the tools, and centres
   itself there: on the header's one row, or on the brand's row when the tools
   take the second. */
body.studium-world .studium-domains {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  /* 14px between the two pills: two focus rings meet at 12px (§9). */
  gap: 14px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
}

body.studium-world .studium-domain-slot {
  display: flex;
}

body.studium-world .studium-domain {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--portal-edge);
  border-radius: 999px;
  background: linear-gradient(var(--portal-wash), var(--portal-wash)),
              var(--vs-surface-raised);
  color: var(--portal-accent);
  line-height: 1.25;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 160ms ease-out,
              border-color 160ms ease-out,
              color 160ms ease-out;
}

body.studium-world .studium-domain-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--portal-accent);
  color: var(--vs-surface-raised);
  font-family: var(--font-serif);
  line-height: 1;
  transition: background-color 160ms ease-out, color 160ms ease-out;
}

body.studium-world .studium-domain-name {
  padding-inline: 8px 4px;
}

body.studium-world .studium-domain:hover,
body.studium-world .studium-domain:focus-visible {
  background: var(--portal-accent);
  border-color: var(--portal-accent);
  color: var(--vs-surface-raised);
}

body.studium-world .studium-domain:hover .studium-domain-mark,
body.studium-world .studium-domain:focus-visible .studium-domain-mark {
  background: var(--vs-surface-raised);
  color: var(--portal-accent);
}

/* «Generaciones» (P13.8; R14, frame 1 of round 3): a round glyph button after the doors, drawn as «Administración»
   is, its name in a tip in the page's look on hover (after 0.4 s) and on focus, never the browser's title. On
   Generaciones' own pages it takes the selected colours (`.is-here`, with aria-current). */
body.studium-world .studium-generaciones {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  /* The 44px floor declared, as Studium's targets do (tests/test_studium_responsive_browser.py's sweep). */
  min-height: 44px;
  border: 1px solid var(--vs-border-strong);
  border-radius: 999px;
  background: var(--vs-surface-raised);
  color: var(--vs-ink);
  text-decoration: none;
  transition: background-color 160ms ease-out, border-color 160ms ease-out;
}

body.studium-world .studium-generaciones:hover,
body.studium-world .studium-generaciones:focus-visible {
  background: color-mix(in srgb, var(--vs-ink) 12%, var(--vs-surface-raised));
}

body.studium-world .studium-generaciones:focus-visible {
  outline: 3px solid var(--vs-focus);
  outline-offset: 3px;
}

body.studium-world .studium-generaciones.is-here,
body.studium-world .studium-generaciones.is-here:hover {
  background: var(--vs-chosen);
  border-color: var(--vs-chosen-line);
  color: var(--vs-chosen-ink);
}

body.studium-world .studium-generaciones-glyph {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* A closed name takes no box: one laid out near the window's edge would still widen the page (admissions' tip). */
body.studium-world .studium-generaciones-tip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 46;
  display: none;
  padding: 6px 10px;
  border: 1px solid var(--vs-border-strong);
  border-radius: 6px;
  background: var(--vs-surface-raised);
  box-shadow: var(--vs-shadow);
  color: var(--vs-ink);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
}

body.studium-world .studium-generaciones:focus-visible .studium-generaciones-tip {
  display: block;
}

@media (hover: hover) {
  body.studium-world .studium-generaciones:hover .studium-generaciones-tip {
    display: block;
    animation: studium-generaciones-name 400ms steps(1, end);
  }
}

/* The button and its 14px take 60px more of the header's row, and at 1366 the doors had none to spare: the tools
   took a second row, 154px of header instead of 92 (lane RF, stage 1; the owner's «RF fixes it», 2026-11-12). A
   header that carries it keeps one row there with its gaps at 24px (still clear of a focus ring's 6px) and its search
   44px narrower, the placeholder whole. `:where()` keeps these at the specificity of the rules they adjust, so the
   bands below (from 1160 down the tools have their own row) still win, written later: no new @media block. */
body.studium-world .studium-header:where(:has(.studium-generaciones)),
body.studium-world :where(.studium-header:has(.studium-generaciones)) .studium-header-tools {
  column-gap: 24px;
}

body.studium-world :where(.studium-header:has(.studium-generaciones)) .studium-search {
  width: 336px;
}

/* On hover the name waits 0.4 s, as «Administración»'s does: hidden for the first step, then shown. */
@keyframes studium-generaciones-name {
  from { visibility: hidden; }
  to { visibility: visible; }
}

/* `max-width` + `opacity`, as in main.css's `.sophia-link-text` (its note says
   why not a `0fr -> 1fr` track), with `min-width: 0` so a flex item's content
   minimum cannot beat `max-width: 0`. The open ceiling only paces the opening:
   12ch less the name's 12px of padding (the box is border-box) holds «Alchemia»
   in the face (7.4ch) and in the fallbacks measured (Liberation Serif 8.1ch,
   Noto Serif 8.4ch). The pill's room is not reckoned in ch: the slot carries a
   hidden copy of the name in the open pill's own widths (border, padding and
   mark before it, the name's 4px, padding and border after), so it holds the
   name in whatever font renders it, and the gaps after it (the pair's 14px,
   the header's 24 or 32px) keep a focus ring's 6px clear. */
@media (hover: hover) and (pointer: fine) {
  body.studium-world .studium-domain-slot {
    position: relative;
    height: 44px;
  }

  body.studium-world .studium-domain-slot::after {
    content: attr(data-door-name);
    padding-inline: calc(1px + 8px + 26px + 8px) calc(4px + 8px + 1px);
    white-space: nowrap;
    visibility: hidden;
  }

  body.studium-world .studium-domain {
    position: absolute;
    top: 0;
    left: 0;
    width: max-content;
  }

  body.studium-world .studium-domain-name {
    overflow: hidden;
    max-width: 0;
    min-width: 0;
    padding-inline: 0;
    opacity: 0;
    transition: max-width 200ms ease-out,
                padding-inline 200ms ease-out,
                opacity 140ms ease-out;
  }

  body.studium-world .studium-domain:hover .studium-domain-name,
  body.studium-world .studium-domain:focus-visible .studium-domain-name {
    max-width: 12ch;
    padding-inline: 8px 4px;
    opacity: 1;
  }
}

/* Slice 6 needed an `html`-prefixed `border-radius: 999px` restore here, because
   §9's focus baseline carried `border-radius: 3px` and visibly squared these two
   pills the moment they took focus. Slice 7b dropped the radius from the baseline
   — an outline follows its own element's radius — so the restore became dead code
   and went out with it rather than being left to read as load-bearing. */

/* ==========================================================================
 * 6. Page body — the hero, and the person's program below it
 * ==========================================================================
 *
 * Wider and more generously spaced than the Alchemia dashboard: the platform
 * home is meant to read as ceremonial rather than as another application
 * screen. The measure is capped so long paragraphs stay in the 60-75 character
 * band even on a very wide monitor.
 */
/* `overflow: clip` (not `hidden`: no scrollport, no scroll anchoring, no new
   containing block for fixed descendants) bounds the lower field's tail at
   <main>'s padding box, so the verdigris always reaches the footer, never grows
   the document and never adds a scrollbar. `overflow-clip-margin` preserves the
   6px a 3px/3px focus ring reaches past its border box, plus 2px of slack; the
   repair for any ring that still overruns is a clip margin at the INNERMOST
   clipper, never removing this clip. */
body.studium-world .studium-content {
  padding-inline: 0;
  padding-block: clamp(28px, 5vw, 64px);
  position: relative;
  overflow: clip;
  overflow-clip-margin: 8px;
}

/* Shared markup, and the only thing left in <main> that the page grid does not
   place: the inline padding it used to inherit from `.studium-content` has to be
   restated now that the content box runs edge to edge. */
body.studium-world .flash-stack {
  padding-inline: var(--vs-gutter);
}

/* A FULL-BLEED GRID, so the lower field can reach the viewport edges while the
   content stays on the measure. The three tracks give every child a named
   `content` column and the decorative wrapper a named `full` column — no `100vw`
   (which ignores the scrollbar and would add a horizontal one) and no negative
   margins. `column-gap` must stay 0: with three tracks a column gap would widen
   the page past the viewport. */
body.studium-world .studium-page {
  display: grid;
  grid-template-columns:
    [full-start] minmax(var(--vs-gutter), 1fr)
    [content-start] minmax(0, var(--vs-measure)) [content-end]
    minmax(var(--vs-gutter), 1fr) [full-end];
  column-gap: 0;
  row-gap: clamp(20px, 3vw, 36px);
}

body.studium-world .studium-page > * {
  grid-column: content;
}

/* --------------------------------------------------------------------------
 * THE LOWER VERDIGRIS FIELD — anchored to the document, not to the viewport.
 *
 * `.studium-lower` groups everything below the hero (the program's columns, the
 * doors' row when there are no course cards, and the Novedades band), so the
 * horizon is positioned by the composition: it begins `--vs-underfield-rise`
 * above the columns at every width, on a short page and on a long one, and on a
 * phone. `74vh` or `bottom: 26%` would put it wherever the window happened to
 * end. The wrapper carries no ARIA and no heading — each column and the band keep
 * their own labelled landmarks and their own place in the source order.
 *
 * The negative margin plus the equal padding is what buys the run-up: the box
 * starts above the section while its content stays exactly where it was.
 *
 * `subgrid` re-uses the page's own three tracks, so what it holds still aligns
 * to the measure while the wrapper spans the full bleed.
 * -------------------------------------------------------------------------- */
body.studium-world .studium-lower {
  grid-column: full;
  display: grid;
  grid-template-columns: subgrid;
  row-gap: clamp(20px, 3vw, 36px);
  position: relative;
  margin-block-start: calc(-1 * var(--vs-underfield-rise));
  padding-block-start: var(--vs-underfield-rise);
  /* The negative-margin run-up is visually transparent but overlaps the end of
     the preceding hero in box geometry. Let clicks pass through that empty
     strip; the real lower regions opt back in immediately below. */
  pointer-events: none;
}

body.studium-world .studium-lower > * {
  grid-column: content;
  pointer-events: auto;
}

/* Bounded in both axes and behind all content in `.page`'s stacking context.
   The `-100vh` tail is what lets the floor continue past the last region to the end of
   <main>; `.studium-content`'s `overflow: clip` is what stops it there.
 *
 * The gradient's stops are LENGTHS from the wrapper's own top edge, so the ramp
 * is as document-bound as its origin, and it settles on `--vs-underfield-deep`
 * before the fold — which is what lets the footer continue the same colour.
 *
 * This opaque field necessarily covers the fixed atmosphere beneath it. The
 * settled floor remains quiet, but not inert: two extremely broad, non-repeating
 * mineral variations sit above the document-bound colour ramp. One carries a
 * restrained warm inclusion; the other is a broad cool lift from the same light
 * ink the surfaces already consume. Their shared registered strength keeps the
 * plane calm in daylight and quieter still at night, with no tile size, grain
 * cell, noise, filter, or independent motion. The procedural texture is kept off
 * this pseudo-element: unlike the gradients, a repeated image would be opaque at
 * the wrapper's top and expose the exact horizon as a hard horizontal seam. */
body.studium-world .studium-lower::before {
  content: "";
  position: absolute;
  z-index: -2;
  pointer-events: none;
  inset-inline: 0;
  inset-block: 0 -100vh;
  background-image:
    radial-gradient(
      ellipse 84% 44% at 2% 38%,
      color-mix(
        in srgb,
        var(--vs-grain) var(--vs-underfield-material),
        transparent
      ) 0%,
      transparent 72%
    ),
    radial-gradient(
      ellipse 70% 62% at 103% 76%,
      color-mix(
        in srgb,
        var(--vs-lit-ink) calc(var(--vs-underfield-material) * 0.42),
        transparent
      ) 0%,
      transparent 76%
    ),
    linear-gradient(
      to bottom,
      transparent 0,
      var(--vs-underfield) var(--vs-underfield-soft),
      var(--vs-underfield-deep) calc(var(--vs-underfield-soft) * 2)
    );
  background-repeat: no-repeat;
}

body.studium-world .studium-page--home {
  /* ----------------------------------------------------------------------
   * ONE CELESTIAL FIELD, IN PAGE/WORLD COORDINATES.
   *
   * These dimensions describe one background canvas behind the home
   * composition, of which the hero is the window (since P3.4 the only one: the
   * program's columns sit on the floor, each on its own almost transparent
   * backing). `studium_atmosphere.js` replaces the safe viewport defaults with
   * measured page/hero boxes after layout; the hero then shifts the canvas by
   * its own page offset, so responsive reflow changes the revealed slice
   * naturally.
   *
   * Before or without JavaScript, `fixed` attachment makes the same image use
   * the viewport as its positioning area on every surface. Once mapped, the
   * attachment becomes `scroll` and the measured offsets make it true document
   * space, stable while the page scrolls. Both modes are one shared field; the
   * mapper improves the coordinate origin rather than inventing the light. */
  --vs-world-width: 100vw;
  --vs-world-height: 400vh;
  --vs-world-hero-x: max(
    var(--vs-gutter),
    calc((100vw - var(--vs-measure)) * 0.5)
  );
  --vs-world-hero-y: calc(88px + clamp(28px, 5vw, 64px));
  --vs-world-hero-width: min(
    var(--vs-measure),
    calc(100vw - var(--vs-gutter) * 2)
  );
  --vs-world-hero-height: 240px;
  --vs-world-surface-x: 0px;
  --vs-world-surface-y: 0px;
  --vs-world-source-travel: 0.64;
  /* Unitless hero coordinates keep the light axis independent of the slab's
     aspect ratio. The world positions and atan2() share these same points. */
  --vs-world-source-nx: calc(
    0.5 + var(--lux-light-dir) * var(--vs-world-source-travel)
  );
  --vs-world-source-ny: calc(0.08 + (1 - var(--lux-light-elev)) * 0.34);
  --vs-world-source-x: calc(
    var(--vs-world-hero-x)
    + var(--vs-world-hero-width) * var(--vs-world-source-nx)
  );
  --vs-world-source-y: calc(
    var(--vs-world-hero-y)
    + var(--vs-world-hero-height) * var(--vs-world-source-ny)
  );
  /* Retain the direction-only rake for browsers without atan2(). */
  --vs-world-beam-rake: calc(360deg - var(--lux-rake));
  /* The old hero deliberately kept the radial source just outside the slab
     while centring its separate band inside it. Preserve that relationship in
     world space: the wash keeps the real source point, and the beam anchor is
     drawn inward from that source using the same live direction/elevation.
     Unlike the old local 50%, this one anchor belongs to the whole page. */
  --vs-world-band-nx: calc(
    var(--vs-world-source-nx) - var(--lux-light-dir) * 0.34
  );
  --vs-world-band-ny: calc(0.52 + (1 - var(--lux-light-elev)) * 0.08);
  --vs-world-band-x: calc(
    var(--vs-world-hero-x)
    + var(--vs-world-hero-width) * var(--vs-world-band-nx)
  );
  --vs-world-band-y: calc(
    var(--vs-world-hero-y)
    + var(--vs-world-hero-height) * var(--vs-world-band-ny)
  );
  /* A linear gradient's 50% point is the image centre. Project the band anchor onto
     its gradient axis and move the band centre by that signed distance. CSS
     angles use 0deg=up and 90deg=right, hence x*sin - y*cos. */
  --vs-world-band-axis: calc(
    50%
    + (var(--vs-world-band-x) - var(--vs-world-width) * 0.5)
      * sin(var(--vs-world-beam-rake))
    - (var(--vs-world-band-y) - var(--vs-world-height) * 0.5)
      * cos(var(--vs-world-beam-rake))
  );
  --vs-world-field-attachment: fixed;

  /* THE SECTION RHYTHM, HOME ONLY. With the outer slabs gone,
     the gap between a card and the next section heading is the only thing
     separating one section from the next, so it carries what a border used to.
     Measured off the 1:1 concept image and retained as the direct hero-to-domain
     transition.

     Scoped to `--home` rather than raised on the shared `.studium-page`, which
     `/studium/search` also uses: search keeps its slabs, and widening its rows
     to suit a page that no longer has any would be the same accidental change
     the de-slab decision was scoped to avoid. */
  row-gap: clamp(28px, 3vw, 36px);
}

@supports (transform: rotate(atan2(1, 1))) {
  body.studium-world .studium-page--home {
    /* atan2(dy, dx) measures the source-to-anchor ray clockwise from right in
       hero coordinates. A CSS gradient's constant-colour bands are perpendicular
       to its axis (0deg up), so this angle makes the VISIBLE band follow that
       ray: down/right in morning, near vertical at midday, down/left later. */
    --vs-world-beam-rake: atan2(
      calc(var(--vs-world-band-ny) - var(--vs-world-source-ny)),
      calc(var(--vs-world-band-nx) - var(--vs-world-source-nx))
    );
  }
}

/* The mapper adds this class only after all page and surface coordinates are
   present. From here on the field is anchored to the document, not the camera. */
body.studium-world .studium-page--home.has-lux-world-map {
  --vs-world-field-attachment: scroll;
}

/* In step with the row above it, not with the shared default. `.studium-lower`
   declares its own `row-gap` because it is a subgrid, and a value left behind
   here would make exactly one gap on the page — the columns to the Novedades
   band — narrower than every other. */
body.studium-world .studium-page--home .studium-lower {
  row-gap: clamp(28px, 3vw, 36px);
}

/* And the other half of the rhythm: a region's head to its body, ~10px against
   the 36px that separates sections. Since P3.4 the home's only region head is
   the hero's own «No disponible» state (the program's columns carry their
   kickers instead); search keeps the shared 10px. */
body.studium-world .studium-page--home .studium-region-head {
  margin-bottom: clamp(10px, 0.8vw, 12px);
}

/* --------------------------------------------------------------------------
 * THE SURFACE-LIGHT CONTRACT (atrium slice 2).
 *
 * One parametric shadow, scaled per surface by that surface's own `--vs-lift`.
 * `--lux-light-dir * -1` is the whole "a shadow falls opposite the light" rule,
 * written once; `--lux-light-elev` is what shortens the horizontal reach as the
 * source climbs, so midday reads as centred rather than as weakly right-lit.
 *
 * WHY THE CHAIN IS DECLARED HERE AND NOT IN §1. A custom property's `var()`s
 * are substituted at computed-value time on the element that DECLARES it, and
 * the resulting token stream is what inherits. A single `--vs-cast` on
 * `body.studium-world` would therefore have already resolved `var(--vs-lift)`
 * against the body's `1` before any card ever saw it, and the hierarchy would
 * silently collapse into one uniform shadow. Declaring the chain on the lit
 * surfaces themselves is what makes `--vs-lift` a real per-surface lever — and
 * it is also what makes the hover lift work, since changing `--vs-lift` on
 * `:hover` re-resolves the chain on that element alone.
 *
 * The list is the four elevation levels' selectors, and nothing else. A surface
 * that is not in it takes no cast, which is the level-0 contract.
 * -------------------------------------------------------------------------- */
body.studium-world .studium-search-page .studium-region,
body.studium-world .studium-region--hero,
body.studium-world .studium-course-card,
body.studium-world .studium-search-group {
  --vs-cast-x: calc(var(--lux-light-dir) * -1 * var(--vs-cast-reach)
               * (1 - var(--lux-light-elev) * 0.55) * var(--vs-lift));
  --vs-cast-y: calc(var(--vs-cast-drop)
               * (0.55 + var(--lux-light-elev) * 0.45) * var(--vs-lift));
  --vs-cast-blur: calc(var(--vs-cast-spread) * var(--vs-lift));
  /* Geometry scales linearly with the lift, ink SUB-linearly: increasing both
     offset and opacity at the same rate would read as a sticker, not as modest
     material separation. */
  --vs-cast-ink: color-mix(in srgb, var(--vs-shadow-ink)
               calc(var(--vs-shadow-alpha) * (0.55 + var(--vs-lift) * 0.45)), transparent);
  --vs-cast: var(--vs-cast-x) var(--vs-cast-y) var(--vs-cast-blur) var(--vs-cast-ink);
  /* The lit edge faces the light: direction -1 (light at the left) gives a
     +1px inset x offset, which paints the band on the LEFT inner edge. Its
     geometry is a hairline at every level, so it is deliberately not scaled by
     the lift — only its presence distinguishes level 2 from level 3. */
  --vs-cast-edge: inset calc(var(--lux-light-dir) * -1px) 1px 0 0
               color-mix(in srgb, var(--vs-lit-ink) var(--vs-edge-alpha), transparent);
}

/* --------------------------------------------------------------------------
 * THE REGION, SPLIT (atrium slice 3).
 *
 * The home page used to read `large surface panel > heading > inner card`, three
 * times over: a slab whose only content was a heading and one card that already
 * had its own surface. The concept image has no outer panels at all — the
 * section headings sit directly on the atmosphere, and the only surfaces are the
 * hero and the two portal cards (since P3.4: the hero, the program columns'
 * almost transparent backing and the course cards).
 *
 * SCOPE IS HOME ONLY, by decision. `/studium/search` is a dense list of results
 * grouped by domain; there the slab is doing real work, separating groups that
 * would otherwise run together. So the rule is SPLIT rather than overridden: one
 * declaration stays global because it was never about being a slab, and the
 * whole surface contract moves behind `.studium-search-page`, which
 * `search.html` already puts on its `.studium-page`.
 *
 * `position: relative` is the global half. It remains useful to the semantic
 * stretched-link cards nested in the regions without creating a surface.
 * -------------------------------------------------------------------------- */
body.studium-world .studium-region {
  position: relative;
}

/* Search keeps a shallow cast because its grouped result slabs still do real
   structural work; the four home regions carry no surface of their own. */
body.studium-world .studium-search-page .studium-region {
  padding: clamp(22px, 3vw, 34px);
  background: var(--vs-surface);
  border: 1px solid var(--vs-border);
  border-radius: var(--vs-radius);
  --vs-lift: 0.32;
  box-shadow: var(--vs-cast);
  transition: background-color var(--lux-register-fade) ease,
              border-color var(--lux-register-fade) ease;
}

/* --------------------------------------------------------------------------
 * THE SURFACE FIELD — one page-sized image, seen through the hero.
 *
 * This is the ONLY definition of the wash, band, and falloff. Its radial centre
 * is the hero-derived world source above; its linear centre is the inward band
 * anchor derived from that source, direction, elevation, and rake. The hero
 * does not restart a gradient at its own 50%: its background position is the
 * negative of its measured page position, so its placement selects a slice of
 * one canvas. Until P3.4 the three Hoy cards were windows onto the same canvas;
 * the program's columns that replaced them sit on the floor instead.
 *
 * The hero supplies only strength. Night still suppresses the daylight band by
 * setting the shared parent strength `--vs-hero-band` to zero.
 * -------------------------------------------------------------------------- */
body.studium-world .studium-region--hero {
  /* Declared on the WINDOW, not the page: custom-property var() references
     resolve on the element that declares them. Putting this on the parent
     would freeze every inherited answer against the parent's 0px fallback and
     silently restart all four backgrounds at their local top-left corner. */
  --vs-world-field-position:
    calc(-1 * var(--vs-world-surface-x))
    calc(-1 * var(--vs-world-surface-y));
  --vs-world-wash-width: clamp(760px, 72vw, 1180px);
  --vs-world-wash-height: clamp(520px, 62vw, 980px);
  --vs-world-light-field:
    radial-gradient(
      ellipse var(--vs-world-wash-width) var(--vs-world-wash-height)
        at var(--vs-world-source-x) var(--vs-world-source-y),
      color-mix(
        in srgb,
        var(--vs-lit-ink) var(--vs-surface-light-wash),
        transparent
      ) 0%,
      color-mix(
        in srgb,
        var(--vs-lit-ink) calc(var(--vs-surface-light-wash) * 0.45),
        transparent
      ) 46%,
      transparent 80%
    ),
    linear-gradient(var(--vs-world-beam-rake),
      transparent calc(var(--vs-world-band-axis) - 310px),
      color-mix(
        in srgb,
        var(--vs-lit-ink) var(--vs-surface-light-feather),
        transparent
      ) calc(var(--vs-world-band-axis) - 190px),
      color-mix(
        in srgb,
        var(--vs-lit-ink) calc(var(--vs-surface-light-band) * 0.25),
        transparent
      ) calc(var(--vs-world-band-axis) - 105px),
      color-mix(
        in srgb,
        var(--vs-lit-ink) var(--vs-surface-light-band),
        transparent
      ) calc(var(--vs-world-band-axis) - 34px),
      color-mix(
        in srgb,
        var(--vs-lit-ink) var(--vs-surface-light-band),
        transparent
      ) calc(var(--vs-world-band-axis) + 28px),
      color-mix(
        in srgb,
        var(--vs-lit-ink) calc(var(--vs-surface-light-band) * 0.55),
        transparent
      ) calc(var(--vs-world-band-axis) + 82px),
      color-mix(
        in srgb,
        var(--vs-lit-ink) var(--vs-surface-light-feather),
        transparent
      ) calc(var(--vs-world-band-axis) + 165px),
      transparent calc(var(--vs-world-band-axis) + 285px)
    ),
    linear-gradient(var(--vs-world-beam-rake),
      transparent calc(var(--vs-world-band-axis) - 140px),
      color-mix(
        in srgb,
        var(--vs-shadow-ink) calc(var(--vs-surface-light-falloff) * 0.35),
        transparent
      ) calc(var(--vs-world-band-axis) + 190px),
      color-mix(
        in srgb,
        var(--vs-shadow-ink) var(--vs-surface-light-falloff),
        transparent
      ) calc(var(--vs-world-band-axis) + 900px)
    );
  /* The hero's plaster stack, anchored to the same page origin as the light
     so the grain never restarts at the card's corner. */
  --vs-surface-material-field:
    radial-gradient(
      ellipse 88% 150% at 16% 88%,
      color-mix(
        in srgb,
        var(--vs-grain) var(--vs-surface-material),
        transparent
      ) 0%,
      transparent 73%
    ),
    linear-gradient(
      var(--vs-world-beam-rake),
      color-mix(
        in srgb,
        var(--vs-lit-ink) calc(var(--vs-surface-material) * 0.50),
        transparent
      ) 0%,
      transparent 41%,
      color-mix(
        in srgb,
        var(--vs-shadow-ink) calc(var(--vs-surface-material) * 0.65),
        transparent
      ) 100%
    );
}

/* LEVEL 1 — the primary surface on the page. Its brightest region follows the
   active light and crosses over the day, while the fixed page field stays broad
   and environmental. */
/* Slice 3 hands this rule the WHOLE surface contract it used to inherit from
   `.studium-region`. That rule now carries only `position: relative`, so the
   border (not merely its colour), the radius, the inline padding and the
   register cross-fade all have to be declared here or the hero loses them. A
   partial transfer is the quiet failure mode: `border-color` alone leaves a
   borderless hero, because there is no longer a `border-width` to colour. */
body.studium-world .studium-region--hero {
  /* The card's light (P3.4, light 1D): the sun's ink by day, the moon's by
     night, mixed by the moon's share of the sky's light; and the shipped
     strengths scaled by how much light there is. Declared here, where the
     field resolves, so the error card (which carries this class) is lit the
     same way. */
  --vs-lit-ink: color-mix(
    in srgb,
    var(--vs-lunar-ink) calc(var(--card-moon-share) * 100%),
    var(--vs-lit-sun)
  );
  --vs-surface-light-wash: calc(var(--vs-hero-wash) * var(--card-amount));
  --vs-surface-light-band: calc(var(--vs-hero-band) * var(--card-amount));
  /* Zero preserves the approved feather on every cut of this material. */
  --vs-surface-light-feather: 0%;
  --vs-surface-light-falloff: calc(var(--vs-hero-falloff) * var(--card-amount));
  --vs-surface-material: var(--vs-hero-material);
  background-image:
    var(--vs-world-light-field),
    url("../images/studium-mineral.svg"),
    var(--vs-surface-material-field);
  background-size:
    var(--vs-world-width) var(--vs-world-height),
    var(--vs-world-width) var(--vs-world-height),
    var(--vs-world-width) var(--vs-world-height),
    520px 520px,
    auto,
    auto;
  background-position:
    var(--vs-world-field-position),
    var(--vs-world-field-position),
    var(--vs-world-field-position),
    var(--vs-world-field-position),
    0 0,
    0 0;
  background-repeat:
    no-repeat,
    no-repeat,
    no-repeat,
    repeat,
    no-repeat,
    no-repeat;
  background-attachment:
    var(--vs-world-field-attachment),
    var(--vs-world-field-attachment),
    var(--vs-world-field-attachment),
    var(--vs-world-field-attachment),
    scroll,
    scroll;
  background-color: var(--vs-surface-translucent);
  border: 1px solid var(--vs-border);
  border-radius: var(--vs-radius);
  padding-block: clamp(32px, 4vw, 46px);
  padding-inline: clamp(28px, 3.4vw, 48px);
  opacity: 1;
  transform: none;
  filter: none;
  --vs-lift: 1.35;
  box-shadow: var(--vs-cast-edge), var(--vs-cast);
  transition: background-color var(--lux-register-fade) ease,
              border-color var(--lux-register-fade) ease,
              opacity var(--vs-enter) var(--vs-ease-arrival),
              transform var(--vs-enter) var(--vs-ease-arrival),
              filter var(--vs-blur-enter) var(--vs-ease-arrival);
}

/* The hero's own content (Slice 4). No new tokens and no colour literals: every
   value here is one the token audits in tests/test_studium_tokens.py already
   measure on this surface. */
body.studium-world .studium-hero-eyebrow {
  margin: 0 0 12px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  /* Muted rather than faint so the small tracked text clears every translucent
     hero backdrop. Hierarchy is carried by size, case and tracking instead. */
  color: var(--vs-ink-muted);
}

body.studium-world .studium-hero-greeting {
  margin: 0;
  font-family: var(--font-serif);
  /* Deliberately larger than the region headings: this visible greeting is the
     page's emotional centre even though it is prose, not the landmark name. */
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 500;
  line-height: 1.15;
  color: var(--vs-ink);
  text-wrap: balance;
}

body.studium-world .studium-hero-lead {
  margin: 14px 0 0;
  max-width: 48ch;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--vs-ink-muted);
}

body.studium-world .studium-region-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 18px;
  margin-bottom: 10px;
}

body.studium-world .studium-region-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.32rem;
  font-weight: 500;
  color: var(--vs-ink);
}

body.studium-world .studium-region-body {
  max-width: 68ch;
  margin: 0;
  line-height: 1.65;
  color: var(--vs-ink-muted);
}

/* Inert label, not a control: no aria-disabled, nothing focusable, no hover
   state that would suggest it can be pressed. */
body.studium-world .studium-placeholder {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--vs-border);
  border-radius: 999px;
  background: var(--vs-surface-translucent);
  color: var(--vs-ink-faint);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

body.studium-world .studium-region.is-unavailable .studium-placeholder {
  border-color: var(--vs-danger);
  color: var(--vs-danger);
}

/* --------------------------------------------------------------------------
 * The program below the hero (P3.4: P3.2's approved page, Fable 5.1's consult
 * 3 and the owner's note).
 *
 * Three kinds of reading in up to three columns — «Pendientes» (do),
 * «Calendario» (when), «Tus cursos» (where) — and Novedades as a band under
 * them. The owner's note made three amendments, all here: an almost transparent
 * backing behind each column with the background itself unchanged; no bare
 * underlined links (calendar and Novedades rows are whole-row targets,
 * «Pendientes» rows end in a button, course cards are whole-card links); and
 * each column folded to about half height with «Ver más» over a faded foot,
 * complete without JavaScript (the fold is in §8's capability block).
 *
 * The grid answers the closed ladder in §8: three columns above 1160,
 * «Pendientes» and «Calendario» side by side with the courses under them at
 * ≤1160, one column at ≤900. A column with nothing to show is absent, and the
 * template writes how many there are (`data-columns`), never an inline style.
 * -------------------------------------------------------------------------- */
body.studium-world .studium-program {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 4fr);
  gap: 24px clamp(20px, 2.4vw, 32px);
  align-items: start;
}

body.studium-world .studium-program[data-columns="2"] {
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
}

body.studium-world .studium-program[data-columns="1"] {
  grid-template-columns: minmax(0, 1fr);
}

/* The backing: one almost transparent token per register over the floor, which
   stays as it is. The columns take the portals' old staggered arrival with the
   hero (§9 narrows it under reduced motion to the fade alone). */
body.studium-world .studium-program-col {
  min-width: 0;
  display: grid;
  align-content: start;
  padding: 16px 20px 20px;
  background: var(--vs-program-backing);
  border-radius: var(--vs-radius);
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity var(--vs-enter) var(--vs-ease-arrival),
              transform var(--vs-enter) var(--vs-ease-arrival),
              filter var(--vs-blur-enter) var(--vs-ease-arrival);
}

body.studium-world .studium-program-col:nth-child(1) {
  transition-delay: calc(var(--vs-stagger) * 2);
}

body.studium-world .studium-program-col:nth-child(2) {
  transition-delay: calc(var(--vs-stagger) * 3);
}

body.studium-world .studium-program-col:nth-child(3) {
  transition-delay: calc(var(--vs-stagger) * 4);
}

/* The hero, and the columns after it, arrive as one composition while the
   slower atmosphere continues to settle. `@starting-style` keeps the entrance
   on the browser-native CSS path; unsupported browsers render the final, fully
   visible state immediately.

   THE BLUR IS A MASK, NOT A FOCUS PULL. It runs on `--vs-blur-enter` (80ms), a
   third of the travel, so it covers the fastest early frames of the slide and
   has cleared long before the surface settles. Without it the arrival read as a
   bare slab sliding into place; a long blur (360–680ms) read as a slow paint.
   Keep it short. */
@starting-style {
  body.studium-world .studium-region--hero {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
    filter: blur(10px);
  }

  body.studium-world .studium-program-col {
    opacity: 0;
    transform: translateY(34px) scale(0.975);
    filter: blur(9px);
  }
}

/* The kicker IS the column's <h2> (the owner's note: no second heading). The
   house label idiom: uppercase, tracked, 600 — the one size below Studium's
   sentence-case floor. */
body.studium-world .studium-program-kicker {
  margin: 0 0 10px;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--vs-ink);
}

body.studium-world .studium-program-body {
  min-width: 0;
}

body.studium-world .studium-program-empty,
body.studium-world .studium-program-partial {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--vs-ink);
}

body.studium-world .studium-program-partial {
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--vs-ink-muted);
}

body.studium-world .studium-program-unavailable {
  margin: 0 0 8px;
}

body.studium-world .studium-program-unavailable .studium-placeholder {
  border-color: var(--vs-danger);
  color: var(--vs-danger);
}

/* `gap: 14px`: two 44px buttons that wrap must not land edge to edge, and the
   ring reaches 6px past each border box (§9). */
body.studium-world .studium-program-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 16px 0 0;
}

/* «Ver más» shows only inside the fold's `(scripting: enabled)` block: hidden
   by the stylesheet, never by `hidden` plus an author display rule. A foot row
   that holds nothing else takes no room until then. */
body.studium-world .studium-button.studium-program-more {
  display: none;
}

body.studium-world .studium-program-foot.is-fold-only {
  margin: 0;
}

body.studium-world .studium-todos,
body.studium-world .studium-cal-list,
body.studium-world .studium-course-cards,
body.studium-world .studium-news {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* «Pendientes»: the thing, its facts on labelled lines with the value in bold
   (sophia-selene §A10), and one button at the row's end. */
body.studium-world .studium-todo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 16px;
  padding-block: 12px;
  border-block-start: 1px solid var(--vs-border);
}

body.studium-world .studium-todo:first-child {
  padding-block-start: 2px;
  border-block-start: 0;
}

body.studium-world .studium-todo-text {
  min-width: 0;
  display: grid;
  gap: 4px;
}

body.studium-world .studium-todo-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--vs-ink);
  overflow-wrap: anywhere;
}

body.studium-world .studium-todo-role {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--vs-ink-muted);
}

body.studium-world .studium-facts {
  margin: 0;
  display: grid;
  gap: 2px;
}

body.studium-world .studium-fact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 6px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--vs-ink);
}

/* §A10 as the owner changed it in P5.2b, platform-wide: the label bold, the
   value plain; an amount (`.studium-fact-strong`, P5's payment rows) and what
   must not be missed (the status) stay bold. */
body.studium-world .studium-fact dt {
  font-weight: 600;
}

body.studium-world .studium-fact dd {
  margin: 0;
  font-weight: 400;
  color: var(--vs-ink);
  overflow-wrap: anywhere;
}

body.studium-world .studium-fact dd.studium-fact-strong,
body.studium-world .studium-fact dd.studium-status {
  font-weight: 600;
}

/* What must not be missed, on a line of its own under the date it qualifies,
   with a glyph and an ink as well as words. */
body.studium-world .studium-fact .studium-status {
  flex-basis: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.studium-world .studium-fact .studium-status--danger {
  color: var(--vs-danger);
}

body.studium-world .studium-fact .studium-status--waiting {
  color: var(--vs-accent);
}

/* A payment's last days (P5.7, R4): the warning ink, with P5's warning glyph. Days still to go wait in plain muted
   ink, as drawn (P5.8's comparison): only what must not be missed is bold. */
body.studium-world .studium-fact .studium-status--warn {
  color: var(--vs-warn);
}

body.studium-world .studium-fact dd.studium-status--wait {
  font-weight: 400;
  color: var(--vs-ink-muted);
}

body.studium-world .studium-status-glyph {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  fill: currentColor;
}

body.studium-world .studium-todo-button {
  justify-self: end;
}

/* «Calendario»: small-caps day labels, then whole-row targets, the time first. */
body.studium-world .studium-cal-day {
  margin: 14px 0 4px;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--vs-ink);
}

body.studium-world .studium-program-body > .studium-cal-day:first-child {
  margin-top: 2px;
}

/* 4px each side of the divider: two whole-row targets stay 9px apart, past
   SC 2.5.8's 8px and the 6px ring overrun (P3.4, measured by
   tests/test_studium_responsive_browser.py). */
body.studium-world .studium-cal-row,
body.studium-world .studium-news-row {
  padding-block: 4px;
}

body.studium-world .studium-cal-row + .studium-cal-row {
  border-block-start: 1px solid var(--vs-border);
}

body.studium-world .studium-cal-target {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  column-gap: 12px;
  align-items: baseline;
  min-height: 44px;
  padding: 8px 6px;
  border-radius: var(--vs-radius-sm);
  color: var(--vs-ink);
  text-decoration: none;
  transition: background-color 160ms ease-out;
}

body.studium-world .studium-cal-time {
  grid-row: 1 / span 2;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

body.studium-world .studium-cal-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

body.studium-world .studium-cal-meta {
  grid-column: 2;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--vs-ink-muted);
}

/* «Más adelante» reads the date in words above the title. */
body.studium-world .studium-cal-list--later .studium-cal-target {
  grid-template-columns: minmax(0, 1fr);
}

body.studium-world .studium-cal-list--later .studium-cal-time {
  grid-row: auto;
}

body.studium-world .studium-cal-list--later .studium-cal-meta {
  grid-column: 1;
}

/* «Tus cursos»: one card per course, the one surface below the hero, each in
   its domain's tint and the page's one light. One mapping rule per domain feeds
   the card and its door in the header alike, so the two can never drift
   apart. */
body.studium-world .studium-course-cards {
  display: grid;
  gap: 12px;
}

body.studium-world .studium-course-card--alchemia,
body.studium-world .studium-domain--alchemia {
  --portal-accent: var(--vs-alchemia-accent);
  --portal-edge: var(--vs-alchemia-edge);
  --portal-wash: var(--vs-alchemia-wash);
}

body.studium-world .studium-course-card--sophia,
body.studium-world .studium-domain--sophia {
  --portal-accent: var(--vs-sophia-accent);
  --portal-edge: var(--vs-sophia-edge);
  --portal-wash: var(--vs-sophia-wash);
}

/* LEVEL 2 of the surface-light contract (§6), in the portal card's old place:
   the wash is the first layer over the raised surface, which is the stack
   tests/test_studium_tokens.py composites. The raise interpolates the
   registered `--vs-lift`, so the shadow eases on hover on its own timing; the
   `:active` scale is the press. */
body.studium-world .studium-course-card {
  border: 1px solid var(--portal-edge);
  border-radius: var(--vs-radius-sm);
  background: linear-gradient(var(--portal-wash), var(--portal-wash)),
              var(--vs-surface-raised);
  --vs-lift: 0.72;
  box-shadow: var(--vs-cast-edge), var(--vs-cast);
  transition: border-color 180ms ease-out,
              --vs-lift 180ms ease-out,
              transform var(--vs-press) ease-out;
}

body.studium-world .studium-course-card:hover,
body.studium-world .studium-course-card:focus-within {
  border-color: var(--portal-accent);
  --vs-lift: 0.88;
}

body.studium-world .studium-course-card:active {
  transform: scale(0.99);
}

body.studium-world .studium-course-card-link {
  display: grid;
  gap: 2px;
  min-height: 44px;
  padding: 14px 18px 16px;
  border-radius: inherit;
  color: var(--vs-ink);
  text-decoration: none;
}

body.studium-world .studium-course-card-name {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

body.studium-world .studium-course-card-code,
body.studium-world .studium-course-card-role,
body.studium-world .studium-course-card-fact {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--vs-ink-muted);
}

body.studium-world .studium-course-card-fact {
  margin-top: 6px;
}

body.studium-world .studium-fact-value {
  font-weight: 600;
  color: var(--vs-ink);
}

/* Novedades: a band under the columns, two columns of whole-row targets. */
body.studium-world .studium-program-news {
  display: grid;
  gap: 4px;
}

body.studium-world .studium-news {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(20px, 2.4vw, 32px);
}

body.studium-world .studium-news-row {
  border-block-start: 1px solid var(--vs-border);
}

body.studium-world .studium-news-target {
  display: grid;
  gap: 2px;
  min-height: 44px;
  padding: 8px 6px;
  border-radius: var(--vs-radius-sm);
  color: var(--vs-ink);
  text-decoration: none;
  transition: background-color 160ms ease-out;
}

body.studium-world .studium-news-title {
  /* R9 (P9.8, E16): a title's emoji as the bell above draws them. */
  font-family: var(--font-serif), "VS Emoji";
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

body.studium-world .studium-news-meta {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--vs-ink-muted);
}

/* A whole-row target answers the pointer with a faint tint, never an underline
   (the owner's note); the focus ring is the module baseline (§9). */
body.studium-world a.studium-cal-target:hover,
body.studium-world a.studium-news-target:hover {
  background: color-mix(in srgb, var(--vs-ink) 7%, transparent);
}

/* Revealed once on scroll by studium_reveal.js, and only after it proves
   IntersectionObserver exists: with JavaScript off, missing or unsupported, no
   root class exists and the band is simply there. */
body.studium-world.has-studium-reveal .studium-program-news {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(7px);
}

body.studium-world.has-studium-reveal .studium-program-news.is-revealed {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity var(--vs-enter) var(--vs-ease-arrival),
              transform var(--vs-enter) var(--vs-ease-arrival),
              filter var(--vs-blur-enter) var(--vs-ease-arrival);
}

/* The hero's one exception (P3.2's approved page): a class of the person's
   own whose Aula window is open sits at the far right, with no dividing line;
   it moves under the words at ≤900 (§8). */
body.studium-world .studium-region--hero.has-class-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px 40px;
  align-items: center;
}

body.studium-world .studium-hero-class {
  display: grid;
  justify-items: end;
  gap: 10px;
  text-align: end;
}

body.studium-world .studium-hero-class-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--vs-ink);
}

/* THE FOLD (the owner's note; P3.4). A column the server marked foldable (its
   rows surely overflow the fold at every width) shows about two «Pendientes»
   rows or five calendar rows, its foot fading out, and «Ver más». All of it is
   inside `(scripting: enabled)`, so with JavaScript off the query does not
   match: every column is complete and no button shows. The body keeps 6px of
   padding inside its clip, so a focus ring at its edge stays whole, and a body
   holding focus unfolds in CSS, so a row reached by Tab is never invisible even
   if the script never ran. The fold applies at first paint: no layout shift. */
@media (scripting: enabled) {
  body.studium-world .studium-program-col.is-foldable .studium-program-body {
    max-height: var(--vs-program-fold);
    margin: -6px;
    padding: 6px;
    overflow: clip;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 72px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 72px), transparent);
  }

  body.studium-world .studium-program-col.is-foldable.is-expanded .studium-program-body,
  body.studium-world .studium-program-col.is-foldable .studium-program-body:focus-within {
    max-height: none;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  body.studium-world .studium-program-col.is-foldable .studium-program-more {
    display: inline-flex;
  }

  body.studium-world .studium-program-col.is-foldable .studium-program-foot.is-fold-only {
    margin: 16px 0 0;
  }
}

/* The courses' exception to the fold. Their cards run one across above 1160 and
   at 900 and below, and the server folds the column by that stack. From 1160 to
   901 the three-column grid sets them two across (§8), about half as tall: a
   column whose two-across stack fits the fold (`is-fold-one-across`) is whole
   there, with no fade and no «Ver más». The ladder's own divisions, inside the
   fold's capability query, so with JavaScript off nothing here applies. */
@media (scripting: enabled) and (min-width: 901px) and (max-width: 1160px) {
  body.studium-world .studium-program[data-columns="3"] .studium-program-col--cursos.is-fold-one-across .studium-program-body {
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  body.studium-world .studium-program[data-columns="3"] .studium-program-col--cursos.is-fold-one-across .studium-program-more {
    display: none;
  }

  body.studium-world .studium-program[data-columns="3"] .studium-program-col--cursos.is-fold-one-across .studium-program-foot.is-fold-only {
    margin: 0;
  }
}

/* The glyph sprite: out of flow and out of sight; its symbols are drawn by
   `<use>` where they are needed. */
body.studium-world .studium-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* P5's sprite (P5.7), drawn on the home when a payment row needs its warning glyph. */
body.studium-world .pay-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
 * The shared result rows (Slice 5's Hoy groups, now the search page's).
 *
 * The search page's sections reuse the `.studium-hoy-*` row rules; the home's
 * own Hoy groups left with P3.4.
 * -------------------------------------------------------------------------- */
/* The search page's groups keep a shallow cast because their dense result
   structure benefits from separation. */
body.studium-world .studium-hoy-group,
body.studium-world .studium-search-group {
  padding: 18px 20px;
  border: 1px solid var(--vs-border);
  border-radius: var(--vs-radius-sm);
  transition: background-color var(--lux-register-fade) ease,
              border-color var(--lux-register-fade) ease;
}

body.studium-world .studium-search-group {
  background: var(--vs-surface-raised);
  --vs-lift: 0.32;
  box-shadow: var(--vs-cast);
}

body.studium-world .studium-hoy-group h3,
body.studium-world .studium-search-group h3 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--vs-ink);
}

/* The section count stands in its own span after the name, spaced by the gap
   (P3.4: no « · » on Studium pages), and wraps under it on a narrow box. */
body.studium-world .studium-search-group h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.6em;
}

body.studium-world .studium-search-section-count {
  font-weight: 400;
  letter-spacing: 0;
  color: var(--vs-ink-muted);
}

body.studium-world .studium-hoy-list,
body.studium-world .studium-search-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
}

body.studium-world .studium-hoy-row,
body.studium-world .studium-search-row {
  padding: 4px 0;
  border-top: 1px solid var(--vs-border);
}

body.studium-world .studium-hoy-row:first-child,
body.studium-world .studium-search-row:first-child {
  border-top: 0;
}

body.studium-world .studium-hoy-link,
body.studium-world .studium-search-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: 6px;
  font-size: 0.96rem;
  line-height: 1.4;
  font-weight: 600;
  color: var(--vs-ink);
  /* A Lectio title is arbitrary text in a one-third-width column. Without this
     a single long word overflows the track and the PAGE scrolls sideways —
     tests/test_studium_shell_browser.py measures `scrollWidth - clientWidth`. */
  min-width: 0;
  overflow-wrap: anywhere;
}

body.studium-world .studium-hoy-link:hover,
body.studium-world .studium-hoy-link:focus-visible,
body.studium-world .studium-search-link:hover,
body.studium-world .studium-search-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.studium-world .studium-hoy-meta,
body.studium-world .studium-search-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 0 0 8px;
  font-size: 0.84rem;
  color: var(--vs-ink-muted);
}

body.studium-world .studium-hoy-domain,
body.studium-world .studium-search-domain {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.studium-world .studium-hoy-mark,
body.studium-world .studium-search-mark {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--vs-border-strong);
  border-radius: 999px;
  font-family: var(--font-serif);
  font-size: 0.68rem;
  line-height: 1;
  color: var(--vs-accent);
}

body.studium-world .studium-hoy-context,
body.studium-world .studium-search-context {
  color: var(--vs-ink-faint);
}

body.studium-world .studium-hoy-empty,
body.studium-world .studium-search-empty {
  margin: 6px 0 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--vs-ink-muted);
}

/* The row gap was 0, which is invisible until the foot WRAPS, landing two 44px
   targets edge to edge (measured before Slice 7b). Fourteen pixels keeps the
   focus rings separate. */
body.studium-world .studium-hoy-foot,
body.studium-world .studium-search-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin: 6px 0 0;
  padding-top: 6px;
  border-top: 1px solid var(--vs-border);
}

body.studium-world .studium-hoy-seeall,
body.studium-world .studium-search-seeall {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--vs-accent);
}

/* --------------------------------------------------------------------------
 * The search results page (Slice 6, vision §25).
 *
 * A result row is the SAME component as a Hoy row, so the selector lists above
 * were extended rather than duplicated (the file already uses that idiom for
 * `.studium-hoy-link, .studium-hoy-link-static`). The payoff is that the
 * `overflow-wrap: anywhere` fix and the 44px floor live in exactly one place
 * and cannot be corrected on one page while being missed on the other.
 *
 * Genuinely new below: the section grid and the four small meta chips.
 *
 * The page CANNOT use `--vs-alchemia-*` / `--vs-sophia-*`:
 * `test_each_domain_token_is_referenced_exactly_once_in_the_stylesheet` forbids
 * a second reference. Domain identity here is the neutral lettered disc, which
 * is what `.studium-hoy-mark` already is.
 * -------------------------------------------------------------------------- */
body.studium-world .studium-search-groups {
  display: grid;
  gap: 16px;
  margin: 22px 0 0;
  /* `auto-fit`, not Hoy's fixed three tracks: Alchemia contributes three
     sections and Sophia four, so a fixed grid would leave one domain a hole. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  align-items: start;
}

body.studium-world .studium-search-count {
  margin: 0 0 4px;
  font-size: 0.84rem;
  color: var(--vs-ink-muted);
}

body.studium-world .studium-search-note {
  margin: 8px 0 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--vs-ink-muted);
}

body.studium-world .studium-search-tips {
  margin: 10px 0 0;
  padding-inline-start: 20px;
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--vs-ink-muted);
}

/* The three meta chips. Worded, never colour-only: the content type, the
   staff-visibility reason and the match tier each have to survive being read
   aloud or seen without colour. */
body.studium-world .studium-search-type,
body.studium-world .studium-search-status,
body.studium-world .studium-search-tier {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border: 1px solid var(--vs-border);
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--vs-ink-muted);
}

body.studium-world .studium-search-status {
  border-color: var(--vs-border-strong);
  color: var(--vs-ink);
}

body.studium-world .studium-search-tier {
  color: var(--vs-accent);
}

body.studium-world .studium-search-snippet {
  margin: 4px 0 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--vs-ink-muted);
  /* Same reason as the row link: snippet text is arbitrary and lives in a
     narrow grid track, and one long word would scroll the page sideways. */
  min-width: 0;
  overflow-wrap: anywhere;
}

body.studium-world .studium-search-snippet mark {
  padding: 0 2px;
  background: transparent;
  color: var(--vs-ink);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
 * The 404, 403 and 500 pages (P3.3; P3.2's approved prototype, Fable 5.1)
 *
 * app/main/errors.py renders errors/error_page.html: a bare header (the coat of
 * arms and the name, no search and no actions), one card in the hero's surface
 * — it carries `.studium-region--hero`, so the hero's light and casts are its
 * own — and one button. No atmosphere script and no timer, so the hour's light
 * is held still. No new @media block: the card is a capped single column at
 * every width. Focus is the module baseline (§9).
 * -------------------------------------------------------------------------- */
body.studium-world .studium-header--bare {
  justify-content: flex-start;
}

body.studium-world .studium-page--error {
  min-height: calc(100dvh - 220px);
  align-content: center;
}

body.studium-world .studium-error {
  max-width: 720px;
  justify-self: center;
  width: 100%;
  display: grid;
  gap: 6px;
}

body.studium-world .studium-error .studium-hero-greeting {
  font-weight: 500;
}

body.studium-world .studium-error-action {
  margin: 18px 0 0;
}

/* --------------------------------------------------------------------------
 * The buttons (P4.2c: R12, R13).
 *
 * Every page's own main action is the gold-leaf button: the «Pendientes»
 * buttons, the hero's class button and the error pages' «Ir al inicio», whose
 * class is kept. «Ver más», «Ver el calendario completo», the Novedades links
 * and the header's «Buscar» are the quiet button, outlined in the page ink (the
 * owner's answer: gold stays for each page's own actions). The domains' doors
 * keep their domain tint. Colour and the press scale are the only motion.
 * -------------------------------------------------------------------------- */
body.studium-world .studium-button,
body.studium-world .studium-error-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 20px;
  border: 1px solid var(--vs-btn-edge);
  border-radius: 999px;
  background: var(--vs-btn-bg);
  color: var(--vs-btn-ink);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease-out,
              border-color 160ms ease-out,
              transform var(--vs-press) ease-out;
}

body.studium-world .studium-button:hover,
body.studium-world .studium-error-button:hover {
  background: var(--vs-btn-hover);
}

body.studium-world .studium-button:active,
body.studium-world .studium-error-button:active {
  transform: scale(0.97);
}

body.studium-world .studium-button--quiet,
body.studium-world .studium-search-submit {
  background: transparent;
  border-color: var(--vs-ink);
  color: var(--vs-ink);
}

/* The quiet button's hover, and the account button's, which is drawn the
   same: a wash of the page ink over whatever it sits on, darker by day and
   lighter by night (the owner's note after P3.7: the raised surface it used
   to take was the header's own colour, so nothing seemed to change). */
body.studium-world .studium-button--quiet:hover,
body.studium-world .studium-search-submit:hover,
body.studium-world .studium-search-submit:focus-visible,
body.studium-world .studium-header-menu-toggle:hover,
body.studium-world .studium-header-menu-toggle:focus-visible {
  background: color-mix(in srgb, var(--vs-ink) 12%, transparent);
}

/* ==========================================================================
 * 7. Footer (vision §9 region 6)
 * ========================================================================== */
body.studium-world .studium-footer {
  padding-top: 12px;
  border-top: 1px solid var(--vs-border);
}

/* The footer is a SIBLING of <main>, so the document-anchored lower field cannot
   reach it — and a transparent footer below the floor would show the fixed
   MINERAL field as a bright band under the verdigris. It therefore paints the
   floor's own settled colour, which the field has already reached by the time it
   is clipped at <main>'s bottom edge. `--vs-underfield-deep` is `--vs-atmo-max`
   in the light registers, so every ink on it is already inside the contrast
   audit.
 *
 * `:has(.studium-lower)` is the whole point of this rule being separate: only a
 * page with a floor gets a floor. Rendered and rejected first: an unconditional
 * verdigris footer, which on the search page — which shares this shell but has no
 * lower field — read as an unexplained green slab under a mineral page. The
 * alternative was a second home-only body class, and a structural condition that
 * cannot fall out of step with the structure is the better of the two. */
body.studium-world .page:has(.studium-lower) .studium-footer {
  background-color: var(--vs-underfield-deep);
  transition: background-color var(--lux-register-fade) ease;
}

body.studium-world .studium-footer .site-footer-brand,
body.studium-world .studium-footer .site-footer-credit {
  color: var(--vs-ink-faint);
}

/* The emoji family's credit (P9.8, E16): a sentence like the brand's, its licence link inside it. Unlike the brand
   (a signature), it is text a reader may need and its link is a control, so it holds Studium's floors (P9.11's gate):
   the small size Studium uses (0.875rem, above the 15.7px type floor) and a 44px target. The link's inline-flex box
   takes its baseline from its text, so the sentence keeps its line; where the footer runs in one row (Anuncios) the
   legal links beside it are already 44px tall, so the row doesn't grow. */
body.studium-world .studium-footer .site-footer-credit {
  margin: 2px 0 0;
  font-size: 0.875rem;
}

body.studium-world .studium-footer .site-footer-credit a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The two legal links are SHARED markup styled by main.css, where they render
   34px tall with a 2px row gap. Slice 2 measured that and recorded it for "Slice 7,
   which owns the responsive/touch pass" (VS_PLAN §Slice 2) — this is that pass, so
   they are brought up to the floor.
 *
 * Scoped to `body.studium-world`, so no Alchemia or Sophia footer moves: this slice
 * is not the owner of the shared component. Since P3.3 the Studium footer has no
 * `·` separator, so the gap alone spaces the two links: 32px across, about the
 * 35px the separator and its two 16px gaps used to take (measured), and well
 * past two 6px ring reaches; 8px down, the SC 2.5.8 floor, if they wrap.
 * `align-items: center` on the anchors is safe here where an inline-flex box mid-
 * sentence would not be: this is a two-item control row, not prose. */
body.studium-world .studium-footer .site-footer-links {
  gap: 8px 32px;
}

body.studium-world .studium-footer .site-footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ==========================================================================
 * 8. Responsive — the closed viewport ladder
 * ==========================================================================
 *
 *     VIEWPORT DIVISIONS: 1160 | 980 | 900 | 650.   CLOSED.
 *
 * A division is not a number, it is a boundary, and CSS ranges are INCLUSIVE.
 * Each division therefore has exactly two legal spellings — `max-width: D` on the
 * narrow side and `min-width: D + 1` on the wide side. `min-width: 900px` beside
 * `max-width: 900px` is a one-pixel overlap, not a synonym, which is why
 * tests/test_studium_tokens.py gates the operator as well as the value.
 *
 * Adding a fifth division is a module-wide decision, and the gate is what makes
 * that a decision rather than a habit. Studium is a single-column page with no
 * side rail, so every width condition in this file really is about the WINDOW:
 * there is deliberately no container-proxy register here (unlike sophia.css, which
 * needs one). The first rule that reacts to a column's width rather than the
 * viewport's is the change that adds one, with the column named.
 *
 * What each division is for, and what it is NOT for:
 *
 *   1160 — the header's four zones stop sharing one comfortable line: from
 *          here down it runs in two rows, the brand and the domains' doors,
 *          then the search field and the account actions (the owner's note
 *          after P3.7). Just above it the tools group wraps to the second row
 *          by itself while one row is too narrow for it at full width (about
 *          1225px with a mouse, 1260px on touch, more for a long name): a
 *          wrap, not a breakpoint. The measure stops being decided by the
 *          1120px cap.
 *          The program goes two-up: «Pendientes» and «Calendario» side by
 *          side, the courses full width under them, cards two across (P3.4).
 *    980 — THE TABLET BAND. Nothing changes here since the header's two rows
 *          moved to 1160 (until then the search field took its own line at
 *          980). The hero stays FULL WIDTH (vision §30).
 *    900 — the platform-wide mobile-nav / touch boundary, shared with Scholarium,
 *          Rota and main.css. IMMOVABLE. The program becomes one column, the
 *          hero's class line goes below its words, and the light fields become
 *          subtler; nothing about the header changes here, because 1160
 *          already owns it.
 *    650 — phone width: the header becomes a column, a row's button goes below
 *          its facts, Novedades runs in one column, and every wrapped meta row
 *          stacks. The account button is the same disclosure at every width.
 *
 * The bands are written WIDEST FIRST and there is exactly ONE block per division.
 * That is load-bearing for
 * `test_the_disclosure_is_shown_and_the_inline_links_hidden_only_below_650`, which
 * splits this file on the FIRST `@media (max-width: 650px) {`.
 * ========================================================================== */
@media (max-width: 1160px) {
  body.studium-world .studium-header {
    gap: 14px 24px;
  }

  /* Two rows from here down: the brand and the domains' doors, then the tools
     across the whole second row, the search field growing into it. Until the
     owner's note after P3.7 the field took a line of its own at 980, the
     actions a third. */
  body.studium-world .studium-header-tools {
    flex-basis: 100%;
    gap: 14px 24px;
  }

  body.studium-world .studium-search {
    flex: 1 1 0;
  }

  /* Below 1160px the page is padding-limited (1067px at 1160px), so the 1120px cap
     is unreachable and the ceremonial side margin collapses onto the content
     padding. A 1040px measure keeps it visible through the band. Since Slice 8
     the cap is a token the full-bleed track list reads, so this is one
     declaration rather than a second `max-width` the grid would have to agree
     with. */
  body.studium-world .studium-page {
    --vs-measure: 1040px;
  }

  /* The program's two-up (P3.2's approved ladder): «Pendientes» and
     «Calendario» side by side, the courses under them across the full width
     with their cards two across. */
  body.studium-world .studium-program[data-columns="3"] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  body.studium-world .studium-program[data-columns="3"] .studium-program-col--cursos {
    grid-column: 1 / -1;
  }

  body.studium-world .studium-program[data-columns="3"] .studium-course-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  /* Vision §30: on mobile the light fields stay subtler and mostly offscreen,
     so the atmosphere never makes a small screen feel visually heavy.

     `html`-prefixed because the base rules for these two elements are
     (0,2,2) — a bare `body.studium-world …` override here would be (0,2,1) and
     would silently lose to them. */
  html body.studium-world .studium-atmosphere__solar,
  html body.studium-world .studium-atmosphere__lunar {
    width: 150vw;
    height: 90vh;
    margin: -45vh 0 0 -75vw;
  }

  html body.studium-world .studium-atmosphere__solar {
    opacity: calc(var(--lux-solar-alpha) * 0.72);
  }

  html body.studium-world .studium-atmosphere__lunar {
    opacity: calc(var(--lux-lunar-alpha) * 0.72);
  }

  /* The directional cast steps down with the fields. Even the restrained
     desktop geometry would be too emphatic between stacked phone cards. One rule, on
     `.studium-page` rather than on the body — the maxima keep §1 as their single
     desktop source of truth, and every lit surface on both Studium pages is
     inside the page wrapper. */
  body.studium-world .studium-page {
    --vs-cast-reach: 6px;
    --vs-cast-drop: 5px;
    --vs-cast-spread: 12px;
  }

  /* A narrow slab cannot carry a long diagonal band without showing the device
     used to draw it. Keep the directional wash and opposing falloff, but remove
     the band at the existing touch boundary. The source still follows the same
     direction/elevation variables and night is therefore unchanged in logic. */
  body.studium-world .studium-page--home {
    --vs-world-source-travel: 0.46;
    --vs-hero-band: 0%;
  }

  /* One column below the touch boundary: «Pendientes», «Calendario», then the
     courses, each card a destination rather than a compressed widget (vision
     §30). «Más adelante» stays: the fold handles a column's length, and hiding
     it here would lose its rows. The hero's class line moves under the words. */
  body.studium-world .studium-program[data-columns] {
    grid-template-columns: minmax(0, 1fr);
  }

  body.studium-world .studium-program[data-columns="3"] .studium-course-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  body.studium-world .studium-region--hero.has-class-line {
    grid-template-columns: minmax(0, 1fr);
  }

  body.studium-world .studium-hero-class {
    justify-items: start;
    text-align: start;
  }

  /* No Rota coin on this page, so the shared 96px touch-phone footer inset that
     clears it (main.css) would be dead space here. This lived in its own ≤900
     block beside the footer rules until Slice 7b; the ladder allows exactly one
     block per division, so it moved here rather than the band being split. */
  body.app-shell.studium-world .site-footer {
    padding-bottom: 24px;
  }
}

@media (max-width: 650px) {
  /* «Generaciones» on a phone: a row of the account menu instead of the round button (lane RF, stage 1; the owner's
     «B: into the menu», 2026-11-13). Until then (P13.8) the button stayed and its name opened from its right edge,
     and with both doors the bar took two rows. */
  body.studium-world .studium-generaciones {
    display: none;
  }

  body.studium-world .account-control .studium-generaciones-phone {
    display: flex;
  }

  /* Administración on a phone (P4.5): the bar stays one row. */
  body.studium-world .studium-admin {
    display: none;
  }

  body.studium-world .account-control .studium-admin-phone {
    display: flex;
  }

  /* One row on a phone (P6.6; the owner's general note in P6.3): the arms, the doors as their discs, the glass,
     the bell and the account control. The tools group dissolves (`display: contents`) so its pieces sit in the
     header's own row, and the field, once the glass opens it, takes a row of its own under them (the scripting
     block after this band). Without JavaScript the glass never shows and the field keeps that row at once.
     14px row gap: a 6px focus ring never reaches the next row's border box. */
  body.studium-world .studium-header {
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 8px;
    padding-inline: 12px;
  }

  body.studium-world .studium-header-tools {
    display: contents;
  }

  /* The wordmark yields to the doors; clipped, never removed, so the link home keeps its name. */
  body.studium-world .studium-brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  body.studium-world .studium-domains {
    flex: 0 1 auto;
    gap: 8px;
  }

  /* The doors keep their discs; each link keeps its aria-label («Ir a Alchemia»). With a mouse the slot held the
     open pill's room; here it holds the disc's. */
  body.studium-world .studium-domain-name {
    display: none;
  }

  body.studium-world .studium-domain-slot {
    width: 44px;
  }

  body.studium-world .studium-domain-slot::after {
    content: none;
  }

  body.studium-world .studium-header-end {
    margin-inline-start: auto;
  }

  body.studium-world .studium-header-actions {
    flex: none;
    gap: 8px;
  }

  body.studium-world .studium-search {
    order: 99;
    flex: 1 1 100%;
    width: auto;
  }

  /* On a phone the field's own button is the glass (the owner, P6.4); its word stays its name. */
  body.studium-world .studium-search-submit {
    width: 44px;
    padding: 0;
  }

  body.studium-world .studium-search-submit-glyph {
    display: block;
  }

  body.studium-world .studium-search-submit-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  body.studium-world .studium-region-head {
    align-items: flex-start;
  }

  /* A phone's «Pendientes» row puts its button under its facts, and Novedades
     runs in one column. */
  body.studium-world .studium-todo {
    grid-template-columns: minmax(0, 1fr);
  }

  body.studium-world .studium-todo-button {
    justify-self: start;
  }

  body.studium-world .studium-news {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Each fact keeps its own line rather than wrapping mid-item. */
  body.studium-world .studium-hoy-meta,
  body.studium-world .studium-search-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* Stacked, but never flush: two 44px targets touching edge to edge is the
     mis-tap case the 8px minimum-spacing rule exists for. 14px rather than 8px
     since Slice 7b, because the focus ring now reaches 6px past each border box
     and 12px is where two rings meet. */
  body.studium-world .studium-hoy-foot,
  body.studium-world .studium-search-foot {
    flex-direction: column;
    gap: 14px 0;
  }
}

/* ==========================================================================
 * 9. Accessibility baselines: the focus ring, and reduced motion.
 * ==========================================================================
 *
 * Under reduced motion the page shows the same light moving through the same
 * day; only the arrival's slide and blur are dropped (the owner's rule, below).
 */
/* One module-wide baseline, 3px wide at a 3px offset — the platform geometry
   Selene settled on, adopted here in Slice 7b. `--vs-focus` is unchanged and
   still clears 3:1 on every backdrop in all three registers
   (tests/test_studium_tokens.py), so this is geometry only, no new colour.
 *
 * NO `border-radius`. Slice 3's 2px/2px baseline carried `border-radius: 3px`,
 * which squared the two search pills and the menu toggle the moment they took
 * focus and needed a per-control restore. An outline already follows its own
 * element's radius, so the baseline must not impose one — dropping it is the fix
 * Slice 6 identified and deferred (VS_PLAN §Slice 6, "the clean fix is dropping
 * the radius from the baseline").
 *
 * The consequence is geometric and is why the gap fixes above exist: every
 * indicator now reaches 6px past its border box instead of 4px, so no two
 * adjacent targets may sit closer than that. Measured, not read, by
 * tests/test_studium_responsive_browser.py. */
body.studium-world :focus-visible {
  outline: 3px solid var(--vs-focus);
  outline-offset: 3px;
}

/* REDUCED MOTION, AS THE OWNER RULED (P3.2): «we dont have to have reduced
   motion on the studium page (some of my students who prefer reduced motion have
   said in general the platform feels stiff)», then «All but the slide». Students
   who ask for reduced motion keep the moving light, the register cross-fades,
   the fades, the hover, the press scale and the skip link's slide; only the
   arrival's slide and blur go. This departs from vision §7 and Selene §B8 for
   Studium, on the owner's word.
 *
 * So each arriving surface keeps the opacity and colour entries of its own
 * transition list and drops transform and filter, which are the last entries of
 * every one of those lists: `transition-property` alone is restated, so each
 * kept entry keeps its own duration, curve and stagger delay. The hidden reveal
 * state loses its offset and blur and keeps its opacity, so it fades in. The
 * atmosphere's arrival settles by opacity alone: a second `studium-lux-arrival`,
 * which wins under this query because it comes later, so the name the settle
 * helpers look for is unchanged. Each rule here wins by coming later in the
 * file, at the specificity of the rule it narrows. */
@media (prefers-reduced-motion: reduce) {
  body.studium-world .studium-region--hero {
    transition-property: background-color, border-color, opacity;
  }

  body.studium-world .studium-program-col {
    transition-property: opacity;
  }

  body.studium-world.has-studium-reveal .studium-program-news {
    transform: none;
    filter: none;
    transition-property: opacity;
  }

  body.studium-world.has-studium-reveal .studium-program-news.is-revealed {
    transition-property: opacity;
  }

  @keyframes studium-lux-arrival {
    from { opacity: 0.55; }
    to   { opacity: 1; }
  }
}

/* The phone's search behind its glass (P6.6), only where scripting runs, decided by the stylesheet before the
   first paint: a class the script added after load would move the page (studium_delivery_browser measures it).
   Without JavaScript the field keeps its row and the glass never shows. */
@media (scripting: enabled) and (max-width: 650px) {
  body.studium-world .studium-search-toggle {
    display: inline-grid;
  }

  body.studium-world .studium-header:not(.is-searching) .studium-search {
    display: none;
  }
}
