/* Fleet Commander — site theme
   Matches the app: near-black space background, pixel-art ship, terminal/mono
   type, a single gold accent. */

:root {
  --bg: #070b14;
  --bg-2: #0a1020;
  --panel: #0d1422;
  --panel-2: #111a2c;
  --border: #1b263f;
  --border-2: #26344f;
  --ink: #e8edf7;
  --muted: #8593af;
  --faint: #7c89a8;
  --accent: #f5c451; /* the app's gold "3 SHIPS ACTIVE" header */
  --accent-dim: #b8902e;
  --ship: #ff5f6d;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  -webkit-font-smoothing: antialiased;
}

/* Static starfield — layered, no animation, no paint cost beyond first frame. */
.starfield {
  background-color: var(--bg);
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1px 1px at 70% 18%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,0.40), transparent),
    radial-gradient(1px 1px at 85% 55%, rgba(255,255,255,0.50), transparent),
    radial-gradient(1px 1px at 12% 82%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1.5px 1.5px at 55% 42%, rgba(245,196,81,0.45), transparent),
    radial-gradient(1px 1px at 92% 88%, rgba(255,255,255,0.40), transparent),
    radial-gradient(1px 1px at 30% 12%, rgba(255,255,255,0.30), transparent),
    radial-gradient(900px 600px at 78% -10%, rgba(40,55,90,0.45), transparent),
    radial-gradient(700px 500px at 8% 0%, rgba(30,42,72,0.40), transparent);
  background-repeat: no-repeat;
}

.font-pixel {
  font-family: "Press Start 2P", "JetBrains Mono", monospace;
}

/* Terminal window chrome */
.terminal {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border-2);
  border-radius: 12px;
  box-shadow: 0 24px 60px -30px rgba(0,0,0,0.85);
}

.dot { height: 11px; width: 11px; border-radius: 9999px; display: inline-block; }

/* Device screenshot frame */
.device {
  border-radius: 28px;
  border: 1px solid var(--border-2);
  background: #000;
  box-shadow: 0 40px 90px -40px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.02) inset;
  overflow: hidden;
}

/* Hero ship — gentle compositor-only float, disabled under reduced motion. */
.ship-float { will-change: transform; animation: ship-float 6s ease-in-out infinite; }
@keyframes ship-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  .ship-float { animation: none; will-change: auto; }
  html { scroll-behavior: auto; }
}

a { text-decoration: none; }
::selection { background: rgba(245,196,81,0.25); }

/* Inline command chips (privacy/support pages) — make commands scannable. */
code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.9em;
  background: rgba(124, 137, 168, 0.13);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.06em 0.4em;
  overflow-wrap: anywhere; /* break long tokens (e.g. repo slugs) instead of overflowing */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
code.block { padding: 0.45em 0.7em; }

/* Visible keyboard focus everywhere. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Animated in-device product demo ─────────────────────────────────────────
   A looping recreation of the live space-map (mirrors the app's demo fleet):
   ships drift, the waiting ship pulses, an approval card pops in. Pure CSS,
   compositor-only transforms. Frozen under prefers-reduced-motion. */

.fc-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--ink);
  background:
    radial-gradient(1px 1px at 18% 24%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 72% 16%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 46% 62%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 84% 78%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 28% 86%, rgba(255,255,255,0.3), transparent),
    radial-gradient(120% 90% at 60% 0%, #0c1730, #05070f 70%);
}

/* Phone */
.fc-phone { aspect-ratio: 9 / 19.3; }
.fc-statusbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 2px; font-size: 11px; font-weight: 700; color: var(--ink);
}
.fc-statusbar .fc-sb { display: flex; gap: 4px; align-items: center; color: var(--muted); letter-spacing: 1px; }
.fc-head { padding: 6px 16px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.fc-title { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-align: center; }
.fc-sub {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 7px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; color: var(--accent);
}

/* Radar map */
.fc-map { position: absolute; inset: 70px 0 0; }
.fc-map::before, .fc-map::after {
  content: ""; position: absolute; left: 50%; top: 46%;
  border: 1px solid rgba(120,150,210,0.10); border-radius: 9999px;
  transform: translate(-50%, -50%);
}
.fc-map::before { width: 70%; aspect-ratio: 1; }
.fc-map::after  { width: 116%; aspect-ratio: 1; }

.fc-ship { position: absolute; transform: translate(-50%, -50%); }
.fc-ship .fc-craft {
  position: relative; width: 11px; height: 11px; margin: 0 auto;
  border-radius: 3px; transform: rotate(45deg);
  background: var(--c); box-shadow: 0 0 10px 1px color-mix(in srgb, var(--c) 70%, transparent);
}
.fc-ship .fc-label { margin-top: 9px; text-align: center; white-space: nowrap; transform: translateX(-50%); margin-left: 50%; width: max-content; }
.fc-ship .fc-proj { display: block; font-size: 9.5px; font-weight: 600; color: rgba(232,237,247,0.82); }
.fc-ship .fc-meta { display: block; font-size: 7.5px; letter-spacing: 0.4px; color: var(--c); opacity: 0.85; }

.fc-work    { --c: #46e08f; }
.fc-wait    { --c: #f5c451; }
.fc-idle    { --c: #ff5f6d; opacity: 0.62; }

/* waiting ship pulses to read as "needs you" */
.fc-wait .fc-craft { animation: fc-pulse 1.8s ease-in-out infinite; }
@keyframes fc-pulse {
  0%, 100% { box-shadow: 0 0 6px 0 rgba(245,196,81,0.5); }
  50%      { box-shadow: 0 0 16px 4px rgba(245,196,81,0.85); }
}

/* drift paths (gentle, organic) */
@keyframes fc-d1 { 0%,100% { translate: 0 0; } 50% { translate: 10px -12px; } }
@keyframes fc-d2 { 0%,100% { translate: 0 0; } 50% { translate: -13px 9px; } }
@keyframes fc-d3 { 0%,100% { translate: 0 0; } 50% { translate: 9px 13px; } }
@keyframes fc-d4 { 0%,100% { translate: 0 0; } 50% { translate: -10px -10px; } }

/* approval card — slides up, sits, the Approve button flashes, slides away */
.fc-approval {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  border: 1px solid var(--border2); border-radius: 12px;
  background: linear-gradient(180deg, #131d31, #0c1422);
  box-shadow: 0 16px 40px -16px rgba(0,0,0,0.9);
  padding: 11px 12px; opacity: 0;
  transform: translateY(130%);
  animation: fc-card 14s ease-in-out infinite;
}
.fc-approval .fc-ap-tag { font-size: 8px; font-weight: 800; letter-spacing: 1px; color: var(--accent); }
.fc-approval .fc-ap-proj { margin-top: 3px; font-size: 11px; font-weight: 700; }
.fc-approval .fc-ap-cmd {
  margin-top: 6px; padding: 6px 8px; border-radius: 7px; font-size: 9.5px;
  background: rgba(0,0,0,0.35); border: 1px solid var(--border); color: #ff8d8d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fc-approval .fc-ap-btns { display: flex; gap: 7px; margin-top: 9px; }
.fc-approval .fc-ap-btn { flex: 1; text-align: center; font-size: 10px; font-weight: 700; padding: 7px 0; border-radius: 7px; }
.fc-approval .fc-deny { border: 1px solid var(--border2); color: var(--muted); }
.fc-approval .fc-allow { background: #1d3a2a; color: #46e08f; border: 1px solid rgba(70,224,143,0.35); animation: fc-flash 14s ease-in-out infinite; }
@keyframes fc-card {
  0%, 40%   { transform: translateY(130%); opacity: 0; }
  46%, 80%  { transform: translateY(0);    opacity: 1; }
  86%, 100% { transform: translateY(130%); opacity: 0; }
}
@keyframes fc-flash {
  0%, 68%, 76%, 100% { background: #1d3a2a; box-shadow: none; }
  72% { background: #2c5a40; box-shadow: 0 0 0 2px rgba(70,224,143,0.5); }
}

/* Watch */
.fc-watch { aspect-ratio: 1 / 1.16; }
.fc-watch .fc-w-top { display: flex; justify-content: flex-end; padding: 8px 12px 0; font-size: 12px; font-weight: 700; }
.fc-watch .fc-w-head { display: flex; align-items: center; gap: 6px; padding: 4px 12px 8px; font-size: 13px; font-weight: 800; color: var(--accent); }
.fc-watch .fc-w-map { position: absolute; inset: 56px 0 8px; }

@media (prefers-reduced-motion: reduce) {
  .fc-ship, .fc-craft, .fc-approval, .fc-allow { animation: none !important; }
  .fc-approval { transform: translateY(0); opacity: 1; } /* show statically */
}

/* ── Lightfall animated background (home page only) ──────────────────────────
   A WebGL shader layer above the static starfield, below the content. If WebGL
   or motion is unavailable, nothing mounts and the static starfield remains. */
.fx-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.fx-bg canvas { display: block; width: 100%; height: 100%; }

.fx-scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; display: none;
  background:
    linear-gradient(90deg, rgba(7,11,20,0.80) 0%, rgba(7,11,20,0.38) 48%, rgba(7,11,20,0.12) 100%),
    radial-gradient(120% 85% at 50% -12%, transparent 42%, rgba(7,11,20,0.62) 100%),
    linear-gradient(180deg, transparent 52%, rgba(7,11,20,0.88) 100%);
}
body.fx-on .fx-scrim { display: block; }

@media (max-width: 640px) {
  /* On phones the hero is centered/stacked — darken top & bottom, not the side. */
  .fx-scrim {
    background:
      linear-gradient(180deg, rgba(7,11,20,0.58) 0%, rgba(7,11,20,0.28) 34%, rgba(7,11,20,0.62) 100%),
      radial-gradient(130% 70% at 50% 0%, transparent 34%, rgba(7,11,20,0.7) 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fx-bg, .fx-scrim { display: none !important; } /* keep the pure static starfield */
}
