/* =========================================================================
   RBAC Drift — light, professional theme
   ========================================================================= */
:root {
  /* palette */
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #64748b;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e3e8f0;
  --border-strong: #cdd6e4;

  --primary: #1d4ed8;
  --primary-700: #1e40af;
  --primary-soft: #eaf0ff;
  --teal: #0ea5a3;
  --teal-soft: #e3fbf8;
  --violet: #7c3aed;
  --violet-soft: #f1e9ff;
  --amber: #f59e0b;

  --code-bg: #f5f8ff;
  --code-border: #e6ecfb;
  --inline-code-bg: #eef2fb;

  /* type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;

  /* metrics */
  --header-h: 4.25rem;
  --shell-max: 78rem;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 48px rgba(29, 78, 216, 0.16);
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.site-main { flex: 1 0 auto; width: 100%; }

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

/* ---- shared shell (wide on desktop, fluid on mobile) ------------------- */
.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

/* ---- links ------------------------------------------------------------- */
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-700); }

.doc-body a,
.home-prose a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent);
  text-underline-offset: 0.18em;
  transition: color var(--transition), text-decoration-color var(--transition), background var(--transition);
  border-radius: 3px;
}
.doc-body a:hover,
.home-prose a:hover {
  color: var(--primary-700);
  text-decoration-color: var(--primary-700);
  background: var(--primary-soft);
}

:where(a, button, summary):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 1000;
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: top var(--transition);
}
.skip-link:focus { top: 0.75rem; color: #fff; }

/* anchor offset so in-page links clear the sticky header */
:is(h1, h2, h3, h4, h5, h6)[id] { scroll-margin-top: calc(var(--header-h) + 1rem); }

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--ink); }
.brand-mark { transition: transform var(--transition); }
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; letter-spacing: -0.01em; font-size: 1.12rem; }
.brand-sub { font-size: 0.72rem; color: var(--ink-faint); font-weight: 500; }

.primary-nav { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.nav-ico { width: 1.15rem; height: 1.15rem; flex: none; }
.nav-link:hover { background: var(--surface-2); color: var(--primary); transform: translateY(-1px); }
.nav-link.is-current { background: var(--primary-soft); color: var(--primary-700); }

.nav-sep { width: 1px; height: 1.5rem; background: var(--border-strong); margin-inline: 0.35rem; }

/* the three pillar links */
.nav-pillar { font-size: 0.88rem; padding-inline: 0.7rem; }
.nav-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent); }
.pillar-1 { background: var(--primary); }
.pillar-2 { background: var(--teal); }
.pillar-3 { background: var(--violet); }
.nav-pillar.is-current { background: var(--surface-2); color: var(--ink); }

@media (max-width: 1080px) {
  .brand-sub { display: none; }
  .nav-link { padding-inline: 0.6rem; }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 40px;
  padding: 9px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle-bar { height: 2px; background: var(--ink); border-radius: 2px; transition: var(--transition); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.75rem clamp(1rem, 4vw, 2.5rem) 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-130%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
  }
  .primary-nav.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-link { justify-content: flex-start; font-size: 0.98rem; }
  .nav-pillar { font-size: 0.98rem; }
  .nav-sep { width: 100%; height: 1px; margin: 0.4rem 0; }
}

/* =========================================================================
   Hero / homepage
   ========================================================================= */
.hero {
  background:
    radial-gradient(1200px 480px at 15% -10%, var(--primary-soft), transparent 60%),
    radial-gradient(900px 420px at 95% 0%, var(--teal-soft), transparent 55%);
  padding-block: clamp(2.5rem, 6vw, 5rem);
}
.hero-inner { text-align: center; }
.hero-logo {
  width: clamp(110px, 16vw, 168px);
  height: auto;
  display: block;
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 14px 28px rgba(29, 78, 216, 0.28));
  transition: transform var(--transition);
}
.hero-logo:hover { transform: translateY(-4px) scale(1.02); }
.hero-title {
  font-size: clamp(1.9rem, 1.3rem + 3vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 850;
  margin: 0 auto 0.75rem;
  max-width: 22ch;
}
.grad {
  background: linear-gradient(100deg, var(--primary), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lede {
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 0 auto 2rem;
}

.hero-cta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  max-width: 56rem;
  margin: 0 auto;
}
.cta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-align: left;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.cta:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; color: var(--ink); }
.cta-ico {
  flex: none;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
}
.cta-ico svg { width: 1.6rem; height: 1.6rem; }
.cta-text { display: flex; flex-direction: column; }
.cta-label { font-weight: 750; line-height: 1.25; }
.cta-go { font-size: 0.85rem; color: var(--ink-faint); font-weight: 600; }
.accent-blue .cta-ico { background: var(--primary-soft); color: var(--primary); }
.accent-teal .cta-ico { background: var(--teal-soft); color: var(--teal); }
.accent-violet .cta-ico { background: var(--violet-soft); color: var(--violet); }

.home-prose { padding-block: clamp(2rem, 4vw, 3rem); }
.home-prose p { color: var(--ink-soft); margin: 0 0 1.1rem; max-width: none; }

.home-sections { padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-heading {
  font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
}

/* =========================================================================
   Cards / related navigation
   ========================================================================= */
.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.section-card h3 { margin: 0 0 0.6rem; font-size: 1.12rem; }
.card-arrow { color: var(--teal); margin-right: 0.4rem; transition: transform var(--transition); display: inline-block; }
.card a:hover .card-arrow { transform: translateX(3px); }
.card-sublist { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.25rem; }
.card-sublist a { font-size: 0.92rem; color: var(--ink-soft); }
.card-sublist a:hover { color: var(--primary); }

/* content library page */
.content-section {
  margin-block: 1.75rem;
  padding: 1.4rem 1.5rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--primary);
}
.content-section:nth-of-type(2) { border-left-color: var(--teal); }
.content-section:nth-of-type(3) { border-left-color: var(--violet); }
.content-section > h2 {
  font-size: 1.3rem;
  margin: 0 0 1.1rem;
  border: 0;
  padding: 0;
}
.content-section > h2 a { color: var(--ink); text-decoration: none; background: none; }
.content-section:nth-of-type(1) > h2 a:hover { color: var(--primary); }
.content-section:nth-of-type(2) > h2 a:hover { color: var(--teal); }
.content-section:nth-of-type(3) > h2 a:hover { color: var(--violet); }

/* card links are navigation, not prose — drop the prose underline/highlight */
.doc-body .card > a,
.doc-body .card-sublist a {
  text-decoration: none;
  background: none;
}
.doc-body .card > a { font-weight: 650; color: var(--ink); }
.doc-body .card > a:hover { color: var(--primary); }

/* =========================================================================
   Document / content page
   ========================================================================= */
.doc { padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(2.5rem, 5vw, 4rem); }
.doc-body { max-width: none; }

.breadcrumbs { margin-bottom: 1.5rem; font-size: 0.9rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; color: var(--ink-faint); }
.breadcrumbs li { display: flex; align-items: center; gap: 0.35rem; }
.breadcrumbs li + li::before { content: "›"; color: var(--border-strong); }
.breadcrumbs [aria-current="page"] { color: var(--ink-soft); font-weight: 600; }

.doc-body h1 {
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 850;
  margin: 0 0 1.1rem;
  background: linear-gradient(100deg, var(--primary), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.doc-body h2 {
  font-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.9rem);
  letter-spacing: -0.01em;
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}
.doc-body h3 { font-size: 1.3rem; margin: 1.9rem 0 0.7rem; color: var(--primary-700); }
.doc-body h4 { font-size: 1.1rem; margin: 1.5rem 0 0.6rem; color: var(--ink); }
.doc-body p { margin: 0 0 1.15rem; }
.doc-body ul, .doc-body ol { margin: 0 0 1.2rem; padding-left: 1.4rem; }
.doc-body li { margin: 0.35rem 0; }
.doc-body li::marker { color: var(--teal); }

.doc-body blockquote {
  margin: 1.4rem 0;
  padding: 0.6rem 1.1rem;
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
}

/* inline code: subtle, borderless, blends in */
.doc-body :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--inline-code-bg);
  color: #1e3a8a;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  white-space: break-spaces;
}
.doc-body a code { color: inherit; }

/* =========================================================================
   Code blocks + copy button
   ========================================================================= */
.code-wrap { position: relative; margin: 1.5rem 0; }
.doc-body pre,
pre[class*="language-"] {
  margin: 0;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
  line-height: 1.6;
  tab-size: 4;
}
.doc-body pre code {
  font-family: var(--font-mono);
  background: none;
  padding: 0;
  color: #0b2545;
}
.copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  font: 600 0.78rem/1 var(--font-sans);
  color: var(--primary-700);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition), color var(--transition);
}
.code-wrap:hover .copy-btn,
.copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.copy-btn.is-copied { background: var(--teal); color: #fff; border-color: var(--teal); }

/* Prism token colours — light theme aligned to palette */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #7a8aa3; font-style: italic; }
.token.punctuation { color: #5b6b86; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol { color: #b4530a; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #0e8a6a; }
.token.operator, .token.entity, .token.url { color: #0f766e; }
.token.atrule, .token.attr-value, .token.keyword { color: #1d4ed8; font-weight: 600; }
.token.function, .token.class-name { color: #7c3aed; }
.token.regex, .token.important, .token.variable { color: #b4530a; }
.token.deleted { color: #b91c1c; }

/* =========================================================================
   Tables (styled + horizontally scrollable)
   ========================================================================= */
.table-scroll {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.doc-body table { border-collapse: collapse; width: 100%; min-width: 32rem; font-size: 0.94rem; }
.doc-body thead th { background: var(--primary-soft); color: var(--primary-700); }
.doc-body th, .doc-body td {
  text-align: left;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.doc-body tbody tr:nth-child(even) { background: var(--surface-2); }
.doc-body tbody tr:hover { background: var(--teal-soft); }
.doc-body td:first-child, .doc-body th:first-child { padding-left: 1.1rem; }

/* =========================================================================
   Task-list checkboxes
   ========================================================================= */
.doc-body ul.contains-task-list { list-style: none; padding-left: 0.2rem; }
.doc-body li.task-list-item { list-style: none; display: flex; align-items: flex-start; gap: 0.6rem; }
.doc-body li.task-list-item::marker { content: ""; }
.doc-body li.task-list-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  margin-top: 0.32em;
  width: 1.15em;
  height: 1.15em;
  flex: none;
  border: 2px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition);
}
.doc-body li.task-list-item input[type="checkbox"]:hover { border-color: var(--primary); }
.doc-body li.task-list-item input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.doc-body li.task-list-item input[type="checkbox"]:checked::after {
  content: "";
  display: block;
  width: 0.32em;
  height: 0.62em;
  margin: 0.02em 0 0 0.33em;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.doc-body li.task-list-item.is-checked { color: var(--ink-faint); text-decoration: line-through; text-decoration-color: var(--ink-faint); }

/* =========================================================================
   FAQ accordions
   ========================================================================= */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin: 0.7rem 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  font-weight: 650;
  padding: 0.95rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: background var(--transition);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--primary);
  transition: transform var(--transition);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { background: var(--primary-soft); }
.faq-item > :not(summary) { padding-inline: 1.1rem; }
.faq-item > :last-child { padding-bottom: 1rem; }

/* =========================================================================
   Related navigation blocks
   ========================================================================= */
.related { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.related-title { font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); margin: 0 0 1rem; }
.pill-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; }
.pill-list a {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: var(--transition);
}
.pill-list a:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-2px); }

/* =========================================================================
   Mermaid diagrams + full-screen lightbox
   ========================================================================= */
.mermaid { margin: 1.5rem 0; text-align: center; }
.mermaid svg { max-width: 100%; height: auto; }

/* zoomable inline diagram presented as a figure-like card */
.diagram--zoomable {
  position: relative;
  cursor: zoom-in;
  padding: 1.25rem 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.diagram--zoomable:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-2px); }
.diagram--zoomable:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 3px; }
.diagram-hint {
  position: absolute;
  right: 0.7rem;
  bottom: 0.6rem;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--primary-700);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--transition), transform var(--transition);
  pointer-events: none;
}
.diagram--zoomable:hover .diagram-hint,
.diagram--zoomable:focus-visible .diagram-hint { opacity: 1; transform: translateY(0); }

body.modal-open { overflow: hidden; }

.diagram-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  background: rgba(8, 15, 31, 0.72);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--transition);
}
.diagram-modal.is-open { opacity: 1; }
.diagram-modal__inner {
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(1rem, 2.5vw, 2rem);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  max-width: 96vw;
  max-height: 92vh;
  overflow: auto;
  transform: scale(0.97);
  transition: transform var(--transition);
}
.diagram-modal.is-open .diagram-modal__inner { transform: scale(1); }
.diagram-modal__inner svg { display: block; margin: 0 auto; }
.diagram-modal__close {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.8rem;
  line-height: 1;
  color: #0f172a;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), background var(--transition), color var(--transition);
}
.diagram-modal__close:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: rotate(90deg); }

/* =========================================================================
   Footer (pinned to bottom)
   ========================================================================= */
.site-footer { flex-shrink: 0; margin-top: 3rem; background: #0c1730; color: #cbd5e1; }
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 2rem;
  padding-block: 2.5rem 1.5rem;
}
.footer-brand { display: flex; gap: 0.9rem; align-items: flex-start; }
.footer-name { font-weight: 800; color: #fff; margin: 0; }
.footer-tag { margin: 0.25rem 0 0; font-size: 0.9rem; color: #93a4bf; max-width: 42ch; }
.footer-heading { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: #93a4bf; margin: 0 0 0.7rem; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.footer-nav a { color: #cbd5e1; }
.footer-nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 0.2em; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, 0.1); padding-block: 1.1rem; }
.footer-base p { margin: 0; font-size: 0.82rem; color: #7e90ac; }

@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
