/* Ratifi: modern and bold. Cobalt + highlighter yellow; Archivo with its wide axis for display. */
:root {
  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --ink: #0E1433;
  --muted: #545B78;
  --rule: #DDE0EC;
  --cobalt: #2337E6;
  --cobalt-deep: #1626B0;
  --cobalt-soft: #E3E7FF;
  --hi: #FFC92E;          /* highlighter: current stage */
  --on-cobalt: #FFFFFF;
  --on-button: #FFFFFF;
  --on-cobalt-muted: #C9D0FF;
  --track-on-cobalt: rgba(255, 255, 255, .22);
  --veto: #D83A3F;
  --link: #2337E6;
  --focus: #2337E6;
  --hero-bg: #2337E6;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0F24;
    --surface: #141A36;
    --ink: #EEF0FA;
    --muted: #A4ABCB;
    --rule: #262E52;
    --cobalt: #7D8CFF;
    --cobalt-deep: #5A6BFF;
    --cobalt-soft: #1E2759;
    --hi: #FFD24D;
    --on-cobalt: #FFFFFF;
    --on-button: #0B0F24;
    --on-cobalt-muted: #C3CAF5;
    --track-on-cobalt: rgba(255, 255, 255, .18);
    --veto: #FF6B6F;
    --link: #9CA8FF;
    --focus: #FFD24D;
    --hero-bg: #1B27A6;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.55 var(--font); }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--surface); color: var(--ink); padding: .5rem 1rem; }
.wrap { max-width: 74rem; margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--muted); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-stretch: 125%; font-size: 1.3rem; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.brand__mark { display: inline-flex; gap: 2px; align-items: flex-end; }
.brand__mark i { display: block; width: 6px; border-radius: 1px; background: var(--cobalt); }
.brand__mark i:nth-child(1) { height: 10px; }
.brand__mark i:nth-child(2) { height: 15px; }
.brand__mark i:nth-child(3) { height: 20px; background: var(--hi); }
.brand--small { font-size: 1.05rem; }

/* Masthead */
.masthead { background: var(--surface); border-bottom: 1px solid var(--rule); }
.masthead__inner { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; padding-block: .9rem; }
.mainnav { margin-right: auto; }
.mainnav a { font-weight: 600; color: var(--ink); text-decoration: none; padding: .35rem .2rem; }
.mainnav a:hover { text-decoration: underline; }
.masthead--hero { background: var(--hero-bg); border-bottom: 0; }
.masthead--hero .brand, .masthead--hero .mainnav a { color: var(--on-cobalt); }
.masthead--hero .brand__mark i { background: var(--on-cobalt); }
.masthead--hero .brand__mark i:nth-child(3) { background: var(--hi); }

/* Search */
.search { display: flex; }
.search input { flex: 1; min-width: 0; font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--rule); border-right: 0; border-radius: 10px 0 0 10px; }
.search button, .btn { font: 700 1rem var(--font); cursor: pointer; border: 2px solid var(--cobalt); background: var(--cobalt); color: var(--on-button); }
.search button { border-radius: 0 10px 10px 0; }
.search button:hover, .btn:hover { background: var(--cobalt-deep); border-color: var(--cobalt-deep); }
.search--header { flex: 1 1 18rem; max-width: 30rem; }
.search--header input { padding: .5rem .8rem; }
.search--header button { padding: .5rem 1rem; }
.search--hero { max-width: 40rem; }
.search--hero input { padding: 1rem 1.15rem; font-size: 1.1rem; border-color: transparent; }
.search--hero button { padding: 1rem 1.4rem; font-size: 1.05rem; background: var(--hi); border-color: var(--hi); color: #0E1433; }
.search--hero button:hover { background: #FFD95E; border-color: #FFD95E; }
.btn { border-radius: 10px; padding: .55rem 1rem; }

/* Landing: hero */
.hero { background: var(--hero-bg); color: var(--on-cobalt); padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 6vw, 4.5rem); }
.hero__title { font-weight: 900; font-stretch: 125%; font-size: clamp(2.6rem, 1.4rem + 5.4vw, 6rem); line-height: .98; letter-spacing: -.03em; margin: 0 0 1.25rem; max-width: 14ch; }
.hero__lede { font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem); line-height: 1.5; color: var(--on-cobalt-muted); max-width: 46ch; margin: 0 0 2rem; }
.hero__alt { margin: .9rem 0 0; }
.hero a { color: var(--on-cobalt); }
.hero :focus-visible { outline-color: var(--hi); }

.bigrail { margin-top: clamp(3rem, 7vw, 5rem); }
.bigrail__caption { font-size: 1rem; font-weight: 600; color: var(--on-cobalt-muted); margin: 0 0 1rem; }
.bigrail__track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.bigrail__step a { display: block; text-decoration: none; color: var(--on-cobalt); padding-bottom: .5rem; border-radius: 4px; }
.bigrail__bar { display: block; height: 14px; border-radius: 3px; background: var(--track-on-cobalt); position: relative; overflow: hidden; margin-bottom: 1rem; }
.bigrail__bar::after { content: ""; position: absolute; inset: 0; background: var(--on-cobalt); transform-origin: left; transform: scaleX(var(--p, 1)); }
.bigrail__step:last-child .bigrail__bar::after { background: var(--hi); }
.bigrail__count { display: block; font-weight: 900; font-stretch: 125%; font-size: clamp(1.8rem, 1.1rem + 2.4vw, 3.2rem); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bigrail__label { display: block; margin-top: .35rem; font-size: .95rem; font-weight: 600; color: var(--on-cobalt-muted); }
.bigrail__step a:hover .bigrail__label { color: var(--on-cobalt); text-decoration: underline; }
.bigrail__note { margin: 1rem 0 0; font-size: .95rem; }

@media (prefers-reduced-motion: no-preference) {
  .bigrail__bar::after { animation: fill .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 110ms + 150ms); }
  @keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(var(--p, 1)); } }
}

/* Landing: bands */
.band { padding: clamp(3rem, 6vw, 4.5rem) 0; }
.band + .band { border-top: 1px solid var(--rule); }
.band--plain { background: var(--surface); }
.band__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 2rem; margin-bottom: 1.75rem; }
.band__title { font-weight: 800; font-stretch: 115%; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); line-height: 1.1; letter-spacing: -.02em; margin: 0; }
.band__title--wide { max-width: 20ch; margin-bottom: 2.25rem; }
.band__title + .coverage { margin-top: 1.5rem; }

.moving { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }
.moving__item { background: var(--surface); border: 2px solid var(--rule); border-radius: 14px; padding: 1.1rem 1.15rem 1rem; display: flex; flex-direction: column; gap: .8rem; }
.moving__item:hover { border-color: var(--cobalt); }
.moving__link { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.moving__meta { font-size: .88rem; color: var(--muted); }
.moving__meta strong { color: var(--ink); margin-right: .35rem; }
.moving__title { font-weight: 700; font-size: 1.05rem; line-height: 1.3; }
.moving__link:hover .moving__title { text-decoration: underline; }
.moving__when { margin: 0; font-size: .85rem; color: var(--muted); }

.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 2.5rem; }
.point { border-top: 6px solid var(--cobalt); padding-top: 1.1rem; }
.point:nth-child(3) { border-top-color: var(--hi); }
.point h3 { font-size: 1.2rem; font-weight: 800; line-height: 1.25; margin: 0 0 .5rem; }
.point p { margin: 0; color: var(--muted); max-width: 40ch; }

.coverage { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.coverage a { display: inline-flex; align-items: baseline; gap: .7rem; padding: .7rem 1.1rem; border-radius: 999px; background: var(--surface); border: 2px solid var(--rule); color: var(--ink); text-decoration: none; font-weight: 700; }
.coverage a:hover { border-color: var(--cobalt); }
.coverage__n { font-weight: 500; color: var(--muted); font-size: .9rem; }

.cta { background: var(--ink); color: var(--bg); padding: clamp(3rem, 6vw, 4.5rem) 0; }
.cta__inner { display: grid; gap: 1.5rem; }
.cta__title { font-weight: 900; font-stretch: 125%; font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3.4rem); line-height: 1.02; letter-spacing: -.025em; margin: 0; max-width: 16ch; }
.cta .search--hero input { border-color: transparent; }
.cta :focus-visible { outline-color: var(--hi); }

/* Bill list */
.list-head { padding: 2.5rem 0 1rem; }
.list-head h1 { font-weight: 900; font-stretch: 120%; font-size: clamp(1.8rem, 1.2rem + 2vw, 2.8rem); line-height: 1.05; letter-spacing: -.025em; margin: 0 0 .4rem; }
.count { margin: 0; color: var(--muted); display: flex; gap: 1rem; flex-wrap: wrap; }
.stage-filter { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; margin: 0 0 1.75rem; padding: 0; }
.stage-filter a { display: inline-flex; gap: .45rem; align-items: baseline; padding: .4rem .85rem; font-size: .92rem; font-weight: 600; color: var(--ink); text-decoration: none; background: var(--surface); border: 2px solid var(--rule); border-radius: 999px; }
.stage-filter a:hover { border-color: var(--cobalt); }
.stage-filter a[aria-current] { color: var(--on-button); background: var(--cobalt); border-color: var(--cobalt); }
.stage-filter .n { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage-filter a[aria-current] .n { color: inherit; opacity: .75; }

.layout { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2.5rem; align-items: start; padding-bottom: 2rem; }
.filters { display: grid; gap: 1rem; position: sticky; top: 1rem; }
.filters label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: .3rem; }
.filters select { width: 100%; font: inherit; padding: .5rem .55rem; color: var(--ink); background: var(--surface); border: 2px solid var(--rule); border-radius: 8px; }

.bills { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.bill { background: var(--surface); border: 2px solid var(--rule); border-radius: 14px; padding: 1.15rem 1.25rem 1.2rem; }
.bill:hover { border-color: var(--cobalt); }
.bill__meta { display: flex; flex-wrap: wrap; gap: .2rem 1rem; margin: 0; font-size: .88rem; color: var(--muted); }
.bill__id { font-weight: 800; color: var(--ink); }
.bill__title { font-weight: 700; font-size: 1.18rem; line-height: 1.3; letter-spacing: -.005em; margin: .3rem 0 .85rem; max-width: 62ch; }
.bill__title a { color: var(--ink); text-decoration: none; }
.bill__title a:hover { text-decoration: underline; }
.bill__latest, .bill__sponsor { margin: .6rem 0 0; max-width: 75ch; font-size: .93rem; color: var(--muted); }
.bill__latest time { margin-right: .5rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.empty { padding: 2rem 0; color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 0; color: var(--muted); font-weight: 600; }

/* Compact rail (list rows, cards) */
.rail { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.rail__track { display: flex; align-items: center; gap: 3px; list-style: none; margin: 0; padding: 0; }
.rail--compact .rail__step { width: 2.1rem; height: .5rem; background: var(--rule); border-radius: 2px; }
.rail--compact .is-reached { background: var(--cobalt); }
.rail--compact .is-current { background: var(--hi); height: .8rem; box-shadow: inset 0 0 0 2px var(--cobalt); }
.rail--compact .is-veto.is-reached { background: var(--veto); box-shadow: none; }
.rail__status { font-weight: 700; font-size: .9rem; }
.rail__status.is-veto { color: var(--veto); }

/* Full rail (bill page) */
.progress { margin: 1.75rem 0 2.75rem; padding: 1.7rem 1.5rem 1.5rem; background: var(--surface); border: 2px solid var(--rule); border-radius: 16px; }
.rail--full .rail__track { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: start; }
.rail--full .rail__step { position: relative; padding: 1.9rem .75rem 0 0; }
.rail--full .rail__step::before { content: ""; position: absolute; top: .5rem; left: .6rem; right: 0; height: 6px; border-radius: 3px; background: var(--rule); }
.rail--full .rail__step:last-child::before { display: none; }
.rail--full .rail__step::after { content: ""; position: absolute; top: 0; left: 0; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--surface); border: 3px solid var(--rule); }
.rail--full .is-reached:not(.is-current)::before { background: var(--cobalt); }
.rail--full .is-reached::after { background: var(--cobalt); border-color: var(--cobalt); }
.rail--full .is-current::after { background: var(--hi); border-color: var(--cobalt); box-shadow: 0 0 0 5px var(--cobalt-soft); }
.rail--full .is-veto.is-reached::after { background: var(--veto); border-color: var(--veto); box-shadow: 0 0 0 5px color-mix(in srgb, var(--veto) 22%, transparent); }
.rail__label { display: block; font-weight: 700; font-size: .95rem; line-height: 1.3; }
.rail--full .rail__step:not(.is-reached) .rail__label { font-weight: 500; color: var(--muted); }
.rail--full .is-veto.is-reached .rail__label { color: var(--veto); }
.rail--full time, .rail__pending { display: block; margin-top: .15rem; font-size: .84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: no-preference) {
  .rail--full .is-reached::after { animation: pop .35s cubic-bezier(.2, .9, .3, 1.3) both; animation-delay: calc(var(--i) * 90ms); }
  @keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
}

/* Bill page */
.crumbs { padding-top: 1.75rem; font-size: .92rem; font-weight: 600; }
.bill-head__id { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: 1rem 0 .4rem; font-weight: 800; }
.bill-head__id span { font-weight: 500; color: var(--muted); }
.bill-head__title { font-weight: 900; font-stretch: 112%; font-size: clamp(1.7rem, 1.1rem + 2.2vw, 2.9rem); line-height: 1.08; letter-spacing: -.025em; margin: 0; max-width: 30ch; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 3rem; align-items: start; padding-bottom: 3rem; }
.section-h { font-size: 1.2rem; font-weight: 800; margin: 0 0 .8rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: .2rem 1.25rem; padding: .85rem 0; border-top: 1px solid var(--rule); }
.timeline time { font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline p { margin: 0; max-width: 68ch; }
.timeline__chamber { display: block; font-size: .8rem; color: var(--muted); }
.timeline .is-milestone time { color: var(--cobalt); font-weight: 700; }
.timeline .is-milestone p { font-weight: 700; }
.facts { background: var(--surface); border: 2px solid var(--rule); border-radius: 14px; padding: 1.25rem; }
.facts dl { margin: 0; }
.facts dt { margin-top: 1.1rem; font-size: .85rem; color: var(--muted); }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: .15rem 0 0; font-weight: 600; }
.facts ul { list-style: none; margin: 0; padding: 0; }
.facts li + li { margin-top: .25rem; }
.source-link { display: inline-block; margin-top: 1.4rem; font-weight: 700; }

/* Footer */
.footer { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; color: var(--muted); font-size: .9rem; }
.page-landing .footer { border-top: 0; }
.footer__inner { display: flex; flex-wrap: wrap; gap: .75rem 2rem; align-items: center; justify-content: space-between; }
.footer p { margin: 0; max-width: 60ch; }

/* Small screens */
@media (max-width: 52rem) {
  .layout { grid-template-columns: 1fr; gap: 1.25rem; }
  .filters { position: static; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; gap: 2rem; }
  .facts { order: -1; }
  .points { grid-template-columns: 1fr; }
  .bigrail__track { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 1.25rem; }
}
@media (max-width: 40rem) {
  .search--hero { flex-direction: column; gap: .5rem; }
  .search--hero input { border-right: 2px solid transparent; border-radius: 10px; }
  .search--hero button { border-radius: 10px; }
  .bigrail__track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rail--compact .rail__step { width: 1.6rem; }
  .rail--full .rail__track { grid-auto-flow: row; grid-auto-columns: auto; }
  .rail--full .rail__step { padding: 0 0 1.15rem 2.2rem; }
  .rail--full .rail__step:last-child { padding-bottom: 0; }
  .rail--full .rail__step::before { top: .6rem; bottom: -.6rem; left: .5rem; right: auto; width: 6px; height: auto; }
  .timeline li { grid-template-columns: 1fr; }
}
