@font-face {
  font-family: "Geist";
  src: url("https://www.shadcn.io/_next/media/Geist_Variable-s.p.0mrjj4bg00-he.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #ffffff;
  --page: #ffffff;
  --card: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e2e4e9;
  --sarawak-red: #d22630;
  --sarawak-red-ink: #9f1d26;
  --sarawak-yellow: #f7c948;
  --sarawak-yellow-soft: #fffbea;
  --sarawak-black: #111111;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--canvas);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0f1115;
  --page: #0f1115;
  --card: #171b22;
  --ink: #f3f5f7;
  --muted: #aeb6c2;
  --line: #2c333d;
  --sarawak-red: #f15b61;
  --sarawak-red-ink: #ff8d92;
  --sarawak-yellow: #f7c948;
  --sarawak-yellow-soft: #3a3110;
  --sarawak-black: #111111;
}

body {
  width: 100%;
  max-width: 840px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 20px 80px;
  background: var(--page);
  color: var(--ink);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  transition: background-color .22s ease, color .22s ease;
}

button { font: inherit; }

a {
  color: inherit;
  text-decoration-color: #b7bcc5;
  text-underline-offset: .18em;
}

html[data-theme="dark"] a { text-decoration-color: #657180; }

a:hover { text-decoration-color: currentColor; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--sarawak-yellow);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

html[data-theme="dark"] .skip-link {
  background: var(--ink);
  color: var(--page);
}

.bar {
  max-width: 760px;
  min-height: 58px;
  margin: 0 auto;
  padding: 16px 0 12px;
  position: relative;
  display: flex;
  align-items: center;
}

.bar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--line);
}

.brand-lockup,
.bar-rule-tail {
  align-self: stretch;
  position: relative;
}

.brand-lockup { display: flex; align-items: center; }

.bar-rule-tail {
  flex: 1 1 auto;
  min-width: 0;
}

.brand-lockup::after,
.bar-rule-tail::after {
  content: "";
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: -13px;
  left: 0;
  height: 3px;
}

.brand-lockup::after { background: var(--sarawak-red); }

.bar-rule-tail::after {
  right: -36px;
  background: linear-gradient(90deg, var(--sarawak-yellow) 0 50%, var(--sarawak-black) 50% 100%);
}

html[data-theme="dark"] .bar-rule-tail::after {
  background: linear-gradient(90deg, var(--sarawak-yellow) 0 50%, #3d4652 50% 100%);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

@media (hover: hover) {
  .theme-toggle:hover {
    transform: translateY(-1px);
    color: var(--ink);
  }
}

.theme-icon-morph {
  width: 16px;
  height: 16px;
  overflow: visible;
}

.theme-icon-moon,
.theme-icon-sun {
  fill: currentColor;
  transform-origin: 12px 12px;
  transition: opacity .22s ease, transform .32s cubic-bezier(.22, 1, .36, 1);
}

.theme-icon-moon {
  opacity: 0;
  transform: scale(.55) rotate(25deg);
}

.theme-icon-sun,
.theme-icon-rays {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.theme-icon-rays {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
  transform-origin: 12px 12px;
  transition: opacity .22s ease, transform .32s cubic-bezier(.22, 1, .36, 1);
}

html[data-theme="dark"] .theme-toggle { color: var(--sarawak-yellow); }

html[data-theme="dark"] .theme-icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0);
}

html[data-theme="dark"] .theme-icon-sun,
html[data-theme="dark"] .theme-icon-rays {
  opacity: 0;
  transform: scale(.55) rotate(-25deg);
}

.brand {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .01em;
  line-height: 1.15;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 48px;
  gap: 3px;
  transform: translateY(-50%);
}

.nav-toggle { display: none; }

.site-nav-link {
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.6;
  text-decoration: none;
}

.site-nav-link.is-active {
  color: var(--ink);
  text-decoration: none;
}

.site-nav-link:hover {
  border-color: var(--sarawak-black);
  background: var(--sarawak-black);
  color: #fff;
}

html[data-theme="dark"] .site-nav-link:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--page);
}

.brief {
  max-width: 760px;
  margin: 32px auto 8px;
  padding: 42px 8px 28px;
  text-align: center;
  animation: rise .7s cubic-bezier(.22, 1, .36, 1) both;
}

h1 {
  max-width: 680px;
  margin: 0 auto 16px;
  font-size: clamp(36px, 6vw, 48px);
  font-weight: 700;
  letter-spacing: -1.2px;
  line-height: 1.02;
  text-wrap: balance;
}

.brief-deck {
  max-width: 620px;
  margin: 0 auto;
  color: #374151;
  font-size: 18px;
  line-height: 1.62;
}

html[data-theme="dark"] .brief-deck { color: #d2d8df; }

.updated {
  margin: 18px 0 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .065em;
  text-transform: uppercase;
}

.updated-label,
.updated-count {
  color: var(--ink);
  font-weight: 900;
}

.updated time {
  color: var(--muted);
  font-weight: 750;
}

.changes,
.jump,
.level-filter,
.group,
.about-page {
  max-width: 760px;
  margin-right: auto;
  margin-left: auto;
}

.changes {
  margin-top: 8px;
  padding: 22px 22px 8px;
  border-radius: 10px;
  background: var(--sarawak-yellow-soft);
  animation: rise .7s cubic-bezier(.22, 1, .36, 1) .08s both;
}

.changes h2,
.group-head h2,
.about-section h2,
.about-hero h1 {
  letter-spacing: -.04em;
  line-height: 1.15;
}

.changes h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.changes p,
.group-head p,
.about-section p,
.scheme-copy p,
.amount-note,
.unspecified {
  color: var(--muted);
}

.changes p { margin: 0 0 12px; }

.changes ol {
  margin: 0;
  padding: 0 0 8px 20px;
}

.changes li {
  margin: 0 0 12px;
  padding-left: 4px;
  color: var(--ink);
}

.changes li::marker {
  color: var(--sarawak-red-ink);
  font-weight: 800;
}

.jump { margin-top: 28px; }

.jump-title,
.level-filter-title,
.sources-title,
.group-sources-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .075em;
  line-height: 1.4;
  text-transform: uppercase;
}

.jump-links,
.level-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 4px;
}

.jump-links::-webkit-scrollbar,
.level-filter-options::-webkit-scrollbar { display: none; }

.jump-links a,
.level-filter-button {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  text-decoration: none;
}

.level-filter-button {
  appearance: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.jump-count,
.level-filter-count {
  margin-left: 4px;
  color: var(--muted);
  font-weight: 750;
}

.jump-links a:hover,
.level-filter-button:hover,
.level-filter-button.is-active {
  border-color: var(--sarawak-black);
  background: var(--sarawak-black);
  color: #fff;
}

.level-filter-button.is-active .level-filter-count,
.jump-links a:hover .jump-count,
.level-filter-button:hover .level-filter-count {
  color: var(--sarawak-yellow);
}

html[data-theme="dark"] .level-filter-button.is-active,
html[data-theme="dark"] .jump-links a:hover,
html[data-theme="dark"] .level-filter-button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--page);
}

.level-filter {
  margin-top: 18px;
  padding-bottom: 8px;
}

.group {
  margin-top: 36px;
  padding-top: 8px;
}

.group-head {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.group-head h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.group-head p { margin: 0 0 14px; }

.group-sources,
.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.sources a,
.desks a {
  color: var(--sarawak-red-ink);
  font-size: 14px;
  font-weight: 650;
}

.scheme-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.scheme {
  padding: 16px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  scroll-margin-top: 16px;
}

.scheme[hidden],
.group[hidden] { display: none; }

.scheme-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
}

.level,
.basis {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  line-height: 1.4;
  text-transform: uppercase;
}

.level-state {
  border: 1px solid var(--sarawak-red);
  color: var(--sarawak-red-ink);
}

.level-federal {
  background: var(--sarawak-yellow);
  color: var(--sarawak-black);
}

.scheme-short {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.scheme h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.3;
}

.basis {
  margin: 12px 0 0;
  background: transparent;
  color: var(--sarawak-red-ink);
  border: 1px solid var(--line);
}

.amount-list {
  display: grid;
  gap: 4px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.scheme[data-amount-basis="page"] .amount-list li {
  color: var(--ink);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -.01em;
}

.scheme[data-amount-basis="attachment"] .amount-list li {
  font-size: 16px;
  font-weight: 650;
}

.amount-note,
.unspecified,
.scheme-copy p {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.6;
}

.scheme-copy p:first-child { margin-top: 10px; }

.sources-title { margin-top: 14px; }

.scheme .sources { margin-bottom: 4px; }

.about-hero {
  padding: 48px 0 28px;
  border-bottom: 1px solid var(--line);
}

.about-eyebrow {
  margin: 0 0 10px;
  color: var(--sarawak-red-ink);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.about-hero h1 {
  max-width: none;
  margin: 0 0 12px;
  text-align: left;
}

.about-lede {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.about-section {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.about-section h2 {
  margin: 0 0 10px;
  font-size: 26px;
}

.about-section p { margin: 0 0 12px; }

.about-section p:last-child { margin-bottom: 0; }

.desks {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.desks li {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.desks strong { font-size: 15px; }

.desks span {
  color: var(--muted);
  font-size: 14px;
}

.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--sarawak-black);
  border-radius: 6px;
  background: var(--sarawak-black);
  color: var(--sarawak-yellow);
  cursor: pointer;
  font-size: 18px;
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 4px 14px rgb(17 24 39 / 10%);
}

.back-to-top-label { display: none; }

html[data-theme="dark"] .back-to-top {
  border-color: var(--sarawak-yellow);
  background: #111111;
  color: var(--sarawak-yellow);
}

.back-to-top .back-to-top-arrow { color: var(--sarawak-yellow); }

.back-to-top[hidden] { display: none; }

footer { margin-top: 40px; }

.site-footer {
  max-width: 760px;
  margin-right: auto;
  margin-left: auto;
  overflow: hidden;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--muted);
}

html[data-theme="dark"] .site-footer {
  border-color: var(--line);
  background: #161c24;
}

.site-footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, 1fr);
}

.site-footer-summary,
.site-footer-nav { padding: 28px; }

.site-footer-nav {
  border-left: 1px solid var(--line);
}

.site-footer-brand,
.site-footer-note,
.site-footer-bottom p { margin: 0; }

.site-footer-brand {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.site-footer-note {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
}

.site-footer-nav h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.site-footer-categories-title {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.site-footer-nav ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer-link {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.site-footer-nav .site-footer-link:hover {
  color: var(--sarawak-red);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--sarawak-red);
}

.site-footer-bottom {
  padding: 16px 28px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.65;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.group,
.scheme,
.about-hero { scroll-margin-top: 12px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 560px) {
  body { padding: 0 15px 72px; }

  .bar { min-height: 62px; padding: 18px 0 14px; }

  .brand-lockup::after,
  .bar-rule-tail::after { bottom: -15px; }

  .bar-rule-tail::after { right: -78px; }

  .nav-toggle {
    order: 4;
    width: 36px;
    height: 36px;
    margin-left: 6px;
    padding: 7px 6px;
    display: flex;
    position: relative;
    z-index: 4;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
  }

  .nav-toggle[aria-expanded="true"] {
    border-color: var(--sarawak-black);
    background: var(--sarawak-black);
    color: #fff;
  }

  .nav-toggle span {
    display: block;
    width: 18px;
    height: 1.6px;
    border-radius: 1px;
    background: currentColor;
  }

  .site-nav {
    left: auto;
    right: 0;
    top: calc(100% + 8px);
    display: none;
    padding: 8px;
    flex-direction: column;
    align-items: stretch;
    transform: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    box-shadow: 0 12px 24px rgb(17 24 39 / 12%);
  }

  .site-nav.is-open { display: flex; }

  .site-nav-link { padding: 8px 12px; font-size: 13px; }

  h1 { font-size: clamp(2.15rem, 11vw, 3rem); }

  .brief { padding-top: 28px; }

  .brief-deck { font-size: 17px; }

  .changes { padding: 18px 14px 4px; }

  .group-head h2,
  .about-section h2 { font-size: 23px; }

  .site-footer-main { grid-template-columns: 1fr; }

  .site-footer-summary { padding: 22px 18px; }

  .site-footer-nav {
    padding: 22px 18px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .site-footer-bottom { padding: 14px 18px; }

  .back-to-top { right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .brief,
  .changes { animation: none; }
}
