/* ==========================================================================
   Fidian demo — shared design system (mocks only, no real backend)
   Dark "platform" tokens pulled from ts/platform globals.css.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap");

:root {
  /* platform tokens (from globals.css) */
  --deep-bg: #0d0614;
  --bg: #120b1c;
  --panel: #1a1322;
  --panel-2: #211e29;
  --gray-dark: #211e29;
  --gray-medium: #44444d;
  --border: #2a2333;
  --border-strong: #3a3343;

  --pass: #5ce58a;
  --fail: #e64560;
  --warn: #f5b14c;
  --diff-add-bg: #131c1d;
  --diff-del-bg: #210c19;
  --diff-add-fg: #5ce58a;
  --diff-del-fg: #e64560;

  --accent: #2dd4bf;        /* teal ≈ oklch(0.60 0.10 185) */
  --accent-dim: #15a99a;
  --accent-glow: rgba(45, 212, 191, 0.18);
  --violet: #a78bfa;

  --text: #ece9f3;
  --text-muted: #9a93a8;
  --text-faint: #6b6478;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 0 1px var(--accent-glow), 0 12px 40px -10px var(--accent-glow);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(45, 212, 191, 0.07), transparent 60%),
    radial-gradient(900px 600px at 0% 110%, rgba(167, 139, 250, 0.07), transparent 55%),
    var(--deep-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ---- THEME: conceptual architecture (lighter Fidian purple) ------------- */
body.arch {
  --deep-bg: #1c1340;
  --bg: #221748;
  --panel: #2a1d54;
  --panel-2: #332463;
  --gray-dark: #2a1d54;
  --border: #463576;
  --border-strong: #5a4690;
  --text: #efeafc;
  --text-muted: #b6abdc;
  --text-faint: #8b7fb8;
  --shadow-glow: 0 0 0 1px rgba(167,139,250,0.25), 0 12px 40px -10px rgba(167,139,250,0.25);
  background:
    radial-gradient(1100px 700px at 78% -12%, rgba(167, 139, 250, 0.20), transparent 60%),
    radial-gradient(900px 650px at 8% 112%, rgba(45, 212, 191, 0.12), transparent 58%),
    linear-gradient(180deg, #221748, #1a1138 60%, #160f31);
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent-glow); }

/* ---- top brand bar ------------------------------------------------------- */
.topbar {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 6, 20, 0.7);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
}
/* Brand = the full Fidian wordmark SVG (matches the platform's
   fidian-wordmark.svg), rendered light against the dark bar. */
.brand .logo {
  height: 19px;
  width: auto;
  display: block;
  color: var(--text);
}
.crumbs { color: var(--text-faint); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.crumbs b { color: var(--text-muted); font-weight: 500; }
.topbar .spacer { flex: 1; }
.topbar .pill {
  font-size: 12px; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 11px; display: flex; gap: 7px; align-items: center;
}

/* ---- left nav rail (matches the platform sidebar) ------------------------ */
/* Fixed 56px rail on the left; pages opt in with <body class="railed"> and a
   <nav class="fnav"> as the first child. The rail carries the brand (fn mark
   pinned to the bottom), so railed pages drop the wordmark from their topbar. */
.fnav {
  position: fixed; top: 0; left: 0; height: 100vh; width: 56px; z-index: 45;
  background: #1a0c29; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 0 28px; gap: 28px;
}
.fnav .ri { width: 24px; height: 24px; display: grid; place-items: center; color: var(--violet); cursor: pointer; }
.fnav .ri svg { width: 22px; height: 22px; display: block; }
.fnav .ri.active { color: var(--text); }
.fnav .spacer { flex: 1; }
.fnav .fnmark { color: var(--text); }
.fnav .fnmark svg { width: 30px; height: 26px; display: block; }
body.railed { padding-left: 56px; }

/* ---- generic primitives -------------------------------------------------- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent), var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--font-mono); }
.pass { color: var(--pass); }
.fail { color: var(--fail); }
.accent { color: var(--accent); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}
.badge.green { color: var(--pass); border-color: rgba(92,229,138,0.35); background: rgba(92,229,138,0.08); }
.badge.red   { color: var(--fail); border-color: rgba(230,69,96,0.35);  background: rgba(230,69,96,0.08); }
.badge.teal  { color: var(--accent); border-color: rgba(45,212,191,0.35); background: rgba(45,212,191,0.08); }
.badge.amber { color: var(--warn); border-color: rgba(245,177,76,0.35); background: rgba(245,177,76,0.08); }
.badge.violet{ color: var(--violet); border-color: rgba(167,139,250,0.35); background: rgba(167,139,250,0.08); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.dot.green { background: var(--pass); }
.dot.red { background: var(--fail); }
.dot.amber { background: var(--warn); }

.btn {
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  border-radius: var(--radius-sm); padding: 8px 14px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--panel-2); color: var(--text);
  transition: transform .08s, border-color .15s, background .15s;
}
.btn:hover { border-color: var(--accent-dim); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #04110f; border: none;
}

/* ---- eval pass/fail grid cells ------------------------------------------ */
.cell {
  width: 22px; height: 22px; border-radius: 5px;
  display: inline-block;
  border: 1px solid transparent;
}
.cell.green { background: rgba(92,229,138,0.85); box-shadow: 0 0 10px rgba(92,229,138,0.25); }
.cell.red   { background: rgba(230,69,96,0.85);  box-shadow: 0 0 10px rgba(230,69,96,0.2); }
.cell.empty { background: var(--panel-2); border-color: var(--border); }

/* ---- wrapper layout ------------------------------------------------------ */
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 26px 80px; }
.row { display: flex; gap: 14px; }
.between { display: flex; align-items: center; justify-content: space-between; }
.grid-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

h1.page { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.sub { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* scene caption chip — hidden by default (no visible mock tells on camera).
   Press "t" on any page to toggle it on for your own reference while editing. */
.scene-tag {
  display: none;
  position: fixed; left: 16px; bottom: 14px; z-index: 50;
  font: 500 12px var(--font-mono); color: var(--text-faint);
  background: rgba(13,6,20,0.8); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: 8px; backdrop-filter: blur(6px);
}
body.show-tags .scene-tag { display: block; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes flowdash { to { stroke-dashoffset: -22; } }
