:root {
  --ink: #101927;
  --paper: #f5f0e7;
  --paper-deep: #e9e0d3;
  --white: #fffdf8;
  --teal: #0f766e;
  --teal-dark: #09554f;
  --amber: #c9850d;
  --coral: #a7443e;
  --slate: #52606d;
  --line: #cbc0b1;
  --shadow: 0 20px 50px rgba(16, 25, 39, .12);
  --measure: 72ch;
  --display: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 3%, rgba(216, 154, 43, .09), transparent 25rem),
    linear-gradient(180deg, var(--paper) 0%, #f8f4ec 38rem, var(--white) 100%);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--teal-dark); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--coral); }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  inset: .7rem auto auto .7rem;
  padding: .65rem .9rem;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-180%);
}
.skip-link:focus { transform: none; }

.preview-bar {
  border-bottom: 1px solid rgba(245, 240, 231, .18);
  color: #fff8e8;
  background: var(--ink);
  font: 700 .73rem/1.4 var(--mono);
  letter-spacing: .04em;
}
.preview-bar__inner {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  width: min(100% - 2rem, 1180px);
  margin: auto;
  padding: .52rem 0;
}
.preview-bar a { color: #d7eee9; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(16, 25, 39, .15);
  background: rgba(245, 240, 231, .94);
  backdrop-filter: blur(12px);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
  width: min(100% - 2rem, 1180px);
  min-height: 74px;
  margin: auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--ink);
  font: 700 1.08rem/1.1 var(--display);
  text-decoration: none;
}
.brand svg { width: 34px; height: 34px; }
.brand small {
  display: block;
  margin-top: .22rem;
  color: var(--slate);
  font: 700 .62rem/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.desktop-nav {
  display: flex;
  gap: .3rem;
  justify-content: center;
}
.desktop-nav a {
  padding: .7rem .75rem;
  border-bottom: 2px solid transparent;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 750;
  text-decoration: none;
}
.desktop-nav a[aria-current="page"], .desktop-nav a:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}
.scope-badge {
  display: inline-flex;
  gap: .55rem;
  align-items: center;
  padding: .48rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font: 800 .72rem/1 var(--mono);
}
.scope-badge b { color: var(--coral); }
.nav-details { display: none; }

.shell {
  width: min(100% - 2rem, 1180px);
  margin-inline: auto;
}
.breadcrumbs {
  padding: 1.1rem 0 .25rem;
  color: var(--slate);
  font-size: .78rem;
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.breadcrumbs li:not(:last-child)::after { margin-left: .45rem; content: "›"; color: var(--amber); }
.breadcrumbs a { color: inherit; }

.article-head {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
  gap: clamp(2rem, 5vw, 5.5rem);
  align-items: center;
  min-height: 430px;
  padding: clamp(2.5rem, 6vw, 6rem) 0 3rem;
}
.article-head.no-image {
  grid-template-columns: minmax(0, 850px);
  min-height: 340px;
}
.eyebrow {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.1rem;
  color: var(--teal-dark);
  font: 800 .72rem/1.3 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}
.eyebrow .case-id {
  color: var(--slate);
}
h1, h2, h3 {
  font-family: var(--display);
  text-wrap: balance;
}
h1 {
  max-width: 18ch;
  margin: 0 0 1.2rem;
  font-size: clamp(2.5rem, 6vw, 5.4rem);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.045em;
}
.article-head.no-image h1 { max-width: 20ch; }
.lead {
  max-width: 62ch;
  margin: 0;
  color: #2b3846;
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  line-height: 1.6;
}
.hero-figure {
  position: relative;
  margin: 0;
  padding: .7rem;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
  rotate: 1.2deg;
}
.hero-figure::before {
  position: absolute;
  z-index: 2;
  inset: -1.15rem auto auto 1rem;
  padding: .36rem .55rem;
  color: #fff;
  background: var(--teal-dark);
  content: "CASE VISUAL";
  font: 800 .62rem/1 var(--mono);
  letter-spacing: .07em;
}
.hero-figure img { width: 100%; border: 1px solid rgba(16, 25, 39, .12); }
.hero-figure figcaption { padding: .65rem .35rem .1rem; color: var(--slate); font-size: .74rem; }

.case-entry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 0 0 4rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  box-shadow: var(--shadow);
}
.case-entry a {
  min-height: 190px;
  padding: 1.2rem;
  color: var(--ink);
  background: var(--white);
  text-decoration: none;
}
.case-entry a:nth-child(even) { background: #efe6d8; }
.case-entry a:hover { background: #dfeeea; }
.case-entry .num { display: block; color: var(--coral); font: 800 .7rem/1 var(--mono); }
.case-entry strong { display: block; margin: 2.4rem 0 .45rem; font: 700 1.25rem/1.15 var(--display); }
.case-entry span:last-child { color: var(--slate); font-size: .86rem; line-height: 1.45; }

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: clamp(2.2rem, 6vw, 6rem);
  align-items: start;
  padding-bottom: 6rem;
}
.article-body { min-width: 0; max-width: 820px; }
.article-body > *:first-child { margin-top: 0; }
.article-body p, .article-body li { max-width: var(--measure); }
.article-body p { margin: 0 0 1.25rem; }
.article-body h2 {
  margin: 3.7rem 0 1.1rem;
  padding-top: .5rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -.025em;
  scroll-margin-top: 110px;
}
.article-body h2::before {
  display: block;
  margin-bottom: .65rem;
  color: var(--teal);
  content: "§";
  font: 800 .8rem/1 var(--mono);
}
.article-body h3 {
  margin: 2.1rem 0 .65rem;
  font-size: 1.35rem;
  line-height: 1.25;
  scroll-margin-top: 110px;
}
.article-body ul, .article-body ol { padding-left: 1.35rem; }
.article-body li { margin: .55rem 0; padding-left: .3rem; }
.article-body strong { color: #09131e; }
.article-body code {
  padding: .12rem .28rem;
  border-radius: 3px;
  background: var(--paper-deep);
  font: .88em/1.3 var(--mono);
}

.short-answer {
  position: relative;
  margin: 0 0 3rem;
  padding: 1.4rem 1.5rem 1.4rem 4rem;
  border: 1px solid var(--teal);
  border-left-width: 5px;
  background: #edf7f4;
  box-shadow: 7px 7px 0 rgba(15, 118, 110, .12);
}
.short-answer::before {
  position: absolute;
  top: 1.25rem;
  left: 1.2rem;
  color: var(--teal-dark);
  content: "01";
  font: 900 .84rem/1 var(--mono);
}
.short-answer p { margin: 0; }

.method-visual {
  position: relative;
  width: 100%;
  margin: 1.6rem 0 3rem;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--ink);
  box-shadow: 8px 8px 0 rgba(15, 118, 110, .14);
}
.method-visual::after {
  position: absolute;
  right: .7rem;
  bottom: .6rem;
  width: 12px;
  height: 12px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--amber);
  content: "";
}
.method-visual picture,
.method-visual img { display: block; width: 100%; }
.method-visual img { height: auto; aspect-ratio: 24 / 5; object-fit: cover; }
.method-visual--route { box-shadow: 8px 8px 0 rgba(216, 154, 43, .16); }
.method-visual--evidence { box-shadow: 8px 8px 0 rgba(214, 90, 74, .13); }

.table-scroll {
  position: relative;
  width: 100%;
  margin: 1.6rem 0 2.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 10px 30px rgba(16, 25, 39, .07);
  overscroll-behavior-inline: contain;
}
.table-scroll.can-scroll::after {
  position: sticky;
  right: 0;
  bottom: 0;
  display: block;
  width: max-content;
  margin-left: auto;
  padding: .3rem .55rem;
  color: #fff;
  background: var(--teal-dark);
  content: "Scroll table →";
  font: 700 .68rem/1 var(--mono);
}
table { width: 100%; min-width: 650px; border-collapse: collapse; font-size: .88rem; line-height: 1.5; }
th, td { padding: .85rem .95rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--white); background: var(--ink); font: 800 .72rem/1.35 var(--mono); letter-spacing: .03em; }
td:first-child { position: sticky; left: 0; z-index: 1; background: #f2eadf; font-weight: 750; }
tr:last-child td { border-bottom: 0; }

.support-figure {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, .9fr);
  gap: 1.2rem;
  align-items: center;
  margin: 3rem 0;
  padding: 1rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
}
.support-figure img { width: 100%; }
.support-figure figcaption { padding: 1rem; }
.support-figure b { display: block; margin-bottom: .55rem; color: #9ed9d0; font: 800 .7rem/1 var(--mono); letter-spacing: .08em; }

.slot-visual,
.slot-demo__visual {
  position: relative;
  margin: 1.6rem 0 2.2rem;
  padding: .65rem;
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: 8px 8px 0 rgba(15, 118, 110, .14);
}
.slot-visual picture,
.slot-demo__visual picture,
.slot-visual img,
.slot-demo__visual img { display: block; width: 100%; }
.slot-visual img,
.slot-demo__visual img { aspect-ratio: 16 / 9; object-fit: cover; }
.slot-visual figcaption,
.slot-demo__visual figcaption {
  padding: .55rem .2rem 0;
  color: var(--slate);
  font: 700 .68rem/1.4 var(--mono);
}

.slot-summary {
  margin: 0 0 3.2rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  background: #fffaf0;
}
.slot-summary__label,
.slot-card__provider {
  margin: 0 0 .7rem !important;
  color: var(--coral);
  font: 900 .68rem/1.2 var(--mono);
  letter-spacing: .08em;
}
.slot-summary dl {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 1rem;
  background: var(--line);
}
.slot-summary dl div { min-width: 0; padding: .75rem; background: var(--white); }
.slot-summary dt,
.slot-card dt { color: var(--slate); font: 800 .64rem/1.3 var(--mono); text-transform: uppercase; }
.slot-summary dd,
.slot-card dd { margin: .35rem 0 0; font-size: .82rem; font-weight: 750; line-height: 1.35; overflow-wrap: anywhere; }
.slot-summary > p:last-child { margin: 0; color: var(--slate); font-size: .78rem; }

.slot-demo {
  margin: 3rem 0;
  padding: clamp(1rem, 3vw, 1.7rem);
  border: 1px solid var(--ink);
  background: #eef4f2;
  box-shadow: 10px 10px 0 rgba(16, 25, 39, .08);
}
.slot-demo__head h2 {
  margin: 0 0 .8rem;
  padding: 0;
  border: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}
.slot-demo__head h2::before { display: none; }
.slot-demo__head p:last-child { margin-bottom: 1rem; }
.slot-demo__visual { margin: 1rem 0 1.5rem; box-shadow: none; }
.demo-facade { min-height: 110px; display: grid; place-items: center; gap: .7rem; padding: 1.2rem; border: 1px dashed var(--teal); background: var(--white); text-align: center; }
.demo-load,
.provider-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: .75rem 1rem;
  border: 2px solid var(--ink);
  color: var(--white);
  background: var(--ink);
  font: 800 .82rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.demo-load:hover,
.provider-link:hover { color: var(--white); background: var(--teal-dark); }
.demo-note { margin: 0 !important; color: var(--slate); font-size: .74rem; }
.demo-facade iframe { width: 100%; min-height: 540px; border: 0; background: var(--ink); }
.demo-facade.is-loaded { display: block; padding: 0; border-style: solid; }

.slot-catalog { margin: 0 0 4.5rem; }
.slot-catalog__intro { max-width: 760px; margin-bottom: 1.3rem; }
.slot-catalog__intro h2 { margin: 0 0 .8rem; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; }
.slot-filters { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.3rem 0 3rem; }
.slot-filters a { padding: .55rem .8rem; border: 1px solid var(--ink); color: var(--ink); background: var(--white); font-size: .78rem; font-weight: 800; text-decoration: none; }
.slot-filters a:hover { color: var(--white); background: var(--teal-dark); }
.slot-group { margin: 3.8rem 0; scroll-margin-top: 110px; }
.slot-group > h2 { margin: 0 0 1.2rem; padding-bottom: .7rem; border-bottom: 3px solid var(--ink); font-size: clamp(1.6rem, 3vw, 2.25rem); }
.slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.slot-card { min-width: 0; border: 1px solid var(--line); background: var(--white); box-shadow: 0 12px 30px rgba(16, 25, 39, .08); }
.slot-card__image { display: block; overflow: hidden; background: var(--ink); }
.slot-card__image img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .2s ease; }
.slot-card__image:hover img { transform: scale(1.025); }
.slot-card__body { padding: 1rem; }
.slot-card h3 { margin: 0 0 .65rem; font-size: 1.4rem; line-height: 1.15; }
.slot-card h3 a { color: var(--ink); text-decoration: none; }
.slot-card h3 a:hover { color: var(--teal-dark); text-decoration: underline; }
.slot-card__body > p:not(.slot-card__provider) { min-height: 3.2em; margin: 0 0 1rem; color: var(--slate); font-size: .82rem; line-height: 1.55; }
.slot-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; background: var(--line); }
.slot-card dl div { min-width: 0; padding: .65rem; background: #f6f1e8; }

.toc {
  position: sticky;
  top: 105px;
  padding: 1.1rem 0 1.1rem 1.1rem;
  border-left: 2px solid var(--teal);
}
.toc strong { display: block; margin-bottom: .8rem; font: 800 .72rem/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: item; }
.toc li { position: relative; margin: .62rem 0; padding-left: 1.9rem; counter-increment: item; }
.toc li::before { position: absolute; left: 0; color: var(--amber); content: counter(item, decimal-leading-zero); font: 700 .65rem/1.8 var(--mono); }
.toc a { color: var(--slate); font-size: .82rem; line-height: 1.35; text-decoration: none; }
.toc a:hover { color: var(--teal-dark); text-decoration: underline; }

.page-end {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  margin-top: 4rem;
  padding: 1.5rem;
  border-top: 4px solid var(--ink);
  background: var(--paper-deep);
}
.page-end p { margin: 0; font-size: .82rem; }
.page-end code { font-size: .76rem; }
.back-top { font-weight: 800; }

.site-footer { color: #dbe2e8; background: var(--ink); }
.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 3rem;
  width: min(100% - 2rem, 1180px);
  margin: auto;
  padding: 4rem 0 2rem;
}
.footer-inner h2 { margin: 0 0 .9rem; color: var(--white); font-size: 1.5rem; }
.footer-inner h3 { margin: 0 0 .9rem; color: #9ed9d0; font: 800 .72rem/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.footer-inner p { max-width: 45ch; color: #b9c5cf; font-size: .86rem; }
.footer-links { display: grid; gap: .6rem; }
.footer-links a { color: #edf5f4; font-size: .86rem; }
.footer-base {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  width: min(100% - 2rem, 1180px);
  margin: auto;
  padding: 1.2rem 0 2rem;
  border-top: 1px solid rgba(255,255,255,.18);
  color: #9dadb9;
  font: .7rem/1.5 var(--mono);
}

.not-found {
  min-height: 65vh;
  display: grid;
  place-items: center;
  text-align: center;
}
.not-found h1 { margin-inline: auto; }

@media (max-width: 980px) {
  .header-inner { grid-template-columns: 1fr auto; }
  .desktop-nav { display: none; }
  .nav-details { display: block; }
  .nav-details summary {
    min-width: 44px;
    min-height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
  }
  .nav-details summary::-webkit-details-marker { display: none; }
  .mobile-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 1rem;
    left: 1rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    padding: 1px;
    border: 1px solid var(--ink);
    background: var(--ink);
    box-shadow: var(--shadow);
  }
  .mobile-nav a {
    min-height: 54px;
    display: flex;
    align-items: center;
    padding: .85rem 1rem;
    color: var(--ink);
    background: var(--white);
    font-weight: 750;
    text-decoration: none;
  }
  .scope-badge { display: none; }
  .article-layout { grid-template-columns: 1fr; }
  .toc { position: static; grid-row: 1; padding: 1rem; border: 1px solid var(--line); background: var(--white); }
  .toc ol { columns: 2; column-gap: 2rem; }
  .case-entry { grid-template-columns: repeat(2, 1fr); }
  .slot-summary dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { font-size: .97rem; }
  .preview-bar__inner { display: block; }
  .preview-bar__inner span:last-child { display: none; }
  .header-inner { min-height: 64px; gap: 1rem; }
  .brand small { display: none; }
  .article-head, .article-head.no-image {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 2.3rem;
    padding: 2.5rem 0 2rem;
  }
  h1 { font-size: clamp(2.45rem, 12vw, 4rem); max-width: 20ch; }
  .hero-figure { width: calc(100% - .7rem); margin-left: .7rem; }
  .article-layout { padding-bottom: 4rem; }
  .article-body h2 { margin-top: 3rem; }
  .support-figure { grid-template-columns: 1fr; }
  .support-figure figcaption { padding: .45rem; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-base { display: block; }
  .footer-base span { display: block; margin-top: .4rem; }
  .slot-summary dl { grid-template-columns: 1fr 1fr; }
  .demo-facade iframe { min-height: 430px; }
}

@media (max-width: 520px) {
  .shell, .header-inner, .preview-bar__inner, .footer-inner, .footer-base { width: min(100% - 1.25rem, 1180px); }
  .brand { font-size: .98rem; }
  .mobile-nav { right: .625rem; left: .625rem; grid-template-columns: 1fr; }
  .breadcrumbs { font-size: .72rem; }
  .case-entry { grid-template-columns: 1fr; }
  .case-entry a { min-height: 130px; }
  .case-entry strong { margin-top: 1.4rem; }
  .toc ol { columns: 1; }
  .short-answer { padding: 3.2rem 1rem 1.1rem; }
  .short-answer::before { top: 1rem; left: 1rem; }
  .method-visual { margin: 1.2rem 0 2.4rem; box-shadow: 5px 5px 0 rgba(15, 118, 110, .14); }
  .page-end { grid-template-columns: 1fr; }
  .slot-grid { grid-template-columns: 1fr; }
  .slot-summary dl { grid-template-columns: 1fr; }
  .slot-card__body > p:not(.slot-card__provider) { min-height: 0; }
  .demo-facade iframe { min-height: 62vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .preview-bar, .site-header, .toc, .site-footer, .back-top { display: none !important; }
  body { background: #fff; color: #000; }
  .article-head, .article-layout { display: block; }
  .hero-figure { max-width: 500px; box-shadow: none; }
  a { color: #000; }
}
