/* ============================================================
   martora — congressman profile
   Type system: IBM Plex Mono (labels/data) + Archivo (display) + Inter (body)
   ============================================================ */

:root {
  --bg: #e9ebee;
  --surface: #ffffff;
  --ink: #17181c;
  --ink-soft: #55585f;
  --ink-faint: #9a9da6;
  --line: #ececef;
  --green: #8fd837;
  --buy: #0e9f5c;
  --sell: #e04b3a;

  /* bubble ramp, rank 1 → 6 */
  --c1: #2b3ef2;
  --c2: #8b2ff5;
  --c3: #e935a1;
  --c4: #ff5c1f;
  --c5: #ff9d00;
  --c6: #ffd600;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* the sticky header would otherwise sit on top of whatever an in-page link
   jumps to (#demo, #unlock, #chain…) */
html { scroll-padding-top: 96px; }

body {
  background: var(--bg);
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  padding: 18px;
  -webkit-font-smoothing: antialiased;
}

.card {
  background: var(--surface);
  border-radius: 28px;
  max-width: 1560px;
  margin: 0 auto;
  padding: 28px 46px 32px;
  min-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
}

/* ---------------- header ---------------- */

/* The nav never leaves. It is pinned to the top of the viewport and painted
   with the card's own surface, so it reads as part of the card rather than a
   floating browser chrome bar. The negative insets pull the background out to
   the card's padding edges; the radius matches the card so the corners don't
   poke out when it's stuck. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: -28px -46px 26px;
  padding: 22px 46px 14px;
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 14px 22px -20px rgba(16, 17, 20, 0.45);
}

.logo {
  color: var(--ink);
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  width: fit-content;
}
.logo sup { font-size: 10px; font-weight: 600; }
.logo__img { height: 36px; width: auto; display: block; }
.logo__img { height: 30px; width: auto; display: block; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 10px 16px;
  border-radius: 0 0 12px 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 2px;
  border-radius: 4px;
}

.tabs { display: flex; gap: 4px; justify-self: center; align-items: center; }

/* products | destinations */
.tabs__sep {
  width: 1px;
  height: 16px;
  background: var(--line, #e4e6ea);
  margin: 0 8px;
  flex: none;
}

.tab {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  border: none;
  background: transparent;
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.tab:hover { background: #f4f5f7; }
.tab--active { background: #eceef2; font-weight: 500; }
a.tab { text-decoration: none; display: inline-block; }

/* the coverage tab is the feature nobody else has — mark it once, quietly */
.tab--flag::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  margin-left: 6px;
  vertical-align: 1.5px;
}

.account { justify-self: end; display: flex; align-items: center; gap: 12px; }

.signin {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
.signin:hover { color: var(--ink); }

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  letter-spacing: 0.02em;
}
.avatar--account { background: #17181c; cursor: pointer; }
.avatar--fallback { background: #17181c; width: 54px; height: 54px; }

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  background: var(--surface);
  margin-bottom: 18px;
  width: fit-content;
  transition: border-color .12s ease, color .12s ease;
}
.backlink:hover { color: var(--ink); border-color: var(--ink); }

/* congressman identity block, left column */
.profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}
.profile__photo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
}
.profile__name { font-weight: 600; font-size: 15px; }
.profile__desc {
  font-size: 12.5px;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
}
.party {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  padding: 2.5px 7px;
  border-radius: 999px;
  color: #fff;
}
.party--d { background: #3b5bdb; }
.party--r { background: #d6453a; }
.party--m { background: var(--green); color: #101114; }

/* ---------------- layout ---------------- */

.grid {
  display: grid;
  grid-template-columns: 290px 1fr 350px;
  gap: 44px;
  flex: 1;
  min-height: 0;
}

.col--left { display: flex; flex-direction: column; padding-top: 26px; }
.col--chart {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.col--right { padding-top: 26px; display: flex; flex-direction: column; gap: 24px; }

/* ---------------- shared bits ---------------- */

.label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.chip {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 999px;
}
.chip--buy { background: rgba(14, 159, 92, 0.12); color: var(--buy); }
.chip--sell { background: rgba(224, 75, 58, 0.12); color: var(--sell); }
.chip--mono { border: 1px dashed #c3c7d1; color: var(--ink-soft); }
.chip--period {
  background: #f1f2f5;
  color: var(--ink-soft);
  font-size: 9px;
  padding: 3px 8px;
}

/* ---------------- left column ---------------- */

.big-number {
  font-family: "Archivo", sans-serif;
  font-weight: 500;
  font-size: 58px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 8px 0 36px;
  transition: opacity 0.3s ease;
}

.insights .label { margin-bottom: 16px; }

.insight { margin-bottom: 22px; }
.insight__title {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 4px;
}
.insight__body {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ---------------- bubble chart ---------------- */

.chart-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px 10px;
}

.metric-toggle {
  display: inline-flex;
  background: #f1f2f5;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.metric {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
}
.metric--active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 22, 30, 0.10); }

.chart-actions { display: flex; align-items: center; gap: 12px; }

.live {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}
.live--tick i { animation: none; transform: scale(1.5); transition: transform 0.2s; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.iconbtn {
  border: none;
  background: #f1f2f5;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  display: grid;
  place-items: center;
}
.iconbtn:hover { background: #e6e8ee; }

#bubble-chart {
  position: relative;
  flex: 1 1 auto;
  min-height: 300px;
  /* capped: at full column height the bubbles were the whole page and pushed
     the performance chart below the fold. The expand button is still there for
     anyone who wants it big. */
  max-height: 400px;
  width: 100%;
}
#bubble-chart svg { display: block; width: 100%; height: 100%; cursor: grab; }
#bubble-chart svg:active { cursor: grabbing; }

.chart-empty {
  font-size: 13.5px;
  color: var(--ink-faint);
  text-align: center;
  padding-top: 120px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 10px 2px 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend__hint { margin-left: auto; color: var(--ink-faint); }

/* fullscreen expanded chart */
.chart--expanded {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--surface);
  padding: 26px 40px 30px;
}
.no-scroll { overflow: hidden; }

.bubble { cursor: pointer; }
.bubble__label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.12em;
  fill: var(--ink);
  pointer-events: none;
}
.bubble__label--ghost { fill: #b6bac4; }

.tooltip {
  position: absolute;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
  white-space: nowrap;
  z-index: 10;
}
.tooltip b { font-family: "IBM Plex Mono", monospace; font-weight: 500; }
.tooltip .tooltip__row { color: #c9ccd4; }

/* ---------------- right column ---------------- */

.score__value {
  font-family: "Archivo", sans-serif;
  font-weight: 500;
  font-size: 32px;
  margin: 10px 0 12px;
}
.score__value span { color: var(--ink); }

.score__bar {
  position: relative;
  height: 7px;
  border-radius: 99px;
  background: #e8e9ed;
  overflow: visible;
  margin-bottom: 14px;
}
.score__fill {
  height: 100%;
  border-radius: 99px;
  background: var(--green);
}
.score__marker {
  position: absolute;
  top: -3px;
  width: 1.5px;
  height: 13px;
  background: #b9bcc4;
}
.score__comment {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* trades */

.trades__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.pill {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  border: none;
  background: #eceef2;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink);
}
.pill:hover { background: #e2e4ea; }
.pill--dark { background: var(--ink); color: #fff; text-decoration: none; }
.pill--dark:hover { background: #2c2e35; }
.pill--green { background: var(--green); color: #101114; text-decoration: none; }
.pill--green:hover { background: #7fc72c; }
.pill--full { width: 100%; justify-content: center; }
.pill[disabled] { opacity: 0.45; cursor: default; }
a.pill { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.pill--lg { padding: 12px 22px; font-size: 11.5px; }

.pill--lab {
  display: inline-block;
  text-decoration: none;
  background: var(--ink);
  color: #fff;
  margin-top: 14px;
}
.pill--lab:hover { background: #2c2e35; }

.trades__list { list-style: none; }

.trade {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  transition: opacity 0.15s ease;
}
.trade:last-child { border-bottom: none; }

.trade__info { display: flex; flex-direction: column; gap: 4px; }
.trade__name { font-size: 13.5px; font-weight: 500; }
.trade__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-faint);
}
.trade__amount {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
}

.dot {
  width: 14px;
  height: 6px;
  border-radius: 99px;
  background: #cfd2da;
  display: inline-block;
}
.side { font-weight: 600; font-size: 11px; letter-spacing: 0.04em; }
.side--buy { color: var(--buy); }
.side--sell { color: var(--sell); }

.instr {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.08em;
  border: 1px dashed #b9bdc9;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 1.5px 6px;
}

/* performance */

#perf-chart { margin: 14px 0 12px; }
#perf-chart svg { display: block; width: 100%; }

.perf__note {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* next step from a profile: turn a member into a coverage plan */

.nextstep {
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 16px;
  padding: 18px 20px;
  background: #fafbfc;
}
.nextstep__title { font-size: 14.5px; font-weight: 600; margin-bottom: 7px; }
.nextstep__body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.nextstep .pill { display: inline-flex; }

/* ---- info tooltip (shared help system) ---------------------------------- */
.info {
  display: inline-grid; place-items: center;
  width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid var(--ink-faint); color: var(--ink-faint);
  font-family: "IBM Plex Mono", monospace; font-size: 9px; font-weight: 500;
  font-style: normal; line-height: 1; cursor: help; position: relative;
  vertical-align: middle; flex: none; user-select: none;
  transition: color .12s ease, border-color .12s ease;
}
.info:hover, .info:focus-visible { color: var(--ink); border-color: var(--ink); outline: none; }
.info::after {
  content: attr(data-tip);
  position: absolute; z-index: 60; top: calc(100% + 9px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content; max-width: 230px;
  background: var(--ink); color: #fff;
  font-family: "Inter", sans-serif; font-size: 11.5px; font-weight: 400;
  letter-spacing: 0; line-height: 1.45; text-transform: none; text-align: left;
  padding: 9px 11px; border-radius: 10px;
  box-shadow: 0 14px 32px -14px rgba(0, 0, 0, 0.55);
  opacity: 0; pointer-events: none; transition: opacity .14s ease, transform .14s ease;
}
.info::before {
  content: ""; position: absolute; z-index: 61; top: calc(100% + 4px); left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-bottom-color: var(--ink);
  opacity: 0; transition: opacity .14s ease;
}
.info:hover::after, .info:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.info:hover::before, .info:focus-visible::before { opacity: 1; }
/* right-anchored variant to avoid clipping near edges */
.info--r::after { left: auto; right: -6px; transform: translateY(4px); }
.info--r:hover::after, .info--r:focus-visible::after { transform: translateY(0); }
.info--r::before { left: auto; right: 2px; transform: none; }

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

.foot {
  margin-top: 56px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr);
  gap: 34px 48px;
}

.foot__logo { height: 26px; width: auto; display: block; margin-bottom: 12px; }

.foot__tag {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 400px;
  margin-bottom: 16px;
}

.foot__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.foot__col { display: flex; flex-direction: column; gap: 9px; }
.foot__head { color: var(--ink-faint); margin-bottom: 3px; }
.foot__col a {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  width: fit-content;
}
.foot__col a:hover { color: var(--ink); text-decoration: underline; }

.foot__legal {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-faint);
  /* no width cap: the disclaimer runs the full width of the footer, like the
     rule above it, instead of stopping two thirds of the way across */
}
.foot__legal b { color: var(--ink-soft); }
/* the "*" markers in body copy point here; :target lifts it out of the grey */
.foot__legal:target { color: var(--ink-soft); }
.foot__star { font-weight: 600; margin-right: 2px; }

/* footnote marker used inline in body copy */
.fnref {
  font-size: 0.8em;
  vertical-align: super;
  line-height: 0;
  margin-left: 1px;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}
.fnref:hover, .fnref:focus-visible { color: var(--ink); }

.foot__copy {
  display: block;
  margin-top: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
}

/* ---------------- error pages ---------------- */

.errpage {
  max-width: 560px;
  margin: 10vh auto;
  text-align: center;
}
.errpage__code { color: var(--ink-faint); margin-bottom: 14px; }
.errpage__title {
  font-family: "Archivo", sans-serif;
  font-weight: 500;
  font-size: 42px;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.errpage__body { font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); }
.errpage__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px;
}

/* ---------------- motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------------- responsive ---------------- */

@media (max-width: 900px) {
  .foot { grid-template-columns: 1fr; gap: 26px; }
  .foot__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .grid { grid-template-columns: 1fr 340px; }
  .col--left { grid-column: 1 / -1; padding-top: 10px; }
  .big-number { margin-bottom: 20px; }
}

/* six tabs stop fitting on one line well before the phone breakpoint, so the
   two-row header starts here instead of at 820 */
@media (max-width: 1120px) {
  html { scroll-padding-top: 132px; }  /* two-row header */

  .topbar {
    grid-template-columns: auto 1fr auto;
    row-gap: 12px;
    padding-bottom: 10px;
  }
  .logo { grid-column: 1; grid-row: 1; }
  .account { grid-column: 3; grid-row: 1; }
  .tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex: none; }
}

@media (max-width: 820px) {
  .card { padding: 20px 18px 28px; border-radius: 20px; }
  body { padding: 10px; }
  .grid { grid-template-columns: 1fr; gap: 30px; }
  .chart-legend__hint { display: none; }

  .topbar {
    margin: -20px -18px 18px;
    padding: 14px 18px 10px;
    border-radius: 20px 20px 0 0;
  }
  .logo__img { height: 30px; }
  .avatar { width: 40px; height: 40px; font-size: 13px; }

  .big-number { font-size: 46px; margin-bottom: 26px; }
  .col--left, .col--right { padding-top: 0; }
}

@media (max-width: 460px) {
  /* on a phone the header keeps the one action that matters */
  .signin { display: none; }
  .errpage__title { font-size: 32px; }
}
