/* =================================================================
   Lease Automation — Site stylesheet
   Light, professional palette: teal primary + amber accent on warm
   paper background. Wide on desktop, comfortable on mobile.
   ================================================================= */

:root {
  --c-bg: #fbfaf7;
  --c-bg-soft: #f4f1ea;
  --c-surface: #ffffff;
  --c-text: #1c2a33;
  --c-text-soft: #4a5a64;
  --c-muted: #7a8a93;
  --c-rule: #e5e0d4;

  --c-primary: #1f6f8b;
  --c-primary-strong: #155670;
  --c-primary-soft: #e6f1f5;
  --c-accent: #e58a3e;
  --c-accent-soft: #fbe9d6;
  --c-link: #1c5d76;
  --c-link-hover: #e58a3e;
  --c-success: #2f7d4d;
  --c-warn: #b9701a;

  --c-code-bg: #f1ede2;        /* warm light, matches paper */
  --c-code-inline-bg: #ece5d3;
  --c-code-text: #2b3941;

  --header-h: 64px;
  --container-narrow: 78ch;
  --container-wide: 1440px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(20, 40, 60, 0.06);
  --shadow-md: 0 6px 24px rgba(20, 40, 60, 0.08);
  --shadow-lg: 0 14px 40px rgba(20, 40, 60, 0.10);

  --transition: 180ms ease;

  --font-sans: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-display: "Inter", var(--font-sans);
}

@media (min-width: 1100px) {
  :root { --header-h: 72px; }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px); /* anchor offset under sticky header */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg { max-width: 100%; height: auto; display: block; }

/* Inline SVG icons default to text-relative size; specific places (nav, CTAs)
   override via more-specific selectors below. */
.icon {
  width: 1.1em;
  height: 1.1em;
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

a {
  color: var(--c-link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

a:hover, a:focus-visible {
  color: var(--c-link-hover);
  border-bottom-color: currentColor;
}

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

::selection {
  background: var(--c-accent-soft);
  color: var(--c-primary-strong);
}

/* ----------------- Layout container ----------------- */
.container {
  width: 100%;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
  max-width: var(--container-wide);
}

.container--narrow { max-width: 920px; }

main { flex: 1 0 auto; }

/* Apply anchor offset to every heading (set by md transform) */
.anchor-target {
  scroll-margin-top: calc(var(--header-h) + 14px);
}

/* ----------------- Header ----------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--c-rule);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--c-primary-strong);
  border-bottom: none;
  letter-spacing: -0.01em;
  font-size: 1.02rem;
}

.brand:hover, .brand:focus-visible { color: var(--c-primary); }

.brand__logo { width: 36px; height: 36px; flex-shrink: 0; }

.brand__name { white-space: nowrap; }
.brand__name-full { display: none; }
@media (min-width: 720px) {
  .brand__name-short { display: none; }
  .brand__name-full { display: inline; }
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--c-text-soft);
  border-bottom: none;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  transition:
    background var(--transition),
    color var(--transition),
    transform var(--transition);
}

.nav__link:hover, .nav__link:focus-visible {
  background: var(--c-primary-soft);
  color: var(--c-primary-strong);
  transform: translateY(-1px);
}

.nav__link[aria-current="page"] {
  background: var(--c-primary-soft);
  color: var(--c-primary-strong);
  box-shadow: inset 0 -2px 0 var(--c-accent);
}

.nav__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav__label { display: none; }
@media (min-width: 640px) {
  .nav__label { display: inline; }
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--c-rule);
  color: var(--c-primary-strong);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-left: auto;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

@media (max-width: 560px) {
  .nav { display: none; }
  .nav.is-open {
    display: flex;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 12px;
    gap: 4px;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-rule);
    box-shadow: var(--shadow-md);
  }
  .nav.is-open .nav__link { width: 100%; }
  .nav.is-open .nav__label { display: inline; }
  .nav-toggle { display: inline-flex; align-items: center; }
}

/* ----------------- Hero (homepage) ----------------- */
.hero {
  padding: clamp(40px, 7vw, 88px) 0 clamp(36px, 5vw, 64px);
  background:
    radial-gradient(1200px 480px at 80% -10%, rgba(229,138,62,0.10), transparent 60%),
    radial-gradient(900px 600px at 0% 0%, rgba(31,111,139,0.08), transparent 60%),
    var(--c-bg);
  border-bottom: 1px solid var(--c-rule);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

.hero__logo {
  width: clamp(180px, 30vw, 320px);
  filter: drop-shadow(0 18px 30px rgba(20, 60, 80, 0.18));
  transition: transform 400ms cubic-bezier(.2,.7,.2,1);
}
.hero__logo:hover { transform: translateY(-4px) rotate(-1deg); }

.hero__media {
  display: flex;
  justify-content: center;
  order: -1;
}
@media (min-width: 900px) {
  .hero__media { order: 0; justify-content: flex-end; }
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-primary);
  background: var(--c-primary-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5.2vw, 3.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--c-text);
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}
.hero__title .accent {
  background: linear-gradient(120deg, var(--c-primary) 0%, var(--c-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lede {
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  color: var(--c-text-soft);
  margin: 0 0 14px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  color: var(--c-text);
  font-weight: 600;
  font-size: 0.98rem;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--c-rule);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition),
    background var(--transition);
}

.cta:hover, .cta:focus-visible {
  transform: translateY(-2px);
  border-color: var(--c-primary);
  box-shadow: var(--shadow-md);
  color: var(--c-primary-strong);
}

.cta--primary {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-strong) 100%);
  color: #fff;
  border-color: transparent;
}
.cta--primary:hover, .cta--primary:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, #2a8aa8 0%, var(--c-primary) 100%);
  border-color: transparent;
}

.cta__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--c-primary-soft);
  color: var(--c-primary);
}
.cta--primary .cta__icon {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

.cta__icon svg { width: 18px; height: 18px; }

/* Per-section accent colors */
.cta[data-accent="amber"] .cta__icon { background: var(--c-accent-soft); color: var(--c-accent); }
.cta[data-accent="violet"] .cta__icon { background: #ece6fb; color: #6c52d4; }
.cta[data-accent="green"]  .cta__icon { background: #dcefe1; color: #2f7d4d; }
.cta[data-accent="rose"]   .cta__icon { background: #fbe1e6; color: #c14b6a; }

/* ----------------- Section blocks (homepage) ----------------- */
.section {
  padding: clamp(48px, 6vw, 88px) 0;
}

.section--soft { background: var(--c-bg-soft); border-block: 1px solid var(--c-rule); }

.section__head { max-width: 760px; margin-bottom: 36px; }

.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  letter-spacing: -0.015em;
  color: var(--c-primary-strong);
  margin: 0 0 12px;
}

.section__lede {
  color: var(--c-text-soft);
  font-size: 1.05rem;
  margin: 0;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--c-rule);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}

.card:hover, .card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--c-primary);
  box-shadow: var(--shadow-md);
  color: inherit;
}

.card__title {
  font-weight: 700;
  color: var(--c-primary-strong);
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
}

.card__lede {
  color: var(--c-text-soft);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.55;
}

.card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--c-primary-soft);
  color: var(--c-primary);
  display: grid;
  place-items: center;
}
.card__icon svg { width: 22px; height: 22px; }

.card__more {
  margin-top: auto;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--c-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card:hover .card__more, .card:focus-visible .card__more {
  color: var(--c-accent);
}

/* ----------------- Footer ----------------- */
.site-footer {
  margin-top: auto;
  background: #14333f;
  color: #d6e4e9;
  padding: clamp(40px, 6vw, 64px) 0 24px;
}

.site-footer a {
  color: #b9d7df;
  border-bottom-color: transparent;
}
.site-footer a:hover, .site-footer a:focus-visible {
  color: #fbd0a3;
  border-bottom-color: currentColor;
}

.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 1.4fr repeat(2, 1fr); }
}

.footer-brand { display: flex; gap: 14px; align-items: flex-start; }
.footer-brand__logo { width: 48px; height: 48px; flex-shrink: 0; }
.footer-brand p {
  margin: 6px 0 0;
  color: #a9c4cd;
  font-size: 0.94rem;
  line-height: 1.55;
  max-width: 42ch;
}
.footer-brand strong { color: #f3f7f9; font-size: 1.05rem; }

.footer-col h4 {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: #a9c4cd;
  margin: 0 0 12px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 36px;
  padding-top: 18px;
  font-size: 0.85rem;
  color: #8aa5ad;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

/* ----------------- Content page layout ----------------- */
.content-wrap {
  padding: clamp(24px, 4vw, 48px) 0 64px;
}

.content-layout {
  display: grid;
  gap: 36px;
  grid-template-columns: 1fr;
}
@media (min-width: 1100px) {
  .content-layout {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 56px;
  }
  /* If the side-nav is absent for any reason, let the article span fully */
  .content-layout > .article:only-child { grid-column: 1 / -1; }
}

.side-nav { position: sticky; top: calc(var(--header-h) + 16px); align-self: start; }
.side-nav h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-muted);
  margin: 0 0 12px;
}
.side-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-bottom: none;
  color: var(--c-text-soft);
  font-size: 0.92rem;
  line-height: 1.35;
  transition: background var(--transition), color var(--transition);
}
.side-nav a:hover { background: var(--c-primary-soft); color: var(--c-primary-strong); }
.side-nav a[aria-current="page"] {
  background: var(--c-primary-soft);
  color: var(--c-primary-strong);
  font-weight: 600;
}

/* On narrow viewports, render the side nav inline above content */
@media (max-width: 1099px) {
  .side-nav { position: static; }
}

/* Breadcrumbs — plain inline flow so every entry sits on the same text
   baseline regardless of whether the ::before separator is present.
   Selectors are doubled with .article so they always win over .article a. */
.breadcrumbs,
.article .breadcrumbs {
  display: block;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--c-muted);
  margin: 0 0 18px;
  list-style: none;
  padding: 0;
}
.breadcrumbs li,
.article .breadcrumbs li {
  display: inline;
}
.breadcrumbs li + li::before,
.article .breadcrumbs li + li::before {
  content: "›";
  color: var(--c-muted);
  font-weight: 600;
  margin: 0 6px;
}
.breadcrumbs a,
.article .breadcrumbs a {
  color: var(--c-text-soft);
  border-bottom: 1px solid transparent;
  font-weight: 500;
  font-size: inherit;
  line-height: inherit;
  vertical-align: baseline;
}
.breadcrumbs a:hover,
.article .breadcrumbs a:hover {
  color: var(--c-primary);
  border-bottom-color: currentColor;
}
.breadcrumbs li[aria-current="page"],
.article .breadcrumbs li[aria-current="page"] {
  color: var(--c-primary-strong);
  font-weight: 600;
}

/* On-page table of contents */
.toc {
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}
.toc h4 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-muted);
}
.toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.toc a {
  display: block;
  padding: 4px 6px;
  border-radius: 6px;
  border-bottom-color: transparent;
  color: var(--c-text-soft);
  line-height: 1.35;
}
.toc a:hover { background: var(--c-primary-soft); color: var(--c-primary-strong); }
.toc-list--h3 { padding-left: 12px !important; font-size: 0.86rem; }

/* Article (rendered markdown) */
.article {
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 56px);
  box-shadow: var(--shadow-sm);
  /* Full width of container; never collapsing into a narrow column */
  max-width: 100%;
}

.article h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  letter-spacing: -0.018em;
  line-height: 1.15;
  margin: 0 0 18px;
  background: linear-gradient(120deg, var(--c-primary-strong) 0%, var(--c-primary) 55%, var(--c-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.article h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  letter-spacing: -0.012em;
  color: var(--c-primary-strong);
  margin: 40px 0 14px;
  position: relative;
  padding-left: 14px;
}
.article h2::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--c-primary) 0%, var(--c-accent) 100%);
}

.article h3 {
  font-size: 1.2rem;
  color: var(--c-primary);
  margin: 28px 0 8px;
  font-weight: 700;
}

.article h4 { font-size: 1.05rem; color: var(--c-text); margin: 22px 0 6px; }

.article p {
  margin: 0 0 16px;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--c-text);
}

.article ul, .article ol {
  margin: 0 0 18px;
  padding-left: 1.4rem;
  line-height: 1.7;
}
.article li + li { margin-top: 6px; }

.article a {
  color: var(--c-link);
  border-bottom: 1px solid rgba(28,93,118,0.25);
  font-weight: 500;
}
.article a:hover {
  color: var(--c-link-hover);
  border-bottom-color: currentColor;
}

.article hr {
  border: 0;
  border-top: 1px solid var(--c-rule);
  margin: 32px 0;
}

.article blockquote {
  margin: 18px 0;
  padding: 14px 20px;
  border-left: 4px solid var(--c-accent);
  background: var(--c-accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #5a3b14;
}
.article blockquote p:last-child { margin-bottom: 0; }

/* Inline code: blends into prose, no border, warm light bg */
.article :not(pre) > code {
  background: var(--c-code-inline-bg);
  color: var(--c-code-text);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.92em;
  font-family: var(--font-mono);
  font-weight: 500;
  border: 0;
}

/* Headings: anchor link */
.article :is(h1,h2,h3,h4,h5,h6) > a.header-anchor {
  color: inherit;
  border-bottom: none;
}
.article :is(h2,h3,h4) > a.header-anchor::after {
  content: " ¶";
  color: var(--c-muted);
  opacity: 0;
  font-weight: 400;
  margin-left: 4px;
  transition: opacity var(--transition);
}
.article :is(h2,h3,h4):hover > a.header-anchor::after { opacity: 1; }

/* Tables: responsive horizontal scroll */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 18px 0;
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
}
.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.table-scroll th, .table-scroll td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--c-rule);
  vertical-align: top;
}
.table-scroll thead th {
  background: var(--c-primary-soft);
  color: var(--c-primary-strong);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--c-primary);
}
.table-scroll tbody tr:hover { background: var(--c-bg-soft); }

/* Task list (checkboxes) — bullet hidden, line-through when checked */
.article li.task-item {
  list-style: none;
  margin-left: -1.4rem;
  padding-left: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.article ul:has(li.task-item), .article ol:has(li.task-item) {
  padding-left: 0;
}
.article li.task-item .task-checkbox {
  margin-top: 0.4em;
  width: 16px;
  height: 16px;
  accent-color: var(--c-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.article li.task-item:has(.task-checkbox:checked) {
  color: var(--c-muted);
  text-decoration: line-through;
}

/* ----------------- Code blocks ----------------- */
.codeblock {
  position: relative;
  margin: 20px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--c-code-bg);
  border: 1px solid var(--c-rule);
  box-shadow: var(--shadow-sm);
}
.codeblock pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--c-code-text);
  background: transparent;
  -webkit-overflow-scrolling: touch;
}
.codeblock pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
  font-family: inherit;
}
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--c-surface);
  color: var(--c-primary-strong);
  border: 1px solid var(--c-rule);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition), color var(--transition), background var(--transition), border-color var(--transition);
  z-index: 2;
  font-family: var(--font-sans);
}
.codeblock:hover .copy-btn { opacity: 1; }
.copy-btn:hover, .copy-btn:focus-visible {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
  opacity: 1;
}
.copy-btn.is-copied {
  background: var(--c-success);
  border-color: var(--c-success);
  color: #fff;
  opacity: 1;
}

/* Prism syntax-highlight overrides (light theme, warm) */
.codeblock .token.comment,
.codeblock .token.prolog,
.codeblock .token.doctype,
.codeblock .token.cdata { color: #8a9296; font-style: italic; }
.codeblock .token.punctuation { color: #5a6a73; }
.codeblock .token.namespace { opacity: 0.7; }
.codeblock .token.property,
.codeblock .token.tag,
.codeblock .token.boolean,
.codeblock .token.number,
.codeblock .token.constant,
.codeblock .token.symbol,
.codeblock .token.deleted { color: #b86131; }
.codeblock .token.selector,
.codeblock .token.attr-name,
.codeblock .token.string,
.codeblock .token.char,
.codeblock .token.builtin,
.codeblock .token.inserted { color: #2f7d4d; }
.codeblock .token.operator,
.codeblock .token.entity,
.codeblock .token.url,
.language-css .codeblock .token.string,
.codeblock .style .token.string { color: #1c5d76; }
.codeblock .token.atrule,
.codeblock .token.attr-value,
.codeblock .token.keyword { color: #6c52d4; font-weight: 600; }
.codeblock .token.function,
.codeblock .token.class-name { color: #1f6f8b; font-weight: 600; }
.codeblock .token.regex,
.codeblock .token.important,
.codeblock .token.variable { color: #c14b6a; }

/* ----------------- Mermaid ----------------- */
.mermaid {
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin: 20px 0;
  text-align: center;
  overflow-x: auto;
}

/* ----------------- FAQ accordion ----------------- */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}
.faq-item {
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.faq-item[open] {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-sm);
}
.faq-item > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  color: var(--c-primary-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+";
  color: var(--c-primary);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1;
  transition: transform var(--transition);
}
.faq-item[open] > summary::after { content: "−"; }
.faq-item .faq-body {
  padding: 0 18px 16px;
  color: var(--c-text-soft);
}
.faq-item .faq-body > :first-child { margin-top: 0; }
.faq-item .faq-body > :last-child { margin-bottom: 0; }

/* ----------------- Related-content footer (per page) ----------------- */
.related {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--c-rule);
}
.related h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-muted);
  margin: 0 0 14px;
}
.related-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.related-grid a {
  display: block;
  padding: 14px 16px;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-sm);
  color: var(--c-primary-strong);
  font-weight: 600;
  border-bottom: 1px solid var(--c-rule);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.related-grid a:hover {
  background: var(--c-primary-soft);
  border-color: var(--c-primary);
  transform: translateY(-2px);
}

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

/* ----------------- Print ----------------- */
@media print {
  .site-header, .site-footer, .side-nav, .copy-btn, .nav-toggle { display: none !important; }
  .article { border: 0; box-shadow: none; padding: 0; }
  a { color: #000; border-bottom: none; }
}
