/* The PM Advantage Blog | ProjectMentorPro
   Every text/background pair below is mirrored in CONTRAST_PAIRS in tools/build.py.
   Change a color here and update that list so the build keeps checking it. */

/* ------------------------------------------------------------------ tokens */

:root,
[data-theme="light"] {
  color-scheme: light;

  /* brand constants (same in both themes) */
  --night: #05163C;          /* Deep Night: header, footer, prompt bar */
  --night-hover: #0A2459;
  --royal: #003F91;          /* Royal Navy: hero band */
  --royal-hover: #0B2F6E;
  --lime: #39B54A;           /* Signature Lime Green: accents, badges */
  --lime-soft: #8FE39A;      /* lime text on navy */
  --on-dark: #FFFFFF;
  --on-dark-soft: #D6E2F5;
  --nav-ink: #DCE6F7;
  --btn: #1F7A31;            /* primary buttons */
  --btn-hover: #19672A;

  /* light reading canvas */
  --bg: #F4F7FB;
  --surface: #FFFFFF;
  --ink: #14213D;
  --muted: #4A5670;
  --link: #003F91;
  --border: #DCE3EE;
  --border-strong: #B9C5D8;
  --rule-bg: #EAF1FC;
  --rule-edge: #003F91;
  --mentor-bg: #EEF8F0;
  --mentor-edge: #39B54A;
  --badge-bg: #1F7A31;
  --badge-ink: #FFFFFF;
  --tag-ink: #1F7A31;
  --tag-bg: #EEF8F0;
  --eyebrow: #1F7A31;
  --code-bg: #F6F8FC;
  --code-ink: #14213D;
  --chip-bg: #EEF3FA;
  --chip-ink: #14213D;
  --chip-muted: #4A5670;
  --before-edge: #B9C5D8;
  --after-edge: #39B54A;
  --after-badge-bg: #1F7A31;
  --after-badge-ink: #FFFFFF;
  --focus: #003F91;
  --shadow: 0 1px 2px rgba(5, 22, 60, 0.06), 0 8px 24px rgba(5, 22, 60, 0.06);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 68px;
  --gutter: clamp(16px, 4vw, 32px);
  --measure: 720px;
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0B1222;
  --surface: #121C30;
  --ink: #E6ECF6;
  --muted: #A9B6CC;
  --link: #8DB7FF;
  --border: #22304A;
  --border-strong: #33456A;
  --rule-bg: #16284D;
  --rule-edge: #8DB7FF;
  --mentor-bg: #12301F;
  --mentor-edge: #6FD27D;
  --badge-bg: #6FD27D;
  --badge-ink: #05163C;
  --tag-ink: #6FD27D;
  --tag-bg: transparent;
  --eyebrow: #6FD27D;
  --code-bg: #0E1729;
  --code-ink: #E6ECF6;
  --chip-bg: #1A2640;
  --chip-ink: #E6ECF6;
  --chip-muted: #E6ECF6;
  --before-edge: #33456A;
  --after-edge: #6FD27D;
  --after-badge-bg: #6FD27D;
  --after-badge-ink: #05163C;
  --focus: #8DB7FF;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* -------------------------------------------------------------------- base */

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

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

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

a, button, summary { touch-action: manipulation; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration-thickness: 2px; }
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}

code, pre, kbd { font-family: var(--font-mono); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.site-header :focus-visible,
.site-footer :focus-visible,
.home-hero :focus-visible,
.post-hero :focus-visible,
.cta-card :focus-visible,
.prompt-card__bar :focus-visible { outline-color: var(--lime-soft); }

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

.skip-link {
  position: absolute;
  left: 12px; top: -100px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--night);
  color: var(--on-dark);
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }

/* --------------------------------------------------------- reading progress */

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  z-index: 120;
  background: transparent;
  pointer-events: none;
}
.progress__bar {
  height: 100%;
  width: 0;
  background: var(--lime);
  border-radius: 0 2px 2px 0;
}

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--night);
  color: var(--nav-ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 10px;
  min-width: 0;
  color: var(--on-dark);
  text-decoration: none;
  margin-right: auto;
}
.brand__logo { width: 40px; height: 40px; border-radius: 10px; }
.brand__word {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand__badge {
  flex-shrink: 0;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--night);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--nav-ink);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a[aria-current="page"] { background: var(--night-hover); color: var(--on-dark); }
@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover { background: var(--night-hover); color: var(--on-dark); }
}
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--lime); }

.header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid rgba(220, 230, 247, 0.22);
  border-radius: 10px;
  background: transparent;
  color: var(--nav-ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { background: var(--night-hover); color: var(--on-dark); }
}

/* theme toggle: moon offers dark mode, sun offers light mode */
#theme-toggle { min-width: 44px; min-height: 44px; }
#theme-toggle .icon-sun { display: none; }
#theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] #theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] #theme-toggle .icon-moon { display: none; }

#menu-toggle { display: none; min-width: 44px; min-height: 44px; }
#menu-toggle path { transition: transform 0.2s ease, opacity 0.2s ease; transform-origin: 12px 12px; }
#menu-toggle[aria-expanded="true"] .bar1 { transform: translateY(5px) rotate(45deg); }
#menu-toggle[aria-expanded="true"] .bar2 { opacity: 0; }
#menu-toggle[aria-expanded="true"] .bar3 { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 860px) {
  /* Without JS the nav simply wraps under the brand; with JS it becomes a menu. */
  .site-header__inner { flex-wrap: wrap; }
  .site-nav { order: 3; flex-basis: 100%; }
  .site-nav ul { flex-wrap: wrap; padding-bottom: 8px; }

  html.js #menu-toggle { display: inline-flex; }
  html.js .site-header__inner { flex-wrap: nowrap; }
  html.js .site-nav {
    display: none;
    position: absolute;
    inset: 100% 0 auto 0;
    background: var(--night);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 32px rgba(5, 22, 60, 0.35);
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  html.js .site-nav.is-open { display: block; }
  html.js .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px var(--gutter) 16px;
  }
  html.js .site-nav a { display: flex; min-height: 48px; font-size: 1rem; }
}

@media (max-width: 400px) {
  .brand__badge { display: none; }
  .brand__logo { width: 36px; height: 36px; }
  .brand__word { font-size: 1rem; }
  .site-header__inner { gap: 8px; }
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  border: 2px solid transparent;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn--primary { background: var(--btn); color: var(--on-dark); }
.btn--ghost { background: transparent; color: var(--on-dark); border-color: rgba(255, 255, 255, 0.55); }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--btn-hover); }
  .btn--ghost:hover { background: var(--royal-hover); border-color: var(--on-dark); }
}
.btn--block { display: flex; width: 100%; }

.text-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--link); }

.eyebrow {
  margin: 0 0 8px;
  color: var(--eyebrow);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow--on-dark { color: var(--lime-soft); }

.tag {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--tag-ink);
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.6;
}

/* -------------------------------------------------------------------- heroes */

.home-hero,
.post-hero {
  background:
    radial-gradient(900px 420px at 88% -20%, rgba(57, 181, 74, 0.14), transparent 60%),
    radial-gradient(700px 360px at -5% 120%, rgba(141, 183, 255, 0.12), transparent 60%),
    var(--royal);
  color: var(--on-dark);
}

.home-hero__inner,
.post-hero__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) var(--gutter);
}
.home-hero__title,
.post-hero__title {
  max-width: 20ch;
  font-size: clamp(2rem, 1.3rem + 3.4vw, 3.5rem);
  color: var(--on-dark);
}
.home-hero__lead,
.post-hero__dek {
  max-width: 62ch;
  margin: 18px 0 0;
  color: var(--on-dark-soft);
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
}
.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.home-hero--compact .home-hero__inner { padding-block: clamp(40px, 6vw, 72px); }

.post-hero__title { max-width: 24ch; }
.post-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 22px 0 0;
  color: var(--on-dark-soft);
  font-size: 0.9375rem;
}
.post-hero__meta a { display: inline-flex; align-items: center; min-height: 44px; color: var(--on-dark); font-weight: 600; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--lime); }

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 12px;
  padding: 0;
  font-size: 0.875rem;
  color: var(--on-dark-soft);
}
.breadcrumb li { display: inline-flex; align-items: center; min-height: 44px; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--lime-soft); }
.breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; color: var(--on-dark); }

/* -------------------------------------------------------------------- home */

.home-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 64px) var(--gutter);
  display: grid;
  gap: 32px;
}
@media (min-width: 1024px) {
  .home-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .home-aside { position: sticky; top: calc(var(--header-h) + 24px); }
}

.section-title { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin-bottom: 20px; }

.post-grid { display: grid; gap: 20px; }
@media (min-width: 768px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-card--featured { grid-column: 1 / -1; }
}

.post-card,
.side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 28px);
}
.post-card { position: relative; border-top: 4px solid var(--lime); }
@media (hover: hover) and (pointer: fine) {
  .post-card:hover { border-color: var(--border-strong); border-top-color: var(--lime); }
}
.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.875rem;
}
.post-card__title { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); }
.post-card--featured .post-card__title { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); }
.post-card__title a { color: var(--ink); text-decoration: none; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
@media (hover: hover) and (pointer: fine) {
  .post-card__title a:hover { color: var(--link); text-decoration: underline; }
}
.post-card__excerpt { margin: 12px 0 0; color: var(--muted); }
.post-card__byline { margin: 14px 0 0; color: var(--muted); font-size: 0.875rem; font-weight: 600; }

.home-aside { display: grid; gap: 20px; }
.side-card__title { font-size: 1.25rem; margin-bottom: 8px; }
.side-card p { color: var(--muted); margin: 0 0 16px; }
.side-card .btn { margin-bottom: 12px; }
.side-card--quote { border-left: 4px solid var(--lime); }
.side-card--quote blockquote { margin: 0; }
.side-card--quote blockquote p {
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
}
.side-card__cite { font-size: 0.875rem; }

.narrow { max-width: var(--measure); margin: 0 auto; padding: clamp(32px, 5vw, 56px) var(--gutter); }
.link-list { margin: 0; padding-left: 1.2em; }
.link-list li { margin: 4px 0; }
.link-list li::marker { color: var(--lime); }
.link-list a { display: inline-flex; align-items: center; min-height: 44px; }

/* -------------------------------------------------------------------- post */

.post-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) var(--gutter) clamp(40px, 6vw, 80px);
  display: grid;
  gap: 40px;
}
.post-main { min-width: 0; }

.prose {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 5vw, 56px);
}
.prose > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin-top: 0; margin-bottom: 1.15em; }
.prose h2 {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  margin-top: 2.2em;
  margin-bottom: 0.7em;
  padding-top: 0.2em;
}
.prose h3 { font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.375rem); margin: 1.8em auto 0.6em; }
.prose ul, .prose ol { padding-left: 1.4em; margin-top: 0; margin-bottom: 1.15em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--btn); font-weight: 700; }
html[data-theme="dark"] .prose li::marker { color: var(--tag-ink); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em auto; }
.prose strong { font-weight: 700; }
.prose :not(pre) > code {
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--chip-bg);
  color: var(--chip-ink);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

pre {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
pre.code {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* callouts */
.callout {
  display: flex;
  gap: 14px;
  margin-top: 1.6em;
  margin-bottom: 1.6em;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  color: var(--ink);
}
.callout > div { min-width: 0; }
.callout p:last-child { margin-bottom: 0; }
.callout--rule { background: var(--rule-bg); border-left-color: var(--rule-edge); }
.callout__icon { color: var(--rule-edge); margin-top: 3px; }
.callout--mentor {
  flex-direction: column;
  gap: 10px;
  background: var(--mentor-bg);
  border-left-color: var(--mentor-edge);
}
.callout__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 4px 12px 4px 8px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-ink);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.callout__badge svg { width: 18px; height: 18px; }

/* before / after */
.ba {
  position: relative;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-left: 4px solid;
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.prose .ba { margin-bottom: 1em; }
.ba > strong:first-child {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  vertical-align: 0.12em;
}
.ba--before { border-left-color: var(--before-edge); border-left-style: dashed; }
.ba--before > strong:first-child { background: var(--chip-bg); color: var(--chip-muted); }
.ba--after { border-left-color: var(--after-edge); }
.ba--after > strong:first-child { background: var(--after-badge-bg); color: var(--after-badge-ink); }

/* prompt card */
.prompt-card {
  margin-top: 1.6em;
  margin-bottom: 1.8em;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--code-bg);
  box-shadow: var(--shadow);
}
.prompt-card__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 8px 8px 8px 16px;
  background: var(--night);
  color: var(--on-dark);
}
.prompt-card__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.prompt-card__label::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--lime);
}
.prompt-card__actions { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.prompt-card__status { color: var(--lime-soft); font-size: 0.8125rem; font-weight: 600; }
.prompt-card__status:empty { display: none; }
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--lime);
  color: var(--night);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .copy-btn:hover { background: var(--lime-soft); }
}
.copy-btn.is-copied { background: var(--lime-soft); }
.prompt-card__body {
  margin: 0;
  padding: 18px 20px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.65;
  tab-size: 2;
  white-space: pre;
}
.prompt-card__body code { font-family: inherit; }

/* table of contents */
.toc { display: none; }
.toc-mobile {
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.toc-mobile summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after {
  content: "";
  width: 8px; height: 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.toc-mobile[open] summary::after { transform: rotate(-135deg); }
.toc-mobile ol,
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc-mobile ol { padding: 0 8px 12px; }
.toc-mobile a,
.toc a {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.45;
  text-decoration: none;
}
.toc-mobile a { min-height: 44px; align-items: center; }
.toc-mobile li,
.toc li { counter-increment: toc; }
.toc-mobile a::before,
.toc a::before { content: counter(toc, decimal-leading-zero); color: var(--muted); font-family: var(--font-mono); font-size: 0.8125rem; padding-top: 0.12em; }
@media (hover: hover) and (pointer: fine) {
  .toc-mobile a:hover,
  .toc a:hover { color: var(--link); text-decoration: underline; }
}
.toc a.is-active,
.toc-mobile a.is-active {
  border-left-color: var(--lime);
  background: var(--chip-bg);
  color: var(--chip-ink);
  font-weight: 600;
}

@media (min-width: 1080px) {
  .post-layout { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
  .toc { display: block; position: sticky; top: calc(var(--header-h) + 24px); }
  .toc-mobile { display: none; }
  .toc__inner {
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
    padding: 20px 12px 20px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  .toc__title {
    margin: 0 0 10px 12px;
    color: var(--ink);
    font-family: var(--font-head);
    font-size: 0.875rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}

/* offer card */
.cta-card {
  margin-top: 40px;
  padding: clamp(24px, 5vw, 48px);
  border-radius: var(--radius);
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(57, 181, 74, 0.16), transparent 60%),
    var(--night);
  color: var(--on-dark-soft);
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .cta-card { border: 1px solid var(--border-strong); }
.cta-card__title { color: var(--on-dark); font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); max-width: 26ch; }
.cta-card__text { margin: 14px 0 0; max-width: 60ch; }
.cta-card__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
@media (hover: hover) and (pointer: fine) {
  .cta-card__actions .btn--ghost:hover { background: var(--night-hover); }
}
.cta-card__more {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid rgba(214, 226, 245, 0.18);
}
@media (min-width: 768px) { .cta-card__more { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cta-card__more a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid rgba(214, 226, 245, 0.18);
  border-radius: var(--radius-sm);
  color: var(--on-dark-soft);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.45;
}
@media (hover: hover) and (pointer: fine) {
  .cta-card__more a:hover { background: var(--night-hover); border-color: var(--lime); }
}
.cta-card__more strong { color: var(--on-dark); font-size: 1rem; }

/* author bio */
.author-bio {
  display: grid;
  gap: 20px 28px;
  margin-top: 32px;
  padding: clamp(20px, 4vw, 36px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
@media (min-width: 640px) { .author-bio { grid-template-columns: 132px minmax(0, 1fr); } }
.author-bio__photo {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--lime);
}
.author-bio__name { font-size: 1.5rem; margin-bottom: 10px; }
.author-bio__body p { margin: 0 0 14px; color: var(--muted); }
.credentials {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
}
.credentials li {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-ink);
  font-size: 0.8125rem;
  font-weight: 600;
}
.author-bio__quote { margin: 0 0 14px; padding-left: 14px; border-left: 3px solid var(--lime); }
.author-bio__quote p { color: var(--ink); font-family: var(--font-head); font-weight: 700; font-size: 1.125rem; }

/* ------------------------------------------------------------------ footer */

.site-footer {
  background: var(--night);
  color: var(--on-dark-soft);
  font-size: 0.9375rem;
}
.site-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px var(--gutter) 32px;
  display: grid;
  gap: 24px;
}
@media (min-width: 768px) {
  .site-footer__inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .site-footer__legal { grid-column: 1 / -1; }
}
.site-footer__brand p { margin: 0 0 8px; max-width: 52ch; }
.site-footer__name { color: var(--on-dark); font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; }
.site-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0 16px;
}
.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--on-dark);
  text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
  .site-footer__links a:hover { text-decoration: underline; color: var(--lime-soft); }
}
.site-footer__legal {
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid rgba(214, 226, 245, 0.15);
  font-size: 0.875rem;
}

/* --------------------------------------------------------- small screens */

@media (max-width: 480px) {
  body { font-size: 1rem; }
  .home-hero__actions .btn,
  .cta-card__actions .btn { width: 100%; }
  .prompt-card__bar { padding-left: 12px; }
  .prompt-card__body,
  pre.code { padding: 14px; font-size: 0.8125rem; }
  .callout { padding: 14px 16px; }
  .callout--rule { flex-direction: column; gap: 8px; }
  .author-bio { justify-items: start; }
}

/* --------------------------------------------------------------- motion */

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

@media print {
  .site-header, .progress, .toc, .toc-mobile, .cta-card, .copy-btn, .site-footer { display: none !important; }
  .prose, .post-card, .author-bio { box-shadow: none; border: 0; }
  .prompt-card__body { white-space: pre-wrap; }
}
