/* Flemmings — introduction screen.
 *
 * ADDITIVE BY DESIGN. This file declares NO new colours. Every value is either
 * an existing --fb-* token from styles.css or a geometry/spacing rule. The
 * reason is concrete and recent: a second palette and a second icon language
 * shipped once already and only a look-pass caught it, because each surface
 * looked fine alone.
 *
 * Layer: --fb-intro-z is above everything in styles.css. The highest existing
 * layer is the results card at z-index 30; the intro must beat it AND the
 * dossier map, so 40 is the floor, not a preference.
 */

.fb-intro {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: clamp(16px, 4vh, 44px) clamp(18px, 5vw, 64px);
  /* The 3D diorama is the whole point, so the card must not cover it. Ink is
     kept legible by the card's own case rather than by dimming the scene: a
     scrim over the diorama would flatten exactly the relief the game is about. */
  background: transparent;
  font-family: ui-monospace, monospace;
  color: var(--fb-text);
}

/* The diorama fills the viewport behind the card. It is a real second WebGL
   surface, which is why it is disposed hard on dismissal (see intro.js
   _teardownScene) rather than merely hidden. */
.fb-intro-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

/* One hairline case at the top so the card never floats over a bright sky with
   no edge. Uses the existing edge token, not a new grey. */
.fb-intro-card {
  position: relative;
  z-index: 1;
  max-width: min(560px, 92vw);
  padding: 18px 20px 16px;
  background: rgba(12, 16, 22, .86);
  border: 1px solid var(--fb-edge);
  border-radius: 7px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

/* Dossier masthead: the same 9-10px / letter-spaced caps the bottom bar and the
   map already use, so this reads as the same establishment's stationery. */
.fb-intro-est {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 9px/1 ui-monospace, monospace;
  letter-spacing: 1.1px;
  color: var(--fb-dim);
  margin-bottom: 10px;
}

.fb-intro-est-rule {
  flex: 1 1 auto;
  height: 1px;
  background: var(--fb-metal-hi);
}

.fb-intro-title {
  margin: 0 0 6px;
  font: 700 clamp(26px, 4.4vw, 40px)/1.05 ui-monospace, monospace;
  letter-spacing: 4px;
  color: var(--fb-text);
}

.fb-intro-sub {
  margin: 0 0 14px;
  font: 400 12.5px/1.55 ui-monospace, monospace;
  color: var(--fb-dim);
  max-width: 46ch;
}

/* The one strong accent in this game is the green EXIT sign, and it stays that
   way: the intro's primary action uses --fb-accent (amber), which is the
   dossier's own selection colour, so no new hue enters the system and the
   exit keeps the only saturated green on screen. */
.fb-intro-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fb-intro-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 6px;
  border: 1px solid var(--fb-edge);
  background: var(--fb-metal);
  color: var(--fb-text);
  font: 700 11px/1 ui-monospace, monospace;
  letter-spacing: 1px;
  cursor: pointer;
}

.fb-intro-btn:hover { background: var(--fb-metal-hi); }

.fb-intro-btn:focus-visible {
  outline: 2px solid var(--fb-accent);
  outline-offset: 2px;
}

.fb-intro-btn--primary {
  border-color: var(--fb-accent);
  color: var(--fb-accent);
}

.fb-intro-btn--ghost {
  background: transparent;
  color: var(--fb-dim);
}

/* Same contract as the bottom-bar icons: 32-unit viewBox, stroke 2.2, butt
   caps, miter joins, 4px of internal margin. Scaling a 2.2 stroke below 18px
   is what made three of the skill icons unreadable before the unification. */
.fb-intro-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: butt;
  stroke-linejoin: miter;
}

.fb-intro-hint {
  margin-top: 12px;
  font: 400 10px/1.4 ui-monospace, monospace;
  letter-spacing: .4px;
  color: var(--fb-dim);
}

.fb-intro-hint kbd {
  font: 700 10px/1 ui-monospace, monospace;
  color: var(--fb-text);
  border: 1px solid var(--fb-metal-hi);
  border-radius: 3px;
  padding: 2px 4px;
}

/* Screen-reader-only text. Not display:none, which would remove it from the
   accessibility tree and defeat the point. */
.fb-intro-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  /* The diorama's only motion is the crew walking; intro.js reads this media
     query and parks them rather than letting a vestibular trigger run. */
  .fb-intro-card { animation: none; }
}
