/* Site chrome shared by both skins. Skin colours come from skins.css tokens;
   the --s-* aliases below map each skin's names onto one vocabulary. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-latin-wght-normal.7660bd9909fb.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.260c81a4759b.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin-wght-normal.b058178d7f30.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

html[data-skin="explorer"] {
  --s-surface: var(--card);
  --s-surface-2: var(--card-2);
  --s-radius: 18px;
  --s-radius-sm: 12px;
  --s-num: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --s-gutter: 24px;
  --s-max: 1680px;
}
html[data-skin="terminal"] {
  --s-surface: var(--panel);
  --s-surface-2: var(--panel-2);
  --s-radius: 8px;
  --s-radius-sm: 6px;
  --s-num: var(--mono);
  --s-gutter: 14px;
  --s-max: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; }

/* Only the header variant for the active skin is shown. */
html[data-skin="explorer"] [data-skin-only="terminal"],
html[data-skin="terminal"] [data-skin-only="explorer"] { display: none; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header layout additions (the rest comes from each skin). */
html[data-skin="explorer"] .fes-app .shell.shell-header { padding-bottom: 0; }
html[data-skin="explorer"] .fes-app .shell-header header.top { margin-bottom: 0; flex-wrap: wrap; }
html[data-skin="explorer"] .fes-app .shell.shell-app { padding-top: 20px; }
.site-header-terminal { position: sticky; top: 0; z-index: 30; }
html[data-skin="explorer"] .brand { text-decoration: none; color: inherit; }
html[data-skin="explorer"] .brand-name { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
html[data-skin="explorer"] .head-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
html[data-skin="terminal"] .logo { text-decoration: none; color: inherit; }
.view-switches { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fes-app .btn { display: inline-flex; align-items: center; text-decoration: none; }

/* Page H1 + summary, server-rendered below the app for crawlers and readers. */
.insights .intro { margin-bottom: 36px; }
.insights .intro h1 { margin: 0 0 6px; font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; }

#app-root { position: relative; min-height: 640px; }
/* Draw the "i" as a mask so it sits on the true centre regardless of font metrics. */
.fes-app .info { font-size: 0 !important; }
.fes-app .info::before {
  content: "";
  display: block;
  transform: translateY(1px);
  width: 12px;
  height: 12px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='4.6' r='1.15'/%3E%3Crect x='7' y='6.8' width='2' height='5.4' rx='1'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='4.6' r='1.15'/%3E%3Crect x='7' y='6.8' width='2' height='5.4' rx='1'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
html[data-skin="terminal"] .fes-app .info::before { width: 11px; height: 11px; }
/* Slim, inset scrollbars so they don't get clipped by rounded corners. */
.fes-app .asset-list, .fes-app .table-wrap { scrollbar-gutter: stable; }
.fes-app ::-webkit-scrollbar { width: 10px; height: 10px; }
.fes-app ::-webkit-scrollbar-track { background: transparent; margin: 8px; }
.fes-app ::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: var(--axis); background-clip: padding-box; }
.fes-app ::-webkit-scrollbar-thumb:hover { background-color: var(--faint); }
.fes-app ::-webkit-scrollbar-corner { background: transparent; }
@supports not selector(::-webkit-scrollbar) {
  .fes-app * { scrollbar-width: thin; scrollbar-color: var(--axis) transparent; }
}

/* Table pagination footer. */
.fes-app .table-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.fes-app .table-pager:empty { display: none; }
.fes-app .pager-range { font-variant-numeric: tabular-nums; }
.fes-app .pager-pages { display: flex; align-items: center; gap: 2px; }
.fes-app .page-btn { min-width: 30px; height: 30px; padding: 0 8px; border: 0; border-radius: var(--s-radius-sm); background: none; color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; }
.fes-app .page-btn:hover:not(:disabled) { background: var(--s-surface-2); }
.fes-app .page-btn.current { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.fes-app .page-btn:disabled { color: var(--muted); opacity: 0.45; cursor: default; }
.fes-app .page-gap { padding: 0 4px; }
html[data-skin] .fes-app label.pager-size { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
html[data-skin] .fes-app .pager-size select { width: auto; height: 30px; }
html[data-skin="terminal"] .fes-app .table-pager { padding: 8px 12px; font-family: var(--mono); font-size: 11.5px; }
html[data-skin="terminal"] .fes-app .page-btn { min-width: 26px; height: 26px; }
html[data-skin="terminal"] .fes-app label.pager-size select { height: 26px; }

/* Symbols panel: header, search, top-N + Reset/Clear, list. */
.fes-app .picker-head .group-title, .fes-app .watch-head .section-title { margin: 0; }
.fes-app .picker-head, .fes-app .watch-head { margin-bottom: 10px; }
.fes-app .picker-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
html[data-skin] .fes-app label.top-label { display: inline-flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
html[data-skin] .fes-app select.top-select { width: auto; }
html[data-skin="explorer"] .fes-app select.top-select { height: 32px; border-radius: 10px; }
html[data-skin="terminal"] .fes-app select.top-select { height: 26px; }
.fes-app .picker-actions { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.fes-app .link-btn { padding: 2px 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.fes-app .link-btn:hover { text-decoration: underline; }
.fes-app .asset-more { display: block; width: 100%; padding: 12px; font-size: 13px; text-align: center; }
.notice { max-width: var(--s-max); margin: 12px auto; padding: 14px var(--s-gutter); color: var(--muted); }
.fes-app .chart-panel.is-loading #chartMount { opacity: 0.55; transition: opacity 150ms ease; }

/* Server-rendered insights: tables + FAQ. */
.site-container { width: 100%; max-width: var(--s-max); margin: 0 auto; padding: 0 var(--s-gutter); }
.insights { padding-top: 32px; padding-bottom: 24px; color: var(--ink); }
.insights section { margin-bottom: 36px; }
.insights h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.01em; }
.insights p { margin: 0 0 14px; max-width: 920px; color: var(--muted); line-height: 1.6; }
.insights .faq h3 { margin: 22px 0 6px; font-size: 16px; color: var(--ink); }
.insights .faq p { margin-bottom: 0; }
.table-note { font-size: 13px; }
.insights a, .prose a, .site-footer a { color: var(--accent); }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--s-radius-sm); background: var(--s-surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; }
.data-table thead th { background: var(--s-surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table .num { text-align: right; font-family: var(--s-num); }
.data-table tbody th { font-weight: 500; color: var(--muted); max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.data-table .sym { font-weight: 700; color: var(--ink); margin-right: 6px; font-family: var(--s-num); }
.data-table .sym-name { font-size: 12.5px; }
.data-table abbr { text-decoration: none; cursor: help; }
.data-table .positive { color: var(--up); }
.data-table .negative { color: var(--down); }

/* Content pages. */
.content-wrap { padding-top: 24px; padding-bottom: 48px; }
.breadcrumb ol { display: flex; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.prose { max-width: 760px; color: var(--ink); font-size: 16px; line-height: 1.7; }
.prose h1 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 8px; }
.prose h2 { font-size: 22px; line-height: 1.3; margin: 36px 0 10px; }
.prose h3 { font-size: 18px; margin: 26px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose code { font-family: var(--s-num); font-size: 0.92em; background: var(--s-surface-2); padding: 1px 5px; border-radius: 4px; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 14.5px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--s-surface-2); }
.page-dates { color: var(--muted); font-size: 14px; margin-bottom: 28px !important; }

/* Footer. */
.site-footer { margin-top: 24px; border-top: 1px solid var(--line); background: var(--s-surface); color: var(--muted); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 32px; padding-top: 32px; padding-bottom: 24px; }
.footer-name { color: var(--ink) !important; font-weight: 800; font-size: 17px; text-decoration: none; }
.footer-brand p { margin: 8px 0 0; max-width: 520px; line-height: 1.6; }
.footer-note { font-size: 13px; }
.footer-heading { margin: 0 0 10px; color: var(--ink); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; }
.footer-nav ul { margin: 0; padding: 0; list-style: none; }
.footer-nav li { margin-bottom: 8px; }
.footer-nav a { color: var(--muted); text-decoration: none; display: inline-block; padding: 2px 0; }
.footer-nav a:hover { color: var(--accent); text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 22px; border-top: 1px solid var(--line); font-size: 13px; }
.footer-bottom a { color: var(--muted); }

/* First-visit onboarding dialog. */
.onboarding {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--s-radius);
  background: var(--s-surface);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(10, 12, 24, 0.35);
  overflow: auto;
}
.onboarding::backdrop { background: rgba(10, 12, 24, 0.55); backdrop-filter: blur(3px); }
.onboarding-form { padding: 26px 26px 22px; }
.onboarding h2 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.onboarding-desc { margin: 6px 0 18px; color: var(--muted); }
.choice-group { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.choice-group legend { padding: 0; margin-bottom: 10px; font-weight: 700; font-size: 14px; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: var(--s-radius-sm);
  background: var(--s-surface-2);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.choice:hover .choice-body { border-color: var(--muted); }
.choice input:checked + .choice-body { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice input:focus-visible:not(:checked) + .choice-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.choice-text { color: var(--muted); font-size: 13px; }
.choice-shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border-radius: 6px; border: 1px solid var(--line); margin-bottom: 8px; background: var(--line); }
.badge { padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; }
.onboarding-actions { display: flex; justify-content: flex-end; }
.onboarding-submit {
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--s-radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.onboarding-submit:hover { filter: brightness(1.08); }

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  html[data-skin="explorer"] { --s-gutter: 16px; }
}
@media (max-width: 560px) {
  .choice-row { grid-template-columns: 1fr; }
  .choice-row-asset { grid-template-columns: 1fr 1fr; }
  .onboarding-form { padding: 20px 16px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Keep the 760px-minimum chart from widening the page on small screens. */
html[data-skin] .fes-app #chartMount { overflow-x: auto; }
html[data-skin] .fes-app .main { min-width: 0; }
@media (max-width: 1000px) {
  html[data-skin="explorer"] .fes-app .layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  html[data-skin="terminal"] .fes-app .app { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  html[data-skin="explorer"] .fes-app .seg { flex-wrap: wrap; max-width: 100%; border-radius: 16px; }
  html[data-skin="terminal"] .fes-app .seg-scroll { max-width: 100%; }
  html[data-skin="terminal"] .fes-app .chart-controls { max-width: 100%; }
  html[data-skin="terminal"] .fes-app .panel-head { flex-wrap: wrap; }
}
