/* ==========================================================================
   Colorado Water Rights — design system (DESIGN.md v1)
   One stylesheet, no framework, no JS dependency. Editorial reference work:
   a beautifully typeset government circular from a parallel universe.
   Order: tokens · fonts · reset · type · layout · chrome · components ·
   templates · footer · responsive · print.
   ========================================================================== */

/* --- tokens ------------------------------------------------------------- */

:root {
  --paper: #faf8f3;
  --ink: #17232d;
  --muted: #5a6572;
  --rule: #e4dfd4;
  --primary: #1b4965;
  --primary-deep: #123246;
  --teal: #3e7c74;
  --ochre: #b67a28;
  --ochre-text: #8a5a17;
  --tint: #eff3f4;

  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --measure: 70ch;
  --gutter: 24px;
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 48px;
  --s6: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101820;
    --ink: #e9e5db;
    --muted: #9aa4ad;
    --rule: #26313b;
    --primary: #7fb3d3;
    --primary-deep: #a8cee5;
    --teal: #6fb3a8;
    --ochre: #d79a45;
    --ochre-text: #d79a45;
    --tint: #18232d;
  }
}

/* --- fonts -------------------------------------------------------------- */

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/source-sans-3-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/source-sans-3-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}

/* --- reset -------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/* --- type --------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.011em;
  line-height: 1.22;
  margin: 0 0 var(--s2);
  text-wrap: balance;
}

h1 {
  font-size: 2.25rem;
  margin-bottom: var(--s3);
}

h2 {
  font-size: 1.6rem;
  margin-top: var(--s5);
  padding-top: var(--s3);
  border-top: 1px solid var(--rule);
}

h3 {
  font-size: 1.3rem;
  margin-top: var(--s4);
}

h4 {
  font-size: 1.125rem;
  margin-top: var(--s3);
}

p,
ul,
ol,
dl {
  margin: 0 0 var(--s3);
}

li {
  margin-bottom: var(--s1);
}

li > ul,
li > ol {
  margin-top: var(--s1);
  margin-bottom: 0;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--primary-deep);
}

a:visited {
  color: var(--teal);
}

strong {
  font-weight: 600;
}

abbr {
  text-decoration: none;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--s5) 0;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.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 {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper);
  color: var(--primary);
  font-family: var(--sans);
  padding: var(--s2);
  z-index: 20;
}

.skip:focus {
  left: 0;
}

/* --- layout ------------------------------------------------------------- */

main {
  display: block;
}

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--s5) var(--gutter) var(--s6);
}

/* --- header ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 1px 1px color-mix(in srgb, var(--ink) 6%, transparent);
}

.hdr-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--s2) var(--gutter);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
}

.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--primary);
}

.site-header nav {
  display: flex;
  gap: var(--s3);
  font-family: var(--sans);
  font-size: 0.9375rem;
  flex-wrap: wrap;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.site-header nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--rule);
}

.site-header nav a.emph {
  color: var(--primary);
  font-weight: 600;
}

.site-header nav a[aria-current='page'] {
  color: var(--ink);
  border-bottom-color: var(--ochre);
}

/* --- breadcrumb + verified badge ---------------------------------------- */

.crumb {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: var(--s2);
}

.crumb a {
  color: var(--muted);
  text-decoration: none;
}

.crumb a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.crumb i {
  font-style: normal;
  padding: 0 0.5em;
  color: var(--rule);
}

.crumb span[aria-current] {
  color: var(--ink);
}

.verified {
  float: right;
  margin: 0 0 var(--s2) var(--s3);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.verified .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.5em;
  border-radius: 50%;
  background: var(--ochre);
  vertical-align: 0.05em;
}

/* --- answer box (component 1) ------------------------------------------- */

.answer {
  clear: both;
  background: var(--tint);
  border-left: 3px solid var(--primary);
  padding: var(--s3) var(--s3) calc(var(--s3) - 8px);
  margin: 0 0 var(--s4);
  font-size: 1.1875rem;
  line-height: 1.55;
}

.answer > p:last-child {
  margin-bottom: 0;
}

.answer strong {
  font-weight: 600;
}

/* --- source chip (component 2) ------------------------------------------ */

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  padding: 1px 8px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--muted);
  background: var(--paper);
  text-decoration: none;
  white-space: nowrap;
}

a.chip:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.lit {
  font-family: var(--mono);
  font-size: 0.9em;
}

/* --- statute block ------------------------------------------------------ */

.statute {
  margin: var(--s4) 0;
  padding: 0 0 0 var(--s3);
  border-left: 1px solid var(--rule);
}

.statute blockquote {
  margin: 0 0 var(--s2);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.statute blockquote::before {
  content: '\201C';
}

.statute blockquote::after {
  content: '\201D';
}

.statute figcaption {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
}

.statute figcaption a {
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.statute .eff {
  display: block;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.06em;
}

/* --- callout (component 7) ---------------------------------------------- */

.callout {
  margin: var(--s4) 0;
  padding: var(--s3);
  background: var(--tint);
  border-left: 3px solid var(--ochre);
  font-size: 1rem;
}

.callout-note {
  border-left-color: var(--teal);
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout h3 {
  margin-top: 0;
  font-size: 1.125rem;
}

/* --- glossary term (component 8) ---------------------------------------- */

.term {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--muted);
}

.term:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* --- figures, tables, steps --------------------------------------------- */

.fig {
  margin: var(--s5) 0;
}

.fig img {
  display: block;
  width: 100%;
  border: 1px solid var(--rule);
}

.fig figcaption {
  margin-top: var(--s2);
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.9375rem;
  margin: var(--s4) 0;
}

th,
td {
  text-align: left;
  padding: var(--s1) var(--s2) var(--s1) 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th {
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom-color: var(--ink);
}

td .lit,
td .chip {
  white-space: nowrap;
}

.step {
  margin: var(--s5) 0;
}

.step h3 {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  margin-top: 0;
}

.step-n {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  color: var(--ochre-text);
  font-variant-numeric: lining-nums;
}

/* --- FAQ ---------------------------------------------------------------- */

.faqs details {
  border-bottom: 1px solid var(--rule);
}

.faqs summary {
  cursor: pointer;
  padding: var(--s2) 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.125rem;
  list-style: none;
  display: flex;
  gap: var(--s2);
  align-items: baseline;
}

.faqs summary::-webkit-details-marker {
  display: none;
}

.faqs summary::before {
  content: '+';
  font-family: var(--sans);
  color: var(--ochre-text);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1;
  flex: none;
  width: 0.75em;
}

.faqs details[open] summary::before {
  content: '\2212';
}

.faq-a {
  padding: 0 0 var(--s2) calc(0.75em + var(--s2));
}

.faq-a > :last-child {
  margin-bottom: 0;
}

/* --- sources, related, sequence ----------------------------------------- */

.sources ul,
.related ul {
  list-style: none;
  padding: 0;
}

.sources {
  font-family: var(--sans);
  font-size: 0.9375rem;
}

.sources li {
  padding-left: 1.1em;
  text-indent: -1.1em;
  margin-bottom: var(--s2);
}

.sources li::before {
  content: '~';
  color: var(--teal);
  padding-right: 0.6em;
}

.sources .note {
  color: var(--muted);
  font-size: 0.875rem;
}

.related li {
  margin-bottom: var(--s2);
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--rule);
}

.related li a {
  display: block;
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
}

.related li a:hover {
  text-decoration: underline;
}

.related li span {
  display: block;
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--muted);
}

.seq {
  display: flex;
  gap: var(--s3);
  margin: var(--s5) 0 0;
  padding-top: var(--s3);
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
}

.seq a {
  flex: 1;
  text-decoration: none;
  font-weight: 600;
}

.seq a span {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.seq-next {
  text-align: right;
}

/* --- capture (component 9) ---------------------------------------------- */

.capture {
  max-width: var(--measure);
  margin: 0 auto var(--s6);
  padding: var(--s4);
  border: 1px solid var(--rule);
}

.capture h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  font-size: 1.3rem;
}

.capture p {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: var(--s3);
}

.capture-form {
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
}

.capture-form input[type='email'] {
  flex: 1 1 16rem;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid var(--muted);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
}

.capture-form button {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 20px;
  border: 1px solid var(--primary);
  border-radius: 2px;
  background: var(--primary);
  color: var(--paper);
  cursor: pointer;
}

.capture-form button:hover {
  background: var(--primary-deep);
  border-color: var(--primary-deep);
}

.capture-form button:disabled {
  opacity: 0.6;
  cursor: default;
}

.capture-msg:empty {
  display: none;
}

.capture-msg {
  font-family: var(--sans);
  font-size: 0.9375rem;
  margin: var(--s2) 0 0;
}

.hp {
  position: absolute;
  left: -9999px;
}

/* --- home + hub template blocks ----------------------------------------- */

.tpl-home h1 {
  font-size: 2.25rem;
}

.lede {
  font-size: 1.1875rem;
  color: var(--muted);
  margin-bottom: var(--s4);
}

.hub-list {
  list-style: none;
  padding: 0;
  margin: var(--s4) 0;
}

.hub-list li {
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--rule);
  margin: 0;
}

.hub-list li:first-child {
  border-top: 1px solid var(--rule);
}

.hub-list a {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  text-decoration: none;
}

.hub-list a:hover {
  text-decoration: underline;
}

.hub-list p {
  margin: var(--s1) 0 0;
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--muted);
}

.label {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: var(--s1);
}

/* --- glossary ----------------------------------------------------------- */

.glossary {
  margin: var(--s4) 0;
}

.glossary dt {
  font-weight: 600;
  font-size: 1.125rem;
  margin-top: var(--s3);
  scroll-margin-top: 5rem;
}

.glossary dd {
  margin: var(--s1) 0 0;
  color: var(--ink);
}

.glossary dt:target {
  border-left: 3px solid var(--ochre);
  padding-left: var(--s2);
  margin-left: calc(-1 * (var(--s2) + 3px));
}

/* --- signature SVG figures (timeline, division map) --------------------- */

.timeline text,
.divmap text {
  font-family: var(--sans);
  fill: var(--muted);
}

.timeline .yr,
.divmap .lbl {
  font-family: var(--serif);
  fill: var(--ink);
}

.divmap .lbl {
  font-family: var(--sans);
  font-size: 11px;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.06em;
}

/* --- footer ------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  background: color-mix(in srgb, var(--tint) 55%, var(--paper));
  font-family: var(--sans);
  font-size: 0.9375rem;
}

.foot-map {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--s5) var(--gutter) var(--s3);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s4);
}

.foot-map h3 {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 var(--s2);
  font-weight: 600;
}

.foot-map h3 a {
  color: var(--muted);
  text-decoration: none;
}

.foot-map h3 a:hover {
  color: var(--primary);
}

.foot-map ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.foot-map li {
  margin-bottom: 6px;
}

.foot-map a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.875rem;
}

.foot-map a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.foot-end {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--s3) var(--gutter) var(--s5);
  border-top: 1px solid var(--rule);
}

.foot-brand {
  font-family: var(--serif);
  font-size: 1.0625rem;
  margin: 0 0 var(--s2);
}

.tilde {
  color: var(--teal);
  padding: 0 0.35em;
}

.foot-end nav {
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
  margin-bottom: var(--s3);
}

.foot-end nav a {
  color: var(--primary);
  text-decoration: none;
}

.foot-end nav a:hover {
  text-decoration: underline;
}

.fineprint {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
  max-width: 80ch;
}

/* --- responsive --------------------------------------------------------- */

@media (max-width: 44rem) {
  body {
    font-size: 1.0625rem;
  }
  h1 {
    font-size: 1.875rem;
  }
  h2 {
    font-size: 1.4rem;
  }
  .page {
    padding-top: var(--s4);
  }
  .verified {
    float: none;
    margin-left: 0;
  }
  .hdr-inner {
    gap: var(--s1);
  }
  .site-header nav {
    gap: var(--s2);
    font-size: 0.875rem;
  }
  .capture {
    padding: var(--s3);
  }
  .seq {
    flex-direction: column;
  }
  .seq-next {
    text-align: left;
  }
}

/* --- print -------------------------------------------------------------- */

@media print {
  .site-header,
  .capture,
  .foot-map,
  .skip,
  .seq {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }
  .page {
    max-width: none;
  }
  a {
    color: #000;
  }
  .answer {
    border-left: 3px solid #000;
  }
}
