/* integratorlog.com secondary pages (/monitor/install/, /tutorials/): one shared stylesheet, so their
   Content-Security-Policy can be style-src 'self' with no inline blocks. The tokens are the landing page's
   (site/index.html), which are the app's own (app/public/shared/tokens.js). */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-700-normal.woff2) format("woff2"); }

:root {
  --brand: #16324F; --on-brand: #FFFFFF; --on-brand-muted: #C9D6E3; --brand-line: #2A4A6B;
  --primary: #1D5FB8; --primary-hover: #174E98; --on-primary: #FFFFFF;
  --page: #F3F5F7; --card: #FFFFFF; --line: #D8DDE3; --soft: #E8ECF0;
  --text: #111A23; --muted: #566473;
  --warn-bg: #FFF4D6; --warn-line: #E2B93B;
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1120px; --text-w: 46rem; --gutter: 16px; --header-h: 64px;
  --radius: 10px; --radius-sm: 6px;
  --focus: 0 0 0 3px color-mix(in srgb, var(--primary) 55%, transparent);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #5B9BF0; --primary-hover: #7FB1F4; --on-primary: #0D131A;
    --page: #0D131A; --card: #151E28; --line: #26333F; --soft: #1D2834;
    --text: #E8EDF2; --muted: #9AA7B4;
    --warn-bg: #2E2710; --warn-line: #8A6D16;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary: #5B9BF0; --primary-hover: #7FB1F4; --on-primary: #0D131A;
  --page: #0D131A; --card: #151E28; --line: #26333F; --soft: #1D2834;
  --text: #E8EDF2; --muted: #9AA7B4;
  --warn-bg: #2E2710; --warn-line: #8A6D16;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--page); color: var(--text); font: 400 1.0625rem/1.6 var(--font); overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.015em; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 0; background: var(--card); color: var(--text); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.muted { color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm); font: 600 1rem/1 var(--font); text-decoration: none; border: 2px solid transparent; white-space: nowrap; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }

/* Header: fixed height, never resizes on scroll. No script: the links wrap into a second row on phones. */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--brand); color: var(--on-brand); border-bottom: 1px solid var(--brand-line); }
.site-header .wrap { min-height: var(--header-h); display: flex; align-items: center; gap: 8px 24px; }
.logo { display: inline-flex; align-items: center; min-height: 44px; gap: 10px; color: var(--on-brand); text-decoration: none; font-weight: 700; font-size: 1.1875rem; letter-spacing: -.01em; }
.logo:hover { color: var(--on-brand); }
.logo svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: 4px; margin-right: auto; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--on-brand-muted); text-decoration: none; font-size: .9375rem; padding: 0 10px; border-radius: var(--radius-sm); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--on-brand); background: rgba(255, 255, 255, .08); }
.site-header .btn-primary { background: #1D5FB8; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.site-header .btn-primary:hover { background: #2569C7; }
.site-header :focus-visible { box-shadow: 0 0 0 3px #5B9BF0; }
@media (max-width: 760px) {
  html { scroll-padding-top: 16px; }
  .site-header { position: static; }
  .site-header .wrap { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .site-header .btn-primary { margin-left: auto; padding: 0 14px; font-size: .9375rem; }
  .nav { order: 3; flex: 1 1 100%; margin: 0 -8px; flex-wrap: wrap; gap: 0; }
  .nav a { padding: 0 8px; font-size: .875rem; }
}

/* Page */
.page-head { padding: 56px 0 32px; }
.eyebrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; font-size: .9375rem; color: var(--muted); }
.tag { display: inline-block; font-size: .8125rem; font-weight: 600; line-height: 1.4; padding: 2px 8px; border-radius: 4px; background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; max-width: 22em; }
.page-head .lede { margin-top: 16px; font-size: 1.1875rem; color: var(--muted); max-width: 38em; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 56px; align-items: start; padding-bottom: 88px; }
.toc { position: sticky; top: calc(var(--header-h) + 24px); font-size: .9375rem; border-left: 2px solid var(--line); padding-left: 16px; }
.toc h2 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 5px 0; color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--primary); text-decoration: underline; }
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; order: -1; margin-bottom: 40px; border-left: 0; padding: 16px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
  .toc ol { columns: 2 12rem; column-gap: 24px; }
}

/* Prose */
.prose { max-width: var(--text-w); }
.prose > section { padding-top: 40px; margin-top: 40px; border-top: 1px solid var(--line); }
.prose > section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 1.875rem); margin-bottom: 16px; }
.prose h3 { font-size: 1.1875rem; margin: 28px 0 10px; }
.prose p, .prose ul, .prose ol, .prose pre, .prose .table-wrap, .prose .callout { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-top: 6px; }
.prose li::marker { color: var(--muted); }
.prose code { font: .9em/1.4 var(--mono); background: var(--soft); padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }
.prose pre { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; overflow-x: auto; font: .875rem/1.55 var(--mono); }
.prose pre code { background: none; padding: 0; overflow-wrap: normal; }
.callout { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: var(--radius-sm); padding: 14px 18px; }
.callout.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); }
.prose table { border-collapse: collapse; width: 100%; font-size: 1rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px; border-top: 1px solid var(--line); }
.prose thead th { border-top: 0; font-weight: 600; background: var(--soft); }
.contact { margin-top: 48px; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.contact h2 { font-size: 1.25rem; margin-bottom: 6px; }

/* Tutorials */
.course-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 20px; color: var(--muted); font-size: .9375rem; }
.course-meta { align-items: center; }
.course-meta strong { color: var(--text); font-weight: 600; }
.course-meta a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.groups { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; padding: 0; list-style: none; }
.groups a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--text); text-decoration: none; font-size: .9375rem; }
.groups a:hover { border-color: var(--primary); color: var(--primary); }
.course { list-style: none; margin: 0; padding: 0 0 88px; }
.course > li + li { margin-top: 12px; }
.course .group-head { margin: 36px 0 4px; font-size: 1.25rem; }
.course > li.group-start:first-child .group-head { margin-top: 0; }
.lesson { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; gap: 4px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.lesson .num { font-weight: 700; color: var(--muted); font-size: .9375rem; padding-top: 2px; white-space: nowrap; }
.lesson h3 { font-size: 1.125rem; }
.lesson .desc { margin-top: 6px; color: var(--muted); font-size: 1rem; }
.lesson .who { margin-top: 8px; font-size: .875rem; color: var(--muted); }
.lesson .who b { color: var(--text); font-weight: 600; }
.lesson .watch { align-self: start; text-align: right; }
.lesson .watch a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; white-space: nowrap; }
.lesson .watch svg { width: 18px; height: 18px; flex: none; fill: currentColor; }
.lesson .watch a { text-decoration: none; }
.lesson .watch a .t { text-decoration: underline; }
.lesson .watch .len { display: block; font-size: .8125rem; color: var(--muted); font-weight: 400; }
.lesson .soon { display: inline-block; font-size: .875rem; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 8px 12px; white-space: nowrap; }
.lesson details { grid-column: 2 / -1; margin-top: 10px; }
.lesson summary { cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; color: var(--primary); font-weight: 600; font-size: .9375rem; }
.lesson .transcript { margin-top: 4px; padding: 14px 16px; background: var(--page); border-radius: var(--radius-sm); font-size: .9375rem; max-height: 22rem; overflow-y: auto; }
.lesson .transcript p + p { margin-top: 10px; }
@media (max-width: 640px) {
  .lesson { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .lesson .watch { text-align: left; }
  .lesson details { grid-column: 1; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: .9375rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 24px; }
.site-footer a { color: var(--text); display: inline-flex; align-items: center; min-height: 44px; }
