:root {
  --cream: #F4EDE1;
  --blueprint: #2E4A6B;
  --amber: #F0A83C;
  --terracotta: #C96F4A;
  --sitegreen: #7C9A6D;
  --ink: #22303C;
  --ink-soft: #5C6B76;
  --paper: #fffaf1;
  --white: #fff;
  --line: rgba(46,74,107,.18);
  --shadow: 0 18px 50px rgba(46,74,107,.09);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: 'Manrope', system-ui, sans-serif; font-size: 17px; line-height: 1.7; font-weight: 500; -webkit-font-smoothing: antialiased; }
a { color: var(--blueprint); }
.case-shell { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.case-nav { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 25px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.case-nav a { font-weight: 800; text-decoration: none; }
.case-nav .nav-cta { border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; background: rgba(255,255,255,.35); }
.case-hero { padding: clamp(56px, 8vw, 108px) 0 56px; max-width: 980px; }
.kicker { margin: 0 0 16px; color: var(--sitegreen); font-size: .78rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1, h2, h3, h4 { color: var(--blueprint); font-family: 'Manrope', system-ui, sans-serif; line-height: 1.12; font-weight: 800; letter-spacing: -.025em; }
h1 { max-width: 940px; margin: 0 0 22px; font-size: clamp(2.4rem, 6vw, 5.2rem); letter-spacing: -.055em; }
h2 { margin: 0 0 16px; font-size: clamp(1.7rem, 3vw, 2.65rem); }
h3 { margin: 0 0 10px; font-size: 1.3rem; }
h4 { margin: 0 0 8px; font-size: 1rem; }
.lede { max-width: 840px; margin: 0 0 26px; color: var(--ink-soft); font-size: clamp(1.08rem, 2vw, 1.35rem); line-height: 1.55; }
.meta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; background: rgba(255,255,255,.48); color: var(--blueprint); font-size: .82rem; font-weight: 800; }
.case-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: clamp(34px, 6vw, 82px); align-items: start; padding-bottom: 90px; }
.case-content { min-width: 0; max-width: 820px; overflow-wrap: anywhere; }
.case-content section { scroll-margin-top: 28px; margin-bottom: 78px; }
.case-content p { margin: 0 0 18px; }
.case-content ul { margin: 0; padding-left: 22px; }
.case-content li { margin-bottom: 8px; }
.context-callout, .human-callout { margin-bottom: 54px; border-radius: 0 20px 20px 0; padding: 22px 24px; background: var(--white); box-shadow: var(--shadow); }
.context-callout { border-left: 5px solid var(--amber); }
.human-callout { border: 1px solid var(--line); border-left: 5px solid var(--sitegreen); background: rgba(255,255,255,.58); }
.glance-block { margin-bottom: 54px; border: 1px solid var(--line); border-radius: 20px; padding: 22px; background: rgba(255,255,255,.52); }
.glance-label { margin: 0 0 16px !important; color: var(--sitegreen); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.glance-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.glance-item { padding: 14px 16px; border-radius: 14px; background: rgba(244,237,225,.72); }
.glance-item strong { display: block; margin-bottom: 4px; color: var(--blueprint); }
.glance-item p { margin: 0; color: var(--ink-soft); font-size: .92rem; line-height: 1.5; }
/* Optional master-template modules: render only when authentic evidence or verified testing exists. */
.actual-build-evidence, .testing-verification { margin-bottom: 78px; }
.section-intro { max-width: 680px; margin-bottom: 26px !important; color: var(--ink-soft); }
.workflow-frame, .build-frame { margin-top: 28px; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.workflow-frame img, .build-frame img { display: block; width: 100%; height: auto; }
.workflow-frame a, .build-frame a { display: block; cursor: zoom-in; }
.actual-evidence-frame a { display: block; cursor: zoom-in; }
.actual-evidence-frame img { background: #fff; }
body.lightbox-open { overflow: hidden; }
.image-lightbox { position: fixed; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(34,48,60,.78); }
.image-lightbox.is-open { display: flex; }
.image-lightbox__panel { width: min(1180px, 100%); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid rgba(255,255,255,.35); border-radius: 20px; background: var(--paper); box-shadow: 0 24px 80px rgba(0,0,0,.32); }
.image-lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.image-lightbox__bar p { margin: 0; color: var(--blueprint); font-size: .9rem; font-weight: 800; }
.image-lightbox__close { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--blueprint); font-size: 1.7rem; line-height: 1; cursor: pointer; }
.image-lightbox__close:hover, .image-lightbox__close:focus-visible { background: rgba(46,74,107,.1); }
.image-lightbox__image-button { display: block; width: 100%; padding: 0; border: 0; background: #fff; cursor: zoom-out; }
.image-lightbox__image-button img { display: block; width: 100%; height: auto; }
.image-lightbox__hint { margin: 0; padding: 10px 16px 14px; color: var(--ink-soft); font-size: .78rem; text-align: center; }
.visual-caption { margin: 12px 4px 0; color: var(--ink-soft); font-size: .82rem; }
.build-grid, .control-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-top: 25px; }
.control-card, .stack-card { border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: rgba(255,255,255,.5); }
.control-card strong, .stack-card strong { display: block; margin-bottom: 6px; color: var(--blueprint); }
.control-card p, .stack-card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.stack-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.stack-list span { border-radius: 999px; padding: 8px 12px; background: var(--blueprint); color: #fff; font-size: .84rem; font-weight: 800; }
.disclosure { margin-top: 24px; border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; background: rgba(255,255,255,.58); color: var(--ink-soft); font-size: .94rem; }
.case-sidebar { position: sticky; top: 22px; border: 1px solid var(--line); border-radius: 22px; padding: 20px; background: var(--paper); box-shadow: var(--shadow); }
.sidebar-label { margin: 0 0 13px; color: var(--sitegreen); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.case-sidebar nav { display: grid; gap: 5px; margin-bottom: 25px; }
.case-sidebar nav a { border-radius: 9px; padding: 7px 9px; color: var(--ink-soft); font-size: .9rem; text-decoration: none; }
.case-sidebar nav a:hover, .case-sidebar nav a:focus-visible, .case-sidebar nav a.is-current { background: rgba(46,74,107,.09); color: var(--blueprint); font-weight: 800; }
.sidebar-cta { border-top: 1px solid var(--line); padding-top: 18px; }
.sidebar-cta p { margin: 0 0 13px; color: var(--ink-soft); font-size: .9rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; border-radius: 999px; padding: 12px 16px; background: var(--blueprint); color: #fff; font-weight: 800; text-align: center; text-decoration: none; }
.btn--ghost { margin-top: 9px; border: 1px solid var(--line); background: transparent; color: var(--blueprint); }
.case-next { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; padding-top: 25px; border-top: 1px solid var(--line); }
.next-link { display: block; border: 1px solid var(--line); border-radius: 17px; padding: 16px; background: rgba(255,255,255,.52); font-weight: 800; text-decoration: none; }
.next-link span { display: block; margin-bottom: 4px; color: var(--ink-soft); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; }
footer { padding: 30px 0 46px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .86rem; text-align: center; }
@media (max-width: 860px) {
  body { overflow-x: hidden; }
  .case-shell { padding: 0 20px; }
  .case-nav { align-items: flex-start; flex-direction: column; gap: 10px; }
  .case-nav .nav-cta { align-self: flex-start; }
  .case-hero { padding: 45px 0 38px; }
  h1 { font-size: clamp(2.35rem, 12vw, 4rem); }
  .case-layout { display: block; padding-bottom: 58px; }
  .case-sidebar { position: static; margin-bottom: 38px; }
  .case-sidebar nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sidebar-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
  .sidebar-cta p { flex: 1 1 100%; }
  .sidebar-cta .btn { flex: 1 1 210px; width: auto; }
  .sidebar-cta .btn--ghost { flex: 0 0 auto; margin-top: 0; }
  .case-content section { margin-bottom: 58px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .case-shell { padding: 0 16px; }
  .glance-grid { grid-template-columns: 1fr; }
  .meta-row, .build-grid, .control-grid, .case-next { grid-template-columns: 1fr; display: grid; }
  .pill { width: 100%; }
  .case-sidebar nav { grid-template-columns: 1fr; }
  .sidebar-cta { display: block; }
  .sidebar-cta .btn, .sidebar-cta .btn--ghost { width: 100%; margin-top: 9px; }
  .workflow-frame, .build-frame { margin-left: -2px; margin-right: -2px; border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
