/*
 * Manicode brand theme, mirroring manicode/website src/styles/app.css:
 * Zinc neutrals, Rose brand color, Inter. The site is dark-only, so this page is too.
 */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-variable.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  /* Brand: Rose */
  --brand: #be123c;        /* rose-700 */
  --brand-hover: #9f1239;  /* rose-800 */
  --brand-bright: #f43f5e; /* rose-500, for thin marks and focus rings on dark */
  /* Zinc scale */
  --surface-0: #09090b;    /* canvas, zinc-950 */
  --surface-1: #18181b;    /* surface, zinc-900 */
  --surface-2: #27272a;    /* elevated, zinc-800 */
  --text-primary: #fafafa; /* content, zinc-50 */
  --text-secondary: #d4d4d8; /* dim, zinc-300 */
  --text-muted: #a1a1aa;   /* subtle, zinc-400 */
  --grid: #27272a;         /* divide, zinc-800 */
  --axis: #52525b;         /* edge, zinc-600 */
  --border: #27272a;
  --link: #60a5fa;         /* blue-400 */
  /* Categorical series, in stack order. Checked against #18181b with the dataviz palette
     validator: neighboring bands pass every check. Slot 1 is the brand Rose. */
  --series-1: #f43f5e; /* rose-500 */
  --series-2: #3b82f6; /* blue-500 */
  --series-3: #d97706; /* amber-600 */
  --series-4: #7c3aed; /* violet-600 */
  --series-5: #0d9488; /* teal-600 */
  --series-6: #d946ef; /* fuchsia-500 */
  --series-7: #65a30d; /* lime-600 */
  --series-8: #71717a; /* zinc-500, folds any extra category into a neutral */
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--surface-0);
  /* The website's rose glow at the top of the page. */
  background-image: radial-gradient(60% 50% at 50% -10%, rgb(190 18 60 / 0.16), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text-primary);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
main { max-width: 1152px; margin: 0 auto; padding: 0 16px 48px; }
a { color: var(--link); }

.brand-bar { display: flex; align-items: center; height: 72px; border-bottom: 1px solid var(--border); margin-bottom: 40px; }
.brand { display: flex; align-items: center; gap: 4px; color: var(--text-primary); text-decoration: none; font-size: 20px; font-weight: 900; text-transform: uppercase; }
.brand svg { height: 18px; width: auto; fill: var(--brand); }
.brand-accent { color: var(--brand); }

.eyebrow { margin: 0 0 12px; color: var(--brand-bright); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.2em; }
h1 { font-size: 36px; line-height: 1.1; letter-spacing: -0.025em; font-weight: 700; margin: 0 0 12px; }
h2 { font-size: 12px; margin: 0 0 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; }
.subtitle { margin: 0; color: var(--text-secondary); font-size: 16px; line-height: 1.6; max-width: 70ch; }

.counter { display: flex; flex-wrap: wrap; gap: 32px; margin: 20px 0 16px; }
.stat { display: flex; flex-direction: column; min-width: 120px; }
.stat .label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; }
.stat .value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .sub { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; min-height: 1.45em; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; }
.controls label { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); }
button, select {
  font: inherit;
  color: var(--text-primary);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}
button:hover, select:hover { background: var(--surface-2); }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--brand-bright); outline-offset: 2px; }
#play { min-width: 80px; font-weight: 600; color: #fff; background: var(--brand); border-color: var(--brand); }
#play:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
#scrubber { flex: 1 1 200px; min-width: 160px; accent-color: var(--brand-bright); }
.segmented { display: inline-flex; }
.segmented button { border-radius: 0; margin-left: -1px; }
.segmented button:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.segmented button:last-child { border-radius: 0 8px 8px 0; }
.segmented button[aria-pressed="true"] { background: var(--surface-2); color: var(--text-primary); border-color: var(--axis); position: relative; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
@media (max-width: 820px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.chart-panel, .ticker, .table-view {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.chart-panel { position: relative; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; padding: 0; color: var(--text-secondary); font-size: 12px; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.series-1 { background: var(--series-1); }
.series-2 { background: var(--series-2); }
.series-3 { background: var(--series-3); }
.series-4 { background: var(--series-4); }
.series-5 { background: var(--series-5); }
.series-6 { background: var(--series-6); }
.series-7 { background: var(--series-7); }
.series-8 { background: var(--series-8); }

.axis text { fill: var(--text-muted); font-size: 11px; }
.axis path, .axis line { stroke: var(--axis); }
.grid line { stroke: var(--grid); }
.grid path { display: none; }
.band { stroke: var(--surface-1); stroke-width: 1; }
.band.dim { opacity: 0.35; }
.playhead { stroke: var(--text-primary); stroke-width: 1; stroke-dasharray: 3 3; }
.crosshair { stroke: var(--text-secondary); stroke-width: 1; }

.tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface-2);
  border: 1px solid var(--axis);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.5);
  min-width: 200px;
  z-index: 2;
}
.tooltip .tt-head { font-weight: 600; margin-bottom: 4px; }
.tooltip .tt-row { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 6px; align-items: center; font-variant-numeric: tabular-nums; }
.tooltip .tt-row.active { font-weight: 600; }
.tooltip .swatch { width: 10px; height: 10px; border-radius: 3px; }
.tooltip .tt-row span:nth-child(3), .tooltip .tt-row span:nth-child(4) { text-align: right; }
.tooltip .tt-row span:nth-child(4) { color: var(--text-muted); min-width: 34px; }

.ticker { max-height: 500px; overflow: auto; }
.ticker ol { list-style: none; margin: 0; padding: 0; }
.ticker .release { margin-bottom: 12px; transition: opacity 0.3s; }
.ticker .fade-1 { opacity: 0.85; }
.ticker .fade-2 { opacity: 0.7; }
.ticker .fade-3 { opacity: 0.55; }
.ticker .fade-4 { opacity: 0.4; }
.ticker .fade-5 { opacity: 0.35; }
.ticker .release-head { font-weight: 600; font-size: 12px; margin-bottom: 2px; }
.ticker .release-head span { color: var(--text-muted); font-weight: 400; }
.ticker .item { display: grid; grid-template-columns: 14px 10px 1fr; gap: 6px; align-items: baseline; font-size: 12px; color: var(--text-secondary); }
.ticker .item .sign { font-weight: 700; color: var(--text-primary); }
.ticker .item .swatch { width: 8px; height: 8px; border-radius: 2px; }
.ticker .more, .ticker .quiet { font-size: 12px; color: var(--text-muted); padding-left: 30px; }

.table-view { margin-top: 16px; }
.table-view summary { cursor: pointer; color: var(--text-secondary); }
.table-view table { border-collapse: collapse; width: 100%; margin-top: 12px; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--grid); }
.table-view th:first-child, .table-view td:first-child { text-align: left; }
.table-view th { color: var(--text-secondary); font-weight: 600; font-size: 12px; }

.footnote { color: var(--text-muted); font-size: 12px; margin-top: 16px; }
