/* ==========================================================================
   Tinyvation — design system
   Palette, type and spacing per the co-founder workbook (sheet 3):
   warm cream canvas, evergreen ink, one amber accent used sparingly.
   Source Serif 4 for display, Inter for everything else.
   ========================================================================== */

:root {
  /* color */
  --cream: #FAF8F2;
  --cream-2: #F2EFE6;
  --card: #FFFFFF;
  --border: #E7E1D6;
  --border-soft: #EFEAE0;
  --ink: #1D2723;
  --ink-2: #3D4A44;
  --muted: #647067;
  --evergreen: #163B34;
  --evergreen-2: #1E4A41;
  --evergreen-deep: #102B26;
  --on-green: #F2EFE6;
  --on-green-dim: #A8BAB1;
  --green-line: #2A524A;
  --amber: #F2B84B;
  --amber-deep: #D99A26;
  --amber-tint: #FBF0D8;
  --teal: #2F9C95;
  --teal-tint: #E2F0EF;
  --coral: #E46F52;
  --coral-tint: #FAE7E1;

  /* type */
  --display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, monospace;

  /* rhythm */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --wrap: 1128px;
  --wrap-narrow: 720px;
  --ease: cubic-bezier(.25, .1, .25, 1);
  --shadow-sm: 0 1px 2px rgba(29, 39, 35, .05);
  --shadow-md: 0 2px 8px rgba(29, 39, 35, .06), 0 12px 32px rgba(29, 39, 35, .05);
}

/* ---------- reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html, body { overflow-x: clip; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  font-feature-settings: 'cv05' 1, 'cv11' 1;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
ul[role='list'], ol[role='list'] { list-style: none; }
::selection { background: rgba(242, 184, 75, .35); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 2px; }

/* ---------- layout ---------- */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.wrap-narrow { max-width: var(--wrap-narrow); margin-inline: auto; padding-inline: 24px; }
section { padding-block: 96px; }
section.tight { padding-block: 64px; }
.band-tint { background: var(--cream-2); }
.band-dark { background: var(--evergreen); color: var(--on-green); }
.band-dark ::selection { background: rgba(242, 184, 75, .4); color: var(--evergreen-deep); }
@media (max-width: 720px) {
  section { padding-block: 64px; }
  .wrap, .wrap-narrow { padding-inline: 20px; }
}

/* ---------- typography ---------- */
h1, h2, .h1, .h2 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.02em;
  color: var(--evergreen);
  text-wrap: balance;
}
.band-dark h1, .band-dark h2, .band-dark h3 { color: var(--on-green); }
h1, .h1 { font-size: clamp(2.5rem, 5.4vw, 3.9rem); font-variation-settings: 'opsz' 60; }
h2, .h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: 1.12; }
/* The display serif never below 24px: h3 and smaller stay in the sans */
h3, .h3 { font-family: var(--sans); font-size: 1.1rem; font-weight: 600; line-height: 1.35; letter-spacing: -.005em; color: var(--evergreen); }
h4 { font-family: var(--sans); font-size: 1.02rem; font-weight: 600; letter-spacing: -.005em; }
p { text-wrap: pretty; }
.lede { font-size: 1.16rem; line-height: 1.6; color: var(--ink-2); max-width: 42em; }
.band-dark .lede { color: var(--on-green-dim); }
.muted { color: var(--muted); }
.band-dark .muted { color: var(--on-green-dim); }
strong { font-weight: 600; }
.serif-em { font-family: var(--display); font-style: italic; font-weight: 500; }

/* kicker above section headings: editorial italic, no badge, no dot */
.eyebrow {
  display: block;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-style: italic;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: .005em;
  color: var(--muted);
}
.band-dark .eyebrow { color: var(--on-green-dim); }

/* grouped label for the tool walls */
.wall-label { font-size: .85rem; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); }

.sec-head { max-width: 680px; margin-bottom: 56px; }
.sec-head h2 { margin-top: 14px; }
.sec-head .lede { margin-top: 16px; }
.sec-head.center { margin-inline: auto; text-align: center; }
.sec-head.center .lede { margin-inline: auto; }

/* numbers and spec details get tabular mono treatment */
.num { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: .96rem;
  letter-spacing: -.005em;
  padding: 13px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
/* buttons carry words, not arrow icons; arrows live on text links only */
.btn svg { display: none; }
.btn-primary { background: var(--evergreen); color: var(--on-green); }
.btn-primary:hover { background: var(--evergreen-2); }
.btn-secondary { border-color: var(--border); background: var(--card); color: var(--evergreen); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--evergreen); }
.band-dark .btn-primary { background: var(--amber); color: var(--evergreen-deep); }
.band-dark .btn-primary:hover { background: var(--amber-deep); }
.band-dark .btn-secondary { background: transparent; border-color: var(--green-line); color: var(--on-green); box-shadow: none; }
.band-dark .btn-secondary:hover { border-color: var(--on-green-dim); }
.btn-lg { padding: 16px 28px; font-size: 1.02rem; border-radius: 12px; }
.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: .95rem; color: var(--evergreen);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: border-color .18s var(--ease);
}
.text-link:hover { border-color: var(--evergreen); }
.text-link svg { width: 14px; height: 14px; transition: transform .18s var(--ease); }
.text-link:hover svg { transform: translateX(2px); }
.band-dark .text-link { color: var(--on-green); border-color: var(--green-line); }
.band-dark .text-link:hover { border-color: var(--on-green); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 242, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--border); }
.nav-bar {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 72px;
}
.logo {
  /* wordmark is the one sanctioned sub-24px display-serif use: it is the logo, not text */
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-size: 1.44rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--evergreen);
  margin-right: 4px;
}
.logo-tile { width: 29px; height: 29px; border-radius: 7px; flex: none; }
.site-footer .logo-tile { box-shadow: 0 0 0 1px var(--green-line); border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links > li { position: relative; }
.nav-links a, .nav-links button.nav-drop-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: .93rem;
  font-weight: 500;
  color: var(--ink-2);
  padding: 8px 13px;
  border-radius: 8px;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.nav-links a:hover, .nav-links button.nav-drop-btn:hover { color: var(--evergreen); background: var(--cream-2); }
.nav-links a[aria-current='page'] { color: var(--evergreen); font-weight: 600; }
.nav-drop-btn svg { width: 10px; height: 10px; transition: transform .18s var(--ease); }
.nav-drop.open .nav-drop-btn svg, .nav-drop:hover .nav-drop-btn svg { transform: rotate(180deg); }
.nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: 8px;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.nav-drop:hover .nav-menu, .nav-drop.open .nav-menu, .nav-drop:focus-within .nav-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-menu a { display: block; padding: 10px 12px; border-radius: 8px; }
.nav-menu a .t { display: block; font-weight: 600; font-size: .92rem; color: var(--evergreen); }
.nav-menu a .d { display: block; font-size: .82rem; color: var(--muted); margin-top: 1px; font-weight: 400; }
.nav-cta { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; }

@media (max-width: 520px) {
  /* keep logo + CTA + menu button inside a small viewport */
  .nav-bar { gap: 10px; }
  .logo { font-size: 1.16rem; gap: 8px; }
  .logo-tile { width: 25px; height: 25px; }
  .nav-cta { gap: 4px; }
  .nav-cta .btn { padding: 9px 13px; font-size: .86rem; }
  .nav-cta .btn svg { display: none; }
  .nav-q { display: none; }
}
@media (max-width: 920px) {
  .nav-links, .nav-cta .btn-secondary { display: none; }
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px; padding: 0 8px; border-radius: 8px;
  }
  .nav-toggle span { display: block; height: 2px; background: var(--evergreen); border-radius: 2px; transition: transform .2s var(--ease), opacity .2s; }
  .nav-toggle[aria-expanded='true'] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded='true'] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-bar { gap: 12px; }
  .mobile-menu {
    display: none;
    position: fixed; inset: 72px 0 0 0;
    background: var(--cream);
    overflow-y: auto;
    padding: 24px 20px 48px;
    z-index: 49;
  }
  .mobile-menu.open { display: block; }
  .mobile-menu .group { border-bottom: 1px solid var(--border); padding: 18px 0; }
  .mobile-menu .group-label { font-family: var(--mono); font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
  .mobile-menu a { display: block; font-size: 1.08rem; font-weight: 500; color: var(--evergreen); padding: 9px 0; }
  .mobile-menu .btn { width: 100%; margin-top: 24px; }
}
@media (min-width: 921px) { .mobile-menu { display: none !important; } }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
a.card:hover, .card.lift:hover { border-color: #D8D0BF; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.band-dark .card { background: var(--evergreen-2); border-color: var(--green-line); box-shadow: none; }
.card .icon-chip {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--cream-2);
  border: 1px solid var(--border-soft);
  margin-bottom: 18px;
}
.card .icon-chip svg { width: 20px; height: 20px; }

/* split layouts set their desktop columns inline; this guarantees a single column
   on small screens even before any script runs */
@media (max-width: 880px) {
  [data-hero-grid], [data-calc-grid], [data-deliver-grid], [data-scope-grid], [data-why-grid],
  [data-rate-grid], [data-contact-grid], [data-case-grid], [data-honest-grid], [data-step-row] {
    grid-template-columns: 1fr !important;
  }
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 920px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- logo wall ---------- */
.logo-wall { display: flex; flex-wrap: wrap; gap: 12px; }
.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: .89rem;
  font-weight: 500;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.tool-chip img { width: 17px; height: 17px; object-fit: contain; }
.tool-chip.wide img { width: auto; max-width: 72px; height: 14px; }

/* marquee ticker (homepage) */
.ticker { overflow: hidden; position: relative; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { display: flex; gap: 12px; width: max-content; animation: ticker 48s linear infinite; padding-block: 4px; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; flex-wrap: wrap; width: auto; } }

/* ---------- stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
@media (max-width: 820px) { .stat-row { grid-template-columns: repeat(2, 1fr); gap: 28px; } }
.stat .n {
  font-family: var(--display);
  font-size: clamp(2.1rem, 3.6vw, 2.9rem);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--evergreen);
  font-variant-numeric: tabular-nums;
}
.band-dark .stat .n { color: var(--amber); }
.stat .l { margin-top: 6px; font-size: .92rem; color: var(--muted); max-width: 22em; }
.band-dark .stat .l { color: var(--on-green-dim); }

/* ---------- process steps ---------- */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 920px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }
.step { counter-increment: step; position: relative; padding-top: 18px; }
.step::before {
  content: '0' counter(step);
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 600;
  color: var(--amber-deep);
  letter-spacing: .04em;
}
.step h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 600; margin-top: 10px; letter-spacing: -.005em; }
.step p { font-size: .94rem; color: var(--muted); margin-top: 8px; }
.when { display: inline-block; margin-top: 12px; font-family: var(--mono); font-size: .78rem; color: var(--ink-2); background: var(--cream-2); border: 1px solid var(--border-soft); border-radius: 6px; padding: 3px 8px; }
.band-dark .step p { color: var(--on-green-dim); }
.band-dark .when { background: var(--evergreen-2); border-color: var(--green-line); color: var(--on-green-dim); }
.band-dark .step h3 { color: var(--on-green); }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 4px;
  font-weight: 600; font-size: 1.04rem; color: var(--evergreen);
  cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .x {
  flex: none; width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 50%;
  color: var(--muted);
  transition: transform .2s var(--ease), background .2s, color .2s;
}
.faq details[open] summary .x { transform: rotate(45deg); background: var(--evergreen); color: var(--on-green); border-color: var(--evergreen); }
.faq .a { padding: 0 44px 24px 4px; color: var(--ink-2); max-width: 60em; }
.faq .a p + p { margin-top: 10px; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-sm); }
table.cmp { width: 100%; border-collapse: collapse; font-size: .94rem; min-width: 640px; }
table.cmp th, table.cmp td { padding: 14px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border-soft); }
table.cmp thead th { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--cream-2); }
table.cmp tbody tr:last-child td { border-bottom: 0; }
table.cmp td.hl { background: var(--amber-tint); font-weight: 500; }
table.cmp .row-label { font-weight: 600; color: var(--evergreen); white-space: nowrap; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .88rem; font-weight: 600; color: var(--evergreen); }
.field input, .field select, .field textarea {
  font: inherit; font-size: .95rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(47, 156, 149, .15);
}
.field .hint { font-size: .8rem; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { background: var(--evergreen); color: var(--on-green-dim); font-size: .92rem; }
.footer-main { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 48px; padding-block: 64px 48px; }
@media (max-width: 920px) { .footer-main { grid-template-columns: 1fr 1fr; gap: 36px; } }
@media (max-width: 560px) { .footer-main { grid-template-columns: 1fr; } }
.footer-main .logo { color: var(--on-green); }
.footer-blurb { margin-top: 14px; max-width: 30em; line-height: 1.6; }
.footer-col .h { font-family: var(--mono); font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--on-green); margin-bottom: 14px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-col a { color: var(--on-green-dim); transition: color .15s; }
.footer-col a:hover { color: var(--on-green); }
.footer-bottom {
  border-top: 1px solid var(--green-line);
  padding-block: 22px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px;
  font-size: .84rem;
}
.footer-bottom .legal { display: flex; gap: 18px; margin-left: auto; }
.footer-bottom a:hover { color: var(--on-green); }

/* newsletter strip */
.newsletter { display: flex; gap: 10px; margin-top: 16px; max-width: 380px; }
.newsletter input {
  flex: 1; font: inherit; font-size: .92rem;
  background: var(--evergreen-2); color: var(--on-green);
  border: 1px solid var(--green-line); border-radius: 10px; padding: 11px 14px;
}
.newsletter input::placeholder { color: var(--on-green-dim); }
.newsletter input:focus { outline: none; border-color: var(--amber); }
.newsletter .btn { padding: 11px 18px; }

/* ---------- hero diagram + flow visuals ---------- */
.flow-node { fill: var(--card); stroke: var(--border); stroke-width: 1.5; }
.flow-edge { fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; }
.flow-edge.dashed { stroke-dasharray: 4 7; }
.flow-dot { fill: var(--amber); }
.draw-in { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: draw 1.6s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .draw-in { animation: none; stroke-dashoffset: 0; } }

/* content renders instantly, like a printed page; the flow diagrams carry
   the site's one signature motion. (.reveal classes remain in markup, inert.) */

/* ---------- breadcrumbs ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .85rem; color: var(--muted); }
.crumbs a:hover { color: var(--evergreen); }
.crumbs .sep { opacity: .5; }

/* ---------- blog / article ---------- */
.article-body { font-size: 1.05rem; line-height: 1.75; color: var(--ink); }
.article-body > * + * { margin-top: 1.25em; }
.article-body h2 { font-size: 1.72rem; margin-top: 2.2em; scroll-margin-top: 96px; }
.article-body h3 { font-size: 1.25rem; margin-top: 1.8em; scroll-margin-top: 96px; }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body li + li { margin-top: .45em; }
.article-body a { color: var(--evergreen); font-weight: 500; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; transition: text-decoration-color .15s; }
.article-body a:hover { text-decoration-color: var(--evergreen); }
.article-body blockquote {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 4px;
  color: var(--ink-2);
  font-family: var(--display);
  font-style: italic;
  font-size: 1.18rem;
  line-height: 1.5;
}
.article-body blockquote code, .article-body blockquote .num { font-style: normal; font-family: var(--mono); font-size: .88em; }
.article-body .callout {
  background: var(--cream-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px 22px;
  font-size: .98rem;
}
.article-body .callout .t { font-weight: 600; color: var(--evergreen); display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.article-body table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.article-body table th, .article-body table td { padding: 11px 14px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.article-body table thead th { background: var(--cream-2); font-weight: 600; color: var(--evergreen); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; font-size: .88rem; color: var(--muted); }
.article-meta .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--evergreen); color: var(--on-green); display: grid; place-items: center; font-weight: 600; font-size: .82rem; letter-spacing: .02em; }
.toc { position: sticky; top: 96px; font-size: .88rem; }
.toc .h { font-family: var(--mono); font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.toc ol { list-style: none; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 6px 0 6px 16px; color: var(--muted); border-left: 2px solid transparent; margin-left: -1.5px; transition: color .15s, border-color .15s; }
.toc a:hover { color: var(--evergreen); }
.toc a.active { color: var(--evergreen); font-weight: 600; border-left-color: var(--amber); }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 64px; align-items: start; }
@media (max-width: 980px) { .article-grid { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }

/* article CTA box */
.article-cta {
  background: var(--evergreen);
  color: var(--on-green);
  border-radius: var(--r-lg);
  padding: 32px;
  margin-top: 2.4em;
}
.article-cta .t { font-family: var(--display); font-size: 1.5rem; font-weight: 600; color: var(--on-green); }
.article-cta p { color: var(--on-green-dim); font-size: .96rem; margin-top: 8px; max-width: 36em; }
.article-cta .btn { margin-top: 18px; background: var(--amber); color: var(--evergreen-deep); }
.article-cta .btn:hover { background: var(--amber-deep); }

/* ---------- utility ---------- */
.center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.flex { display: flex; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.wrap-items { flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap; }
.divider { border: 0; border-top: 1px solid var(--border); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .8rem; font-weight: 600;
  padding: 5px 12px; border-radius: 99px;
  background: var(--teal-tint); color: #1F6B66;
}
.pill.amber { background: var(--amber-tint); color: #8A6113; }
.pill.coral { background: var(--coral-tint); color: #A33E25; }

/* ---------- knowledge base ---------- */
.pill.green { background: #E4EEE7; color: #1E4A41; }
.pill.plain { background: var(--cream-2); color: var(--ink-2); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--card);
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-2);
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.filter-btn:hover { border-color: var(--evergreen); }
.filter-btn.active { background: var(--evergreen); color: var(--on-green); border-color: var(--evergreen); }
.filter-btn .n { font-weight: 500; opacity: .65; margin-left: 4px; font-size: .8rem; }
.kb-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 760px) { .kb-grid { grid-template-columns: 1fr; } }
.kb-card { padding: 26px 28px; display: flex; flex-direction: column; align-items: flex-start; }
.kb-card h2 { font-family: var(--sans); font-size: 1.13rem; font-weight: 600; line-height: 1.35; letter-spacing: -.005em; margin-top: 12px; }
.kb-card .dek { font-size: .92rem; color: var(--muted); margin-top: 8px; }
.kb-card .meta { margin-top: auto; padding-top: 14px; font-size: .8rem; color: var(--muted); }
.kb-card[hidden] { display: none; }
.kb-featured { grid-column: 1 / -1; padding: 36px 40px; }
.kb-featured h2 { font-family: var(--display); font-optical-sizing: auto; font-size: 1.7rem; letter-spacing: -.015em; line-height: 1.15; max-width: 22em; }
.kb-featured .dek { font-size: 1.02rem; max-width: 52em; }
@media (max-width: 760px) { .kb-featured { padding: 26px 28px; } .kb-featured h2 { font-size: 1.35rem; } }

/* ---------- before/after story figure ---------- */
.fig-ba { margin: 0; }
.fig-toggle {
  display: inline-flex; gap: 4px;
  background: var(--cream-2);
  border: 1px solid var(--border);
  border-radius: 99px; padding: 4px;
}
.fb-btn {
  padding: 6px 18px; border-radius: 99px;
  font-size: .82rem; font-weight: 600; color: var(--muted);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.fb-btn.active { background: var(--evergreen); color: var(--on-green); }
.fig-stage {
  margin-top: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.fig-stage svg { width: 100%; height: auto; display: block; }
.fig-note { margin-top: 12px; font-size: .9rem; text-align: center; position: relative; min-height: 2.8em; }
.fig-note span { position: absolute; inset: 0; transition: opacity .22s var(--ease); color: var(--muted); }
.fig-note .note-after { opacity: 0; color: var(--ink-2); transition-delay: 0s; }
.fig-ba.is-after .fig-note .note-before { opacity: 0; }
.fig-ba.is-after .fig-note .note-after { opacity: 1; transition-delay: .26s; }

/* nodes glide between states; each carries its own coordinates */
.fig-ba .bn {
  transform-box: fill-box; transform-origin: center;
  transform: var(--b);
  transition: transform .75s cubic-bezier(.2,1,.2,1), opacity .5s var(--ease);
  transition-delay: var(--d, 0s);
}
.fig-ba.is-after .bn { transform: var(--a); }
/* tangle fades out, clean flow draws in (and retracts on the way back) */
.fig-ba .lines-b path { transition: opacity .22s ease-in; }
.fig-ba.is-after .lines-b path { opacity: 0; }
.fig-ba .lines-a path {
  stroke-dasharray: 700; stroke-dashoffset: 700; opacity: 0;
  transition: stroke-dashoffset .6s cubic-bezier(.2,1,.2,1) .45s, opacity .2s .42s;
}
.fig-ba.is-after .lines-a path { stroke-dashoffset: 0; opacity: 1; }
.fig-ba .a-only { opacity: 0; transition: opacity .4s var(--ease) .8s; }
.fig-ba.is-after .a-only { opacity: 1; }
.fig-ba .b-only { transition: opacity .35s var(--ease); }
.fig-ba.is-after .b-only { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .fig-ba .bn, .fig-ba .lines-a path, .fig-ba .lines-b path, .fig-ba .a-only, .fig-ba .b-only, .fig-note span { transition: none !important; }
}

/* ---------- mobile refinements ---------- */
/* long-form tables scroll instead of overflowing */
.article-body table { display: block; overflow-x: auto; }
.article-body table thead, .article-body table tbody { display: table; min-width: 100%; }
@media (max-width: 720px) {
  /* story figures: keep labels legible when the canvas scales down */
  .fig-flow svg text { font-size: 14px; }
  .fig-flow svg text.sub { display: none; }
  .fig-note { font-size: .85rem; min-height: 3.4em; }
  /* large display numbers shrink gracefully */
  .stat .n { font-size: 1.9rem; }
  /* case study cards breathe on small screens */
  .kb-featured h2 { font-size: 1.3rem; }
}

/* ---------- ambient flow figure (replaces the toggle version) ---------- */
.fig-flow { margin: 0; }
.fig-flow .fig-stage { margin-top: 0; }
.fig-flow .track { stroke: #D6E8E5; stroke-width: 1.8; fill: none; }
.fig-flow .pulse {
  stroke: #2F9C95; stroke-width: 2; fill: none; stroke-linecap: round;
  stroke-dasharray: 12 380; stroke-dashoffset: 392;
  animation: figflow 3.2s linear infinite;
  animation-delay: var(--fd, 0s);
}
@keyframes figflow { to { stroke-dashoffset: 0; } }
.fig-flow .amber-pulse { animation: amberbreathe 3.2s ease-in-out infinite; }
@keyframes amberbreathe { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  .fig-flow .pulse { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; opacity: .8; }
  .fig-flow .amber-pulse { animation: none; }
}
/* edge labels sit on their lines with a halo that masks the line beneath */
.fig-flow .elabel { paint-order: stroke; stroke: #FFFFFF; stroke-width: 9px; stroke-linejoin: round; }
/* boxless flow figures: nodes float on the page */
.fig-flow .nrect { filter: drop-shadow(0 2px 5px rgba(29,39,35,.08)); }
.fig-flow figcaption { max-width: 40em; margin-inline: auto; }

/* ---------- work artifacts: stylized product illustrations ---------- */
.artifact { margin: 0; max-width: 940px; margin-inline: auto; }
.artifact svg { width: 100%; height: auto; filter: drop-shadow(0 4px 10px rgba(29,39,35,.07)) drop-shadow(0 18px 40px rgba(29,39,35,.09)); }
.artifact figcaption { font-size: .88rem; color: var(--muted); margin-top: 20px; text-align: center; max-width: 42em; margin-inline: auto; }
.artifact-band { margin-top: 72px; }
@media (max-width: 880px) { .artifact-band { margin-top: 44px; } }

/* in-copy links share one typeset underline everywhere, not just in articles */
main p a:not(.btn):not(.text-link), main td a, main li a:not(.btn):not(.text-link), .faq-a a {
  color: var(--evergreen); font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px;
  transition: text-decoration-color .15s;
}
main p a:not(.btn):not(.text-link):hover, main td a:hover, main li a:not(.btn):not(.text-link):hover, .faq-a a:hover {
  text-decoration-color: var(--evergreen);
}
.toc a, .toc a:hover { text-decoration: none; }

/* figure numbering: illustrations are evidence, not decoration */
.fig-no { font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; color: var(--muted); margin-right: 8px; }

/* ruled editorial rows: proof without card chrome */
.ruled-list { border-top: 1px solid var(--green-line); }
.ruled-list > a, .ruled-list > div {
  display: grid; grid-template-columns: 120px 1.1fr 1fr; gap: 24px; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--green-line);
}
.ruled-list .case-no { font-family: var(--mono); font-size: .78rem; letter-spacing: .05em; color: var(--on-green-dim); }
.ruled-list h3 { font-size: 1.05rem; color: var(--on-green); }
.ruled-list p { font-size: .9rem; color: var(--on-green-dim); }
.ruled-list a:hover h3 { text-decoration: underline; text-decoration-color: var(--on-green-dim); text-underline-offset: 3px; }
@media (max-width: 720px) { .ruled-list > a, .ruled-list > div { grid-template-columns: 1fr; gap: 6px; padding: 18px 0; } }

.ruled-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--border); }
.ruled-cols > div { padding: 26px 28px 4px 0; border-bottom: 1px solid var(--border); }
@media (min-width: 721px) { .ruled-cols > div:not(:nth-child(3n+1)) { padding-left: 28px; border-left: 1px solid var(--border); } }
@media (max-width: 720px) { .ruled-cols { grid-template-columns: 1fr; } .ruled-cols > div { padding: 20px 0 16px; } }

/* the footer closes like an end mark, not a link dump */
.footer-wordmark {
  font-family: var(--display); font-weight: 600; letter-spacing: -.03em;
  font-size: clamp(3.5rem, 11vw, 9.5rem); line-height: .95;
  color: var(--on-green); opacity: .16; user-select: none;
  margin: 56px 0 16px;
}
.footer-colophon { font-size: .78rem; color: var(--on-green-dim); opacity: .8; padding-bottom: 28px; margin-top: -10px; }

/* quiet physical texture on the alternating bands */
.band-tint {
  background-image: radial-gradient(rgba(29, 39, 35, .05) 1px, transparent 1px);
  background-size: 26px 26px;
}
.band-dark {
  background-image: radial-gradient(120% 90% at 50% -10%, rgba(47, 156, 149, .10), transparent 60%);
}
/* on desktop the figure bleeds slightly past its hero column so the
   diagram reads larger; the 4% overhang stays inside the wrap padding */
@media (min-width: 881px) {
  /* !important: the svg carries an inline width:100%; max-width unclamps the global img/svg rule */
  .fig-flow svg { width: 108% !important; max-width: none; margin-left: -4%; }
}

/* ---------- print: case studies and articles forward cleanly as PDFs ---------- */
@media print {
  @page { margin: 18mm; }
  body { background: #fff; color: #000; font-size: 11.5pt; }
  .site-header, .site-footer, .ticker, .nav-bar, .crumbs,
  .btn, .text-link svg, .filter-bar, form, .band-dark[class] { display: none !important; }
  section { padding-block: 18pt; }
  .band-tint { background: #fff; background-image: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  a { color: #000; text-decoration: none; }
  .article-body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; color: #444; }
  figure, .card, table, blockquote { break-inside: avoid; }
  .fig-flow .pulse, .amber-pulse { display: none; }
  h1, h2 { color: #102B26; }
}
