:root {
  color-scheme: dark;
  --color-primary: #0b0b0b;
  --color-secondary: #ffffff;
  --color-accent: #242424;
  --color-card: #161616;
  --color-text-primary: #f5f5f5;
  --color-text-secondary: #b8b8b8;
  --color-border: #343434;
  --color-info: #62c8f3;
  --color-focus: #ffffff;
  --shadow-color: rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100%;
  color: var(--color-text-primary);
  background: var(--color-primary);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
}

header {
  padding: clamp(2rem, 6vw, 4.5rem) 1.25rem clamp(1.75rem, 4vw, 3rem);
  border-bottom: 1px solid var(--color-border);
}

header > h1,
header > p,
.header-center {
  width: min(100%, 760px);
  margin-right: auto;
  margin-left: auto;
}

header h1 {
  margin: 0 0 .5rem;
  color: var(--color-secondary);
  font-size: clamp(2rem, 6vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -.035em;
}

header p {
  margin-top: .35rem;
  margin-bottom: 0;
  color: var(--color-text-secondary);
}

.logo-bar { display: none; }

.header-center { text-align: left; }

.header-center .eyebrow,
.section-heading .eyebrow {
  margin: 0 0 .35rem;
  color: var(--color-text-secondary);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.header-center .home-link { margin-top: 1rem; }

main {
  width: min(100%, 810px);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) 1.5rem;
}

.legal-index main { width: min(100%, 1120px); }

h2,
h3,
h4 {
  color: var(--color-secondary);
  line-height: 1.28;
}

h2 {
  margin: 2.5rem 0 .8rem;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  letter-spacing: -.015em;
}

h3 { margin: 2rem 0 .65rem; font-size: 1.15rem; }
h4 { margin: 1.5rem 0 .5rem; }
p { margin: 0 0 1.15rem; }
ul, ol { margin: 0 0 1.25rem; padding-left: 1.4rem; }
li { margin: .45rem 0; }

a {
  color: var(--color-info);
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}

a:hover { color: var(--color-secondary); }

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 4px;
  border-radius: 3px;
}

.small { color: var(--color-text-secondary); font-size: .88rem; }

.directory-section + .directory-section { margin-top: clamp(3rem, 7vw, 5.5rem); }

.section-heading { margin-bottom: 1.25rem; }
.section-heading h2 { margin: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.grid--primary { grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)); }

.card {
  display: flex;
  min-height: 185px;
  flex-direction: column;
  padding: 1.4rem;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-card);
  box-shadow: 0 10px 28px var(--shadow-color);
}

.card h3 { margin: 0 0 .45rem; font-size: 1.12rem; }
.card p { margin: 0 0 1.25rem; color: var(--color-text-secondary); font-size: .95rem; line-height: 1.55; }
.card > a { margin-top: auto; font-weight: 650; text-decoration: none; }
.card > a:hover { text-decoration: underline; }

.resource-group {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-card);
}

.resource-group + .resource-group { margin-top: .75rem; }

.resource-group summary {
  cursor: pointer;
  padding: 1rem 1.2rem;
  color: var(--color-secondary);
  font-weight: 700;
}

.resource-group summary::marker { color: var(--color-info); }

.link-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 1px;
  border-top: 1px solid var(--color-border);
  background: var(--color-border);
}

.link-list a {
  display: flex;
  min-height: 88px;
  flex-direction: column;
  justify-content: center;
  padding: 1rem 1.2rem;
  background: var(--color-card);
  text-decoration: none;
}

.link-list a:hover { background: var(--color-accent); }
.link-list span { color: var(--color-secondary); font-weight: 650; }
.link-list small { margin-top: .15rem; color: var(--color-text-secondary); line-height: 1.4; }

table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  -webkit-overflow-scrolling: touch;
}

th,
td {
  padding: .65rem .75rem;
  border: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

th { color: var(--color-secondary); background: var(--color-accent); }

code,
kbd,
pre {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-accent);
}

code, kbd { padding: .1rem .3rem; }
pre { max-width: 100%; overflow-x: auto; padding: 1rem; }

footer {
  margin-top: 2rem;
  padding: 2.5rem 1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

footer .footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 1.75rem;
  max-width: 1050px;
  margin: 0 auto;
  padding: 0 1rem;
}

footer .footer-col h4 { margin: 0 0 .65rem; font-size: .86rem; }
footer .footer-col p { margin: .25rem 0; }
footer .footer-col a { color: var(--color-text-secondary); }
footer .small { font-size: .76rem; line-height: 1.5; }
footer .footer-meta { max-width: 1050px; margin: .75rem auto 0; padding: 0 1rem; }

.card--draft { border-color: #555; opacity: .8; }
.badge-draft { display: inline-block; margin-left: .35rem; padding: .05rem .45rem; border: 1px solid rgba(240, 165, 0, .4); border-radius: 999px; color: #f7bc49; background: rgba(240, 165, 0, .12); font-size: .7rem; font-weight: 600; vertical-align: middle; }
.link-disabled { color: var(--color-text-secondary); font-size: .92rem; font-style: italic; }
.draft-notice { color: #f7bc49 !important; font-weight: 600; text-align: center; }

@media (max-width: 620px) {
  body { font-size: 16px; line-height: 1.68; }
  header { padding-right: 1rem; padding-left: 1rem; }
  main { padding-right: 1rem; padding-left: 1rem; }
  .grid--primary { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .link-list { grid-template-columns: 1fr; }
  footer .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; }
}

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