/* BTC Desk (ADR-022). One family, Archivo; its width axis carries the voice: wide for prices and headings,
   normal for reading. Cool chart-paper ground, navy ink, bitcoin orange only for "now". */

:root {
  color-scheme: light;
  --page: #e9eef2;
  --surface: #f8fafb;
  --ink: #13253a;
  --ink-2: #4b5d70;
  --muted: #6c7b8b;
  --rule: #cbd5de;
  --track: #dde5ec;
  --open: #2f4a66;
  --open-soft: #8fa3b8;
  --now: #d9750b;
  --flow-in: #2a78d6;
  --flow-out: #e34948;
  --grid: #dfe5ea;
  --focus: #1c5cab;
  --radius-lg: 14px;
  --radius-sm: 6px;
  --wrap: 1180px;
  --gutter: 16px;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variation-settings: "wdth" 100;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0e1620;
    --surface: #142130;
    --ink: #e6edf3;
    --ink-2: #a9b8c6;
    --muted: #8495a5;
    --rule: #26384b;
    --track: #1c2d3e;
    --open: #b9cadb;
    --open-soft: #5f7489;
    --now: #f7931a;
    --flow-in: #3987e5;
    --flow-out: #e66767;
    --grid: #22344a;
    --focus: #86b6ef;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e1620;
  --surface: #142130;
  --ink: #e6edf3;
  --ink-2: #a9b8c6;
  --muted: #8495a5;
  --rule: #26384b;
  --track: #1c2d3e;
  --open: #b9cadb;
  --open-soft: #5f7489;
  --now: #f7931a;
  --flow-in: #3987e5;
  --flow-out: #e66767;
  --grid: #22344a;
  --focus: #86b6ef;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

h1, h2, h3 { margin: 0; font-variation-settings: "wdth" 112; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; line-height: 1.25; }
p { margin: 0; }

/* ------------------------------------------------ masthead */

.masthead { border-bottom: 1px solid var(--rule); }
.masthead__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 12px; }
.brand { font-variation-settings: "wdth" 125; font-weight: 750; font-size: 1.05rem; letter-spacing: 0.01em; display: flex; align-items: center; gap: 10px; }
.brand__mark { width: 12px; height: 12px; border-radius: 50%; background: var(--now); display: inline-block; }
.clock { color: var(--ink-2); font-size: 0.95rem; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------ hero: price + the day */

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 40px;
  padding: 32px 0 36px;
  border-bottom: 1px solid var(--rule);
}

.price__usd {
  font-variation-settings: "wdth" 125;
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.price__inr { margin-top: 10px; font-variation-settings: "wdth" 112; font-weight: 500; font-size: 1.3rem; color: var(--ink-2); }
.price__moves { margin-top: 18px; display: grid; gap: 4px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.price__moves strong { color: var(--ink); font-weight: 600; }

.day__title { font-size: 1.05rem; color: var(--ink-2); font-weight: 550; margin-bottom: 14px; }

.day__band { position: relative; --label-col: 148px; }
.band__hours { display: grid; grid-template-columns: repeat(8, 1fr); height: 20px; margin-left: calc(var(--label-col) + 10px); font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.band__hours span { border-left: 1px solid var(--rule); padding-left: 4px; }
.band__row { display: grid; grid-template-columns: var(--label-col) 1fr; align-items: center; gap: 10px; height: 30px; }
.band__label { font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.band__short { display: none; }
.band__track { position: relative; height: 14px; background: var(--track); border-radius: 7px; overflow: hidden; }
.band__open { position: absolute; top: 0; bottom: 0; background: var(--open-soft); border-radius: 7px; }
.band__open--live { background: var(--open); }
.band__overlay { position: absolute; top: 20px; bottom: 0; right: 0; left: calc(var(--label-col) + 10px); pointer-events: none; }
.band__now { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--now); }
.band__now::before { content: ""; position: absolute; top: -8px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--now); }
.band__event { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dotted var(--ink-2); }

.day__status { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 24px; font-size: 0.9rem; color: var(--ink-2); }
.day__status strong { color: var(--ink); font-weight: 600; }
.day__note { margin-top: 12px; font-size: 0.9rem; color: var(--ink-2); max-width: 68ch; }
.day__events { margin-top: 18px; display: grid; gap: 8px; }
.event { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: baseline; padding: 10px 14px; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--surface); }
.event__when { font-variation-settings: "wdth" 112; font-weight: 650; font-variant-numeric: tabular-nums; }
.event__what { color: var(--ink-2); }

/* ------------------------------------------------ blocks */

.block { padding: 32px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.block > h2 { margin-bottom: 8px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; border-bottom: 1px solid var(--rule); }
.pair > .block { border-bottom: 0; }
.lede { color: var(--ink-2); max-width: 64ch; margin-bottom: 16px; }
.subhead { font-size: 1rem; margin-top: 28px; margin-bottom: 10px; }
.hint { color: var(--muted); font-size: 0.85rem; margin-top: 8px; max-width: 60ch; }

.source { margin-top: 12px; font-size: 0.8rem; color: var(--muted); }
.source.is-stale { color: var(--ink); background: color-mix(in srgb, var(--now) 14%, transparent); padding: 6px 10px; border-radius: var(--radius-sm); }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 16px 0 0; }
.facts--network { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.facts div { min-width: 0; }
.facts dt { font-size: 0.85rem; color: var(--ink-2); }
.facts dd { margin: 2px 0 0; font-variation-settings: "wdth" 112; font-weight: 650; font-size: 1.35rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.facts dd small { display: block; font-variation-settings: "wdth" 100; font-weight: 400; font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

/* ------------------------------------------------ charts */

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .axis text, .chart .label { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .baseline { stroke: var(--rule); stroke-width: 1; }
.chart .bar-in { fill: var(--flow-in); }
.chart .bar-out { fill: var(--flow-out); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar-in, .chart .hit:hover + .bar-out { opacity: 0.8; }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--now); stroke: var(--surface); stroke-width: 2; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .legend { fill: var(--ink-2); font-size: 11px; }

.mood { display: flex; align-items: baseline; gap: 14px; margin-top: 8px; }
.mood__value { font-variation-settings: "wdth" 125; font-weight: 700; font-size: 3rem; line-height: 1; }
.mood__label { font-size: 1.15rem; font-weight: 550; color: var(--ink-2); }
.chart--spark { margin-top: 12px; }

.table-view { margin-top: 14px; font-size: 0.9rem; }
.table-view summary { cursor: pointer; color: var(--ink-2); }
.table-view table { margin-top: 10px; border-collapse: collapse; width: 100%; max-width: 360px; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { text-align: left; padding: 4px 8px 4px 0; border-bottom: 1px solid var(--rule); }
.table-view td:last-child, .table-view th:last-child { text-align: right; }

.tip {
  position: fixed; z-index: 20; pointer-events: none; max-width: 240px;
  background: var(--ink); color: var(--surface); font-size: 0.8rem; line-height: 1.35;
  padding: 7px 10px; border-radius: var(--radius-sm); font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------ news */

.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.news li { padding: 12px 0; border-top: 1px solid var(--rule); display: grid; gap: 2px; }
.news li:first-child { border-top: 0; padding-top: 4px; }
.news a { font-weight: 550; text-decoration: none; }
.news a:hover { text-decoration: underline; }
.news .meta { font-size: 0.8rem; color: var(--muted); }

/* ------------------------------------------------ TradingView */

.tv { position: relative; width: 100%; margin-top: 8px; }
.tv--chart { height: 520px; }
.tv--tickers { height: 330px; }
.tv--calendar { height: 520px; }
.tv .tradingview-widget-container { height: 100%; }
.tv .tradingview-widget-copyright { font-size: 0.75rem; color: var(--muted); margin-top: 6px; }
.tv .tradingview-widget-copyright a { color: var(--muted); }

/* ------------------------------------------------ footer */

.footer { padding: 36px 0 56px; color: var(--ink-2); font-size: 0.9rem; }
.footer__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.footer h2 { font-size: 1rem; color: var(--ink); margin-bottom: 10px; }
.footer p { max-width: 62ch; margin-bottom: 10px; }
.credits { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }

/* ------------------------------------------------ small screens */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 24px; }
  .pair, .footer__grid { grid-template-columns: 1fr; gap: 0; }
  .footer__grid { gap: 24px; }
  .pair > .block + .block { border-top: 1px solid var(--rule); }
  .tv--chart { height: 420px; }
}

@media (max-width: 520px) {
  .day__band { --label-col: 84px; }
  .band__label { font-size: 0.8rem; }
  .band__long { display: none; }
  .band__short { display: inline; }
  .event { grid-template-columns: 1fr; }
  .band__hours { grid-template-columns: repeat(4, 1fr); }
  .band__hours span:nth-child(even) { display: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts dd { font-size: 1.15rem; }
}

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

@media (forced-colors: active) {
  .band__open, .chart .bar-in, .chart .bar-out { forced-color-adjust: none; }
}
