/* oakvilleleo.com/data-analytics: built on sheridan.css (same type, ink, bands and cards); this file adds the charts.
   City colours: Beijing orange, Toronto blue (categorical slots 2 and 1, validated as a pair). Maps use one-hue ramps of the same two. */
:root {
  --bj: #eb6834; --to: #2a78d6; --bj-d: #d95926; --to-d: #3987e5;
  --c3: #1baf7a; --c4: #eda100;
  --grid: #e6e5e2; --axis: #8d8b88; --muted: #6b696e;
  --ramp-o: #fdeee6, #f9c9ad, #f4a075, #eb6834, #c94d1d, #9a3812, #6b2509;
  --ramp-b: #cde2fb, #9ec5f4, #6da7ec, #3987e5, #256abf, #184f95, #0d366b;
}
.cap { font-size: 13px; color: var(--ink-3); margin: 10px 0 0; letter-spacing: .3px; }
.hero .kicker { margin-bottom: 18px; }

/* hex map */
.hexmap { position: relative; margin: 0; background: #fbfaf8; aspect-ratio: 16 / 10; overflow: hidden; }
.hexmap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hex-year { position: absolute; top: 18px; left: 22px; font: 300 clamp(44px, 7vw, 96px)/1 Outfit, sans-serif; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; pointer-events: none; }
.hex-ui { position: absolute; left: 22px; right: 22px; bottom: 18px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hex-play { width: 40px; height: 40px; border: 1px solid var(--ink); background: #fff; font-size: 13px; cursor: pointer; flex: 0 0 auto; }
.hex-range { flex: 1 1 200px; accent-color: var(--bj); }
.hex-legend, .map-legend { display: grid; grid-template-columns: auto 160px auto; grid-template-areas: "t t t" "lo r hi"; column-gap: 8px; row-gap: 4px; font-size: 12px; color: var(--ink-3); align-items: center; }
.hex-legend span, .map-legend > span { grid-area: t; letter-spacing: .3px; }
.hex-legend i, .map-legend > i { grid-area: r; height: 8px; border-radius: 4px; }
.hex-legend .lo, .map-legend .lo { grid-area: lo; font-weight: 400; }
.hex-legend .hi, .map-legend .hi { grid-area: hi; font-weight: 400; }
.ramp-o { background: linear-gradient(90deg, var(--ramp-o)); }
.ramp-b { background: linear-gradient(90deg, var(--ramp-b)); }
.hex-tip, .map-tip, .chart-tip { position: absolute; z-index: 5; pointer-events: none; background: #fff; color: var(--ink); border: 1px solid var(--grid); box-shadow: 0 6px 24px rgba(20, 19, 22, .12); padding: 9px 12px; font-size: 13px; line-height: 1.45; min-width: 150px; }
.chart-tip { position: fixed; z-index: 70; }
.hex-tip b, .map-tip b, .chart-tip b { font-weight: 600; }
.chart-tip .k { display: inline-block; width: 10px; height: 2px; vertical-align: middle; margin-right: 6px; }

/* charts (SVG) */
.chart { margin: clamp(24px, 4vw, 40px) 0 0; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; font-family: Outfit, sans-serif; }
.chart .gl { stroke: var(--grid); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 12px; font-weight: 300; }
.chart .lbl { fill: var(--ink); font-size: 13px; font-weight: 400; }
.chart .ttl { fill: var(--ink); font-size: 13px; font-weight: 400; letter-spacing: 1.4px; text-transform: uppercase; }
.chart .ann { fill: var(--ink-3); font-size: 12px; }
.chart .annl { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .xh { stroke: var(--ink); stroke-width: 1; opacity: .35; }
.chart.dark .gl { stroke: #34323a; }
.chart.dark .ax, .chart.dark .ann { fill: #a9a7ae; }
.chart.dark .lbl, .chart.dark .ttl { fill: #fff; }
.chart.dark .annl, .chart.dark .xh { stroke: #a9a7ae; }
.two { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 4vw, 56px); }

/* scatter */
.scatter-wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.scatter { position: relative; margin: 0; aspect-ratio: 1; background: #fbfaf8; }
.scatter canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sc-big { margin: 18px 0 0; }
.sc-big b { display: block; font-size: clamp(44px, 5vw, 64px); font-weight: 300; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.sc-big span { font-size: 15px; color: var(--ink-3); }

.premia { list-style: none; padding: 0; margin: clamp(32px, 4vw, 48px) 0 10px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.premia li { padding: 20px 16px 0 0; }
.premia b { display: block; font-size: clamp(30px, 3.4vw, 44px); font-weight: 300; color: var(--bj-d); line-height: 1; }
.premia span { display: block; font-size: 15px; color: var(--ink-3); margin-top: 8px; max-width: 20ch; }

/* calculator */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; align-items: start; }
.calc label { display: grid; gap: 6px; font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; }
.calc label span { display: flex; align-items: center; gap: 12px; text-transform: none; letter-spacing: 0; }
.calc input[type=range] { flex: 1; accent-color: var(--bj-d); }
.calc output { font-size: 16px; min-width: 70px; font-variant-numeric: tabular-nums; }
.calc select { font: 300 16px Outfit, sans-serif; padding: 8px 10px; border: 1px solid var(--ink); background: #fff; color: var(--ink); }
.checks { display: flex; gap: 22px; align-items: center; padding-top: 18px; }
.checks label { display: flex; gap: 8px; align-items: center; font-size: 15px; letter-spacing: 0; text-transform: none; }
.checks input { width: 18px; height: 18px; accent-color: var(--bj-d); }
.calc-out { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 20px; }
.calc-big { margin: 0; display: flex; align-items: baseline; gap: 12px; }
.calc-big b { font-size: clamp(40px, 5vw, 60px); font-weight: 300; color: var(--bj-d); font-variant-numeric: tabular-nums; }
.calc-big span { font-size: 15px; color: var(--ink-3); }

/* Toronto map */
.tomap { position: relative; margin: 8px 0 0; background: #fbfaf8; }
.tomap svg { display: block; width: 100%; height: auto; }
.tomap path { stroke: #fff; stroke-width: .6; vector-effect: non-scaling-stroke; transition: fill .6s; cursor: pointer; }
.tomap path:hover, .tomap path.is-on { stroke: var(--ink); stroke-width: 1.6; }
.tomap circle { fill: #fff; stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-legend { position: absolute; left: 18px; bottom: 16px; background: rgba(251, 250, 248, .9); padding: 8px 10px; }
.map-legend em { grid-column: 1 / -1; font-style: normal; display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.map-legend .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 1.5px solid var(--ink); display: inline-block; }

/* side by side, on ink */
.ink { background: var(--ink); color: #fff; padding: clamp(64px, 9vw, 120px) 0; }
.ink .kicker { color: #fff; }
.ink .note { color: #b9b7bd; }
.ink .prose p { color: #e7e5ea; }
.split.gap { margin-top: clamp(64px, 9vw, 110px); }
.toggle { display: inline-flex; gap: 10px; align-items: center; margin-top: 14px; font-size: 14px; color: #d8d6dc; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--to-d); }
.takeaways { list-style: none; padding: 0; margin: clamp(64px, 9vw, 110px) 0 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #4d4b4f; }
.takeaways li { padding: 24px 24px 0 0; }
.takeaways li + li { padding-left: 24px; border-left: 1px solid #2f2d33; }
.takeaways em { font-style: normal; font-size: 12px; letter-spacing: 1.5px; color: #8fb4e8; }
.takeaways h4 { margin: 10px 0; color: #fff; }
.takeaways p { font-size: 16px; color: #c9c7cd; margin: 0; }
.method p { font-size: 16px; }

@media (max-width: 960px) {
  .two, .scatter-wrap { grid-template-columns: 1fr; }
  .premia { grid-template-columns: 1fr 1fr; }
  .premia li:nth-child(n+3) { padding-top: 26px; }
  .takeaways { grid-template-columns: 1fr; }
  .takeaways li, .takeaways li + li { padding: 22px 0; border-left: 0; border-bottom: 1px solid #2f2d33; }
}
@media (max-width: 640px) {
  .hexmap { aspect-ratio: 4 / 5; }
  .hex-year { font-size: 44px; top: 12px; left: 14px; }
  .hex-ui { left: 12px; right: 12px; bottom: 12px; gap: 10px; }
  .hex-legend, .map-legend { grid-template-columns: auto 110px auto; }
  .calc { grid-template-columns: 1fr; }
  .map-legend { position: static; margin-top: 8px; background: none; }
  .tabs button { font-size: 11px; letter-spacing: 1px; }
}
