/* ==========================================================================
   jasminegokmen — Architecture / UK Building Regulations knowledge base
   Design language: editorial monochrome, Roboto Light headings, Montserrat
   body, hairline rules, generous whitespace, no rounded corners.
   ========================================================================== */

:root {
  --ink: #1d1e20;
  --charcoal: #292929;
  --charcoal-deep: #1f1f1f;
  --paper: #ffffff;
  --stone: #e6e6e6;
  --stone-warm: #f4f2ed;
  --line: #d9d6cf;
  --line-strong: #bfbcb4;
  --line-dark: rgba(255, 255, 255, 0.18);
  --muted: #6a6862;
  --muted-dark: #c4c1ba;
  --font-body: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --max: 1240px;
  --gutter: 24px;
  --header-h: 96px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.drawer-open {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

ul,
ol,
dl,
dd {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

::selection {
  background: #2b2b2b;
  color: #fff;
}

mark {
  background: #ece5d2;
  color: inherit;
  padding: 0 1px;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 500;
  padding: 10px 16px;
  background: #fff;
  color: #1d1e20;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: none;
}

/* ---------- Typographic utilities ---------- */

.eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow--light {
  color: rgba(255, 255, 255, 0.62);
}

.eyebrow span {
  opacity: 0.6;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
  transition: gap 0.25s var(--ease), opacity 0.25s ease;
}

.text-link:hover {
  gap: 12px;
}

.text-link--light {
  color: #fff;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 24px;
  border: 1px solid transparent;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn--dark {
  background: var(--charcoal);
  color: #fff;
  border-color: var(--charcoal);
}

.btn--dark:hover {
  background: #111;
  border-color: #111;
}

.btn--outline {
  border-color: var(--ink);
  color: var(--ink);
}

.btn--outline:hover {
  background: var(--ink);
  color: #fff;
}

/* ---------- Utility bar ---------- */

.utility-bar {
  position: relative;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 38px;
  padding: 9px var(--gutter);
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  color: #1a1a1a;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  line-height: 1.4;
  text-transform: uppercase;
}

.utility-bar p {
  display: flex;
  gap: 10px;
  align-items: center;
}

.utility-bar__meta {
  color: #6e6c66;
}

.utility-bar__sub {
  display: inline;
}

.utility-bar__meta span + span::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 9px;
  margin-right: 12px;
  background: #cfccc5;
  vertical-align: -1px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--charcoal);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: var(--max);
  min-height: var(--header-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 30px;
}

.primary-nav a {
  position: relative;
  display: inline-block;
  padding: 8px 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.primary-nav a:hover {
  color: #fff;
}

.primary-nav a:hover::after,
.primary-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.primary-nav a[aria-current="page"] {
  color: #fff;
}

.logo {
  justify-self: center;
  display: inline-flex;
}

.logo img {
  width: 82px;
  height: auto;
}

.header-aside {
  justify-self: end;
}

.header-cta {
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.42);
  padding: 12px 16px;
  color: #fff;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.header-cta:hover {
  background: #fff;
  border-color: #fff;
  color: var(--charcoal);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 12px;
  justify-self: end;
  color: #fff;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.menu-toggle__icon {
  display: grid;
  gap: 5px;
  width: 22px;
}

.menu-toggle__icon i {
  display: block;
  height: 1px;
  background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon i:first-child {
  transform: translateY(3px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon i:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

.mobile-menu {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 20px var(--gutter) 28px;
  background: var(--charcoal);
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu nav ul {
  display: grid;
}

.mobile-menu nav a {
  display: block;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 300;
  line-height: 1.2;
}

.mobile-menu nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.mobile-menu__meta {
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 672px;
  overflow: hidden;
  background: #151515;
  color: #fff;
}

.hero__media,
.hero__overlay {
  position: absolute;
  inset: 0;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 38% 42%;
  filter: saturate(0.72) contrast(1.04);
}

.hero__overlay {
  background:
    linear-gradient(90deg, rgba(14, 14, 14, 0.88) 0%, rgba(14, 14, 14, 0.72) 45%, rgba(14, 14, 14, 0.25) 100%),
    linear-gradient(0deg, rgba(14, 14, 14, 0.55) 0%, rgba(14, 14, 14, 0) 46%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
}

.hero__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(280px, 0.58fr);
  align-items: end;
  gap: 64px;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding: 104px var(--gutter) 76px;
}

.hero__content {
  max-width: 790px;
}

.hero h1 {
  max-width: 16ch;
  margin-top: 18px;
  font-size: clamp(46px, 5.4vw, 76px);
  font-weight: 300;
  line-height: 1.01;
  letter-spacing: -0.028em;
}

.hero h1 span {
  display: block;
  color: #d3d0c8;
}

.hero__intro {
  max-width: 59ch;
  margin-top: 26px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 16px;
  line-height: 1.72;
}

.hero-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: min(100%, 760px);
  margin-top: 36px;
  background: #fff;
  color: var(--ink);
  border: 1px solid #fff;
  transition: box-shadow 0.25s ease;
}

.hero-search:focus-within {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.hero-search .icon {
  width: 19px;
  height: 19px;
  margin-left: 20px;
  color: #77746e;
}

.hero-search input {
  width: 100%;
  height: 62px;
  border: 0;
  padding: 0 16px;
  background: transparent;
  font-size: 14px;
  outline: 0;
  min-width: 0;
}

.hero-search input::placeholder {
  color: #807d77;
  opacity: 1;
}

.hero-search input::-webkit-search-cancel-button {
  appearance: none;
}

.hero-search button {
  align-self: stretch;
  padding: 0 28px;
  background: var(--charcoal);
  color: #fff;
  border-left: 1px solid #fff;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background 0.25s ease;
}

.hero-search button:hover {
  background: #111;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 20px;
}

.quick-links__label {
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.quick-links button {
  position: relative;
  padding: 0 0 2px;
  color: rgba(255, 255, 255, 0.74);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.quick-links button:hover {
  color: #fff;
  border-color: #fff;
}

.hero-card {
  align-self: end;
  max-width: 360px;
  margin-left: auto;
  padding: 26px 26px 22px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(18, 18, 18, 0.38);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.hero-card__date {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-card h2 {
  margin-top: 6px;
  font-size: 25px;
  line-height: 1.14;
  letter-spacing: -0.01em;
}

.hero-card > p:not(.eyebrow, .hero-card__date) {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12.5px;
  line-height: 1.65;
}

.hero-card .text-link {
  margin-top: 20px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-stats dt {
  color: rgba(255, 255, 255, 0.44);
  font-size: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-stats dd {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 300;
  line-height: 1;
}

/* ---------- Section heads ---------- */

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: end;
  gap: 48px;
  margin-bottom: 44px;
}

.section-head h2 {
  max-width: 18ch;
  margin-top: 12px;
  font-size: clamp(34px, 3.5vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.section-head__intro {
  max-width: 61ch;
  margin-top: 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.72;
}

.section-head__aside {
  max-width: 38ch;
  justify-self: end;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.review-stamp {
  justify-self: end;
  width: 100%;
  max-width: 262px;
  padding-top: 14px;
  border-top: 1px solid var(--ink);
}

.review-stamp__label {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.review-stamp__date {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 300;
  line-height: 1.2;
}

.review-stamp__next {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Database ---------- */

#database,
#topics,
#changes,
#about {
  scroll-margin-top: 118px;
}

.database {
  padding: 96px 0 104px;
  background: var(--paper);
}

.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 45;
  margin-inline: calc(var(--gutter) * -1);
  padding: 12px var(--gutter);
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.toolbar__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(var(--max) - var(--gutter) * 2);
  margin-inline: auto;
}

.toolbar-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 1px solid var(--line-strong);
  background: #fff;
  transition: border-color 0.2s ease;
}

.toolbar-search:focus-within {
  border-color: var(--ink);
}

.toolbar-search .icon {
  width: 17px;
  height: 17px;
  margin-left: 15px;
  color: #77746e;
}

.toolbar-search input {
  width: 100%;
  height: 46px;
  min-width: 0;
  border: 0;
  padding: 0 12px;
  background: transparent;
  font-size: 12.5px;
  outline: 0;
}

.toolbar-search input::placeholder {
  color: #85827b;
  opacity: 1;
}

.toolbar-search input::-webkit-search-cancel-button {
  appearance: none;
}

.search-clear {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-right: 6px;
  color: #6d6a64;
  font-size: 16px;
  line-height: 1;
}

.search-clear:hover {
  color: var(--ink);
}

.search-clear[hidden] {
  display: none !important;
}

.toolbar-search kbd {
  margin-right: 12px;
  padding: 2px 6px;
  border: 1px solid #d6d3cc;
  color: #8b8881;
  font-family: var(--font-body);
  font-size: 9px;
  line-height: 1.4;
}

.toolbar-sort {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

.toolbar-sort label {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.select-wrap select {
  appearance: none;
  height: 48px;
  min-width: 154px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 0 38px 0 13px;
  background: #fff;
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.select-wrap svg {
  position: absolute;
  right: 13px;
  width: 10px;
  height: 7px;
  pointer-events: none;
}

.filter-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.filter-toggle__count {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: var(--charcoal);
  color: #fff;
  font-size: 9px;
  letter-spacing: 0;
}

.db-layout {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 56px;
  padding-top: 38px;
  align-items: start;
}

/* ---------- Filters ---------- */

.filters {
  position: sticky;
  top: calc(var(--header-h) + 84px);
  max-height: calc(100vh - var(--header-h) - 110px);
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: #c9c6bf transparent;
}

.filters__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
}

.filters__head p {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.filters__head button {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-transform: uppercase;
}

.filters__head button:hover {
  color: var(--ink);
}

.filters fieldset {
  margin: 0;
  padding: 18px 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.filters legend {
  padding: 0;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.filter-list {
  display: grid;
  gap: 2px;
}

.filter-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  color: #44433f;
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
}

.filter-option:hover {
  color: #000;
}

.filter-option input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--charcoal);
  cursor: pointer;
}

.filter-option__count {
  color: #5f5d57;
  font-size: 9.5px;
  line-height: 1;
}

.filter-option input:checked ~ .filter-option__count {
  color: var(--ink);
}

.filters__note {
  margin-top: 22px;
  padding: 16px;
  background: var(--stone-warm);
}

.filters__note p + p {
  margin-top: 8px;
}

.filters__note p:last-child {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

/* ---------- Results ---------- */

.results {
  min-width: 0;
}

.results:focus {
  outline: none;
}

.results__bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  min-height: 23px;
  margin-bottom: 18px;
}

.results__count {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.results__hint {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}

.active-chips[hidden] {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 9px;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.chip button {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: #77746e;
  font-size: 13px;
  line-height: 1;
}

.chip button:hover {
  color: #000;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.reg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 274px;
  padding: 24px 24px 20px;
  background: #fff;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.cards__end {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 274px;
  padding: 24px;
  background: #f8f6f1;
}

.cards__end .eyebrow {
  color: #5f5d57;
}

.cards__end p:not(.eyebrow) {
  max-width: 30ch;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.cards__end .text-link {
  align-self: flex-start;
  margin-top: 22px;
}

.reg-card:hover {
  background: #f8f6f1;
  box-shadow: inset 0 0 0 1px var(--ink);
}

.reg-card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.reg-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.reg-card__ref {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #6f6c66;
}

.reg-card h3 {
  font-size: 24px;
  line-height: 1.14;
  letter-spacing: -0.015em;
}

.reg-card__sub {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.reg-card__summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin-top: 14px;
  color: #5c5a55;
  font-size: 14px;
  line-height: 1.7;
}

.reg-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  color: #6d6a64;
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reg-card__arrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  transition: gap 0.25s var(--ease);
}

.reg-card:hover .reg-card__arrow {
  gap: 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 1px solid currentColor;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.status--current {
  color: #3f5c46;
}

.status--phasing {
  color: #86642f;
}

.status--review {
  color: #4b5b6b;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

.load-more-wrap[hidden] {
  display: none !important;
}

.empty {
  padding: 56px 32px;
  border: 1px solid var(--line);
  text-align: center;
}

.empty h3 {
  max-width: 24ch;
  margin: 12px auto 0;
  font-size: 30px;
  line-height: 1.12;
}

.empty > p:not(.eyebrow) {
  max-width: 52ch;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 13px;
}

.empty__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

.noscript {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--stone-warm);
}

.noscript p {
  font-size: 13px;
}

.noscript ul {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.noscript a {
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Topics ---------- */

.topics {
  padding: 96px 0 104px;
  background: var(--stone);
}

.topics .section-head {
  margin-bottom: 38px;
}

.topics .eyebrow,
.topics .section-head__aside {
  color: #56544f;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: rgba(0, 0, 0, 0.14);
}

.topic-card {
  display: flex;
  flex-direction: column;
  min-height: 214px;
  padding: 22px 22px 18px;
  background: var(--stone);
  text-align: left;
  transition: background 0.25s ease;
}

.topic-card:hover {
  background: #dcd9d1;
}

.topic-card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.topic-card__num {
  color: #5f5d57;
  font-size: 9px;
  letter-spacing: 0.14em;
}

.topic-card h3 {
  margin-top: 34px;
  font-size: 21px;
  line-height: 1.16;
  letter-spacing: -0.01em;
}

.topic-card p {
  margin-top: 9px;
  color: #5f5d57;
  font-size: 13px;
  line-height: 1.6;
}

.topic-card__count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  color: #5d5b55;
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topic-card:hover .topic-card__count {
  color: var(--ink);
}

/* ---------- Changes ---------- */

.changes {
  padding: 100px 0 108px;
  background: var(--charcoal);
  color: #fff;
}

.changes__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 80px;
  align-items: start;
}

.changes__intro {
  position: sticky;
  top: calc(var(--header-h) + 40px);
}

.changes__intro h2 {
  max-width: 13ch;
  margin-top: 14px;
  font-size: clamp(34px, 3.5vw, 52px);
  line-height: 1.06;
}

.changes__intro > p:not(.eyebrow) {
  max-width: 38ch;
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  line-height: 1.72;
}

.changes__intro .text-link {
  margin-top: 28px;
}

.timeline {
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.timeline__item {
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr);
  gap: 26px;
  padding: 24px 0 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.timeline__date {
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 3px;
}

.timeline__kind {
  display: inline-block;
  margin-bottom: 9px;
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.6);
  font-size: 8px;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.timeline__kind--active {
  border-color: rgba(202, 222, 194, 0.55);
  color: #cfe0c8;
}

.timeline h3 {
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: -0.01em;
}

.timeline__item div > p {
  max-width: 58ch;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 14px;
  line-height: 1.68;
}

.timeline .text-link {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 9px;
}

/* ---------- About ---------- */

.about {
  padding: 96px 0 100px;
  background: #fff;
}

.about .section-head {
  margin-bottom: 42px;
}

.about__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

.about__item {
  border-top: 1px solid transparent;
}

.about__num {
  color: #5f5d57;
  font-size: 9px;
  letter-spacing: 0.14em;
}

.about__item h3 {
  margin-top: 18px;
  font-size: 22px;
}

.about__item p:last-child {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.72;
}

.about__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  margin-top: 66px;
  padding-top: 28px;
  border-top: 1px solid var(--ink);
}

.about__cta-title {
  max-width: 44ch;
  margin-top: 9px;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.1vw, 28px);
  font-weight: 300;
  line-height: 1.24;
  letter-spacing: -0.015em;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 74px 0 26px;
  background: var(--charcoal-deep);
  color: #fff;
}

.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.6fr) minmax(0, 0.6fr) minmax(0, 0.9fr);
  gap: 48px;
  padding-bottom: 46px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.footer__brand img {
  width: 72px;
  height: auto;
}

.footer__brand p {
  max-width: 36ch;
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 11.5px;
  line-height: 1.72;
}

.footer__col h2 {
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.58);
  font-family: var(--font-body);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.footer__col ul {
  display: grid;
  gap: 9px;
}

.footer__col a {
  color: rgba(255, 255, 255, 0.78);
  font-size: 11.5px;
  transition: color 0.2s ease;
}

.footer__col a:hover {
  color: #fff;
}

.footer__col p {
  color: rgba(255, 255, 255, 0.54);
  font-size: 11.5px;
  line-height: 1.75;
}

.footer__col p + p {
  margin-top: 14px;
}

.footer__col .text-link {
  color: #fff;
  font-size: 9px;
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 22px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.footer__bottom a {
  color: rgba(255, 255, 255, 0.62);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.footer__bottom a:hover {
  color: #fff;
}

/* ---------- Drawer ---------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(10, 10, 10, 0.56);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
}

.drawer-backdrop[hidden] {
  display: none;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  background: #fff;
  color: var(--ink);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform 0.42s var(--ease);
}

.drawer.is-open {
  transform: none;
}

.drawer[hidden] {
  display: none;
}

.drawer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex: none;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.drawer__ref {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6f6c66;
}

.drawer__close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.drawer__close:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

.drawer__close span {
  font-size: 18px;
  line-height: 1;
  font-weight: 300;
}

.drawer__scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 34px 36px 52px;
}

.drawer__eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.drawer h2 {
  margin-top: 15px;
  font-size: clamp(30px, 3.6vw, 40px);
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.drawer__sub {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.drawer__summary {
  margin-top: 22px;
  color: #3b3a37;
  font-size: 13.5px;
  line-height: 1.75;
}

.drawer__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 26px;
  border: 1px solid var(--line);
  background: var(--line);
}

.drawer__meta > div {
  background: #fff;
  padding: 12px 14px;
}

.drawer__meta dt {
  color: #5f5d57;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.drawer__meta dd {
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.5;
}

.drawer__section {
  margin-top: 30px;
}

.drawer__section h3 {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.key-points {
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.key-points li {
  position: relative;
  padding: 12px 0 12px 17px;
  border-bottom: 1px solid var(--line);
  color: #4a4844;
  font-size: 14px;
  line-height: 1.65;
}

.key-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 19px;
  width: 4px;
  height: 4px;
  background: var(--ink);
}

.metric-list {
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.metric-list > div {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.metric-list dt {
  color: #5f5d57;
  font-size: 10.5px;
  line-height: 1.5;
}

.metric-list dd {
  font-size: 11.5px;
  line-height: 1.5;
  text-align: right;
}

.drawer__note {
  margin-top: 22px;
  padding: 14px 16px;
  border-left: 2px solid var(--ink);
  background: var(--stone-warm);
  color: #5c5a55;
  font-size: 13px;
  line-height: 1.65;
}

.drawer__source {
  margin-top: 26px;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--stone-warm);
}

.drawer__source p {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.drawer__source .btn {
  margin-top: 14px;
}

.drawer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.drawer__copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.drawer__related {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.related-pill {
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.related-pill:hover {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: #fff;
}

.drawer__disclaimer {
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: #8a877f;
  font-size: 9.5px;
  line-height: 1.65;
}

/* ---------- Motion ---------- */

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

.hero__content > *,
.hero-card {
  animation: rise 0.8s var(--ease) both;
}

.hero__content > :nth-child(2) {
  animation-delay: 0.06s;
}
.hero__content > :nth-child(3) {
  animation-delay: 0.12s;
}
.hero__content > :nth-child(4) {
  animation-delay: 0.18s;
}
.hero__content > :nth-child(5) {
  animation-delay: 0.24s;
}
.hero-card {
  animation-delay: 0.18s;
}

/* ---------- Responsive ---------- */

@media (max-width: 1120px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    gap: 40px;
  }

  .hero h1 {
    font-size: clamp(44px, 5.6vw, 66px);
  }

  .db-layout {
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 40px;
  }

  .changes__grid {
    gap: 52px;
  }

  .footer__top {
    gap: 32px;
  }
}

@media (max-width: 960px) {
  :root {
    --header-h: 78px;
  }

  .primary-nav,
  .header-aside {
    display: none;
  }

  .site-header__inner {
    grid-template-columns: 1fr auto;
    min-height: var(--header-h);
  }

  .logo {
    justify-self: start;
  }

  .logo img {
    width: 72px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .hero {
    min-height: 0;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 78px var(--gutter) 56px;
    align-items: start;
  }

  .hero h1 {
    max-width: 18ch;
    font-size: clamp(44px, 7.6vw, 62px);
  }

  .hero-card {
    width: 100%;
    max-width: 520px;
    margin-left: 0;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
  }

  .section-head h2 {
    max-width: 20ch;
  }

  .section-head__aside,
  .review-stamp {
    justify-self: start;
  }

  .toolbar {
    position: static;
    margin-inline: calc(var(--gutter) * -1);
  }

  .toolbar__inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .toolbar-search {
    flex-basis: 100%;
    order: -1;
  }

  .filter-toggle {
    display: inline-flex;
    flex: 1;
    justify-content: center;
  }

  .toolbar-sort {
    flex: 1;
    justify-content: flex-end;
  }

  .select-wrap select {
    width: 100%;
  }

  .db-layout {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-top: 24px;
  }

  .filters {
    position: static;
    display: none;
    max-height: none;
    overflow: visible;
    padding: 20px;
    background: var(--stone-warm);
    border: 1px solid var(--line);
  }

  .filters.is-open {
    display: block;
  }

  .filters__note {
    display: none;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .changes__grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .changes__intro {
    position: static;
  }

  .changes__intro h2 {
    max-width: 16ch;
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .about__item {
    padding: 22px 0;
    border-top: 1px solid var(--line);
  }

  .about__grid {
    border-top: 0;
    padding-top: 0;
  }

  .about__item:first-child {
    border-top: 1px solid var(--line);
  }

  .footer__top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 38px;
  }

  .footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .utility-bar {
    min-height: 34px;
    font-size: 9px;
    letter-spacing: 0.14em;
  }

  .utility-bar__meta span:last-child {
    display: none;
  }

  .hero__grid {
    padding-top: 58px;
  }

  .hero h1 {
    font-size: clamp(40px, 9vw, 54px);
  }

  .hero__intro {
    font-size: 15px;
  }

  .hero-search {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .hero-search button {
    grid-column: 1 / -1;
    height: 50px;
    border-left: 0;
    border-top: 1px solid #fff;
  }

  .hero-search input {
    height: 56px;
  }

  .hero-search .icon {
    margin-left: 15px;
  }

  .quick-links {
    gap: 10px 14px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .cards__end {
    display: none;
  }

  .reg-card {
    min-height: 0;
    padding: 22px 20px 18px;
  }

  .reg-card h3 {
    font-size: 23px;
  }

  .section-head {
    margin-bottom: 30px;
  }

  .section-head h2 {
    font-size: clamp(30px, 8vw, 40px);
  }

  .database,
  .topics,
  .changes,
  .about {
    padding-top: 68px;
    padding-bottom: 72px;
  }

  .search-clear {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-right: 6px;
  color: #6d6a64;
  font-size: 16px;
  line-height: 1;
}

.search-clear:hover {
  color: var(--ink);
}

.search-clear[hidden] {
  display: none !important;
}

.toolbar-search kbd {
    display: none;
  }

  .results__bar {
    display: grid;
    gap: 6px;
  }

  .results__hint {
    text-align: left;
  }

  .timeline__item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .timeline__date {
    padding-top: 0;
  }

  .about__cta {
    display: grid;
    gap: 22px;
    margin-top: 44px;
  }

  .about__cta .btn {
    justify-self: start;
  }

  .drawer {
    width: 100%;
  }

  .drawer__scroll {
    padding: 28px 22px 44px;
  }

  .drawer__top {
    padding: 14px 20px;
  }

  .footer__top {
    grid-template-columns: 1fr;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 520px) {
  :root {
    --gutter: 20px;
  }

  .utility-bar {
    justify-content: space-between;
    gap: 12px;
  }

  .utility-bar__sub {
    display: none;
  }

  .utility-bar__meta span:last-child {
    display: none;
  }

  .hero__grid {
    padding-bottom: 44px;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(36px, 10.4vw, 46px);
  }

  .hero-card {
    padding: 20px 18px 18px;
  }

  .hero-card h2 {
    font-size: 22px;
  }

  .hero-stats dd {
    font-size: 17px;
  }

  .topic-grid {
    grid-template-columns: 1fr;
  }

  .topic-card {
    min-height: 0;
  }

  .topic-card h3 {
    margin-top: 20px;
  }

  .topic-card__count {
    margin-top: 18px;
  }

  .toolbar-sort {
    justify-content: flex-start;
  }

  .toolbar-sort label {
    display: none;
  }

  .select-wrap {
    flex: 1;
  }

  .empty {
    padding: 40px 20px;
  }

  .empty h3 {
    font-size: 25px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .utility-bar,
  .site-header,
  .toolbar,
  .filters,
  .topics,
  .changes,
  .about__cta,
  .site-footer,
  .drawer,
  .drawer-backdrop {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .hero {
    min-height: 0;
    color: #000;
    background: #fff;
  }

  .hero__media,
  .hero__overlay,
  .hero::after,
  .hero-card {
    display: none;
  }

  .hero__grid {
    padding: 0 0 24px;
  }

  .hero h1 span {
    color: #000;
  }

  .database {
    padding: 0;
  }

  .reg-card {
    break-inside: avoid;
    border: 1px solid #ccc;
  }
}
