/* ==========================================================================
   STORY-FLIGHTPATH.CSS // Section 1.1 My Story Flight Path Architecture
   Dual-Hemisphere Orbital Telemetry + Bayer-Dithered Globe + Plate Stack
   ========================================================================== */

#storyFlightpath,
#fpDialog {
  --void: #030407;
  --void-surface: #0a0c12;
  --fg: #f5f5f7;
  --fg-2: #c9c9cf;
  --muted: #8b8b94;
  --dim: #5b5b63;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.22);
  --threat: #ff4d5a;
  --cyber: #5af07a;
  --gov: #f0c050;
  --ai: #c026d3;
  --warm: #ffb86c;
  --font-story: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Space Grotesque", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-baybayin: "Noto Sans Tagalog", serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ensure smooth sticky pinning without clipping */
html, body {
  overflow-x: clip;
}

/* ---------- Split-pin Flight Path Grid ---------- */
.fp-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: clamp(28px, 4.5vw, 80px);
  padding: 0;
  position: relative;
  width: 100%;
}

/* ---------- Left Text Column ---------- */
.fp-text {
  position: relative;
  padding: 12vh 0 64vh 48px;
}

.fp-p {
  font: 400 clamp(1.15rem, 0.95rem + 0.8vw, 1.62rem)/1.72 var(--font-story);
  color: var(--fg-2);
  max-width: 38ch;
  text-wrap: pretty;
}

.fp-p + .fp-p {
  margin-top: 2em;
}

.fp-anchor {
  position: relative;
  color: inherit;
  background: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: color .45s ease, background-size .8s var(--ease), text-shadow .45s ease;
  cursor: pointer;
}

.fp-anchor::before {
  content: attr(data-idx);
  font: 700 .44em var(--font-mono);
  letter-spacing: .04em;
  vertical-align: super;
  display: inline-block;
  line-height: 1;
  margin-right: 2.5px;
  padding: 1px 3.5px 0 3px;
  border-radius: 2px;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: all .35s ease;
}

.fp-anchor:hover::before,
.fp-anchor.is-active::before {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
}

.fp-anchor.is-past {
  color: var(--fg);
  background-size: 100% 1px;
}

.fp-anchor.is-past::before {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.fp-anchor.is-active {
  color: #fff;
  background-size: 100% 1px;
  text-shadow: 0 0 24px rgba(255, 255, 255, .45);
}

.fp-anchor.is-threat.is-active {
  color: #ffd9dc;
  text-shadow: 0 0 24px rgba(255, 77, 90, .6);
}

.fp-anchor.is-threat.is-active::before {
  color: #ffd9dc;
  background: rgba(255, 77, 90, 0.22);
  border-color: var(--threat);
  box-shadow: 0 0 8px rgba(255, 77, 90, 0.45);
}

.fp-anchor.is-warm.is-active {
  color: #ffe6cc;
  text-shadow: 0 0 24px rgba(255, 184, 108, .6);
}

.fp-anchor.is-warm.is-active::before {
  color: #ffe6cc;
  background: rgba(255, 184, 108, 0.22);
  border-color: var(--warm);
  box-shadow: 0 0 8px rgba(255, 184, 108, 0.45);
}

/* Idle Visual Cue on Anchor 01 */
@keyframes anchorIdleGlow {
  0%, 100% {
    text-shadow: 0 0 0px transparent;
    background-size: 0% 1px;
  }
  50% {
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.8), 0 0 24px rgba(0, 240, 255, 0.4);
    background-size: 100% 1px;
  }
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0px transparent;
  }
  50% {
    transform: scale(1.16);
    border-color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  }
}

.fp-anchor.is-idle-pulse {
  animation: anchorIdleGlow 2.4s ease-in-out infinite;
}

.fp-anchor.is-idle-pulse::before {
  animation: badgePulse 2.4s ease-in-out infinite;
}

/* Idle Prompt Chip in Stage */
.fp-idle-hint {
  position: absolute;
  right: 28px;
  bottom: 20px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 600 9px var(--font-mono);
  letter-spacing: 0.14em;
  color: var(--muted);
  padding: 5px 11px;
  background: rgba(8, 10, 14, 0.92);
  border: 1px solid var(--line-2);
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
  pointer-events: none;
  opacity: 1;
  transition: opacity .4s ease;
}

.fp-idle-hint.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.fp-idle-hint .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 8px #00f0ff;
  animation: hintDot 1.8s ease-in-out infinite;
}

@keyframes hintDot {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.25); }
}

/* Progress rail: styled with pillar reticle & diamond ticks */
.fp-rail-wrap {
  position: absolute;
  left: 10px;
  top: 12vh;
  bottom: 64vh;
  width: 24px;
  pointer-events: none;
}

.fp-rail {
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.fp-rail-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 0;
  background: var(--fg);
  box-shadow: 0 0 10px rgba(255, 255, 255, .7);
}

.fp-rail-reticle {
  position: absolute;
  left: 0;
  top: -24px;
  width: 16px;
  height: 16px;
  stroke: var(--muted);
}

.fp-tick {
  position: absolute;
  left: 0.5px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--line-2);
  background: var(--void);
  transform: translate(-50%, -50%) rotate(45deg);
  transform-origin: center center;
  transition: background .4s ease, border-color .4s ease, box-shadow .4s ease;
  cursor: pointer;
  pointer-events: auto;
}

.fp-tick.is-on {
  background: var(--fg);
  border-color: var(--fg);
  box-shadow: 0 0 10px rgba(255, 255, 255, .7);
}

.fp-tick:hover {
  border-color: #fff;
  background: #fff;
  transform: translate(-50%, -50%) rotate(45deg) scale(1.35);
  box-shadow: 0 0 12px rgba(255, 255, 255, .9);
}

/* ---------- Stage Column (Sticky Flight Deck) ---------- */
.fp-stagecol {
  position: relative;
}

.fp-stage {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  height: calc(100svh - 56px);
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #06070a 0%, var(--void) 78%);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.fp-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.2px) 0 0 / 6px 6px;
  -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 20%, transparent 100%);
}

/* Ghosted Leg Numeral */
.fp-ghost-num {
  position: absolute;
  left: 4%;
  top: 12%;
  font: 800 clamp(7rem, 15vw, 15rem)/1 var(--font-mono);
  color: rgba(255, 255, 255, 0.032);
  letter-spacing: -0.06em;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  transition: opacity .45s ease, transform .6s var(--ease);
}

/* Astrolabe Gimbal Rings */
.fp-astrolabe {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(88vw, 680px);
  height: min(88vw, 680px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  opacity: 0.26;
  transition: opacity 0.4s ease, transform 0.25s ease-out;
}

.fp-stage:hover .fp-astrolabe {
  opacity: 0.52;
}

/* Canvas Globe */
.fp-canvas {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  image-rendering: pixelated;
  z-index: 2;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%),
                      linear-gradient(to bottom, transparent 0, #000 6%, #000 94%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%),
              linear-gradient(to bottom, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-composite: intersect;
}

/* Dithered Horizon Silhouette Band */
.fp-horizon {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 86px;
  pointer-events: none;
  z-index: 3;
  opacity: 0.55;
}

/* HUD */
.fp-hud {
  position: absolute;
  inset: 26px;
  pointer-events: none;
  font: 500 10px/1.4 var(--font-mono);
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
  z-index: 4;
}

.fp-hud b {
  color: var(--fg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fp-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 0 solid var(--line-2);
}

.fp-corner.tl { left: 0; top: 0; border-left-width: 1px; border-top-width: 1px; }
.fp-corner.tr { right: 0; top: 0; border-right-width: 1px; border-top-width: 1px; }
.fp-corner.bl { left: 0; bottom: 0; border-left-width: 1px; border-bottom-width: 1px; }
.fp-corner.br { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }

.fp-hud-top {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.fp-beat {
  position: absolute;
  left: 24px;
  top: 28px;
  display: grid;
  gap: 6px;
}

.fp-beat-code {
  color: var(--dim);
}

.fp-beat-label {
  font: 700 14px var(--font-display);
  letter-spacing: .08em;
  color: var(--fg);
  transition: color .4s ease;
}

.fp-stage.is-threat .fp-beat-label { color: var(--threat); }
.fp-stage.is-warm .fp-beat-label { color: var(--warm); }

.fp-hud-bottom {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* Hazard block (from Pillars) */
.fp-hazard {
  position: absolute;
  top: 84px;
  left: 24px;
  width: min(390px, calc(100% - 48px));
  z-index: 5;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .4s ease, transform .4s var(--ease);
  pointer-events: none;
}

.fp-hazard.is-on {
  opacity: 1;
  transform: none;
}

.fp-hazard-stripe {
  height: 22px;
  width: 100%;
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  background-size: 22px 22px;
  background-color: var(--hazard-color, var(--threat));
  background-image: repeating-linear-gradient(45deg, #050608 0, #050608 8px, transparent 8px, transparent 16px);
  border-left: 2px solid #000;
}

.fp-hazard-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 5px;
  font: 700 8.5px/1.2 var(--font-mono);
  letter-spacing: .08em;
  color: var(--hazard-color, var(--threat));
}

.fp-hazard-meta span {
  white-space: nowrap;
}

/* Currency Volatility Ticker */
.fp-ticker {
  position: absolute;
  right: 24px;
  top: 28px;
  text-align: right;
  display: grid;
  gap: 4px;
  z-index: 4;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .35s ease, transform .35s var(--ease);
}

.fp-ticker.is-on {
  opacity: 1;
  transform: none;
}

.fp-ticker .val {
  font: 700 22px var(--font-mono);
  color: var(--fg);
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}

.fp-ticker .delta {
  color: var(--threat);
  font-weight: 700;
}

.fp-ticker .tag {
  font: 600 8px var(--font-mono);
  color: var(--dim);
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ---------- Field Capture Plates Stack ---------- */
.fp-plates {
  position: absolute;
  right: 28px;
  bottom: 120px;
  width: clamp(280px, 29vw, 380px);
  z-index: 5;
  pointer-events: none;
}

.fp-plate {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition: opacity .5s cubic-bezier(0.16, 1, 0.3, 1), transform .5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.fp-plate.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.fp-plate-frame {
  position: relative;
  width: 100%;
  padding: 1px;
  background: rgba(255, 255, 255, 0.16);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 28px), calc(100% - 28px) 100%, 0 100%, 0 18px);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.75);
  transition: background .35s ease, filter .35s ease;
}

.fp-plate:hover .fp-plate-frame {
  background: rgba(255, 255, 255, 0.35);
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.25));
}

/* Sacred Exception: Gathering Plate glows warm and has golden border */
.fp-plate.is-sacred .fp-plate-frame {
  background: linear-gradient(135deg, rgba(255, 184, 108, 0.7), rgba(255, 255, 255, 0.2));
  filter: drop-shadow(0 0 22px rgba(255, 184, 108, 0.35));
}

.fp-plate-inner {
  position: relative;
  background: #090a0e;
  overflow: hidden;
  clip-path: polygon(17.5px 0, 100% 0, 100% calc(100% - 27.5px), calc(100% - 27.5px) 100%, 0 100%, 0 17.5px);
}

.fp-plate-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(11, 12, 16, 0.96);
  border-bottom: 1px solid var(--line);
  font: 700 9px/1.2 var(--font-mono);
  letter-spacing: .12em;
  color: var(--fg);
}

.fp-plate.is-sacred .fp-plate-bar {
  color: var(--warm);
}

.fp-plate-bar .badge {
  padding: 2px 6px;
  font-size: 8px;
  border: 1px solid var(--line-2);
  color: var(--muted);
}

.fp-plate.is-sacred .fp-plate-bar .badge {
  border-color: rgba(255, 184, 108, 0.4);
  color: var(--warm);
}

.fp-plate-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #060609;
}

.fp-plate-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fp-plate-media .photo-dither {
  filter: url(#dither-story);
  image-rendering: pixelated;
  transition: opacity .6s ease;
}

.fp-plate-media .photo-color {
  opacity: 0;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  transition: opacity .6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fp-plate.is-active .fp-plate-media .photo-color,
.fp-plate:hover .fp-plate-media .photo-color {
  opacity: 1;
}

/* Sacred exception: Gathering NEVER dithered, always warm full color */
.fp-plate.is-sacred .fp-plate-media .photo-color {
  opacity: 1 !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

.fp-plate.is-sacred .fp-plate-media .photo-dither {
  display: none !important;
}

.fp-plate-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: rgba(11, 12, 16, 0.96);
  border-top: 1px solid var(--line);
  font: 500 8.5px var(--font-mono);
  letter-spacing: .08em;
  color: var(--muted);
}

/* Telemetry Dossier Cards */
.fp-dossier-card {
  padding: 14px 16px;
  background: #090a0e;
  font: 500 9.5px/1.65 var(--font-mono);
  color: var(--fg-2);
}

.fp-dossier-grid {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.fp-dossier-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.fp-dossier-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.fp-dossier-row dt {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.fp-dossier-row dd {
  color: var(--fg);
}

.fp-dossier-row dd b {
  color: #fff;
  font-weight: 700;
}

.fp-dossier-row dd .highlight {
  color: var(--warm);
}

/* Aghoy Brand Header inside Plate */
.fp-aghoy-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: #07080c;
}

.fp-aghoy-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.fp-aghoy-title h3 {
  font: 700 13px/1.2 var(--font-display);
  letter-spacing: .06em;
  color: #fff;
}

.fp-aghoy-title span {
  font: 600 8.5px var(--font-mono);
  letter-spacing: .14em;
  color: var(--cyber);
}

/* ---------- Baybayin Interactive Trigger & HUD Tooltip (Scoped to Flight Deck) ---------- */
#fpStage .baybayin-trigger,
#fpBayTrigger {
  position: absolute;
  left: 44px;
  bottom: 44px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  outline: none;
  background: none;
  border: 0;
  padding: 4px 6px;
  border-radius: 2px;
  transition: background 0.2s ease;
}

#fpStage .baybayin-trigger:hover,
#fpStage .baybayin-trigger:focus-visible,
#fpStage .baybayin-trigger.is-open {
  background: rgba(255, 255, 255, 0.06);
}

#fpStage .sigil-baybayin {
  font-family: var(--font-baybayin), serif;
  font-size: 34px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.12em;
  padding-bottom: 3px;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.32);
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.25);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-block;
}

#fpStage .baybayin-trigger:hover .sigil-baybayin,
#fpStage .baybayin-trigger:focus-visible .sigil-baybayin,
#fpStage .baybayin-trigger.is-open .sigil-baybayin {
  color: #fff;
  border-bottom: 2px solid #fff;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.7);
}

.fp-stage.is-threat .baybayin-trigger:hover .sigil-baybayin,
.fp-stage.is-threat .baybayin-trigger.is-open .sigil-baybayin {
  border-bottom-color: var(--threat);
  text-shadow: 0 0 24px rgba(255, 77, 90, 0.7);
}

.fp-stage.is-warm .baybayin-trigger:hover .sigil-baybayin,
.fp-stage.is-warm .baybayin-trigger.is-open .sigil-baybayin {
  border-bottom-color: var(--warm);
  text-shadow: 0 0 24px rgba(255, 184, 108, 0.7);
}

#fpStage .sigil-baybayin.is-in {
  animation: bayIn .5s var(--ease) both;
}

@keyframes bayIn {
  from { opacity: 0; transform: translateY(5px); filter: blur(3px); }
}

/* Scoped Flight Path Upward Tooltip */
#fpStage .baybayin-tooltip {
  position: absolute;
  left: 0;
  top: auto !important;
  bottom: calc(100% + 14px) !important;
  width: 290px;
  padding: 16px 18px;
  background: rgba(8, 10, 14, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 3px solid var(--fg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.9), 0 0 24px rgba(0, 0, 0, 0.6);
  border-radius: 2px;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .2s cubic-bezier(0.16, 1, 0.3, 1), transform .2s cubic-bezier(0.16, 1, 0.3, 1), visibility .2s;
  z-index: 1000 !important;
}

#fpStage .baybayin-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  bottom: auto !important;
  left: 0;
  right: 0;
  height: 16px;
}

#fpStage .baybayin-tooltip::before {
  content: "";
  position: absolute;
  top: auto !important;
  bottom: -5px !important;
  left: 16px;
  width: 8px;
  height: 8px;
  background: rgba(8, 10, 14, 0.98);
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 0 !important;
  border-left: 0 !important;
  transform: rotate(45deg);
}

.fp-stage.is-threat .baybayin-tooltip { border-left-color: var(--threat); }
.fp-stage.is-warm .baybayin-tooltip { border-left-color: var(--warm); }

#fpStage .baybayin-trigger:hover .baybayin-tooltip,
#fpStage .baybayin-trigger:focus-within .baybayin-tooltip,
#fpStage .baybayin-trigger.is-open .baybayin-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

#fpStage .bt-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

#fpStage .bt-term {
  font: 700 12px var(--font-mono);
  letter-spacing: .16em;
  color: #fff;
}

#fpStage .bt-phonetic {
  font: 500 10px var(--font-mono);
  color: var(--muted);
  font-style: normal;
}

#fpStage .bt-tag {
  font: 700 9px var(--font-mono);
  color: var(--warm);
  letter-spacing: .12em;
}

#fpStage .bt-divider {
  height: 1px;
  background: var(--line-2);
  margin-bottom: 10px;
}

#fpStage .bt-desc {
  font: 400 11px/1.55 var(--font-story);
  color: var(--fg-2);
  margin-bottom: 8px;
}

#fpStage .bt-doctrine {
  font: 500 10px/1.5 var(--font-mono);
  color: var(--muted);
  margin-bottom: 10px;
}

#fpStage .bt-meta {
  display: flex;
  justify-content: space-between;
  font: 700 8.5px var(--font-mono);
  letter-spacing: .12em;
  color: var(--dim);
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

#fpStage .bt-meta-code {
  color: var(--fg);
}

/* ---------- Monolithic CTA Shell: "Open Flight Log" ---------- */
.fp-shell {
  position: absolute;
  right: 28px;
  bottom: 52px;
  z-index: 5;
  display: inline-block;
  padding: 1.5px;
  background: var(--line-2);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: background .3s ease, filter .3s ease, transform .15s ease;
  cursor: pointer;
}

.fp-shell:hover, .fp-shell.is-armed {
  background: rgba(255, 255, 255, 0.85);
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.4));
  transform: translateY(-1px);
}

.fp-shell.is-armed {
  animation: armPulse 2.4s ease-in-out infinite;
}

.fp-shell:active {
  transform: scale(0.97);
}

.fp-shell .strip {
  display: inline-flex;
  align-items: center;
  background: #080a0f;
  height: 38px;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  overflow: hidden;
  transition: background .25s ease;
}

.fp-shell:hover .strip {
  background: #0d1017;
}

.fp-shell .emblem {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.05);
  font: 700 9.5px var(--font-mono);
  letter-spacing: .16em;
  color: var(--fg);
  clip-path: polygon(7px 0, 100% 0, 100% 100%, 0 100%, 0 7px);
}

.fp-shell .seam {
  width: 8px;
  height: 100%;
  transform: skewX(-20deg);
  margin: 0 4px;
  background: rgba(255, 255, 255, 0.2);
  transition: background .25s ease;
}

.fp-shell:hover .seam {
  background: rgba(255, 255, 255, 0.65);
}

.fp-shell .dots {
  display: flex;
  gap: 4px;
  padding: 0 10px;
}

.fp-shell .dots span {
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: background .25s ease, box-shadow .25s ease;
}

.fp-shell:hover .dots span,
.fp-shell.is-armed .dots span {
  background: #00f0ff;
  box-shadow: 0 0 8px #00f0ff;
}

.fp-shell .cta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 0 6px;
  height: 100%;
  background: none;
  border: 0;
  color: var(--fg);
  font: 700 10.5px var(--font-mono);
  letter-spacing: .16em;
  cursor: pointer;
}

.fp-shell .cta .ico {
  font-size: 13px;
  line-height: 1;
  transition: transform .25s var(--ease);
}

.fp-shell:hover .cta .ico {
  transform: translateX(3px);
  color: #fff;
}

@keyframes armPulse {
  50% { filter: drop-shadow(0 0 12px rgba(255, 255, 255, .55)); }
}

/* ---------- Command Dialog / Field Log Archive Modal ---------- */
.fp-dialog {
  margin: auto;
  width: min(680px, calc(100vw - 32px));
  max-height: 85vh;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
}

.fp-dialog::backdrop {
  background: rgba(3, 3, 5, .8);
  backdrop-filter: blur(8px);
}

.fp-dialog-card {
  position: relative;
  padding: 28px 30px 24px;
  background: #08080c;
  border: 1px solid var(--line-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
  overflow-y: auto;
  max-height: 85vh;
}

.fp-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.fp-dialog-head h3 {
  font: 700 13px var(--font-mono);
  letter-spacing: .2em;
  color: #fff;
}

.fp-dialog-head .badge {
  font: 600 9px var(--font-mono);
  letter-spacing: .14em;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-2);
  color: var(--fg-2);
}

.fp-log {
  list-style: none;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.fp-log li {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  background: #08080c;
  font: 500 11px var(--font-mono);
  letter-spacing: .1em;
  color: var(--fg-2);
  cursor: pointer;
  transition: background .2s ease;
}

.fp-log li:hover { background: #12131a; color: #fff; }
.fp-log li.is-current { background: #151620; border-left: 2px solid var(--fg); color: #fff; }
.fp-log li span:first-child { color: var(--dim); font-weight: 700; }
.fp-log li span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }

.fp-dialog-gallery {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.fp-dialog-gallery h4 {
  font: 700 10px var(--font-mono);
  letter-spacing: .16em;
  color: var(--muted);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.fp-dialog-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.fp-dialog-thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  border: 1px solid var(--line-2);
  cursor: pointer;
  background: #000;
}

.fp-dialog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.fp-dialog-thumb:hover img {
  transform: scale(1.08);
}

.fp-dialog-thumb span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3px 5px;
  background: rgba(0, 0, 0, 0.85);
  font: 600 7.5px var(--font-mono);
  letter-spacing: .08em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-dialog-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  font: 500 9px var(--font-mono);
  letter-spacing: .12em;
  color: var(--dim);
}

.fp-dialog-close {
  background: none;
  border: 1px solid var(--line-2);
  color: var(--fg);
  padding: 8px 16px;
  font: 700 10px var(--font-mono);
  letter-spacing: .16em;
  cursor: pointer;
  transition: border-color .2s ease;
}

.fp-dialog-close:hover {
  border-color: var(--fg);
}

/* ---------- Mobile Adaptations ---------- */
@media (max-width: 900px) {
  .fp-grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }
  .fp-stagecol {
    order: -1;
    position: sticky;
    top: 56px;
    z-index: 4;
    align-self: start;
    height: 50svh;
    background: linear-gradient(to bottom, var(--void) 84%, rgba(3, 3, 5, 0));
  }
  .fp-stage {
    position: relative;
    top: 0;
    height: 50svh;
  }
  .fp-text {
    padding: 4vh 0 52vh 32px;
  }
  .fp-rail-wrap {
    left: 4px;
    top: 4vh;
    bottom: 52vh;
  }
  .fp-hud {
    inset: 12px;
  }
  .fp-hud-bottom span:last-child {
    display: none;
  }
  #fpStage .baybayin-trigger {
    left: 18px;
    bottom: 18px;
  }
  #fpStage .baybayin-trigger .baybayin-tooltip {
    width: min(280px, 80vw);
    bottom: calc(100% + 10px);
  }
  .fp-shell {
    right: 18px;
    bottom: 18px;
  }
  .fp-plates {
    right: 18px;
    bottom: 68px;
    width: min(280px, 65vw);
  }
  .fp-plate-media {
    aspect-ratio: 16/9;
  }
  .fp-ticker .val {
    font-size: 16px;
  }
  .fp-ghost-num {
    font-size: 8rem;
    left: 2%;
    top: 6%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fp-anchor, .fp-anchor::before, .fp-tick, .fp-ticker, .fp-plate, .fp-ghost-num {
    transition: none;
  }
  .sigil-baybayin.is-in, .fp-shell.is-armed {
    animation: none;
  }
}
