/* Overview — the city dossier.
   The banner is full-bleed; everything after it sits inside the page gutter,
   so the content below the fold has one left edge. All spacing comes from the
   --sp scale in base.css. */

/* ------------------------------------------------------ A. the banner */
.banner {
  position: relative;
  min-height: clamp(410px, 55vh, 545px);
  display: flex;
  background: var(--surface-3);
  /* deliberately NOT overflow:hidden — the host picker opens past the banner's
     bottom edge, and clipping it here silently cut the last rows off. The photo
     is clipped by .bmedia instead. */
}
.banner .bmedia {
  position: absolute;
  inset: 0;
  overflow: hidden;   /* contains the photo's entrance zoom */
  z-index: 0;
}
.banner .bphoto {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 520ms var(--ease), transform 900ms var(--ease);
}
.banner .bphoto.in { opacity: 1; transform: none; }
.banner .bscrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 9, 7, 0.58) 0%, rgba(12, 9, 7, 0.20) 34%, rgba(12, 9, 7, 0.80) 100%),
    linear-gradient(96deg, rgba(12, 9, 7, 0.66) 0%, rgba(12, 9, 7, 0.10) 62%);
}

.binner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  color: #fff;
  /* the photo runs edge to edge; its content lines up with the column below */
  padding-block: var(--sp-6) var(--sp-7);
  padding-inline: max(var(--gutter), calc((100% - var(--col)) / 2));
}
.btop { display: flex; align-items: center; gap: var(--sp-4); }
.brank {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* --- the host-city picker: nothing visible until you ask for it --- */
.btop .pickwrap { position: relative; margin-left: auto; }
.citypick {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font: 600 13px/1 var(--font);
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--r-pill);
  padding: 11px 16px;
  cursor: pointer;
  transition: background var(--fast), border-color var(--fast);
}
.citypick:hover { background: rgba(255, 255, 255, 0.24); border-color: rgba(255, 255, 255, 0.45); }

.bmain {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  gap: var(--sp-7);
  flex-wrap: wrap;
}
.bwho { flex: 1; min-width: 260px; }
.bwho h1 {
  font-size: clamp(38px, 5.2vw, 62px);
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.02;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.bsay {
  margin-top: var(--sp-3);
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  max-width: 52ch;
}
.bsay b { color: #fff; font-weight: 700; }

/* the readiness gauge — the band is drawn faintly and named only on hover */
.gauge {
  position: relative;
  width: 214px;
  flex: none;
  text-align: center;
  padding: var(--sp-4) var(--sp-3) var(--sp-3);
  border-radius: var(--r-3);
  /* the photo behind this is unpredictable — the plate guarantees contrast */
  background: rgba(14, 11, 9, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.gauge svg { width: 190px; height: 114px; }
.gauge .gv {
  font-family: var(--display);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #fff;
  margin-top: -48px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.gauge .gl {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  margin-top: var(--sp-2);
}
.gauge .gb {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity var(--fast);
}
.gauge:hover .gb, .gauge:focus-visible .gb { opacity: 1; }

/* --- the condensed header that takes over once the banner scrolls away --- */
.stickybar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding-block: var(--sp-3);
  padding-inline: max(var(--gutter), calc((100% - var(--col)) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--sh-2);
  animation: slideDown 240ms var(--ease);
}
.stickybar[hidden] { display: none; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-100%); }
  to { opacity: 1; transform: none; }
}
.stickybar img { width: 34px; height: 34px; object-fit: cover; border-radius: var(--r-1); }
.stickybar b { font-family: var(--display); font-size: 16px; font-weight: 700; letter-spacing: -0.015em; }
.stickybar .sp { flex: 1; }
.stickybar .sready { font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: baseline; gap: var(--sp-2); }
.stickybar .sready em {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.02em;
}

/* ------------------------------------------------------------ B. KPI row */
.secthead {
  margin: var(--sp-7) 0 var(--sp-4);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-5);
  flex-wrap: wrap;
}
.secthead .shtxt { flex: 1; min-width: 260px; }
.secthead h2 { font-size: 19px; }
.secthead p { font-size: 13.5px; color: var(--ink-3); margin-top: var(--sp-1); max-width: 96ch; }

/* the focus indicator — visible proof of why the page has narrowed, and the
   way back out */
.focusbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--sh-1);
}
.focusbar[hidden] { display: none; }
.focusbar .fl {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}
.focusbar .fl svg { color: var(--dc); }
.focusbar .fl b { color: var(--ink); font-weight: 700; }
.focusbar .fclear {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font: 600 12px/1 var(--font);
  color: var(--ink-2);
  background: var(--surface-3);
  border: 0;
  border-radius: var(--r-pill);
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast), color var(--fast);
}
.focusbar .fclear:hover { background: var(--accent); color: var(--accent-ink); }

/* anything the focused driver does not bear on recedes rather than vanishing */
.kpi.dim, .mixbar span.dim, .mixkey span.dim, .drow.dim {
  opacity: 0.34;
  transition: opacity var(--fast);
}
.kpi.dim:hover, .drow.dim:hover { opacity: 1; }

.kpirow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-4);
}
.kpi {
  position: relative;
  text-align: left;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: var(--sh-2);
  cursor: pointer;
  overflow: hidden;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: border-color var(--fast), transform var(--fast), box-shadow var(--fast);
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }
.kpi.on { border-color: var(--m, var(--accent)); box-shadow: 0 0 0 1px var(--m, var(--accent)), var(--sh-2); }
.kpi.input { background: var(--surface-2); }

.kpi .top { display: flex; align-items: center; gap: var(--sp-3); }
.kpi .ic {
  width: 34px; height: 34px;
  border-radius: var(--r-1);
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--m) 14%, transparent);
  color: var(--m, var(--ink-2));
  flex: none;
}
.kpi .lbl { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.kpi .val {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.05;
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}
.kpi .val .u {
  font-family: var(--font);
  font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: 0;
}
.kpi .peer { display: block; }
.kpi .eq { font-size: 12px; color: var(--ink-3); }

/* trend sparkline: this city against the 11-host median */
.kpi .spark { position: relative; display: block; margin: 0 calc(var(--sp-1) * -1); }
.kpi .spark svg { width: 100%; height: 58px; overflow: visible; }
.smed { fill: none; stroke: var(--ink-3); stroke-width: 1.3; stroke-dasharray: 4 3;
        opacity: 0.6; vector-effect: non-scaling-stroke; }
.stick { fill: var(--ink-3); font: 9px var(--mono); opacity: 0.75; }
.scross { stroke: var(--ink-3); stroke-width: 1; }
.stip {
  position: absolute;
  bottom: calc(100% - 4px);
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 6px 9px;
  border-radius: var(--r-1);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--fast);
  z-index: 20;
  box-shadow: var(--sh-2);
}
.stip.on { opacity: 1; }
.stip b { display: block; font-weight: 700; margin-bottom: 1px; }
.stip .sm { display: block; opacity: 0.65; }

/* ------------------------------------------------- B. composition strip */
.mix { margin-top: var(--sp-4); padding: var(--sp-5) var(--sp-6); }
.mix .mh { display: flex; align-items: baseline; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.mix .mh h3 { font-size: 14.5px; font-weight: 600; }
.mix .mh span { font-size: 12.5px; color: var(--ink-3); }
.mixbar {
  display: flex;
  height: 14px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--surface-3);
  gap: 2px;
}
.mixbar span { height: 100%; display: block; }
.mixkey { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); margin-top: var(--sp-3); }
.mixkey span { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: 12.5px; color: var(--ink-2); }
.mixkey i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.mixkey b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------- B. why it ranks here */
.decomp {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: var(--sp-7);
  padding: var(--sp-6);
}
.decomp .cap { font-size: 12.5px; color: var(--ink-3); margin-bottom: var(--sp-4); line-height: 1.6; }
.decomp .cap b { color: var(--ink); font-weight: 700; }
.decomp .cap.foot { margin: var(--sp-4) 0 0; }
.decomp .wf svg { width: 100%; height: auto; }
.wlab { font: 600 11.5px var(--mono); }
.wfoot { fill: var(--ink-3); font: 10.5px var(--mono); }

.dhead {
  display: grid;
  grid-template-columns: 26px minmax(94px, auto) minmax(0, 1fr) 76px 58px 30px;
  gap: var(--sp-3);
  align-items: center;
  padding: 0 var(--sp-3) var(--sp-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}
.dhead span:nth-child(4),
.dhead span:nth-child(5) { text-align: right; }

.drow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  border-radius: var(--r-1);
  transition: background var(--fast);
}
.drow:hover { background: var(--surface-2); }
.drow.on { background: color-mix(in srgb, var(--dc) 10%, transparent); }

.dmain {
  display: grid;
  grid-template-columns: 26px minmax(94px, auto) minmax(0, 1fr) 76px 58px;
  gap: var(--sp-3);
  align-items: center;
  width: 100%;
  padding: var(--sp-3);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.dmain .di { color: var(--dc, var(--ink-3)); display: grid; place-items: center; }
.dmain .dn { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.dmain .dv { font-size: 12.5px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.dmain .dpts {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.dgo {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 0; border-radius: var(--r-1);
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  opacity: 0.4;
  transition: opacity var(--fast), background var(--fast), color var(--fast);
}
.drow:hover .dgo, .drow.on .dgo, .dgo:focus-visible { opacity: 1; }
.dgo:hover { background: var(--accent); color: var(--accent-ink); }


/* ------------------------------------------------------- B. the chart */


/* ------------------------------------------------------- C. the plays */
/* The .play card and its before/after bars now live in base.css — Compare
   renders the same component for the full playbook. */
.plays {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
  padding: var(--sp-6);
}

.exits {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: 0 var(--sp-6) var(--sp-6);
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .kpirow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decomp { grid-template-columns: 1fr; gap: var(--sp-6); }
  .plays { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .binner { padding-block: var(--sp-5); }
  .bmain { gap: var(--sp-5); }
  .gauge { width: 182px; }
  .gauge svg { width: 158px; height: 96px; }
  .gauge .gv { font-size: 34px; margin-top: -40px; }

  .decomp .wf { display: none; }   /* the rows carry the same story */
  .dhead, .dmain { grid-template-columns: 26px minmax(0, 1fr) 72px 54px; }
  .dhead span:nth-child(3), .dmain .bullet { display: none; }
}
@media (max-width: 560px) {
  .kpirow { grid-template-columns: 1fr; }
}
