/* ==========================================================================
   components.css — Apex Holding
   PURPOSE: Every shared UI construct in the system, fully styled, each with a
   designed hover AND focus-visible state. These class names are a contract —
   world pages and world stylesheets use THESE names. Do not invent parallels.

   INVENTORY
     .btn .btn--primary .btn--ghost .btn--lg
     .icon-btn
     .eyebrow
     .section__head                (structure lives in base.css)
     .card .card__media .card__body .card__title .card__meta .card--tilt
     .stat .stat__value .stat__label
     .chip .chip--active
     .accordion .accordion__item .accordion__trigger .accordion__panel
     .panel .panel__inner .panel__head .panel__close
     .scrim
     .field .field__label .field__input .field__hint .field__error
     .world-card .world-card__title .world-card__essence .world-card--active
     .guide-card .route-card .lightbox
     .media-frame                  (the styled "photo pending" slot)

   RULES OBSERVED THROUGHOUT
     - Only --w-* semantic tokens. No raw palette hex anywhere in this file.
     - No !important. No selector deeper than three levels.
     - Hover-revealed information is ALSO revealed on :focus-within.
     - Interactive targets are never smaller than 44px.
     - Transitions animate transform / opacity / colour only.

   Loaded THIRD, after base.css.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. BUTTONS
   One skeleton, three skins. The signature interaction is a hairline accent
   underline that draws left-to-right on hover/focus while the button lifts
   2px — transform + transform only, so it stays cheap.
   -------------------------------------------------------------------------- */

.btn {
  /* Per-skin knobs. Variants retune these rather than redeclaring the box. */
  --btn-bg: transparent;
  --btn-fg: var(--w-text);
  --btn-line: var(--w-line);
  --btn-rule: var(--w-accent);

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 2.75rem;
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--btn-line);
  border-radius: var(--radius-sm);
  background-color: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-utility);
  font-size: var(--step--1);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform var(--dur-micro) var(--ease-out-soft),
    background-color var(--dur-micro) var(--ease-out-soft),
    border-color var(--dur-micro) var(--ease-out-soft),
    color var(--dur-micro) var(--ease-out-soft),
    box-shadow var(--dur-micro) var(--ease-out-soft);
}

/* The drawing rule. Sits inside the padding box, hidden until engaged. */
.btn::after {
  content: "";
  position: absolute;
  inset-inline: var(--space-5);
  bottom: calc(var(--space-2) + 1px);
  height: 1px;
  background-color: var(--btn-rule);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-micro) var(--ease-out-soft);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  border-color: var(--w-accent);
}

.btn:hover::after,
.btn:focus-visible::after {
  transform: scaleX(1);
}

.btn:active {
  transform: translateY(0);
  transition-duration: 80ms;
}

/* --- Primary: filled in the world accent, text drops to the ground colour.
   The rule inverts so it stays visible against the fill. --------------- */
.btn--primary {
  --btn-bg: var(--w-accent);
  --btn-fg: var(--w-base);
  --btn-line: var(--w-accent);
  --btn-rule: var(--w-base);
  font-weight: 400;
}

.btn--primary:hover,
.btn--primary:focus-visible {
  --btn-bg: var(--w-accent-soft);
  --btn-line: var(--w-accent-soft);
  box-shadow: 0 8px 24px -10px var(--w-glow);
}

/* --- Ghost: hairline only, fills faintly on engagement. ---------------- */
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--w-text);
  --btn-line: var(--w-line);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  --btn-bg: color-mix(in srgb, var(--w-accent) 10%, transparent);
  --btn-fg: var(--w-accent-soft);
}

/* --- Large: hero-scale call to action. --------------------------------- */
.btn--lg {
  min-height: 3.25rem;
  padding: var(--space-4) var(--space-8);
  font-size: var(--step-0);
  letter-spacing: var(--track-wide);
}

.btn--lg::after {
  inset-inline: var(--space-7);
  bottom: var(--space-3);
}

/* Full-width on demand, for stacked mobile CTAs and panel footers. */
.btn--block {
  width: 100%;
}


/* --------------------------------------------------------------------------
   2. ICON BUTTON
   Square, icon-only, always ≥44px of tap target even when the glyph is 20px.
   Every instance MUST carry an accessible name (sr-only span or aria-label).
   -------------------------------------------------------------------------- */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  padding: var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background-color: transparent;
  color: var(--w-text);
  transition:
    background-color var(--dur-micro) var(--ease-out-soft),
    border-color var(--dur-micro) var(--ease-out-soft),
    color var(--dur-micro) var(--ease-out-soft),
    transform var(--dur-micro) var(--ease-out-soft);
}

.icon-btn > svg {
  inline-size: 1.25rem;
  block-size: 1.25rem;
  pointer-events: none;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  background-color: color-mix(in srgb, var(--w-accent) 12%, transparent);
  border-color: var(--w-line);
  color: var(--w-accent-soft);
}

.icon-btn:active {
  transform: scale(0.94);
}

/* Open-dialog state, synced by panels.js / world-switcher.js. */
.icon-btn[aria-expanded="true"] {
  background-color: color-mix(in srgb, var(--w-accent) 18%, transparent);
  border-color: var(--w-accent);
  color: var(--w-accent-soft);
}


/* --------------------------------------------------------------------------
   3. EYEBROW + SECTION HEAD
   .section and .section__inner are structural and live in base.css. This is
   the labelled heading block that sits at the top of a section.
   -------------------------------------------------------------------------- */

.eyebrow {
  display: block;
  font-family: var(--font-utility);
  font-size: var(--step--1);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: var(--track-widest);
  text-transform: uppercase;
  color: var(--w-accent-soft);
}

/* Optional leading tick, purely decorative. */
.eyebrow--ruled {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.eyebrow--ruled::before {
  content: "";
  inline-size: var(--space-6);
  block-size: 1px;
  background-color: var(--w-accent);
  flex: none;
}

.section__head {
  max-width: var(--maxw-prose);
  margin-block-end: var(--space-8);
}

.section__head > * + * {
  margin-block-start: var(--space-4);
}

.section__head p {
  color: var(--w-text-dim);
  font-size: var(--step-1);
  line-height: var(--lh-body);
}

/* Centred variant for portal-scale statements. */
.section__head--center {
  margin-inline: auto;
  text-align: center;
}

.section__head--center .eyebrow--ruled {
  justify-content: center;
}


/* --------------------------------------------------------------------------
   4. CARD
   The workhorse surface. .card--tilt adds the 3D-tilt affordance; the tilt
   TRANSFORM itself is owned by motion.css via [data-tilt] so the two never
   fight — this file supplies the surface, the glow, and the lift.
   -------------------------------------------------------------------------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--w-line);
  border-radius: var(--radius-md);
  background-color: var(--w-surface);
  color: var(--w-text);
  text-decoration: none;
  transition:
    background-color var(--dur-micro) var(--ease-out-soft),
    border-color var(--dur-micro) var(--ease-out-soft),
    box-shadow var(--dur-reveal) var(--ease-out-soft),
    transform var(--dur-micro) var(--ease-out-soft);
}

.card:hover,
.card:focus-within {
  background-color: var(--w-surface-2);
  border-color: color-mix(in srgb, var(--w-accent) 45%, transparent);
  box-shadow: var(--shadow-2);
}

/* A card that is itself a link lifts; a card containing links does not, so
   the lift always tracks the thing actually being activated. */
a.card:hover,
a.card:focus-visible {
  transform: translateY(-2px);
}

.card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--card-media-ratio, 3 / 2);
  background-color: var(--w-base-2);
}

.card__media > img,
.card__media > svg {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  flex: 1;
}

.card__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: var(--lh-snug);
  letter-spacing: var(--track-tight);
  color: var(--w-text);
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  font-family: var(--font-utility);
  font-size: var(--step--1);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--w-text-dim);
}

.card__body p {
  color: var(--w-text-dim);
  margin: 0;
}

/* Stretch a nested link over the whole card so the entire surface is the
   target, while the link text stays the accessible name. */
.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* --- Tilt surface: adds the coloured bloom the pointer tilt reads against. */
.card--tilt {
  transform-style: preserve-3d;
}

.card--tilt:hover,
.card--tilt:focus-within {
  box-shadow: var(--shadow-3), 0 0 40px -12px var(--w-glow);
}


/* --------------------------------------------------------------------------
   5. MEDIA FRAME
   The photographic slot. No binary images exist, so every photo position
   renders as this: a tasteful ruled frame carrying the placeholder tag. The
   aspect-ratio box guarantees zero layout shift when real art lands.
   -------------------------------------------------------------------------- */

.media-frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: var(--frame-ratio, 3 / 2);
  padding: var(--space-6);
  overflow: hidden;
  border: 1px dashed color-mix(in srgb, var(--w-accent-soft) 40%, transparent);
  border-radius: var(--radius-md);
  background-color: var(--w-base-2);
  background-image:
    repeating-linear-gradient(
      135deg,
      transparent 0 12px,
      color-mix(in srgb, var(--w-accent) 5%, transparent) 12px 13px
    );
  text-align: center;
}

.media-frame > img,
.media-frame > svg {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}


/* --------------------------------------------------------------------------
   6. STAT
   Figure-first. .stat__value is display-face and large; the count-up motion
   is driven by [data-countup] in motion.css.
   -------------------------------------------------------------------------- */

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-block: var(--space-4);
  border-block-start: 1px solid var(--w-line);
}

.stat__value {
  font-family: var(--font-display);
  font-size: var(--step-4);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  color: var(--w-accent);
  font-variant-numeric: tabular-nums;
}

.stat__label {
  font-family: var(--font-utility);
  font-size: var(--step--1);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--w-text-dim);
}


/* --------------------------------------------------------------------------
   7. CHIP
   Filter / tag control. Pill-shaped, 44px tap target maintained by padding.
   -------------------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-5);
  border: 1px solid var(--w-line);
  border-radius: var(--radius-pill);
  background-color: transparent;
  color: var(--w-text-dim);
  font-family: var(--font-utility);
  font-size: var(--step--1);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--dur-micro) var(--ease-out-soft),
    border-color var(--dur-micro) var(--ease-out-soft),
    color var(--dur-micro) var(--ease-out-soft);
}

.chip:hover,
.chip:focus-visible {
  border-color: var(--w-accent);
  color: var(--w-text);
}

.chip--active,
.chip[aria-pressed="true"] {
  background-color: var(--w-accent);
  border-color: var(--w-accent);
  color: var(--w-base);
}

.chip--active:hover,
.chip[aria-pressed="true"]:hover {
  background-color: var(--w-accent-soft);
  border-color: var(--w-accent-soft);
}


/* --------------------------------------------------------------------------
   8. ACCORDION
   The panel opens by animating grid-template-rows from 0fr to 1fr.

   NOTE ON THE TRANSFORM-ONLY RULE: the performance contract forbids animated
   width/height on SCROLL paths, because those run every frame against the
   scroll position. This is a discrete, user-initiated, one-off toggle that is
   never tied to scroll, and 0fr→1fr is the only technique that animates to
   intrinsic content height without hard-coding a max-height guess. It is the
   correct tool here and is explicitly permitted.
   -------------------------------------------------------------------------- */

.accordion {
  border-block-start: 1px solid var(--w-line);
}

.accordion__item {
  border-block-end: 1px solid var(--w-line);
}

.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  inline-size: 100%;
  min-height: 3.5rem;
  padding: var(--space-5) 0;
  background: none;
  color: var(--w-text);
  font-family: var(--font-body);
  font-size: var(--step-1);
  line-height: var(--lh-snug);
  text-align: start;
  transition: color var(--dur-micro) var(--ease-out-soft);
}

.accordion__trigger:hover,
.accordion__trigger:focus-visible {
  color: var(--w-accent-soft);
}

/* Plus / minus indicator, built from two rules so it needs no icon asset. */
.accordion__trigger::after {
  content: "";
  flex: none;
  inline-size: 0.875rem;
  block-size: 0.875rem;
  background-color: currentColor;
  transform: rotate(0deg);
  transition: transform var(--dur-reveal) var(--ease-out-soft);
  clip-path: polygon(
    45% 0, 55% 0, 55% 45%, 100% 45%,
    100% 55%, 55% 55%, 55% 100%, 45% 100%,
    45% 55%, 0 55%, 0 45%, 45% 45%
  );
}

.accordion__trigger[aria-expanded="true"]::after {
  transform: rotate(135deg);
}

.accordion__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-reveal) var(--ease-out-soft);
}

.accordion__trigger[aria-expanded="true"] + .accordion__panel {
  grid-template-rows: 1fr;
}

/* The single child of the panel is the clipping wrapper. min-height:0 is what
   makes the fr animation actually collapse. */
.accordion__panel > * {
  overflow: hidden;
  min-height: 0;
}

.accordion__panel p {
  padding-block-end: var(--space-5);
  color: var(--w-text-dim);
}

/* JS-OFF: with no script to toggle aria-expanded, every panel stands open so
   the content is never unreachable. */
html:not(.js) .accordion__panel {
  grid-template-rows: 1fr;
}

html:not(.js) .accordion__trigger::after {
  display: none;
}


/* --------------------------------------------------------------------------
   9. PANEL + SCRIM
   Slide-in side panel. panels.js wires open/close, focus trap, scroll lock.

   JS CONTRACT — panels.js must:
     1. remove the [hidden] attribute,
     2. add .is-open on the NEXT animation frame (so the transform animates),
     3. on close, remove .is-open, then re-add [hidden] after --dur-reveal.

   JS-OFF: the panel is NOT hidden. It renders as an ordinary content block at
   the end of <main>, reachable by the same #id anchor. See the block below.
   -------------------------------------------------------------------------- */

.panel {
  position: fixed;
  inset-block: 0;
  z-index: var(--z-panel);
  display: flex;
  flex-direction: column;
  inline-size: min(26.25rem, calc(100vw - var(--space-6)));
  background-color: var(--w-base-2);
  box-shadow: var(--shadow-3);
  transition: transform var(--dur-reveal) var(--ease-in-out-cinema);
}

.panel[data-panel-side="right"] {
  inset-inline-end: 0;
  border-inline-start: 1px solid var(--w-line);
  transform: translateX(100%);
}

.panel[data-panel-side="left"] {
  inset-inline-start: 0;
  border-inline-end: 1px solid var(--w-line);
  transform: translateX(-100%);
}

.panel.is-open {
  transform: translateX(0);
}

.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6);
  border-block-end: 1px solid var(--w-line);
}

.panel__head h2 {
  font-size: var(--step-2);
}

.panel__inner {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6);
}

.panel__inner > * + * {
  margin-block-start: var(--space-5);
}

.panel__close {
  flex: none;
  /* Inherits the full .icon-btn treatment when both classes are applied;
     these are the panel-specific adjustments only. */
  margin: calc(var(--space-2) * -1);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-scrim);
  background-color: color-mix(in srgb, var(--w-base) 72%, transparent);
  backdrop-filter: blur(var(--glass-blur));
  opacity: 0;
  transition: opacity var(--dur-reveal) var(--ease-out-soft);
}

.scrim.is-open {
  opacity: 1;
}

/* --- JS-OFF fallbacks ------------------------------------------------- */

html:not(.js) .scrim {
  display: none;
}

/* Author styles always beat the UA's [hidden] { display: none }, so this one
   rule is enough to make the panel a normal section of the page — no focus
   trap, no overlay, nothing to escape from. */
html:not(.js) .panel {
  position: static;
  display: block;
  inline-size: 100%;
  margin-block-start: var(--space-9);
  border: 0;
  border-block-start: 1px solid var(--w-line);
  box-shadow: none;
  transform: none;
}

html:not(.js) .panel__close {
  display: none;
}


/* --------------------------------------------------------------------------
   10. FIELDS
   Accessible form controls with explicit hint and error slots. Error state is
   driven by aria-invalid on the input — one source of truth, and the visual
   never disagrees with what a screen reader is told.
   -------------------------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field__label {
  font-family: var(--font-utility);
  font-size: var(--step--1);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--w-text-dim);
}

/* Required marker, added in markup as <span class="field__req">*</span>. */
.field__req {
  color: var(--w-accent);
  padding-inline-start: var(--space-1);
}

.field__input {
  inline-size: 100%;
  min-height: 2.75rem;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--w-line);
  border-radius: var(--radius-sm);
  background-color: var(--w-surface);
  color: var(--w-text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  transition:
    border-color var(--dur-micro) var(--ease-out-soft),
    background-color var(--dur-micro) var(--ease-out-soft);
}

.field__input:hover {
  border-color: color-mix(in srgb, var(--w-accent) 45%, transparent);
}

.field__input:focus-visible {
  border-color: var(--w-accent);
  background-color: var(--w-surface-2);
}

/* Select needs its own arrow once appearance is stripped. */
select.field__input {
  -webkit-appearance: none;
  appearance: none;
  padding-inline-end: var(--space-8);
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - var(--space-5)) center,
    calc(100% - var(--space-4)) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.field__hint {
  font-size: var(--step--1);
  line-height: var(--lh-body);
  color: var(--w-text-dim);
}

.field__error {
  display: none;
  font-family: var(--font-utility);
  font-size: var(--step--1);
  line-height: var(--lh-body);
  color: var(--w-accent-soft);
}

/* Show the error slot only when the control is actually flagged invalid. */
.field:has([aria-invalid="true"]) .field__error {
  display: block;
}

.field__input[aria-invalid="true"] {
  border-color: var(--w-accent-soft);
  background-color: color-mix(in srgb, var(--w-accent) 8%, transparent);
}


/* --------------------------------------------------------------------------
   11. WORLD CARD
   The in-page representation of a world (portal grid, portfolio index). The
   world SWITCHER tiles are a different construct and live in chrome.css.
   -------------------------------------------------------------------------- */

.world-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-3);
  min-height: 18rem;
  padding: var(--space-6);
  overflow: hidden;
  border: 1px solid var(--w-line);
  border-radius: var(--radius-md);
  background-color: var(--w-surface);
  text-decoration: none;
  isolation: isolate;
  transition:
    transform var(--dur-micro) var(--ease-out-soft),
    border-color var(--dur-micro) var(--ease-out-soft),
    box-shadow var(--dur-reveal) var(--ease-out-soft);
}

/* Accent wash that rises from the foot of the card on engagement. */
.world-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(
    to top,
    color-mix(in srgb, var(--w-accent) 26%, transparent),
    transparent 62%
  );
  opacity: 0;
  transition: opacity var(--dur-reveal) var(--ease-out-soft);
}

.world-card:hover,
.world-card:focus-within {
  border-color: var(--w-accent);
  box-shadow: var(--shadow-2), 0 0 40px -16px var(--w-glow);
}

.world-card:hover::before,
.world-card:focus-within::before {
  opacity: 1;
}

.world-card:hover,
.world-card:focus-visible {
  transform: translateY(-3px);
}

.world-card__title {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: var(--lh-snug);
  letter-spacing: var(--track-tight);
  color: var(--w-text);
}

/* The one-line essence of a world. Dim at rest, resolves to full text colour
   on hover AND focus-within, so pointer users and keyboard users see the
   same thing. Opacity only — nothing reflows. */
.world-card__essence {
  font-family: var(--font-utility);
  font-size: var(--step--1);
  line-height: var(--lh-body);
  letter-spacing: var(--track-wide);
  color: var(--w-text-dim);
  opacity: 0.75;
  transition:
    opacity var(--dur-micro) var(--ease-out-soft),
    color var(--dur-micro) var(--ease-out-soft);
}

.world-card:hover .world-card__essence,
.world-card:focus-within .world-card__essence {
  opacity: 1;
  color: var(--w-text);
}

/* The world you are currently standing in. */
.world-card--active {
  border-color: var(--w-accent);
}

.world-card--active::before {
  opacity: 0.6;
}


/* --------------------------------------------------------------------------
   12. GUIDE CARD — support centre article links
   -------------------------------------------------------------------------- */

.guide-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  border: 1px solid var(--w-line);
  border-radius: var(--radius-md);
  background-color: var(--w-surface);
  text-decoration: none;
  transition:
    background-color var(--dur-micro) var(--ease-out-soft),
    border-color var(--dur-micro) var(--ease-out-soft),
    transform var(--dur-micro) var(--ease-out-soft);
}

.guide-card:hover,
.guide-card:focus-within {
  background-color: var(--w-surface-2);
  border-color: var(--w-accent);
  transform: translateY(-2px);
}

.guide-card__title {
  font-family: var(--font-body);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: var(--lh-snug);
  color: var(--w-text);
}

.guide-card__meta {
  font-family: var(--font-utility);
  font-size: var(--step--1);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--w-text-dim);
}

/* Trailing arrow that steps forward on engagement. */
.guide-card::after {
  content: "→";
  align-self: flex-start;
  margin-block-start: auto;
  padding-block-start: var(--space-3);
  color: var(--w-accent-soft);
  font-family: var(--font-utility);
  transform: translateX(0);
  transition: transform var(--dur-micro) var(--ease-out-soft);
}

.guide-card:hover::after,
.guide-card:focus-within::after {
  transform: translateX(6px);
}


/* --------------------------------------------------------------------------
   13. ROUTE CARD — directions / access panels (Faraya, Zaarour)
   A definition-list surface: how you get there, how long it takes.
   -------------------------------------------------------------------------- */

.route-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  border: 1px solid var(--w-line);
  border-inline-start: 2px solid var(--w-accent);
  border-radius: var(--radius-sm);
  background-color: var(--w-surface);
  transition:
    background-color var(--dur-micro) var(--ease-out-soft),
    border-color var(--dur-micro) var(--ease-out-soft);
}

.route-card:hover,
.route-card:focus-within {
  background-color: var(--w-surface-2);
}

.route-card__title {
  font-family: var(--font-utility);
  font-size: var(--step--1);
  letter-spacing: var(--track-widest);
  text-transform: uppercase;
  color: var(--w-accent-soft);
}

.route-card__list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3) var(--space-5);
  margin: 0;
  font-size: var(--step--1);
}

.route-card__list dt {
  font-family: var(--font-utility);
  font-weight: 400;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--w-text-dim);
}

.route-card__list dd {
  color: var(--w-text);
}


/* --------------------------------------------------------------------------
   14. LIGHTBOX
   Full-viewport media viewer. Same open/close protocol as .panel: JS removes
   [hidden], then adds .is-open on the next frame.
   -------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-switcher);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--space-4);
  padding: var(--space-5);
  background-color: color-mix(in srgb, var(--w-base) 94%, transparent);
  backdrop-filter: blur(var(--glass-blur));
  opacity: 0;
  transition: opacity var(--dur-reveal) var(--ease-out-soft);
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.lightbox__caption {
  font-family: var(--font-utility);
  font-size: var(--step--1);
  letter-spacing: var(--track-wide);
  color: var(--w-text-dim);
}

.lightbox__stage {
  display: grid;
  place-items: center;
  min-height: 0;
}

.lightbox__stage > img,
.lightbox__stage > svg {
  max-inline-size: 100%;
  max-block-size: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

html:not(.js) .lightbox {
  display: none;
}


/* --------------------------------------------------------------------------
   15. NARROW VIEWPORTS
   Panels go full-bleed, cards tighten, large buttons stop shouting.
   -------------------------------------------------------------------------- */

@media (max-width: 40em) {
  .panel {
    inline-size: 100vw;
  }

  .card__body,
  .guide-card,
  .route-card,
  .world-card {
    padding: var(--space-5);
  }

  .btn--lg {
    inline-size: 100%;
    padding-inline: var(--space-5);
  }

  .route-card__list {
    grid-template-columns: 1fr;
    gap: var(--space-1) 0;
  }

  .route-card__list dd {
    margin-block-end: var(--space-3);
  }
}
