/* Lyotic documentation site. Built on the system itself: tokens, morph and
   components are imported, then the site adds only page layout. */
@import url("../../packages/tokens/dist/lyotic.css");
@import url("../../packages/morph/src/morph.css");
@import url("../../packages/components/src/components.css");

@font-face { font-family: "Aeonik"; src: url("../../assets/fonts/aeonik/Aeonik-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Aeonik"; src: url("../../assets/fonts/aeonik/Aeonik-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Aeonik"; src: url("../../assets/fonts/aeonik/Aeonik-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../../assets/fonts/GeistMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../../assets/fonts/GeistMono-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--ly-bg);
  color: var(--ly-ink);
  font-family: var(--ly-font-text);
  font-size: var(--ly-t-body-m);
  line-height: var(--ly-lh-prose);
  letter-spacing: var(--ly-ls-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; }
a { color: inherit; text-decoration-color: var(--ly-hairline-strong); text-underline-offset: 3px; transition: text-decoration-color var(--ly-dur-quick) ease; }
@media (hover: hover) and (pointer: fine) { a:hover { text-decoration-color: currentColor; } }
:focus-visible { outline: var(--ly-focus-width) solid var(--ly-focus-ring); outline-offset: var(--ly-focus-offset); border-radius: 4px; }
::selection { background: var(--ly-accent-soft); }

/* ---- top bar ------------------------------------------------------------- */

.s-top {
  position: sticky;
  top: 0;
  z-index: var(--ly-z-sticky);
  display: flex;
  align-items: center;
  gap: var(--ly-space-4);
  height: 56px;
  padding: 0 var(--ly-space-5);
  background: color-mix(in srgb, var(--ly-bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--ly-hairline-faint);
}
.s-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: var(--ly-w-medium); letter-spacing: -0.02em; font-size: 17px; }
.s-brand__mark { width: 22px; height: 22px; }
.s-brand__ver { font-family: var(--ly-font-mono); font-size: 11px; color: var(--ly-muted); letter-spacing: 0; font-weight: 400; }
.s-sections { display: flex; gap: 2px; margin: 0 0 0 var(--ly-space-4); padding: 0; list-style: none; }
.s-sections a { display: block; padding: 6px 10px; border-radius: var(--ly-radius-2); font-size: 14px; color: var(--ly-ink-soft); text-decoration: none; transition: background-color var(--ly-dur-quick) ease, color var(--ly-dur-quick) ease; }
.s-sections a[aria-current="true"] { color: var(--ly-ink); background: var(--ly-bg-tinted); }
@media (hover: hover) and (pointer: fine) { .s-sections a:hover { color: var(--ly-ink); background: var(--ly-bg-tinted); } }
.s-top__end { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.s-icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid transparent; border-radius: var(--ly-radius-full); background: transparent; color: var(--ly-ink-soft); cursor: pointer;
  transition: transform var(--ly-dur-press) var(--ly-ease-out), background-color var(--ly-dur-quick) ease, color var(--ly-dur-quick) ease;
}
.s-icon-btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .s-icon-btn:hover { background: var(--ly-bg-tinted); color: var(--ly-ink); } }
.s-icon-btn svg { width: 18px; height: 18px; }
.s-menu-btn { display: none; }

/* ---- layout -------------------------------------------------------------- */

.s-scrim { display: none; }
.s-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); max-width: 1480px; margin: 0 auto; }
.s-nav {
  position: sticky; top: 56px; align-self: start;
  height: calc(100dvh - 56px); overflow-y: auto; overscroll-behavior: contain;
  padding: var(--ly-space-5) var(--ly-space-3) var(--ly-space-7) var(--ly-space-5);
  font-size: 14px;
  scrollbar-width: thin;
}
.s-nav__group { margin: 0 0 var(--ly-space-5); }
.s-nav__title { margin: 0 0 6px; padding: 0 10px; font-size: var(--ly-t-micro); font-weight: var(--ly-w-medium); letter-spacing: var(--ly-ls-eyebrow); text-transform: uppercase; color: var(--ly-muted); }
.s-nav ul { margin: 0; padding: 0; list-style: none; }
.s-nav a { position: relative; display: block; padding: 5px 10px; border-radius: var(--ly-radius-2); color: var(--ly-ink-soft); text-decoration: none; line-height: 1.4; transition: background-color var(--ly-dur-quick) ease, color var(--ly-dur-quick) ease; }
.s-nav a[aria-current="page"] { color: var(--ly-ink); background: var(--ly-bg-tinted); font-weight: var(--ly-w-medium); }
@media (hover: hover) and (pointer: fine) { .s-nav a:hover { color: var(--ly-ink); background: var(--ly-bg-tinted); } }

.s-main { min-width: 0; padding: var(--ly-space-7) var(--ly-space-6) var(--ly-space-9); display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: var(--ly-space-7); }
.s-main--wide { grid-template-columns: minmax(0, 1fr); }
.s-toc { position: sticky; top: 88px; align-self: start; font-size: 13px; max-height: calc(100dvh - 120px); overflow: auto; }
.s-toc p { margin: 0 0 8px; font-size: var(--ly-t-micro); font-weight: var(--ly-w-medium); letter-spacing: var(--ly-ls-eyebrow); text-transform: uppercase; color: var(--ly-muted); }
.s-toc ul { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--ly-hairline); }
.s-toc a { display: block; padding: 3px 0 3px 12px; margin-left: -1px; border-left: 1px solid transparent; color: var(--ly-muted); text-decoration: none; line-height: 1.45; transition: color var(--ly-dur-quick) ease, border-color var(--ly-dur-quick) ease; }
.s-toc a[aria-current="true"] { color: var(--ly-ink); border-left-color: var(--ly-ink); }

@media (max-width: 1200px) {
  .s-main { grid-template-columns: minmax(0, 1fr); }
  .s-toc { display: none; }
}
@media (max-width: 960px) {
  .s-sections { display: none; }
  .s-menu-btn { display: inline-grid; }
  .s-layout { grid-template-columns: minmax(0, 1fr); }
  .s-nav {
    position: fixed; inset: 56px auto 0 0; z-index: var(--ly-z-overlay); width: min(320px, 86vw); height: auto;
    background: var(--ly-surface); border-right: 1px solid var(--ly-hairline); box-shadow: var(--ly-shadow-3);
    transform: translateX(-100%); visibility: hidden;
    transition: transform 200ms var(--ly-ease-drawer), visibility 0s linear 200ms;
  }
  .s-nav[data-open="true"] { transform: none; visibility: visible; transition: transform 280ms var(--ly-ease-drawer), visibility 0s; }
  .s-scrim { display: block; position: fixed; inset: 56px 0 0; z-index: calc(var(--ly-z-overlay) - 1); background: hsl(0 0% 0% / 0.24); opacity: 0; pointer-events: none; transition: opacity 200ms var(--ly-ease-out); }
  .s-scrim[data-open="true"] { opacity: 1; pointer-events: auto; }
  .s-main { padding: var(--ly-space-6) var(--ly-space-4) var(--ly-space-8); }
  .s-top { padding: 0 var(--ly-space-3) 0 var(--ly-space-2); gap: var(--ly-space-2); }
}

/* ---- document ------------------------------------------------------------ */

.doc { min-width: 0; max-width: 780px; }
.s-main--wide .doc { max-width: 1120px; }
.doc > * + * { margin-top: var(--ly-space-5); }
.doc-head { margin-bottom: var(--ly-space-7); }
.doc-head .eyebrow { margin: 0 0 var(--ly-space-3); }
:where(.doc) h1:not(:where(.demo *)) { margin: 0; font-size: var(--ly-t-display-l); line-height: var(--ly-lh-snug); letter-spacing: var(--ly-ls-tight); font-weight: var(--ly-w-medium); }
:where(.doc) h2:not(:where(.demo *)) { margin: var(--ly-space-8) 0 var(--ly-space-3); font-size: var(--ly-t-title-l); line-height: var(--ly-lh-normal); letter-spacing: var(--ly-ls-snug); font-weight: var(--ly-w-medium); }
:where(.doc) h3:not(:where(.demo *)) { margin: var(--ly-space-6) 0 var(--ly-space-2); font-size: var(--ly-t-title-m); line-height: var(--ly-lh-normal); letter-spacing: var(--ly-ls-normal); font-weight: var(--ly-w-medium); }
:where(.doc) h4:not(:where(.demo *)) { margin: var(--ly-space-5) 0 var(--ly-space-2); font-size: var(--ly-t-body-m); font-weight: var(--ly-w-medium); }
:where(.doc) :is(h2, h3, h4):not(:where(.demo *)) + * { margin-top: 0; }
:where(.doc) :is(p, li):not(:where(.demo *, .ly-wos *)) { color: var(--ly-ink-soft); max-width: 68ch; }
:where(.doc) :is(p, li):not(:where(.demo *)) strong { color: var(--ly-ink); font-weight: var(--ly-w-medium); }
:where(.doc) :is(ul, ol):not(:where(.demo *, .ly-wos *)) { padding-left: 1.2em; }
:where(.doc) li:not(:where(.demo *)) + li { margin-top: 6px; }
.lede { font-size: var(--ly-t-body-l); line-height: var(--ly-lh-relaxed); color: var(--ly-ink-soft); margin: var(--ly-space-4) 0 0; max-width: 60ch; }
.eyebrow { font-size: var(--ly-t-eyebrow); font-weight: var(--ly-w-medium); letter-spacing: var(--ly-ls-eyebrow); text-transform: uppercase; color: var(--ly-muted); }
:where(.doc) :is(code, kbd):not(:where(.demo *, .ly-wos *)) { font-family: var(--ly-font-mono); font-size: 0.86em; padding: 1px 5px; border-radius: var(--ly-radius-1); background: var(--ly-bg-tinted); border: 1px solid var(--ly-hairline-faint); color: var(--ly-ink); letter-spacing: 0; }
:where(.doc) hr { border: 0; border-top: 1px solid var(--ly-hairline); margin: var(--ly-space-7) 0; }

/* Code blocks */
.code { position: relative; margin: var(--ly-space-4) 0; }
.code pre {
  margin: 0; padding: var(--ly-space-4) var(--ly-space-5); overflow-x: auto;
  font-family: var(--ly-font-mono); font-size: 13px; line-height: 1.6; letter-spacing: 0;
  background: var(--ly-surface); border: 1px solid var(--ly-hairline); border-radius: var(--ly-radius-3); color: var(--ly-ink);
  tab-size: 2;
}
.code pre code { padding: 0; border: 0; background: none; font-size: inherit; }
.code__copy { position: absolute; top: 8px; right: 8px; min-height: 28px; padding: 4px 10px; font-size: 12px; opacity: 0; transition: opacity var(--ly-dur-quick) var(--ly-ease-out), transform var(--ly-dur-press) var(--ly-ease-out); }
.code:focus-within .code__copy { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .code:hover .code__copy { opacity: 1; } }
@media (hover: none) { .code__copy { opacity: 1; } }
.tok-c { color: var(--ly-muted); }
.tok-s { color: var(--ly-good); }
.tok-k { color: var(--ly-accent-text); }

/* Callouts: rules the system enforces */
.rule { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--ly-space-3); padding: var(--ly-space-4) var(--ly-space-5); border: 1px solid var(--ly-hairline); border-radius: var(--ly-radius-3); background: var(--ly-surface); }
.rule__id { grid-row: span 2; font-family: var(--ly-font-mono); font-size: 12px; color: var(--ly-muted); padding-top: 2px; }
.rule__text { margin: 0; color: var(--ly-ink) !important; font-weight: var(--ly-w-medium); }
.rule__why { margin: 0; font-size: var(--ly-t-body-s); }
.rules { display: grid; gap: var(--ly-space-2); }

.dodont { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--ly-space-4); }
.dodont > figure { margin: 0; display: grid; gap: var(--ly-space-3); align-content: start; }
.dodont__stage { padding: var(--ly-space-5); border-radius: var(--ly-radius-3); background: var(--ly-bg-tinted); border: 1px solid var(--ly-hairline-faint); min-height: 120px; display: grid; place-items: center; }
.dodont figcaption { font-size: var(--ly-t-body-s); color: var(--ly-ink-soft); border-top: 2px solid var(--ly-good); padding-top: var(--ly-space-2); }
.dodont figure.dont figcaption { border-top-color: var(--ly-bad); }
.dodont figcaption strong { display: block; color: var(--ly-ink); font-weight: var(--ly-w-medium); }

/* Tables in prose */
.s-table { width: 100%; border-collapse: collapse; font-size: var(--ly-t-body-s); margin: var(--ly-space-4) 0; }
.s-table-wrap { overflow-x: auto; margin: var(--ly-space-4) 0; }
.s-table-wrap .s-table { margin: 0; }
.s-table th, .s-table td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--ly-hairline-faint); color: var(--ly-ink-soft); }
.s-table thead th { font-size: var(--ly-t-micro); font-weight: var(--ly-w-medium); letter-spacing: var(--ly-ls-eyebrow); text-transform: uppercase; color: var(--ly-muted); border-bottom-color: var(--ly-hairline); white-space: nowrap; }
.s-table tbody th { color: var(--ly-ink); font-weight: var(--ly-w-medium); white-space: nowrap; }
.s-table td code { white-space: nowrap; }

/* Cards / tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--ly-space-3); padding: 0; list-style: none; }
.tile { position: relative; display: grid; gap: 6px; align-content: start; padding: var(--ly-space-4) var(--ly-space-5) var(--ly-space-5); border: 1px solid var(--ly-hairline); border-radius: var(--ly-radius-4); background: var(--ly-surface); text-decoration: none; min-height: 132px; transition: border-color var(--ly-dur-quick) ease, transform var(--ly-dur-press) var(--ly-ease-out), box-shadow var(--ly-dur-base) ease; }
.tile:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .tile:hover { border-color: var(--ly-hairline-strong); box-shadow: var(--ly-shadow-2); } }
.tile__eyebrow { font-size: var(--ly-t-micro); letter-spacing: var(--ly-ls-eyebrow); text-transform: uppercase; color: var(--ly-muted); font-weight: var(--ly-w-medium); }
.tile__title { font-size: var(--ly-t-title-m); font-weight: var(--ly-w-medium); letter-spacing: var(--ly-ls-snug); color: var(--ly-ink); line-height: 1.3; }
.tile__text { font-size: var(--ly-t-body-s); color: var(--ly-ink-soft); line-height: 1.5; }
.tile__preview { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--ly-space-2); min-height: 28px; align-items: center; }

/* Demo frames */
.demo { margin: var(--ly-space-5) 0; border: 1px solid var(--ly-hairline); border-radius: var(--ly-radius-5); background: var(--ly-bg-tinted); overflow: hidden; }
.demo__stage { padding: var(--ly-space-6) var(--ly-space-5); display: grid; gap: var(--ly-space-4); }
.demo__stage--center { place-items: center; }
.demo__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ly-space-2) var(--ly-space-3); padding: var(--ly-space-3) var(--ly-space-4); border-top: 1px solid var(--ly-hairline); background: var(--ly-surface); font-size: var(--ly-t-body-s); }
.demo__bar .grow { flex: 1; }
.demo__caption { font-size: var(--ly-t-body-s); color: var(--ly-muted); margin: 0; }
.demo--bleed { margin-left: calc(-1 * var(--ly-space-5)); margin-right: calc(-1 * var(--ly-space-5)); }
@media (max-width: 960px) { .demo--bleed { margin-left: 0; margin-right: 0; } .demo__stage { padding: var(--ly-space-4) var(--ly-space-3); } }

/* Segmented control, used by demos */
.seg { display: inline-flex; padding: 2px; border-radius: var(--ly-radius-3); background: var(--ly-bg-tinted); border: 1px solid var(--ly-hairline-faint); position: relative; isolation: isolate; }
.seg button { position: relative; z-index: 1; min-height: 28px; padding: 4px 10px; border: 0; background: transparent; color: var(--ly-ink-soft); font: inherit; font-size: 13px; font-weight: var(--ly-w-medium); border-radius: calc(var(--ly-radius-3) - 2px); cursor: pointer; transition: color var(--ly-dur-quick) ease; }
.seg button[aria-pressed="true"] { color: var(--ly-ink); }
.seg__thumb { position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 0; border-radius: calc(var(--ly-radius-3) - 2px); background: var(--ly-surface); box-shadow: var(--ly-shadow-1), 0 0 0 1px var(--ly-hairline-faint); transition: transform 200ms var(--ly-ease-out); }
@media (prefers-reduced-motion: reduce) { .seg__thumb { transition: none; } }

/* Range */
.s-range { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ly-ink-soft); }
.s-range input { accent-color: var(--ly-ink); }
.s-range input[type="range"] { width: 120px; }
.s-range output { font-family: var(--ly-font-mono); font-size: 12px; min-width: 4ch; color: var(--ly-ink); }

/* Footer, pager */
.s-pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ly-space-3); margin-top: var(--ly-space-9); }
.s-pager a { display: grid; gap: 2px; padding: var(--ly-space-3) var(--ly-space-4); border: 1px solid var(--ly-hairline); border-radius: var(--ly-radius-3); text-decoration: none; transition: border-color var(--ly-dur-quick) ease; }
.s-pager a span { font-size: var(--ly-t-micro); color: var(--ly-muted); text-transform: uppercase; letter-spacing: var(--ly-ls-eyebrow); }
.s-pager a[rel="next"] { text-align: right; grid-column: 2; }
@media (hover: hover) and (pointer: fine) { .s-pager a:hover { border-color: var(--ly-hairline-strong); } }
.s-foot { margin-top: var(--ly-space-8); padding-top: var(--ly-space-5); border-top: 1px solid var(--ly-hairline-faint); font-size: var(--ly-t-body-s); color: var(--ly-muted); display: flex; flex-wrap: wrap; gap: var(--ly-space-2) var(--ly-space-5); }
.s-foot a { color: var(--ly-ink-soft); }

.s-skip { position: absolute; left: 12px; top: -48px; z-index: calc(var(--ly-z-sticky) + 1); padding: 8px 12px; border-radius: var(--ly-radius-2); background: var(--ly-ink); color: var(--ly-bg); text-decoration: none; }
.s-skip:focus { top: 8px; }

/* Plan inspector (used by the case walk) */
.inspector { display: grid; gap: var(--ly-space-3); align-content: start; font-size: 13px; }
.inspector__block { padding: var(--ly-space-3) var(--ly-space-4); border: 1px solid var(--ly-hairline); border-radius: var(--ly-radius-3); background: var(--ly-surface); }
.inspector__block h4 { margin: 0 0 8px; font-size: var(--ly-t-micro); font-weight: var(--ly-w-medium); letter-spacing: var(--ly-ls-eyebrow); text-transform: uppercase; color: var(--ly-muted); }
.inspector dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.inspector dt { color: var(--ly-muted); }
.inspector dd { margin: 0; font-family: var(--ly-font-mono); font-size: 12px; color: var(--ly-ink); overflow-wrap: anywhere; }
.inspector ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.inspector li { display: flex; gap: 8px; align-items: baseline; font-family: var(--ly-font-mono); font-size: 12px; }
.inspector li[data-allowed="false"] { color: var(--ly-muted); text-decoration: line-through; text-decoration-color: var(--ly-hairline-strong); }
.inspector li .why { font-family: var(--ly-font-text); color: var(--ly-muted); text-decoration: none; display: inline; }
.inspector .ok { color: var(--ly-good); }
.inspector .bad { color: var(--ly-bad); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-family: var(--ly-font-mono); font-size: 11px; padding: 1px 6px; border-radius: var(--ly-radius-1); background: var(--ly-bg-tinted); color: var(--ly-ink-soft); border: 1px solid var(--ly-hairline-faint); }
.chip--struck { text-decoration: line-through; color: var(--ly-muted); }

/* Case walk layout */
.walk { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--ly-space-5); align-items: start; }
@media (max-width: 1100px) { .walk { grid-template-columns: minmax(0, 1fr); } }
.steps { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.steps button {
  display: grid; gap: 2px; min-width: 88px; padding: 8px 10px; text-align: left;
  border: 1px solid transparent; border-radius: var(--ly-radius-3); background: transparent; color: var(--ly-muted);
  font: inherit; font-size: 12px; line-height: 1.3; cursor: pointer;
  transition: background-color var(--ly-dur-quick) ease, color var(--ly-dur-quick) ease, border-color var(--ly-dur-quick) ease, transform var(--ly-dur-press) var(--ly-ease-out);
}
.steps button:active { transform: scale(0.97); }
.steps button b { font-family: var(--ly-font-mono); font-weight: 400; font-size: 11px; }
.steps button[aria-current="step"] { color: var(--ly-ink); background: var(--ly-surface); border-color: var(--ly-hairline); }
.steps button[data-past="true"] { color: var(--ly-ink-soft); }
@media (hover: hover) and (pointer: fine) { .steps button:hover { color: var(--ly-ink); } }

/* Home */
.hero { display: grid; gap: var(--ly-space-6); padding: var(--ly-space-6) 0 var(--ly-space-7); }
.hero h1 { font-size: var(--ly-t-display-xl); line-height: var(--ly-lh-tight); letter-spacing: -0.03em; max-width: 14ch; }
.hero .lede { font-size: clamp(17px, 1.6vw, 20px); max-width: 56ch; }
.hero__cta { display: flex; gap: var(--ly-space-2); flex-wrap: wrap; }
.hero__cta a { text-decoration: none; }
.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--ly-space-5); margin: var(--ly-space-6) 0 0; padding: 0; list-style: none; }
.principles li { max-width: none !important; display: grid; gap: 6px; align-content: start; padding-top: var(--ly-space-3); border-top: 1px solid var(--ly-hairline); }
.principles h3 { margin: 0 !important; font-size: var(--ly-t-body-l) !important; }
.principles p { margin: 0; font-size: var(--ly-t-body-s); }

/* Swatches, scales */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--ly-space-3); margin: var(--ly-space-4) 0; padding: 0; list-style: none; }
.swatch { display: grid; gap: 6px; font-size: 12px; max-width: none !important; margin: 0 !important; }
.swatch__chip { height: 56px; border-radius: var(--ly-radius-3); border: 1px solid var(--ly-hairline); }
.swatch__name { font-family: var(--ly-font-mono); color: var(--ly-ink); font-size: 11.5px; overflow-wrap: anywhere; }
.swatch__val { font-family: var(--ly-font-mono); color: var(--ly-muted); font-size: 11px; }
.scale-row { display: grid; grid-template-columns: 150px 1fr; gap: var(--ly-space-4); align-items: center; padding: 10px 0; border-bottom: 1px solid var(--ly-hairline-faint); }
.scale-row__name { font-family: var(--ly-font-mono); font-size: 12px; color: var(--ly-muted); }
.scale-row__name b { display: block; font-weight: 400; color: var(--ly-ink); }
@media (max-width: 560px) { .scale-row { grid-template-columns: 1fr; gap: 4px; } }

/* ---- demo internals ------------------------------------------------------ */

.ly-part-mode { box-sizing: border-box; }
.ly-part-surface { padding: var(--ly-space-4); border-radius: var(--ly-radius-4); background: var(--ly-surface); border: 1px solid var(--ly-hairline); box-shadow: var(--ly-shadow-1); }

.lab-holder { display: grid; place-items: center; min-height: 300px; width: 100%; }
.lab-shell > [data-ly-surface] { background: var(--ly-surface); border: 1px solid var(--ly-hairline); box-shadow: var(--ly-shadow-2); }
.lab-mode { display: grid; gap: var(--ly-space-2); padding: var(--ly-space-4) var(--ly-space-5); width: min(440px, 78vw); }
.lab-mode--compact { display: flex; align-items: center; gap: var(--ly-space-2); width: auto; padding: 8px 16px 8px 10px; white-space: nowrap; font-size: var(--ly-t-body-s); }
.lab-mode .ly-alt { padding: 8px 12px; }
.lab-card { max-width: 560px; }
.lab-input { font: inherit; font-size: 14px; padding: 9px 12px; border-radius: var(--ly-radius-3); border: 1px solid var(--ly-hairline-strong); background: var(--ly-surface); color: var(--ly-ink); width: 100%; transition: border-color var(--ly-dur-quick) ease, box-shadow var(--ly-dur-quick) ease; }
.lab-input:focus { outline: none; border-color: var(--ly-ink-soft); box-shadow: 0 0 0 3px var(--ly-focus-ring); }
.lab-nopress:active { transform: none !important; }

.ease-row { display: grid; grid-template-columns: 200px 1fr; gap: var(--ly-space-4); align-items: center; padding: 8px 0; border-bottom: 1px solid var(--ly-hairline-faint); }
@media (max-width: 560px) { .ease-row { grid-template-columns: 1fr; gap: 6px; } }
.ease-track { position: relative; height: 28px; border-radius: var(--ly-radius-full); background: var(--ly-surface); border: 1px solid var(--ly-hairline); padding: 3px; }
.ease-track--dont { border-style: dashed; border-color: var(--ly-bad-stroke); }
.ease-dot { display: block; width: 20px; height: 20px; border-radius: 50%; background: var(--ly-ink); will-change: transform; }
.ease-track--dont .ease-dot { background: var(--ly-bad); }

.dur-bar { height: 10px; border-radius: var(--ly-radius-full); background: var(--ly-surface); border: 1px solid var(--ly-hairline); overflow: hidden; }
.dur-bar__fill { display: block; height: 100%; background: var(--ly-ink); border-radius: inherit; transform-origin: left center; }

.lit-track { position: relative; width: min(360px, 100%); height: 6px; border-radius: 3px; background: var(--ly-surface); border: 1px solid var(--ly-hairline); overflow: hidden; display: flex; }
.lit-track__lit { width: 72%; background: var(--ly-accent-soft); }
.lit-track__rest { width: 28%; background: var(--ly-hairline); }
.lit-track::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--ly-ink); transform: translateX(0); opacity: 0; }
.lit-track[data-run="true"]::after { opacity: 1; animation: ly-sweep 1520ms linear forwards; }
@keyframes ly-sweep { to { transform: translateX(min(358px, calc(100vw - 80px))); } }
@media (prefers-reduced-motion: reduce) { .lit-track[data-run="true"]::after { animation: none; opacity: 0; } }

.shape-grid { display: flex; flex-wrap: wrap; gap: var(--ly-space-4); }
.shape-grid figure { margin: 0; display: grid; gap: 6px; justify-items: start; font-family: var(--ly-font-mono); font-size: 11px; color: var(--ly-muted); }
.shape-box { display: block; width: 88px; height: 64px; border: 1px solid var(--ly-hairline-strong); background: var(--ly-surface); }
.shape-box--raised { border-radius: var(--ly-radius-4); border-color: var(--ly-hairline); }

.glyph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--ly-space-2); margin: 0; padding: 0; list-style: none; }
.glyph-grid li { display: grid; justify-items: center; gap: 6px; padding: var(--ly-space-3) 0; border-radius: var(--ly-radius-3); background: var(--ly-surface); border: 1px solid var(--ly-hairline-faint); margin: 0 !important; }
.glyph-cell { --ly-glyph-cut: var(--ly-surface); color: var(--ly-ink); }
.glyph-cell .ly-glyph { width: 24px; height: 24px; }
.glyph-grid code { font-size: 11px !important; background: none !important; border: 0 !important; color: var(--ly-muted) !important; }

.role-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border: 1px solid; border-radius: var(--ly-radius-full); font-size: 12px; font-weight: 500; }

/* Until site.js frames the page, keep it from flashing unstyled. If the
   script never runs, the page reveals itself anyway. */
@media (scripting: enabled) {
  body:not([data-framed]) { opacity: 0; animation: s-reveal 0s 1.2s forwards; }
}
@keyframes s-reveal { to { opacity: 1; } }

/* ---- print edition (site/print.html) ------------------------------------- */
/* The morph is spatial; paper is not. In the print edition every shell lays
   out statically, and only the representation that is showing is printed. */
body[data-print] { background: var(--ly-surface); }
.pr-book { max-width: 760px; margin: 0 auto; padding: var(--ly-space-6) var(--ly-space-4); }
body[data-print] [data-ly-shell] { height: auto !important; width: auto !important; }
body[data-print] [data-ly-shell] > [data-ly-clip],
body[data-print] [data-ly-shell] > [data-ly-surface] { position: static; }
body[data-print] [data-ly-shell] > [data-ly-surface] { display: none; }
body[data-print] [data-ly-clip] > [data-ly-mode] { position: static; width: auto !important; }
body[data-print] [data-ly-clip] > [data-ly-mode][inert] { display: none; }
body[data-print] .demo__bar,
body[data-print] .steps,
body[data-print] .code__copy,
body[data-print] .ly-wos__toggle,
body[data-print] .s-pager,
body[data-print] .s-foot { display: none; }
body[data-print] .demo--bleed { margin-left: 0; margin-right: 0; }
body[data-print] .demo__stage { padding: var(--ly-space-4); }
body[data-print] .ly-glyph-spin { animation: none; }
.demo--print { display: grid; gap: var(--ly-space-4); padding: var(--ly-space-4); }
.pr-step { margin: 0; display: block; }
.pr-step > * + * { margin-top: var(--ly-space-2); }
.pr-step__title { break-after: avoid; }
.pr-step__title { font-size: var(--ly-t-body-s); font-weight: var(--ly-w-medium); color: var(--ly-ink); }
.pr-step__title b { font-family: var(--ly-font-mono); font-weight: 400; color: var(--ly-muted); }
.pr-step__plan { margin: 0; font-size: 10.5px; color: var(--ly-muted); overflow-wrap: anywhere; }
.pr-cover { min-height: 70vh; display: grid; align-content: center; gap: var(--ly-space-4); }
.pr-cover h1 { font-size: 56px; line-height: 1.02; letter-spacing: -0.03em; font-weight: var(--ly-w-medium); margin: 0; }
.pr-cover .lede { margin: 0; }
.pr-meta { font-family: var(--ly-font-mono); font-size: 12px; color: var(--ly-muted); }
.pr-toc h2 { font-size: var(--ly-t-title-l); font-weight: var(--ly-w-medium); margin: 0 0 var(--ly-space-4); }
.pr-toc h3 { font-size: var(--ly-t-eyebrow); letter-spacing: var(--ly-ls-eyebrow); text-transform: uppercase; color: var(--ly-muted); font-weight: var(--ly-w-medium); margin: var(--ly-space-4) 0 var(--ly-space-2); }
.pr-toc ol { margin: 0; padding-left: 1.4em; columns: 2; column-gap: var(--ly-space-6); font-size: var(--ly-t-body-s); }
.pr-toc a { color: var(--ly-ink); text-decoration: none; }
.pr-page { max-width: none; padding-top: var(--ly-space-7); }
.pr-page .doc-head { margin-bottom: var(--ly-space-5); }
.pr-page .hero h1, .pr-page h1 { font-size: 36px; }

@media print {
  @page { size: A4; margin: 16mm 14mm 18mm; }
  body[data-print] { background: #fff; }
  .pr-book { max-width: none; padding: 0; }
  .pr-cover { min-height: 240mm; break-after: page; }
  .pr-toc { break-after: page; }
  .pr-page { break-before: page; padding-top: 0; }
  .pr-page h2, .pr-page h3 { break-after: avoid; }
  /* Small units never split; a whole object may, so no step title is left
     alone at the foot of a page. */
  .pr-page .rule, .pr-page .code, .pr-page .tile, .pr-page .dodont > figure,
  .ly-claim, .ly-interp, .ly-alt, .ly-auth, .ly-impact__section, .ly-trace, .ly-verify, .ly-recovery, .ly-handoff__row, .ly-history__item, tr, .pr-step__plan, .ly-wos__head { break-inside: avoid; }
  body[data-print] [data-ly-shell] { contain: none; }
  .ly-wos { overflow: visible; }
  .pr-page .s-table-wrap { overflow: visible; }
  .pr-page .code pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .pr-page a { text-decoration: none; }
  .pr-page .tiles { grid-template-columns: repeat(2, 1fr); }
  .pr-page .walk { grid-template-columns: 1fr; }
}
/* On paper a demo is not a stage: no frame, no tint, so a figure that moves
   to the next page does not leave an empty box behind. */
body[data-print] .demo--print { background: none; border: 0; border-radius: 0; padding: 0; }

/* ---- the stage: where a Case lives (film-style app surface) -------------- */

.walk--solo { grid-template-columns: minmax(0, 1fr); }
.ly-stage { position: relative; min-width: 0; font-size: 13px; }
.ly-stage__bar { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--ly-space-3); margin: 0 0 var(--ly-space-3); }
.ly-stage__crumb { margin: 0 0 4px; font-family: var(--ly-font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ly-muted); }
.ly-stage__title { margin: 0; font-family: var(--ly-font-display); font-size: 22px; font-weight: var(--ly-w-medium); letter-spacing: var(--ly-ls-snug); color: var(--ly-ink); line-height: 1.1; }
.ly-stage__watch { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: var(--ly-radius-full); background: var(--ly-surface); box-shadow: inset 0 0 0 1px var(--ly-hairline); font-size: 12.5px; color: var(--ly-ink-soft); white-space: nowrap; }
.ly-signal { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ly-accent); }
.ly-signal::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: var(--ly-accent); opacity: 0.28; animation: ly-signal 1.1s var(--ly-ease-out) 1 both; /* One breath when the stage mounts, then still (MOT-12). */ }
@keyframes ly-signal { from { transform: scale(0.7); opacity: 0.35; } to { transform: scale(1.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ly-signal::before { animation: none; } }
.ly-stage__card { background: var(--ly-surface); border: 1px solid var(--ly-hairline); border-radius: var(--ly-radius-4); box-shadow: var(--ly-shadow-2); overflow: hidden; }
.ly-stage__table { width: 100%; }
.ly-stage__table th:first-child, .ly-stage__table td:first-child { padding-left: 18px; }
.ly-stage__table th:last-child, .ly-stage__table td:last-child { padding-right: 18px; }
.ly-stage__table td { color: var(--ly-ink); }
.ly-stage__table tr[data-focus] td { transition: background-color var(--ly-dur-settle) var(--ly-ease-out); }
.ly-stage__table tr[data-focus][data-open="true"] td { background: var(--ly-bg-tinted); }
.ly-stage__status { width: 160px; }
.ly-stage__anchor { display: block; width: 100%; height: 22px; }
@media (max-width: 720px) {
  .ly-stage .hide-sm { display: none; }
  .ly-stage__status { width: 132px; }
  /* The first column is hidden: the first visible one keeps the inset. */
  .ly-stage__table tr > .hide-sm:first-child + * { padding-left: 18px; }
}
/* INV-10/16: a phone has no room for a status column beside the numbers.
   Each row stacks its status under the product, so the glyph and the whole
   label always show (a trimmed pixel or two of padding does not hold for a
   longer label such as "Mapping verified"). */
@media (max-width: 520px) {
  .ly-stage__table, .ly-stage__table thead, .ly-stage__table tbody { display: block; }
  .ly-stage__table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: 14px; padding: 9px 14px; border-bottom: 1px solid var(--ly-hairline-faint); }
  .ly-stage__table tbody tr:last-child { border-bottom: 0; }
  .ly-stage__table thead tr { padding-block: 0; border-bottom-color: var(--ly-hairline); }
  .ly-stage__table :is(th, td), .ly-stage__table tr > .hide-sm:first-child + * { height: auto; min-height: 0; padding: 0; border: 0; white-space: normal; }
  .ly-stage__table thead th { height: 32px; display: flex; align-items: center; }
  .ly-stage__table thead th.ly-num { justify-content: flex-end; }
  .ly-stage__table thead .ly-stage__status { display: none; }
  .ly-stage__table td.ly-stage__status { grid-column: 1 / -1; width: auto; padding: 6px 0 0; }
  .ly-stage__table tr[data-focus] { transition: background-color var(--ly-dur-settle) var(--ly-ease-out); }
  .ly-stage__table tr[data-focus][data-open="true"] { background: var(--ly-bg-tinted); }
}

/* The scripted hand (autoplay only). */
.ly-hand { position: absolute; left: 0; top: 0; z-index: 60; pointer-events: none; opacity: 0; transition: opacity 200ms var(--ly-ease-out); transform-origin: 3px 3px; will-change: transform; }
.ly-hand.is-on { opacity: 1; }
.ly-hand svg { display: block; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.25)); }
/* Room for the object to open over its table without pushing the page. */
.walk .ly-stage { min-height: 680px; }
@media (max-width: 720px) { .walk .ly-stage { min-height: 640px; } }

/* Morph playground */
.lab-stage { position: relative; min-height: 360px; }
.lab-table { background: var(--ly-surface); border: 1px solid var(--ly-hairline); border-radius: var(--ly-radius-4); box-shadow: var(--ly-shadow-2); font-size: 13px; overflow: hidden; }
.lab-row { display: grid; grid-template-columns: 1.1fr 1.6fr 0.7fr 0.7fr 150px; align-items: center; gap: 12px; height: 44px; padding: 0 18px; }
.lab-row--head { height: 32px; border-bottom: 1px solid var(--ly-hairline); font-family: var(--ly-font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ly-muted); }
.lab-row__status { min-width: 0; }
.lab-pill .ly-status { background: transparent; box-shadow: none; padding: 3px 11px 3px 9px; }
.lab-card { padding: 16px 18px 18px; display: grid; gap: 8px; box-sizing: border-box; }
.lab-card--lens { width: 340px; }
.lab-card--wide { width: min(520px, calc(100vw - 64px)); }
.lab-card__title { margin: 0 0 4px; font-family: var(--ly-font-display); font-size: 16px; font-weight: var(--ly-w-medium); letter-spacing: var(--ly-ls-snug); }
.lab-line { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; min-height: 36px; border-top: 1px solid var(--ly-hairline-faint); font-size: 12.5px; }
.lab-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }
@media (max-width: 720px) { .lab-row { grid-template-columns: 1.4fr 0.7fr 128px; } .lab-row > :nth-child(1), .lab-row > :nth-child(4) { display: none; } }

/* Search (⌘K). Opens without motion: keyboard-invoked (MOT-08). */
.s-search-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 10px; margin-right: 6px; border: 1px solid var(--ly-hairline); border-radius: var(--ly-radius-3); background: var(--ly-surface); color: var(--ly-muted); font: inherit; font-size: 13px; cursor: pointer; transition: border-color var(--ly-dur-quick) ease, color var(--ly-dur-quick) ease, transform var(--ly-dur-press) var(--ly-ease-out); }
.s-search-btn:active { transform: scale(0.97); }
.s-search-btn svg { width: 16px; height: 16px; }
.s-search-btn kbd { font-family: var(--ly-font-mono); font-size: 11px; padding: 1px 5px; border-radius: var(--ly-radius-1); border: 1px solid var(--ly-hairline); color: var(--ly-muted); }
@media (hover: hover) and (pointer: fine) { .s-search-btn:hover { border-color: var(--ly-hairline-strong); color: var(--ly-ink); } }
@media (max-width: 960px) { .s-search-btn span, .s-search-btn kbd { display: none; } .s-search-btn { border-color: transparent; background: transparent; margin: 0; } }
.s-search { position: fixed; inset: 0; z-index: var(--ly-z-modal); }
.s-search[hidden] { display: none; }
.s-search__scrim { position: absolute; inset: 0; background: hsl(0 0% 0% / 0.2); }
.s-search__panel { position: relative; margin: 12vh auto 0; width: min(620px, calc(100vw - 32px)); background: var(--ly-surface); border: 1px solid var(--ly-accent); border-radius: var(--ly-radius-4); box-shadow: 0 0 0 3px var(--ly-focus-ring), var(--ly-shadow-3); overflow: hidden; }
.s-search__input { width: 100%; box-sizing: border-box; height: 52px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--ly-hairline); background: transparent; color: var(--ly-ink); font: inherit; font-size: 16px; outline: none; }
.s-search__list { list-style: none; margin: 0; padding: 6px; max-height: min(52vh, 460px); overflow-y: auto; }
.s-search__list a { display: grid; gap: 1px; padding: 9px 12px; border-radius: var(--ly-radius-3); text-decoration: none; color: var(--ly-ink); }
.s-search__list [aria-selected="true"] a { background: var(--ly-bg-tinted); }
.s-search__title { font-size: 14px; font-weight: var(--ly-w-medium); }
.s-search__where { font-family: var(--ly-font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ly-muted); }
.s-search__foot { margin: 0; padding: 8px 14px; border-top: 1px solid var(--ly-hairline-faint); font-size: 11.5px; color: var(--ly-muted); }
.s-search__foot kbd { font-family: var(--ly-font-mono); font-size: 10.5px; padding: 0 4px; margin-right: 2px; border: 1px solid var(--ly-hairline); border-radius: 3px; }
