:root{
    --gutter:  2rem;
    --margin:  420px;
    --body-pad: 1rem;
    --content: clamp(
	var(--content-min),
	calc(100vi - 2*var(--body-pad) - 2*(var(--margin) + var(--gutter))),
	var(--content-max)
    );
    --content-min: 60ch;
    --content-max: 880px;
    --bleed: 48px; 
    --fullwidth-cap: 860px;
    --bg: #faf9f6;
    --fg: #000000;
    --link: #1a0dab;
    --heading: #004c99;
    --surface: #ffffff;
    --surface-soft: #f3f1eb;
    --accent: #2563eb;
    --code-bg: #f0f0f0;
    --active-toc: #cacaca;
    --note-color: #555;
    --note-bg: transparent;
    --border: #d7d7d7;
    --chip-bg: #f0f0f0;
    --chip-fg: #444;
    --muted: #666;

    --font-body:  'DM Sans', system-ui, sans-serif;
    --kb-bg-completed:        #e6f4ea;
    --kb-bg-manager-review:  #fff4e5;
    --kb-bg-in-progress:     #e8f0fe;
    --kb-bg-not-started:     #f1f3f5;
    --kb-bg-comments:        #fdecea;
    
    --kb-column-border: rgba(0,0,0,0.06);
    --kb-card-bg: #ffffff;
    --kb-card-text: #1f2933;
}

:root[data-theme="dark"]{
    --bg: #0f1115;
    --fg: #e6e6e6;
    --link: #8ab4ff;
    --heading: #9ecbff;
    --surface: #151820;
    --surface-soft: #1b202a;
    --accent: #8ab4ff;
    --code-bg: #1a1d24;
    
    --note-color: #c2c7cf;
    --note-bg: transparent;
    
    --border: #2a2f3a;
    --chip-bg: #1f2330;
    --chip-fg: #cfd3da;
    --muted: #a9b0bb;
    --active-toc: #313131;

    --kb-bg-completed:        #1e3a2b;
    --kb-bg-manager-review:  #3a2f1e;
    --kb-bg-in-progress:     #1f2a44;
    --kb-bg-not-started:     #2a2d31;
    --kb-bg-comments:        #3b1f24;

    --kb-column-border: rgba(255,255,255,0.08);
    --kb-card-bg: #16181c;
    --kb-card-text: #e5e7eb;
 
}

@font-face {
    font-family: 'Noto';
    src: url('../fonts/NotoSans-Regular.ttf') format('truetype');
}
html, body{
    background-color: var(--bg);
    color: var(--fg);
    font-size: 16px;
    transition: background-color .3s, color .3s;
    margin: 0;    
    font-family: 'Noto', system-ui, sans-serif;
    line-height: 1.65;
}

body {
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: color-mix(in oklab, var(--accent) 24%, transparent);
}

h1, h2, h3{
    color: var(--heading);
    line-height: 1.18;
    letter-spacing: 0;
}

h1 {
    margin-top: 2.25rem;
    margin-bottom: 1rem;
    font-size: clamp(2rem, 4vw, 3.4rem);
}

h2 {
    margin-top: 2.2rem;
}

p {
    margin: 0 0 1.15rem;
}

a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration: underline;
}

.banner-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.85rem;
    padding: 0.7rem;
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in oklab, var(--surface) 88%, var(--bg) 12%);
    box-shadow: 0 12px 32px color-mix(in oklab, #000 8%, transparent);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--fg);
    font-weight: 800;
    white-space: nowrap;
}

.site-brand:hover {
    text-decoration: none;
    color: var(--heading);
}

.site-brand__text {
    font-size: 0.98rem;
}

.banner-logo{
    height: 42px;
    width: 42px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid color-mix(in oklab, var(--border) 80%, transparent);
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    gap: 0.25rem;
    font-weight: 700;
    font-size: 0.95rem;
}

.site-nav a {
    color: var(--muted);
    padding: 0.45rem 0.65rem;
    border-radius: 7px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--fg);
    background: color-mix(in oklab, var(--fg) 7%, transparent);
    text-decoration: none;
    outline: 0;
}

.site-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    flex: 0 1 23rem;
}

.site-search {
    display: block;
    flex: 1 1 13rem;
    min-width: 10rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#preamble.status{
    max-width: var(--content);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--body-pad);
    padding-right: var(--body-pad);
    padding-top: 0.25rem;
    box-sizing: content-box;
}

#preamble .banner-header,
#preamble #updated{
    max-width: 100%;
}



footer{
    color: var(--muted);
    padding: 1.25rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: .9rem;
}

#content.content{
    max-width: var(--content);
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: var(--body-pad);
    padding-right: var(--body-pad);
    box-sizing: content-box;
    position: relative;
    padding-top: 1.5rem;
}


#content .figure,
#content img:not(.fullwidth){
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    overflow: hidden;
}

th,
td {
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 0.75rem;
    text-align: left;
}

th {
    color: var(--heading);
    background: color-mix(in oklab, var(--surface-soft) 80%, transparent);
}

blockquote {
    margin: 1.5rem 0;
    padding: 0.9rem 1.1rem;
    border-left: 4px solid var(--heading);
    background: color-mix(in oklab, var(--surface-soft) 72%, transparent);
    border-radius: 0 8px 8px 0;
    color: color-mix(in oklab, var(--fg) 84%, var(--muted) 16%);
}


ul, ol {
    margin: 1rem 0 1.5rem 1.5rem;
    padding: 0;
    line-height: 1.5;
}

ul {
    list-style: none;
}

ul li {
    position: relative;
    padding-left: 1.2em;
}

ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--heading);
    font-weight: bold;
}

ol {
    counter-reset: list-counter;
    list-style: none;
}

ol li {
    counter-increment: list-counter;
    position: relative;
    padding-left: 1.8em;
}

ol li::before {
    content: counter(list-counter) ".";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--heading);
    font-weight: bold;
}

li {
    margin-bottom: 8px;
    display: flow-root;
}

li::after {
    content: none;
}

li ul,
li ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

li ul li::before {
    content: "–";
    font-weight: normal;
    color: var(--note-color);
}

li ol li::before {
    font-weight: normal;
    color: var(--note-color);
}

.epigraph {
    margin: 2rem auto;
    max-width: 80%;
    font-style: italic;
}

.epigraph blockquote {
    margin: 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--heading);
    background-color: rgba(0, 0, 0, 0.02);
    color: var(--fg);
    line-height: 1.6;
}

.epigraph blockquote footer {
    margin-top: 0.75rem;
    font-style: normal;
    font-size: 0.9em;
    color: var(--note-color);
    text-align: right;
}

.epigraph blockquote cite {
    font-style: italic;
    font-weight: 500;
    color: var(--link);
}

.epigraph blockquote::before,
.epigraph blockquote::after {
    content: none;
}


.epigraph blockquote{
    border-left-color: var(--heading);
    background-color: color-mix(in oklab, var(--bg) 94%, var(--fg) 6%);
    color: var(--fg);
}
.epigraph blockquote footer{ color: var(--muted); }


.hidden { display: none !important; }

.bp-x{ right:72px; }

.bp-next,.bp-prev{ right:8px; }
.bp-prev{ left:8px; }

.bp-wrap{ transition: opacity .18s ease; }
.bp-wrap.bp-fadeout{ opacity: 0; }

.bp-controls{
  padding-top: env(safe-area-inset-top, 0);
  padding-right: calc(env(safe-area-inset-right, 0) + 8px);
}



body.no-sidenotes {
    --body-pad: 0;
    --margin: 0;
    --gutter: 0;

    --content-min: 80ch;
    --content-max: 1200px;

    --content: clamp(
        var(--content-min),
        100vi,
        var(--content-max)
    );
}

/* =========================
   NOTES BOARD
   ========================= */

#notes-tools {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 0.65rem;
  margin: 1.25rem 0 0;
}

#notes-tools label {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#notes-author-filter {
  min-width: min(220px, 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.2;
  padding: 0.45rem 0.65rem;
}

#notes-author-filter:focus {
  outline: 2px solid color-mix(in oklab, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

#notes-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0;
  align-items: start;
}

/* =========================
   NOTE CARD
   ========================= */

.note {
  position: relative;
  padding: 1rem 1rem 0.9rem;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.08),
    0 12px 24px rgba(0, 0, 0, 0.06);
  transform: rotate(var(--note-tilt, 0deg));
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
  
}

/* subtle randomness */
.note:nth-child(3n) { --note-tilt: -0.6deg; }
.note:nth-child(4n) { --note-tilt: 0.4deg; }
.note:nth-child(5n) { --note-tilt: -0.3deg; }

.note:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.12),
    0 18px 36px rgba(0, 0, 0, 0.10);
}

/* =========================
   PIN
   ========================= */

.note::before {
  content: "";
  position: absolute;
  top: 0.6rem;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #c33;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.3);
  opacity: 0.85;
}

/* =========================
   META
   ========================= */

.note-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.note-author {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.note-meta time {
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}

/* =========================
   CONTENT
   ========================= */

.note-content {
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  color: var(--fg);
}

/* =========================
   MOBILE TWEAKS
   ========================= */

@media (max-width: 600px) {
  #notes-wall {
    grid-template-columns: 1fr;
  }

  #notes-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .note {
    transform: none;
  }

  .note::before {
    left: 0.75rem;
    transform: none;
  }
}
/* =========================
   NOTES FORM
   ========================= */

#notes-form-wrapper {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
}

#notes-form {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 1.25rem 1.25rem 1.1rem;
  border-radius: 10px;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.08),
    0 14px 30px rgba(0, 0, 0, 0.06);
  position: relative;
}

/* pin */
#notes-form::before {
  content: "";
  position: absolute;
  top: 0.6rem;
  left: 50%;
  width: 12px;
  height: 12px;
  background: #c33;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35);
}

/* =========================
   LABELS
   ========================= */

#notes-form label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

/* =========================
   INPUTS
   ========================= */

#notes-form input,
#notes-form textarea {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--fg);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  padding: 0.3rem 0;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

#notes-form textarea {
  resize: vertical;
  min-height: 4.5rem;
}

/* focus state */
#notes-form input:focus,
#notes-form textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

/* placeholder */
#notes-form ::placeholder {
  color: var(--muted);
}

/* =========================
   SUBMIT BUTTON
   ========================= */

#notes-form button {
  margin-top: 0.5rem;
  padding: 0.35rem 0.9rem;
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  border: none;
  background: var(--fg);
  color: var(--bg);
  cursor: pointer;
  float: right;
}

#notes-form button:hover {
  background: var(--accent);
  color: var(--surface);
}

#notes-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 600px) {
  #notes-form {
    max-width: 100%;
  }
}

/* Mermaid container for zooming and panning */
.mermaid-container {
  overflow: auto;           /* allow scrolling */
  width: 100%;
  max-height: 800px;        /* adjust to your page */
  border: 1px solid #ccc;   /* optional, visual boundary */
  position: relative;
}

/* Make SVG scale properly */
.mermaid-container .mermaid svg {
  transform-origin: top left; /* needed for scaling */
  transition: transform 0.2s ease; /* smooth zoom */
  width: 100%;
  height: auto;
}

/* Zoom buttons */
.mermaid-zoom-controls {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 10;
}

.mermaid-zoom-controls button {
  padding: 5px 10px;
  margin-left: 5px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.mermaid-zoom-controls button:hover {
  background: #0056b3;
}
