@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/roboto-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/roboto-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Roboto";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/roboto-latin-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/roboto-latin-ext-400-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/roboto-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/roboto-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/roboto-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/roboto-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font-sans: "Roboto", ui-sans-serif, system-ui, sans-serif;
  --ink: #1a1c1e;
  --primary: #005ac1;
  --on-primary: #ffffff;
  --primary-container: #d8e2ff;
  --on-primary-container: #001a41;
  --secondary-container: #dae2f9;
  --surface: #f8f9ff;
  --surface-low: #f1f3fa;
  --surface-container: #ebeef5;
  --surface-high: #e5e7ee;
  --outline: #74777f;
  --outline-variant: #c4c6d0;
  --muted: #5c5f66;
  --success: #146c2e;
  --success-container: #c7efce;
  --warning: #7b5800;
  --warning-container: #ffdea5;
  --error: #ba1a1a;
  --error-container: #ffdad6;
  --header-h: 4.5rem;
  --content: 46rem;
  --sidebar: 16.5rem;
  --shadow: 0 1px 2px rgba(26, 28, 30, 0.06), 0 8px 24px rgba(0, 26, 65, 0.06);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.25rem);
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 80;
  padding: 0.75rem 1rem;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid #e3e5ed;
  background: rgba(248, 249, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: inherit;
  border-radius: 1rem;
  min-width: 0;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--primary);
  color: var(--on-primary);
}
.brand-text { line-height: 1.2; min-width: 0; }
.brand-name {
  display: block;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand-tag {
  display: block;
  margin-top: 0.15rem;
  font-size: 10px;
  color: var(--muted);
}
.header-meta {
  display: none;
  flex-direction: column;
  gap: 0.1rem;
  margin-left: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--outline-variant);
}
.header-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}
.header-version {
  font-size: 0.8rem;
  color: var(--muted);
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
}
.header-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: #45474d;
}
.header-nav a:hover { background: var(--surface-container); }
.header-nav a.btn-filled {
  color: #fff;
  background: var(--primary);
}
.header-nav a.btn-filled:hover { background: #004da5; }

/* Layout */
.shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.toc-label { display: none; }
.toc-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.toc-toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--on-primary-container);
  padding: 0.55rem 0;
}
.toc-toggle-label::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  margin-right: 0.25rem;
}
.toc-toggle:checked + .toc-toggle-label::after {
  transform: rotate(225deg);
  margin-top: 0.3rem;
}
.toc-toggle:not(:checked) ~ .toc-nav { display: none; }
.toc-wrap {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  background: var(--surface);
  margin: 0 -1.25rem;
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid #e3e5ed;
}
.toc {
  list-style: none;
  margin: 0;
  padding: 0 0 0.75rem;
}
.toc a {
  display: block;
  padding: 0.35rem 0.65rem;
  border-radius: 0.55rem;
  color: #31343a;
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.4;
}
.toc a:hover { background: var(--surface-container); }
.toc a[aria-current="location"] {
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-weight: 500;
}
.toc .depth-1 { padding-left: 1.35rem; font-size: 0.84rem; color: var(--muted); }
.toc .depth-1[aria-current="location"] { color: var(--on-primary-container); }

.content { min-width: 0; padding-top: 1.75rem; }

/* Title block */
.hero {
  margin: 0 0 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid #e3e5ed;
}
.eyebrow {
  color: var(--primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
}
.hero h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3.2vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
}
.hero-tagline {
  margin: 0.85rem 0 0;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--on-primary-container);
  max-width: 46rem;
}
.hero-summary {
  margin: 1rem 0 0;
  max-width: 46rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}
.hero-meta {
  margin: 1.15rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Typography in body */
.content h2 {
  margin: 2.75rem 0 1rem;
  padding-top: 0.5rem;
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--ink);
}
.content h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.content p {
  margin: 0 0 0.95rem;
  max-width: var(--content);
}
.content p:last-child { margin-bottom: 0; }

/* Callout */
.callout {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1.4rem;
  padding: 1rem 1.15rem;
  background: var(--primary-container);
  color: var(--on-primary-container);
  border-radius: 1rem;
  max-width: var(--content);
}
.callout-lead {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.callout p { margin: 0; max-width: none; }

/* Properties */
.props {
  display: grid;
  gap: 0;
  margin: 0 0 1.4rem;
  padding: 0.25rem 0;
  border-top: 1px solid var(--outline-variant);
  max-width: var(--content);
}
.prop {
  display: grid;
  gap: 0.15rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--outline-variant);
}
.prop dt {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}
.prop dd { margin: 0; }

/* Tables */
.table-wrap {
  margin: 0 0 1.4rem;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--outline-variant);
  border-radius: 1rem;
  background: #fff;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.5;
}
th, td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e8eaf1;
}
th {
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--surface-low);
  white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(216, 226, 255, 0.28); }

.tone {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.tone-success { color: var(--success); background: var(--success-container); }
.tone-warning { color: var(--warning); background: var(--warning-container); }
.tone-danger { color: var(--error); background: var(--error-container); }

/* Rows / definition blocks */
.rows {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1.4rem;
  max-width: var(--content);
}
.row-card {
  background: #fff;
  border: 1px solid var(--outline-variant);
  border-radius: 0.9rem;
  padding: 0.9rem 1.05rem;
}
.row-card h4 {
  margin: 0 0 0.3rem;
  font-size: 0.98rem;
  font-weight: 500;
}
.row-card p { margin: 0; }

/* Steps */
.steps {
  list-style: none;
  margin: 0 0 1.4rem;
  padding: 0;
  max-width: var(--content);
  counter-reset: step;
}
.steps li {
  position: relative;
  padding: 0 0 1.15rem 3rem;
}
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  top: 2.15rem;
  bottom: 0.15rem;
  width: 2px;
  background: var(--primary-container);
}
.steps h4 {
  margin: 0.2rem 0 0.25rem;
  font-size: 1rem;
  font-weight: 500;
}
.steps p { margin: 0; }

/* Link cards */
.links {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1.4rem;
}
.link-card {
  display: block;
  padding: 0.9rem 1.05rem;
  background: #fff;
  border: 1px solid var(--outline-variant);
  border-radius: 0.9rem;
  text-decoration: none;
  color: inherit;
}
.link-card:hover { border-color: var(--primary); background: #f4f7ff; }
.link-card .site {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.2rem;
}
.link-card .title {
  display: block;
  font-weight: 500;
  color: var(--ink);
}

/* Checklist */
.checklist {
  list-style: none;
  margin: 0 0 1.4rem;
  padding: 0;
  max-width: 52rem;
}
.checklist li {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.7rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #e8eaf1;
  font-size: 0.97rem;
}
.checklist li:last-child { border-bottom: 0; }
.box {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.25rem;
  border: 1.5px solid var(--outline);
  border-radius: 0.25rem;
  background: #fff;
}

/* Numbered open decisions */
.numbered {
  margin: 0 0 1.4rem;
  padding-left: 1.4rem;
  max-width: var(--content);
}
.numbered li { margin: 0 0 0.65rem; padding-left: 0.35rem; }

/* Domain diagram */
.diagram {
  margin: 0 0 1.5rem;
  padding: 1.1rem;
  background: #fff;
  border: 1px solid var(--outline-variant);
  border-radius: 1rem;
  overflow-x: auto;
}
.diagram-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(10.5rem, 1fr));
  gap: 0.85rem 1rem;
  min-width: 34rem;
}
.d-node {
  border: 1px solid var(--outline-variant);
  border-radius: 0.85rem;
  padding: 0.7rem 0.8rem;
  background: var(--surface);
}
.d-node strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 500;
}
.d-node span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}
.d-node.tenant { background: var(--primary-container); border-color: #b4c7f5; }
.d-caption {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.d-edges {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}
.d-edges code {
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--on-primary-container);
  background: var(--surface-low);
  padding: 0.05rem 0.35rem;
  border-radius: 0.3rem;
}

/* Footer */
.site-footer {
  background: var(--on-primary-container);
  color: #d8e2ff;
}
.footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}
.footer-inner strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 500;
  color: #fff;
}
.footer-inner p {
  margin: 0.5rem 0 0;
  max-width: 32rem;
  font-size: 0.9rem;
  line-height: 1.6;
}
.footer-bar {
  border-top: 1px solid rgba(255,255,255,0.1);
}
.footer-bar p {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  font-size: 0.75rem;
  color: #b7c6ea;
}

@media (min-width: 960px) {
  .header-inner, .shell, .footer-inner, .footer-bar p {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  .header-meta { display: flex; }
  .shell {
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
  }
  .toc-wrap {
    position: sticky;
    top: calc(var(--header-h) + 1.25rem);
    margin: 1.75rem 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    max-height: calc(100vh - var(--header-h) - 2.5rem);
    overflow: auto;
  }
  .toc-toggle-label { display: none; }
  .toc-toggle:not(:checked) ~ .toc-nav { display: block; }
  .toc-label {
    display: block;
    margin: 0 0 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
  }
  .content { padding-top: 1.75rem; }
  .prop {
    grid-template-columns: 11.5rem 1fr;
    gap: 1rem;
    align-items: start;
  }
  .links {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
