:root {
  --ink: #14221c;
  --ink-soft: #53635b;
  --paper: #f7f3e9;
  --paper-deep: #ede7da;
  --white: #fffdf8;
  --green: #163f30;
  --green-bright: #2d7758;
  --lime: #d8ef91;
  --orange: #e9793e;
  --line: rgba(20, 34, 28, 0.16);
  --shadow: 0 18px 50px rgba(27, 45, 36, 0.09);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 3%, rgba(216, 239, 145, 0.42), transparent 22rem),
    var(--paper);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.55;
}

a { color: inherit; }

button, input { font: inherit; }

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 20;
  padding: 0.7rem 1rem;
  color: white;
  background: var(--green);
  border-radius: 0 0 10px 10px;
}

.skip-link:focus { top: 0; }

.site-header {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  color: var(--green);
  background: var(--lime);
  border: 1px solid rgba(22, 63, 48, 0.35);
  border-radius: 50%;
  font-family: "Newsreader", serif;
}

.review-date { color: var(--ink-soft); font-size: 0.85rem; }

main { min-height: 75vh; }

.hero,
.catalog,
.bill-detail,
footer {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.hero { padding: clamp(4.5rem, 10vw, 8rem) 0 4rem; }

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--green-bright);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin-top: 0;
  font-family: "Newsreader", Georgia, serif;
  line-height: 1.02;
}

h1 {
  max-width: 800px;
  margin-bottom: 1.15rem;
  font-size: clamp(3.25rem, 8vw, 6.6rem);
  letter-spacing: -0.045em;
}

.lede {
  max-width: 690px;
  margin: 0 0 2rem;
  color: var(--ink-soft);
  font-size: clamp(1.08rem, 2.2vw, 1.35rem);
}

.search-box {
  max-width: 830px;
  min-height: 4.5rem;
  padding: 0 1rem 0 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.search-box:focus-within { outline: 3px solid rgba(45, 119, 88, 0.22); border-color: var(--green-bright); }

.search-icon { font-size: 1.7rem; transform: rotate(-15deg); }

.search-box input {
  width: 100%;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 1.05rem;
}

kbd {
  padding: 0.15rem 0.45rem;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.8rem;
}

.topic-filters { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: 0.55rem; }

.topic-filter,
#clear-search {
  padding: 0.55rem 0.85rem;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.topic-filter:hover,
.topic-filter.active,
#clear-search:hover {
  color: var(--white);
  background: var(--green);
}

.catalog { padding-bottom: 5rem; }

.catalog-heading {
  margin-bottom: 1.4rem;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.catalog-heading h2 { margin-bottom: 0; font-size: clamp(2rem, 4vw, 3rem); }

#result-count { color: var(--ink-soft); font-size: 0.9rem; }

.bill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.bill-card {
  min-height: 285px;
  padding: clamp(1.35rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  background: rgba(255, 253, 248, 0.83);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(27, 45, 36, 0.045);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.bill-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.card-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.bill-number { font-weight: 700; letter-spacing: 0.02em; }

.status-pill {
  padding: 0.3rem 0.65rem;
  color: var(--green);
  background: rgba(216, 239, 145, 0.6);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.bill-card h3 { margin: 1.45rem 0 0.8rem; font-size: clamp(1.65rem, 3vw, 2.25rem); }

.bill-card p { margin: 0; color: var(--ink-soft); }

.card-footer {
  margin-top: auto;
  padding-top: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.topic-label { color: var(--green-bright); font-size: 0.8rem; font-weight: 700; }

.open-bill {
  padding: 0.65rem 0.9rem;
  color: white;
  background: var(--green);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.open-bill:hover { background: var(--green-bright); }

.empty-state { padding: 4rem 1rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }

.bill-detail { padding: 3rem 0 6rem; }

.back-button {
  margin-bottom: 2rem;
  padding: 0;
  color: var(--green-bright);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

.detail-hero {
  padding: clamp(1.5rem, 5vw, 4rem);
  color: var(--white);
  background: var(--green);
  border-radius: 28px;
  position: relative;
  overflow: hidden;
}

.detail-hero::after {
  content: "";
  position: absolute;
  width: 17rem;
  height: 17rem;
  right: -6rem;
  top: -7rem;
  background: var(--lime);
  border-radius: 50%;
  opacity: 0.9;
}

.detail-hero .eyebrow { color: var(--lime); }

.detail-hero h1 { max-width: 900px; font-size: clamp(2.7rem, 6vw, 5.3rem); }

.detail-summary { max-width: 820px; margin-bottom: 0; color: rgba(255, 255, 255, 0.78); font-size: 1.15rem; }

.detail-meta {
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.meta-item { padding: 1.1rem; background: var(--white); }
.meta-item span { display: block; color: var(--ink-soft); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.meta-item strong { display: block; margin-top: 0.35rem; }

.version-note {
  margin: 1rem 0 2.5rem;
  padding: 1rem 1.1rem;
  background: #fff0d8;
  border-left: 4px solid var(--orange);
  border-radius: 8px;
}

.breakdown-heading { margin-bottom: 1.5rem; font-size: clamp(2rem, 4vw, 3.2rem); }

.detail-sections { display: grid; gap: 1rem; }

.detail-section {
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.detail-section h2 { margin-bottom: 1.1rem; font-size: 1.65rem; }

.detail-section ul { margin: 0; padding: 0; list-style: none; }

.detail-section li {
  padding: 0.7rem 0 0.7rem 1.35rem;
  border-top: 1px solid var(--line);
  position: relative;
}

.detail-section li:first-child { border-top: 0; }

.detail-section li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.34rem;
  width: 0.48rem;
  height: 0.48rem;
  background: var(--orange);
  border-radius: 50%;
}

.sources {
  margin-top: 2rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--paper-deep);
  border-radius: var(--radius);
}

.sources h2 { margin-bottom: 0.5rem; }
.sources p { color: var(--ink-soft); }
.source-links { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.source-links a { padding: 0.6rem 0.85rem; background: var(--white); border: 1px solid var(--line); border-radius: 9px; font-weight: 700; text-decoration: none; }
.source-links a:hover { border-color: var(--green-bright); }

footer {
  padding: 2rem 0 3rem;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

footer p { max-width: 520px; }

@media (max-width: 760px) {
  .review-date, kbd { display: none; }
  .hero { padding-top: 4rem; }
  .bill-grid { grid-template-columns: 1fr; }
  .detail-meta { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 0; }
}

@media print {
  body { background: white; }
  .site-header, .hero, .catalog, .back-button, footer { display: none !important; }
  .bill-detail { display: block !important; width: 100%; padding: 0; }
  .detail-hero { color: black; background: white; padding: 0; }
  .detail-hero::after { display: none; }
  .detail-hero .eyebrow, .detail-summary { color: black; }
  .detail-meta { break-inside: avoid; }
  .detail-section { break-inside: avoid; padding: 0.6rem 0; border: 0; }
  .sources { break-inside: avoid; }
}
