@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 Serif 4";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-600-italic.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: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin-400-italic.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");
}

:root {
  --paper: #f4f6f8;
  --ink: #1c2836;
  --muted: #5c6b7a;
  --line: #d5dee7;
  --card: #ffffff;
  --accent: #1f4e79;
  --mark: #1f4e79;
  --mark-ink: #fff;
  --measure: 42rem;
  --frame: 72rem;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #1c2836;
  --ink: #f4f6f8;
  --muted: #b4c0cb;
  --line: #3d4d5e;
  --card: #243244;
  --accent: #9ec0e0;
  --mark: #9ec0e0;
  --mark-ink: #1c2836;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Sans 3", var(--font-sans);
  font-size: var(--font-size-1);
  line-height: var(--font-lineheight-3);
}

main {
  width: min(var(--frame), calc(100% - 2 * var(--size-4)));
  margin: 0 auto;
  padding: var(--size-8) 0 var(--size-6);
}

h1, h2, h3 {
  font-family: "Source Serif 4", var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }

h2 {
  font-size: var(--font-size-5);
  margin-bottom: var(--size-3);
}

h3 {
  font-family: "Source Sans 3", var(--font-sans);
  font-size: var(--font-size-2);
  margin: var(--size-6) 0 var(--size-3);
}

p, li, dd { max-width: var(--measure); }

main img {
  display: block;
  width: 100%;
  max-width: var(--measure);
  height: auto;
}

button.zoom-trigger {
  display: block;
  width: 100%;
  max-width: var(--measure);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  text-align: left;
}

button.zoom-trigger.figure-wide {
  max-width: var(--frame);
}

button.zoom-trigger img {
  width: 100%;
  max-width: none;
  pointer-events: none;
}

img.contact-detail {
  display: inline-block;
  width: auto;
  max-width: none;
  height: 1em;
  vertical-align: -0.15em;
}

.lightbox {
  width: min(96vw, 72rem);
  max-width: 96vw;
  max-height: 96vh;
  margin: auto;
  padding: var(--size-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
}

.lightbox::backdrop {
  background: color-mix(in srgb, #0b1220 72%, transparent);
}

.lightbox-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--size-4);
  margin-bottom: var(--size-3);
}

.lightbox-download,
.lightbox-close {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: 600 var(--font-size-0) "Source Sans 3", var(--font-sans);
  text-decoration: none;
  cursor: pointer;
}

.lightbox-download:hover,
.lightbox-close:hover {
  text-decoration: underline;
}

.lightbox-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(96vh - 7.5rem);
  height: auto;
  margin: 0 auto;
}

.lightbox-caption {
  max-width: 48rem;
  margin: var(--size-3) auto 0;
  color: var(--muted);
  font-size: var(--font-size-0);
  line-height: 1.45;
  text-align: left;
}

.lightbox-caption[hidden] {
  display: none;
}

a { color: var(--accent); }

code {
  background: var(--card);
  color: var(--ink);
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  font-size: 0.95em;
}

pre {
  max-width: var(--frame);
  overflow-x: auto;
  margin: var(--size-4) 0;
  padding: var(--size-3);
  background: var(--card);
  border: 1px solid var(--line);
  line-height: 1.45;
}

pre code {
  background: none;
  padding: 0;
}

table.data {
  border-collapse: collapse;
  max-width: var(--frame);
  margin: var(--size-4) 0;
}

table.data th,
table.data td {
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 1rem 0.45rem 0;
  text-align: left;
  vertical-align: top;
}

a:hover { text-decoration: none; }

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

.site-header { margin-bottom: var(--size-5); }

.site-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--size-4);
}

.profiles {
  display: flex;
  flex: 0 0 auto;
  align-self: stretch;
  align-items: center;
  gap: var(--size-4);
  margin-top: 0;
  padding-left: var(--size-4);
}

.profile {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink);
  font-size: var(--font-size-0);
  font-weight: 600;
  text-decoration: none;
}

.profile svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.profile:hover { color: var(--accent); }

.theme-toggle {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 600 var(--font-size-0) "Source Sans 3", var(--font-sans);
  cursor: pointer;
}

.theme-toggle:hover { color: var(--accent); }

.lede {
  max-width: 38rem;
  margin: var(--size-3) 0 0;
  color: var(--muted);
  font-size: var(--font-size-3);
  line-height: 1.4;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}

.tabbar {
  display: flex;
  align-items: stretch;
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--paper);
  margin: 0 calc(var(--size-4) * -1);
  padding: 0 var(--size-4);
  border-bottom: 1px solid var(--line);
}

.tablist {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: var(--size-4);
  overflow-x: auto;
  scrollbar-width: none;
}

.tablist::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  margin: 0;
  padding: var(--size-3) 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 600 var(--font-size-1) "Source Sans 3", var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 transparent;
}

.tab[aria-selected="true"] {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.panel { padding-top: var(--size-5); }

.panel > h2 { max-width: var(--measure); }

#whitepaper {
  counter-reset: wp-sec;
}

#whitepaper > h2 + p {
  margin: 0 0 0.4rem;
  color: var(--muted);
  text-align: left;
  letter-spacing: 0.01em;
}

#whitepaper > h2 + p + p:has(> a[href$=".pdf"]:only-child) {
  margin: 0 0 1.75rem;
  text-align: left;
  hyphens: none;
}

#whitepaper h3,
#whitepaper h4 {
  scroll-margin-top: 4.5rem;
}

#whitepaper h3 {
  font-family: "Source Serif 4", var(--font-serif);
  font-size: var(--font-size-4);
  line-height: 1.2;
  margin: 2.75rem 0 0.9rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

#whitepaper h3:not(.abstract):not(.toc) {
  counter-increment: wp-sec;
  counter-reset: wp-sub;
}

#whitepaper h3:not(.abstract):not(.toc)::before {
  content: counter(wp-sec) ". ";
}

#whitepaper h3.abstract,
#whitepaper h3.toc {
  margin-top: 0;
  margin-bottom: 0.65rem;
  padding-bottom: 0;
  border-bottom: 0;
  font-size: var(--font-size-3);
}

#whitepaper h3.toc { margin-top: 2rem; }

#whitepaper h4 {
  counter-increment: wp-sub;
  font-family: "Source Sans 3", var(--font-sans);
  font-size: var(--font-size-2);
  font-weight: 600;
  line-height: 1.3;
  margin: 1.85rem 0 0.55rem;
}

#whitepaper h4::before {
  content: counter(wp-sec) "." counter(wp-sub) " ";
  color: var(--muted);
}

#whitepaper p {
  margin: 0 0 0.95rem;
  text-align: justify;
  hyphens: auto;
  line-height: 1.6;
}

#whitepaper h3.abstract + p { margin-bottom: 0.4rem; }

#whitepaper code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-family: Georgia, "Times New Roman", "Liberation Serif", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.05em;
}

#whitepaper code .op {
  font-style: normal;
}

#whitepaper p:has(> code:only-child) {
  margin: 0.85rem 0 1rem;
  padding: 0;
  text-align: center;
  hyphens: none;
  background: none;
  border: 0;
}

#whitepaper p:has(> code:only-child) code {
  font-size: 1.15em;
}

#whitepaper p.eq {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  text-align: center;
  hyphens: none;
}

#whitepaper p.eq code {
  grid-column: 2;
  font-size: 1.15em;
}

#whitepaper p.eq .eq-no {
  grid-column: 3;
  justify-self: end;
  padding-left: 1.25rem;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-style: normal;
  font-size: 1.05em;
}

#whitepaper p:has(> em:only-child) {
  margin: 0.35rem 0 1.6rem;
  text-align: center;
  hyphens: none;
  color: var(--muted);
  font-size: 0.95em;
}

#whitepaper ul,
#whitepaper ol {
  margin: 0.2rem 0 1.15rem;
}

#whitepaper li {
  text-align: left;
  hyphens: none;
}

#whitepaper h3.toc + ol {
  margin-bottom: 2.4rem;
  padding-left: 1.35rem;
}

#whitepaper h3.toc + ol ul {
  margin: 0.15rem 0 0.45rem;
  padding-left: 1.15rem;
}

#whitepaper h3.toc + ol a { text-decoration: none; }

#whitepaper h3.toc + ol a:hover { text-decoration: underline; }

#whitepaper #references + ol li {
  margin-top: 0.7rem;
  padding-left: 0.25rem;
  scroll-margin-top: 4.5rem;
}

#whitepaper #references + ol li span[id^="ref-"] {
  scroll-margin-top: 4.5rem;
}

#whitepaper a.cite {
  text-decoration: none;
  padding: 0 0.15em;
  border-radius: 0.2rem;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

#whitepaper a.cite:hover,
#whitepaper a.cite:focus-visible {
  text-decoration: none;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.cite-preview {
  position: fixed;
  z-index: 30;
  width: min(26rem, calc(100vw - 1.5rem));
  margin: 0;
  padding: 0.8rem 1rem 0.95rem;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  box-shadow: 0 14px 36px rgba(28, 40, 54, 0.14);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  hyphens: none;
}

[data-theme="dark"] .cite-preview {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.cite-preview[hidden] { display: none; }

.cite-preview-no {
  display: block;
  margin: 0 0 0.4rem;
  font-family: "Source Sans 3", var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.cite-preview-body { margin: 0; max-width: none; }

.cite-preview-body em { font-style: italic; }

.cite-preview-body a { color: var(--accent); }

#whitepaper .zoom-trigger { margin: 1.15rem 0 0.35rem; }

ul, ol { padding-left: 1.2rem; }

li + li { margin-top: 0.4rem; }

#the-loop + ol {
  list-style: none;
  margin: var(--size-3) 0 var(--size-4);
  padding: 0;
  counter-reset: step;
}

#the-loop + ol li {
  position: relative;
  max-width: var(--measure);
  margin: 0;
  padding: 0 0 var(--size-4) 2.6rem;
  border-left: 1px solid var(--line);
}

#the-loop + ol li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

#the-loop + ol li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -0.85rem;
  top: 0;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-round);
  background: var(--mark);
  color: var(--mark-ink);
  font-size: var(--font-size-0);
  font-weight: 600;
}

blockquote {
  max-width: var(--measure);
  margin: var(--size-5) 0;
  padding: var(--size-4);
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-2);
}

blockquote p {
  margin: 0;
  max-width: none;
}

blockquote p:first-child {
  margin-bottom: var(--size-2);
  color: var(--accent);
  font-size: var(--font-size-0);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

dl dt {
  margin-top: var(--size-3);
  font-weight: 600;
}

dl dd { margin: 0.25rem 0 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--size-3);
  max-width: var(--measure);
  margin-top: var(--size-3);
}

.card {
  margin: 0;
  padding: var(--size-3) var(--size-4);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
}

.card dt,
.card dd { max-width: none; }

.card dt { margin: 0; }

table.glossary {
  width: 100%;
  max-width: var(--measure);
  border-collapse: separate;
  border-spacing: 0 0.75rem;
  margin: var(--size-3) 0;
}

table.glossary thead th {
  padding: 0 0.9rem 0.15rem;
  color: var(--muted);
  font-size: var(--font-size-0);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

table.glossary tbody tr {
  cursor: pointer;
  scroll-margin-top: 4.5rem;
}

table.glossary tbody th,
table.glossary td {
  padding: 0.85rem 0.95rem;
  background: var(--card);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

table.glossary tbody th {
  width: 32%;
  border-left: 1px solid var(--line);
  border-radius: var(--radius-2) 0 0 var(--radius-2);
  color: var(--accent);
  font-family: "Source Serif 4", var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  scroll-margin-top: 4.5rem;
}

table.glossary tbody td {
  border-right: 1px solid var(--line);
  border-radius: 0 var(--radius-2) var(--radius-2) 0;
}

table.glossary tbody tr:hover th,
table.glossary tbody tr:hover td {
  border-color: var(--accent);
}

table.glossary tbody tr.is-current th,
table.glossary tbody tr.is-current td {
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
  border-color: var(--accent);
}

table.glossary tbody tr.is-current th {
  box-shadow: inset 3px 0 0 var(--accent);
}

a.glossary-link {
  color: inherit;
  font-style: italic;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.15em;
}

table.compare,
table.benefits {
  width: 100%;
  max-width: var(--measure);
  border-collapse: collapse;
  margin: var(--size-4) 0;
}

table.compare th,
table.compare td,
table.benefits td {
  padding: var(--size-3) var(--size-4);
  vertical-align: top;
  text-align: left;
}

table.compare {
  display: block;
}

table.compare thead,
table.compare tbody,
table.compare tr { display: block; }

table.compare tr {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--size-3);
}

table.compare th,
table.compare td {
  max-width: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
}

table.compare th {
  font-family: "Source Sans 3", var(--font-sans);
  font-size: var(--font-size-0);
  letter-spacing: 0.02em;
  color: var(--muted);
}

table.benefits thead { display: none; }

table.benefits,
table.benefits tbody { display: block; }

table.benefits tr {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: var(--size-2) var(--size-4);
  padding: var(--size-3) 0;
  border-bottom: 1px solid var(--line);
}

table.benefits td { padding: 0; }

table.benefits td:first-child { font-weight: 600; }

.site-footer {
  width: min(var(--frame), calc(100% - 2 * var(--size-4)));
  margin: 0 auto;
  padding: var(--size-5) 0 var(--size-7);
  color: var(--muted);
  font-size: var(--font-size-0);
}

@media (max-width: 60rem) {
  .tabbar { flex-wrap: wrap; }

  .profiles {
    order: -1;
    flex: 1 0 100%;
    justify-content: flex-start;
    padding-left: 0;
  }

  .tablist { flex: 1 0 100%; }
}

@media (max-width: 40rem) {
  .cards { grid-template-columns: 1fr; }

  table.compare tr,
  table.benefits tr { grid-template-columns: 1fr; }

  table.compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

  table.compare td:nth-child(1)::before,
  table.compare td:nth-child(2)::before {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: var(--font-size-0);
    font-weight: 600;
  }

  table.compare td:nth-child(1)::before { content: "Conventional"; }
  table.compare td:nth-child(2)::before { content: "Continuous Governance"; }

  table.glossary thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  table.glossary tbody tr {
    display: block;
    margin-bottom: 0.75rem;
  }

  table.glossary tbody th,
  table.glossary tbody td {
    display: block;
    width: auto;
  }

  table.glossary tbody th {
    padding-bottom: 0.2rem;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    border-radius: var(--radius-2) var(--radius-2) 0 0;
  }

  table.glossary tbody td {
    border-left: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 var(--radius-2) var(--radius-2);
  }
}
