/* Shared chrome for the Isometric Bengaluru pieces.
   Each page defines its own tokens (--bg, --ink, --muted, --rule, --panel, --accent)
   on :root; everything here reads from them. */
:root {
  --display: "Anek Kannada", "Noto Sans Kannada", "Avenir Next Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Anek Kannada", "Noto Sans Kannada", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 3vw, 32px);
  --step--1: 0.78rem;
  --step-0: 0.95rem;
  --step-1: 1.15rem;
  --step-3: clamp(2rem, 1.2rem + 3.4vw, 3.6rem);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---------- collection nav ---------- */
.series {
  display: flex; align-items: center; gap: 18px;
  padding: 12px var(--gutter) 0;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase;
  overflow-x: auto; scrollbar-width: none; white-space: nowrap;
  position: relative; z-index: 5;
}
.series::-webkit-scrollbar { display: none; }
.series a { text-decoration: none; color: var(--muted); padding-block: 4px; border-bottom: 1px solid transparent; }
.series a:hover { color: var(--ink); }
.series a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.series .home { color: var(--ink); font-family: var(--display); font-size: 0.95rem; letter-spacing: 0; text-transform: none; font-weight: 700; font-stretch: 112%; }
.series .home span { font-weight: 500; color: var(--muted); }

/* ---------- headings ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 6px;
}
.eyebrow .kn { font-family: var(--display); letter-spacing: 0; text-transform: none; font-size: 0.9rem; color: var(--accent); margin-right: 6px; font-weight: 600; }
h1.title {
  font-family: var(--display); font-weight: 800; font-stretch: 118%;
  font-size: var(--step-3); line-height: 0.92; letter-spacing: -0.01em;
  margin: 0; text-wrap: balance;
}
.dek { margin: 10px 0 0; max-width: 44ch; color: var(--muted); font-size: var(--step-0); text-wrap: pretty; }
.dek b { color: var(--ink); font-weight: 600; }

/* ---------- tooltip ---------- */
.tip {
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 6px;
  padding: 8px 10px; min-width: 150px; max-width: 260px;
  font-size: 0.8rem; line-height: 1.35;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  transform: translate(-9999px, -9999px);
}
.tip .t-head { font-weight: 700; font-family: var(--display); font-size: 0.95rem; font-stretch: 108%; }
.tip .t-row { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }
.tip .t-row span:first-child { color: var(--muted); }
.tip .t-note { color: var(--muted); margin-top: 4px; font-size: 0.74rem; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 6px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--rule); background: var(--panel); border-radius: 999px;
  padding: 7px 14px; cursor: pointer;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase;
}
.btn:hover { border-color: var(--ink); }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- data table sheet ---------- */
.sheet {
  position: fixed; inset: auto var(--gutter) calc(var(--gutter) + env(safe-area-inset-bottom, 0px)) var(--gutter);
  max-width: 760px; margin-inline: auto; max-height: 70%;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 10px;
  padding: 16px 18px; z-index: 40; overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.sheet h2 { font-family: var(--display); font-stretch: 110%; font-size: 1.1rem; margin: 0 0 8px; }
.sheet table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 0.8rem; }
.sheet th, .sheet td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.sheet th:first-child, .sheet td:first-child { text-align: left; }
.sheet th { font-family: var(--mono); font-weight: 500; font-size: 0.66rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.sheet .table-wrap { overflow-x: auto; }
.sheet .close { float: right; }

.source { font-size: 0.72rem; color: var(--muted); line-height: 1.4; }
.source a { color: var(--muted); }

.legend-key { display: inline-flex; align-items: center; gap: 6px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- "/" hides the chrome and leaves only the visualization (viz-only.js) ---------- */
.viz-only .series, .viz-only .intro, .viz-only .legend, .viz-only .ledger, .viz-only .rail, .viz-only .note,
.viz-only .panel, .viz-only .sheet, .viz-only .head, .viz-only .text, .viz-only .rest, .viz-only .mast, .viz-only .foot, .viz-only .touch-hint { display: none !important; }
.viz-only .stage { position: fixed; inset: 0; height: auto; min-height: 0; z-index: 1; }
.viz-only .wrap { grid-template-columns: minmax(0, 1fr); grid-template-areas: "fig"; max-width: none; padding-block: 12px; }
.viz-only .figure { display: grid; place-items: center; min-height: calc(100vh - 24px); }
.viz-only .figure svg { max-height: calc(100vh - 24px); }
.viz-only #cv { height: calc(100vh - 24px); }
.viz-hint {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 60; pointer-events: none;
  transform: translate(-50%, 12px); opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease;
  background: var(--panel); color: var(--ink); border: 1px solid var(--rule); border-radius: 999px; padding: 7px 14px;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
}
.viz-hint.show { opacity: 1; transform: translate(-50%, 0); }
/* the on-screen alternative to "/" — stays visible while everything else is hidden */
.viz-toggle {
  position: fixed; z-index: 60; top: calc(7px + env(safe-area-inset-top, 0px)); right: var(--gutter);
  padding: 5px 12px; font-size: 0.62rem; backdrop-filter: blur(6px);
  background: color-mix(in srgb, var(--panel) 85%, transparent);
}
.viz-only .viz-toggle { opacity: 0.6; }
.viz-only .viz-toggle:hover, .viz-only .viz-toggle:focus-visible { opacity: 1; }
.has-viz-toggle .series { padding-right: calc(var(--gutter) + 120px); }
