/* engine-theme.css — single source of truth for the engine's look.
   Mirrors pyratime.com (apps/www/tailwind.config.ts + globals.css).
   Local-first: fonts are bundled in ./fonts, no runtime network. */

@font-face { font-family:"Inter"; font-weight:400; font-display:swap; src:url("./fonts/Inter-400.woff2") format("woff2"); }
@font-face { font-family:"Inter"; font-weight:500; font-display:swap; src:url("./fonts/Inter-500.woff2") format("woff2"); }
@font-face { font-family:"Inter"; font-weight:600; font-display:swap; src:url("./fonts/Inter-600.woff2") format("woff2"); }
@font-face { font-family:"Inter"; font-weight:700; font-display:swap; src:url("./fonts/Inter-700.woff2") format("woff2"); }
@font-face { font-family:"JetBrains Mono"; font-weight:400; font-display:swap; src:url("./fonts/JetBrainsMono-400.woff2") format("woff2"); }
@font-face { font-family:"JetBrains Mono"; font-weight:500; font-display:swap; src:url("./fonts/JetBrainsMono-500.woff2") format("woff2"); }

:root {
  /* surfaces */
  --pt-bg:#0A0A12; --pt-bg-0:#0A0A12; --pt-bg-1:#161824;
  --pt-glass:rgba(22,24,36,0.70);   /* translucent card surface — lets the page's gold/cyan wash blend through (flat, no blur) */
  /* borders */
  --pt-border:#2A2D3A; --pt-border-2:rgba(42,45,58,0.65);
  /* text */
  --pt-text:#FAFAFA; --pt-text-muted:#9CA3AF;
  /* brand */
  --pt-gold:#FFD700; --pt-primary:#FFD700; --pt-accent:#FFD700;
  --pt-cyan:#66CCFF; --pt-secondary:#66CCFF;
  /* semantic */
  --pt-up:#34D399; --pt-down:#FCA5A5; --pt-danger:#FCA5A5;
  /* categories */
  --pt-crypto:#66CCFF; --pt-macro:#FFD700; --pt-commodity:#34D399;
  /* bodies */
  --pt-sun:#FFD700; --pt-jupiter:#66CCFF; --pt-saturn:#FCA5A5;
  /* type */
  --pt-sans:"Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --pt-mono:"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html, body {
  margin:0; padding:0; min-height:100vh;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,215,0,0.08), transparent 40%),
    radial-gradient(circle at 80% 22%, rgba(102,204,255,0.10), transparent 45%),
    var(--pt-bg);
  color:var(--pt-text);
  font-family:var(--pt-sans);
}

/* ── Shared site chrome: Nav + Footer (ported from components/site) ──────── */
.pt-nav {
  position:sticky; top:0; z-index:40;
  border-bottom:1px solid var(--pt-border);
  background:rgba(10,10,18,0.85);
}
.pt-nav__inner {
  max-width:1152px; margin:0 auto; height:56px;
  display:flex; align-items:center; justify-content:space-between;
  padding:0 16px;
}
@media (min-width:640px){ .pt-nav__inner{ padding:0 24px; } }
@media (min-width:1024px){ .pt-nav__inner{ padding:0 32px; } }
.pt-nav__brand {
  font-family:var(--pt-mono); font-size:14px; font-weight:600;
  letter-spacing:-0.01em; color:var(--pt-text); text-decoration:none;
}
.pt-nav__mark { color:var(--pt-gold); }
.pt-nav__links {
  display:none; align-items:center; gap:24px; margin:0; padding:0;
  list-style:none; font-size:14px;
}
@media (min-width:640px){ .pt-nav__links{ display:flex; } }
.pt-nav__links a { color:rgba(250,250,250,0.80); text-decoration:none; transition:color 140ms ease; }
.pt-nav__links a:hover { color:var(--pt-text); }
.pt-nav__links a[aria-current="page"] { color:var(--pt-gold); }
.pt-nav__signin {
  font-size:14px; font-weight:500; color:var(--pt-text); text-decoration:none;
  padding:6px 12px; border-radius:8px; border:1px solid var(--pt-border);
  transition:color 140ms ease, border-color 140ms ease;
}
.pt-nav__signin:hover { color:var(--pt-gold); border-color:rgba(255,215,0,0.40); }

/* Mobile menu — native <details>, zero JS. Shown < 640px. */
.pt-nav__menu { position:relative; display:none; }
@media (max-width:639px){
  .pt-nav__menu { display:block; }
  .pt-nav__signin { display:none; }
}
.pt-nav__burger {
  list-style:none; cursor:pointer; color:var(--pt-text);
  font-size:18px; line-height:1; border-radius:8px;
  border:1px solid var(--pt-border);
  min-height:40px; min-width:40px;
  display:inline-flex; align-items:center; justify-content:center;
}
.pt-nav__burger::-webkit-details-marker { display:none; }
.pt-nav__menu[open] .pt-nav__burger { border-color:rgba(255,215,0,0.40); color:var(--pt-gold); }
.pt-nav__drawer {
  position:absolute; right:0; top:calc(100% + 8px); z-index:50;
  margin:0; padding:6px; min-width:208px; list-style:none;
  background:var(--pt-bg-1); border:1px solid var(--pt-border);
  border-radius:12px; box-shadow:0 16px 40px -12px rgba(0,0,0,0.80);
  display:grid; gap:2px;
}
.pt-nav__drawer a {
  display:block; padding:11px 12px; border-radius:8px;
  color:rgba(250,250,250,0.85); text-decoration:none; font-size:14px;
}
.pt-nav__drawer a:hover { background:rgba(255,255,255,0.05); color:var(--pt-text); }
.pt-nav__drawer a[aria-current="page"] { color:var(--pt-gold); }

.pt-footer { border-top:1px solid var(--pt-border); background:var(--pt-bg); margin-top:64px; }
.pt-footer__grid {
  max-width:1152px; margin:0 auto; padding:40px 16px;
  display:grid; gap:24px; grid-template-columns:1fr;
}
@media (min-width:640px){ .pt-footer__grid{ grid-template-columns:repeat(2,1fr); padding:40px 24px; } }
@media (min-width:768px){ .pt-footer__grid{ grid-template-columns:repeat(4,1fr); } }
@media (min-width:1024px){ .pt-footer__grid{ padding:40px 32px; } }
.pt-footer__brand { font-family:var(--pt-mono); font-size:14px; font-weight:600; color:var(--pt-text); margin:0; }
.pt-footer__tag { margin:8px 0 0; max-width:22ch; font-size:12px; color:rgba(250,250,250,0.60); }
.pt-footer__h { margin:0; font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:0.06em; color:rgba(250,250,250,0.50); }
.pt-footer__list { margin:12px 0 0; padding:0; list-style:none; display:grid; gap:8px; font-size:14px; }
.pt-footer__list a { color:rgba(250,250,250,0.80); text-decoration:none; }
.pt-footer__list a:hover { color:var(--pt-text); }
.pt-footer__bar { border-top:1px solid var(--pt-border); }
.pt-footer__copy { max-width:1152px; margin:0 auto; padding:16px; font-size:12px; color:rgba(250,250,250,0.50); }
@media (min-width:640px){ .pt-footer__copy{ padding:16px 24px; } }
@media (min-width:1024px){ .pt-footer__copy{ padding:16px 32px; } }

/* Shell content wrapper — homepage section rhythm */
.pt-shell { max-width:1152px; margin:0 auto; padding:48px 16px 64px; }
@media (min-width:640px){ .pt-shell{ padding:48px 24px 80px; } }
@media (min-width:1024px){ .pt-shell{ padding:48px 32px 80px; } }

/* ── Dashboard — tier grouping + collapsible deep panels ─────────────────── */

/* Setup tier: a little more breathing room between the stacked controls */
.section--setup { gap:16px; }

/* Confluence tier: its strip is empty until an anchor is loaded, so hide the
   whole (labeled) section on the cold-open page. Revealed once a preset loads
   via .is-preset-loaded on <body>. Selectors are scoped to .page so they beat
   the inline `.section { display:grid }` rule (equal class specificity, but
   that rule is declared later in source order). */
.page > .section--confluence { display:none; }
.is-preset-loaded .page > .section--confluence { display:grid; }

/* Deep-analysis group header: eyebrow + expand/collapse-all control */
.section__head {
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; flex-wrap:wrap;
}
.section__toggle {
  appearance:none; cursor:pointer;
  font-family:var(--pt-mono);
  font-size:10px; letter-spacing:0.14em; text-transform:uppercase;
  color:var(--pt-text-muted);
  background:rgba(255,255,255,0.02);
  border:1px solid rgba(255,255,255,0.10); border-radius:8px;
  padding:6px 12px;
  transition:color 140ms ease, border-color 140ms ease, background 140ms ease;
}
.section__toggle:hover { color:var(--pt-text); border-color:var(--pt-border); background:rgba(255,255,255,0.06); }

/* Collapsible panel. The wrapper is transparent — each custom element inside
   already renders its own bordered card. Only the summary is a styled bar. */
.pt-panel { display:grid; gap:14px; }
.pt-panel__summary {
  list-style:none; cursor:pointer;
  display:flex; align-items:center; gap:12px;
  min-height:44px; box-sizing:border-box;
  padding:12px 16px;
  background:var(--pt-glass);
  border:1px solid var(--pt-border); border-radius:16px;
  transition:border-color 140ms ease, background 140ms ease;
}
.pt-panel__summary::-webkit-details-marker { display:none; }
.pt-panel__summary:hover { border-color:rgba(102,204,255,0.35); }
.pt-panel[open] .pt-panel__summary { border-color:rgba(102,204,255,0.45); }
.pt-panel__title {
  flex:none;
  font-family:var(--pt-sans); font-size:14px; font-weight:600; color:var(--pt-text);
}
.pt-panel__hint {
  flex:1 1 auto; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  font-size:12px; color:var(--pt-text-muted);
}
.pt-panel__chev {
  flex:none; margin-left:4px;
  color:var(--pt-text-muted); font-size:12px; line-height:1;
  transition:transform 160ms ease, color 140ms ease;
}
.pt-panel[open] .pt-panel__chev { transform:rotate(180deg); color:var(--pt-cyan); }

/* Empty-state hint — shown only when an open panel's component has no content
   yet (toggled by JS via .is-empty). Hidden by default. */
.pt-panel__empty {
  display:none; margin:0; padding:18px 20px;
  font-family:var(--pt-sans); font-size:13px; color:var(--pt-text-muted);
  background:var(--pt-glass);
  border:1px dashed var(--pt-border); border-radius:16px;
}
.pt-panel.is-empty .pt-panel__empty { display:block; }

/* Mobile: comfortable tap target on the expand/collapse-all control */
@media (max-width:640px){ .section__toggle { min-height:44px; } }

/* Chrome is screen-only — printed reports stay clean */
@media print {
  .pt-nav, .pt-footer { display:none !important; }
  html, body { background:#FFFFFF !important; color:#0A0A12 !important; }
}
