/* ============================================================
   Chrome 150 · live feature specimens
   Plain CSS. The page itself uses the features it shows off.
   ============================================================ */

/* ---- tokens -------------------------------------------------- */
:root {
  color-scheme: light dark;

  --bg:        light-dark(#e7ebf2, #07080c);
  --surface:   light-dark(#ffffff, #0f1218);
  --surface-2: light-dark(#f1f4f9, #161a22);
  --ink:       light-dark(#0c0f16, #e9edf4);
  --muted:     light-dark(#59616f, #8a93a2);
  --line:      light-dark(#dbe1ea, #232936);
  --line-soft: light-dark(#e7ebf2, #1a202a);

  --a1: #6c5ce7;   /* violet */
  --a2: #2e9bff;   /* blue   */
  --a3: #14d2b0;   /* teal   */
  --warm: #ff6b6b;
  --ok:  #17b978;

  --spectrum: linear-gradient(115deg, var(--a1), var(--a2) 55%, var(--a3));

  --shadow:    light-dark(0 1px 2px rgba(16,20,30,.07), 0 1px 2px rgba(0,0,0,.5));
  --shadow-lg: light-dark(0 24px 55px -26px rgba(20,26,45,.30), 0 28px 64px -28px rgba(0,0,0,.85));

  --r-card: 20px;
  --r-mid: 13px;
  --maxw: 1120px;

  --f-display: "Bricolage Grotesque", system-ui, sans-serif;
  --f-body: "Inter", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
}

/* keep the page usable if light-dark() isn't supported */
@supports not (color: light-dark(#000, #fff)) {
  :root {
    --bg:#e7ebf2; --surface:#fff; --surface-2:#f1f4f9;
    --ink:#0c0f16; --muted:#59616f; --line:#dbe1ea; --line-soft:#e7ebf2;
    --shadow:0 1px 2px rgba(16,20,30,.07);
    --shadow-lg:0 24px 55px -26px rgba(20,26,45,.30);
  }
}

/* ---- reset-ish ---------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
code { font-family: var(--f-mono); }
a { color: inherit; }
button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--a2);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---- ambient backdrop --------------------------------------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vw 40vw at 78% -8%, color-mix(in oklab, var(--a1) 22%, transparent), transparent 60%),
    radial-gradient(50vw 40vw at 8% 4%, color-mix(in oklab, var(--a3) 16%, transparent), transparent 55%);
  opacity: .8;
  pointer-events: none;
}

/* ---- topbar -------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px) saturate(1.3);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -.01em;
}
.brand__mark {
  width: 18px; height: 18px; border-radius: 6px;
  background: var(--spectrum);
  box-shadow: 0 2px 8px color-mix(in oklab, var(--a1) 45%, transparent);
}
.brand__txt b { font-family: var(--f-display); font-weight: 800; }

/* theme control — a real segmented switch */
.themectl {
  position: relative;
  display: inline-flex;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.themectl__opt {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .25s;
}
.themectl__opt[aria-checked="true"] { color: #fff; }
.themectl__thumb {
  position: absolute;
  z-index: 0;
  top: 4px; bottom: 4px;
  border-radius: 999px;
  background: var(--spectrum);
  box-shadow: 0 3px 10px color-mix(in oklab, var(--a1) 40%, transparent);
  transition: left .3s cubic-bezier(.22,1,.36,1), width .3s cubic-bezier(.22,1,.36,1);
}

/* ---- hero ---------------------------------------------------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 80px; }

.hero { padding: 72px 0 40px; max-width: 940px; }
.eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 22px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 26px; height: 2px;
  vertical-align: middle;
  margin-right: 12px;
  background: var(--spectrum);
}
.hero__title {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: .95;
  margin: 0;
  /* text-fit fallback sets font-size inline; this is the pre-JS default */
  font-size: clamp(2.6rem, 9vw, 6.2rem);
  white-space: nowrap;
  background: linear-gradient(180deg, var(--ink), color-mix(in oklab, var(--ink) 62%, var(--a1)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__sub {
  max-width: 620px;
  margin: 24px 0 0;
  font-size: 17px;
  color: color-mix(in oklab, var(--ink) 78%, transparent);
}
.hero__sub b { color: var(--ink); font-weight: 600; }

/* release ruler = version nav */
.ruler__cap {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 44px 0 14px;
}
.ruler {
  position: relative;
  display: flex;
  gap: 22px;
  align-items: flex-end;
  margin-top: 0;
  padding-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 44px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 44px), transparent 100%);
}
.ruler::-webkit-scrollbar { height: 5px; }
.ruler::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.ruler .ruler__tick { flex: 0 0 auto; scroll-snap-align: center; }
a.ruler__tick {
  text-decoration: none;
  cursor: pointer;
  transition: color .2s, transform .2s;
}
a.ruler__tick:hover { color: var(--ink); transform: translateY(-2px); }
a.ruler__tick:hover::after { background: var(--a2); height: 10px; }
a.ruler__tick.is-now { transform: none; }
.ruler__line {
  position: absolute;
  left: 2px; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}
.ruler__tick {
  position: relative;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--muted);
  padding-bottom: 12px;
}
.ruler__tick::after {
  content: "";
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: 0;
  width: 1px; height: 7px;
  background: var(--line);
}
.ruler__tick.is-now {
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
}
.ruler__tick.is-now::after {
  width: 8px; height: 8px;
  border-radius: 50%;
  bottom: -3.5px;
  background: var(--spectrum);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--a2) 22%, transparent);
}
.ruler__tick.is-next { color: color-mix(in oklab, var(--muted) 70%, transparent); }
.ruler__tick.is-next.is-now { color: var(--ink); font-weight: 500; }
.ruler__tick.is-next i {
  position: absolute;      /* out of flow so the marker centers under the number */
  left: 100%;
  top: 1px;
  margin-left: 5px;
  font-style: normal;
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--a2);
}

/* ---- grid ---------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card--wide { grid-column: span 2; }
.card--full { grid-column: 1 / -1; }
@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card--wide { grid-column: span 2; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .card--wide, .card--full { grid-column: span 1; }
}

/* ---- card ---------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .35s, transform .35s, border-color .35s;

  /* load-in */
  opacity: 0;
  transform: translateY(16px);
  animation: rise .7s cubic-bezier(.22,1,.36,1) forwards;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--a2) 40%, var(--line));
}
.card:nth-child(1) { animation-delay: .02s; }
.card:nth-child(2) { animation-delay: .07s; }
.card:nth-child(3) { animation-delay: .12s; }
.card:nth-child(4) { animation-delay: .17s; }
.card:nth-child(5) { animation-delay: .22s; }
.card:nth-child(6) { animation-delay: .27s; }
.card:nth-child(7) { animation-delay: .32s; }
.card:nth-child(8) { animation-delay: .37s; }
.card:nth-child(9) { animation-delay: .42s; }

/* the featured card wears the signature gradient ring */
.card--feature {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--spectrum) border-box;
}
@keyframes rise { to { opacity: 1; transform: none; } }

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.tag {
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--a2);
  background: color-mix(in oklab, var(--a2) 12%, transparent);
  padding: 4px 9px;
  border-radius: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card__body { margin-top: auto; padding-top: 16px; }
.card__title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.015em;
  margin: 0 0 6px;
}
.card__desc { margin: 0; font-size: 13.5px; color: var(--muted); }
.card__desc code {
  font-size: 12px;
  color: var(--ink);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 5px;
}

/* ---- support pill ------------------------------------------- */
.pill {
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 9px 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.pill.is-yes { color: var(--ok);   border-color: color-mix(in oklab, var(--ok) 40%, var(--line)); background: color-mix(in oklab, var(--ok) 9%, transparent); }
.pill.is-no  { color: var(--warm); border-color: color-mix(in oklab, var(--warm) 40%, var(--line)); background: color-mix(in oklab, var(--warm) 9%, transparent); }
.pill.is-partial { color: var(--a2); border-color: color-mix(in oklab, var(--a2) 40%, var(--line)); background: color-mix(in oklab, var(--a2) 9%, transparent); }

/* ---- demo shell --------------------------------------------- */
.card__demo {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-mid);
  padding: 18px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
}

.btn {
  align-self: flex-start;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .2s, transform .1s, background .2s;
}
.btn:hover { border-color: var(--a2); }
.btn:active { transform: translateY(1px); }

.hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.hint__grip {
  font-family: var(--f-mono);
  color: var(--a2);
  margin-right: 4px;
}
kbd {
  font-family: var(--f-mono);
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
}

/* ── 1 · text-fit ─────────────────────────────────────────── */
.demo-fit { justify-content: space-between; }
.fitwrap {
  display: flex;
  align-items: center;
  min-height: 90px;
  overflow: hidden;
}
.fitline {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  background: var(--spectrum);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field__lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 12px;
}
.field input:focus-visible { outline-offset: 0; border-color: var(--a2); }

/* ── 2 · background-clip: border-area ─────────────────────── */
.demo-border { flex-direction: row; }
.ba {
  flex: 1;
  min-height: 108px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border: 5px solid transparent;
}
.ba span { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }

/* Preferred: clip the gradient to the border strokes (respects border-style). */
@supports (background: linear-gradient(red, red) border-area) {
  .ba--solid {
    border-style: solid;
    background:
      linear-gradient(var(--surface), var(--surface)) padding-box,
      var(--spectrum) border-area;
  }
  .ba--dashed {
    border-style: dashed;
    background:
      linear-gradient(var(--surface), var(--surface)) padding-box,
      var(--spectrum) border-area;
  }
}
/* Fallback: the classic border-box trick — solid ring only, no dashes. */
@supports not (background: linear-gradient(red, red) border-area) {
  .ba {
    border-style: solid;
    background:
      linear-gradient(var(--surface), var(--surface)) padding-box,
      var(--spectrum) border-box;
  }
  .ba--dashed { opacity: .5; }
  .ba--dashed span::after { content: " (needs 150)"; color: var(--warm); }
}

/* ── 3 · zoom ─────────────────────────────────────────────── */
.demo-zoom { align-items: flex-start; }
.zoomstage {
  width: 100%;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: var(--surface);
}
.zoomtile {
  margin: 0;
  width: 78px;
  zoom: 1;
  transition: zoom .5s cubic-bezier(.22,1,.36,1);
  text-align: center;
}
.zoomtile.is-zoomed { zoom: 1.9; }
.zoomtile__scene {
  display: block;
  width: 78px; height: 60px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 30% 30%, #fff6, transparent 40%),
    var(--spectrum);
  box-shadow: 0 6px 16px color-mix(in oklab, var(--a1) 35%, transparent);
}
.zoomtile figcaption {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--muted);
  margin-top: 5px;
}

/* ── 4 · image() ──────────────────────────────────────────── */
.demo-image { justify-content: center; }
.swatches {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.swatches li {
  aspect-ratio: 1;
  border-radius: 10px;
  background-color: var(--c);              /* fallback */
  background-image: image(var(--c));       /* Chrome 150 */
  display: grid;
  align-items: end;
  padding: 6px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.swatches span {
  font-family: var(--f-mono);
  font-size: 9px;
  color: #0009;
  background: #ffffffcc;
  border-radius: 4px;
  padding: 0 3px;
}

/* ── 5 · polygon(round) ───────────────────────────────────── */
.demo-poly { align-items: center; }
.polyshape {
  width: 130px; height: 108px;
  background: var(--spectrum);
  box-shadow: 0 10px 26px -8px color-mix(in oklab, var(--a1) 45%, transparent);
  clip-path: polygon(round 16px, 50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%);
  transition: clip-path .3s;
}
.polyshape.is-sharp {
  clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%);
}
@supports not (clip-path: polygon(round 10px, 0 0, 100% 0, 50% 100%)) {
  .polyshape { clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); }
}

/* ── 6 · container queries ────────────────────────────────── */
.demo-cq { align-items: stretch; }
.cqbox {
  container-type: inline-size;
  container-name: ticket;
  width: 260px;
  min-width: 190px;
  max-width: 100%;
  resize: horizontal;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
}
.ticket {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ticket__media {
  height: 66px;
  border-radius: 9px;
  background: var(--spectrum);
  flex-shrink: 0;
}
.ticket__k { margin: 0; font-size: 11px; color: var(--muted); font-family: var(--f-mono); }
.ticket__v { margin: 2px 0; font-family: var(--f-display); font-weight: 700; font-size: 20px; letter-spacing: -.02em; }

/* comma-separated: the range form, plus a legacy fallback query */
@container ticket (width >= 22rem), ticket (min-width: 352px) {
  .ticket { flex-direction: row; align-items: center; }
  .ticket__media { width: 88px; height: 72px; }
}

/* ── 7 · flex-wrap: balance ───────────────────────────────── */
.demo-flex { align-items: flex-start; }
.chips {
  display: flex;
  flex-wrap: balance;
  gap: 7px;
  width: 100%;
}
.chips.is-plain { flex-wrap: wrap; }
.chips span {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}

/* ── 8 · light-dark() image ───────────────────────────────── */
.demo-ld { align-items: stretch; }
.scene {
  height: 118px;
  border-radius: 12px;
  border: 1px solid var(--line);
  /* Chrome 150: swap the actual image by scheme */
  background-image: light-dark(
    radial-gradient(circle at 74% 30%, #ffe89a 0 9%, transparent 10%),
    radial-gradient(circle at 24% 28%, #fdfcf5 0 6%, transparent 7%)
  ), light-dark(
    linear-gradient(180deg, #8fd3ff 0%, #cdeaff 62%, #eafff2 100%),
    linear-gradient(180deg, #0b1030 0%, #1b2350 60%, #3a2b63 100%)
  );
  background-size: cover;
  position: relative;
  overflow: hidden;
}
.scene::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 34%;
  background: light-dark(
    linear-gradient(180deg, transparent, #37a06740),
    linear-gradient(180deg, transparent, #10163a)
  );
}
/* Fallback: follow prefers-color-scheme with the same two scenes */
@supports not (background-image: light-dark(url(a), url(b))) {
  .scene {
    background-image:
      radial-gradient(circle at 74% 30%, #ffe89a 0 9%, transparent 10%),
      linear-gradient(180deg, #8fd3ff 0%, #cdeaff 62%, #eafff2 100%);
  }
  @media (prefers-color-scheme: dark) {
    .scene {
      background-image:
        radial-gradient(circle at 24% 28%, #fdfcf5 0 6%, transparent 7%),
        linear-gradient(180deg, #0b1030 0%, #1b2350 60%, #3a2b63 100%);
    }
  }
}

/* ── 9 · focusgroup toolbar ───────────────────────────────── */
.demo-fg { align-items: flex-start; }
.toolbar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  flex-wrap: wrap;
}
.toolbar button {
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  transition: background .18s, border-color .18s;
}
.toolbar button:hover { background: var(--surface-2); }
.toolbar button:focus-visible {
  outline: none;
  border-color: var(--a2);
  background: color-mix(in oklab, var(--a2) 14%, transparent);
}
.toolbar button.is-on {
  background: var(--spectrum);
  color: #fff;
}
.toolbar__sep {
  width: 1px; height: 22px;
  background: var(--line);
  margin: 0 3px;
}

/* ---- footer -------------------------------------------------- */
.foot {
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  align-items: baseline;
}
.foot__meta { margin: 0; max-width: 640px; font-size: 12.5px; color: var(--muted); }
.foot__meta code { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink); }
.foot__links { margin: 0; display: flex; gap: 20px; flex-shrink: 0; }
.foot__links a {
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--a2);
}
.foot__links a:hover { text-decoration: underline; }

/* ============================================================
   Shared demo helpers (used by 147–149 pages)
   ============================================================ */
.kv { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: 100%; }
.kv li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface);
}
.kv .k { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-family: var(--f-mono); }
.kv .v { font-family: var(--f-mono); font-size: 13px; color: var(--ink); text-align: right; word-break: break-word; }
.kv .v.hi { color: var(--a2); font-weight: 500; }
.demo-note { margin: 0; font-size: 12px; color: var(--muted); }
.field input[type="color"] {
  width: 100%; height: 40px; padding: 3px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
}

/* ── 147 · border-shape ───────────────────────────────────── */
.demo-bshape { align-items: center; }
.bshape {
  width: 148px; aspect-ratio: 1;
  display: grid; place-items: center;
  color: #fff; font-family: var(--f-display); font-weight: 800; font-size: 40px;
  background: var(--spectrum);
  border: 7px solid color-mix(in oklab, var(--a1) 55%, #fff 25%);
  border-shape: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  filter: drop-shadow(0 12px 22px color-mix(in oklab, var(--a1) 40%, transparent));
}
@supports not (border-shape: circle()) {
  .bshape { border-radius: 24px; border-style: dashed; }
}

/* ── 147 · contrast-color() ───────────────────────────────── */
.demo-contrast { justify-content: space-between; }
.cc-chip {
  height: 96px; border-radius: 12px; display: grid; place-items: center;
  background: var(--c, #6c5ce7);
  color: contrast-color(var(--c, #6c5ce7));
  font-family: var(--f-display); font-weight: 800; font-size: 40px;
  transition: background .2s;
}
@supports not (color: contrast-color(red)) {
  .cc-chip { color: var(--cc-fallback, #fff); } /* JS fills --cc-fallback */
}

/* ── 147 · element-scoped view transition ─────────────────── */
.demo-evt { align-items: stretch; }
.evt-stage {
  height: 118px; border-radius: 12px; border: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden;
  view-transition-name: evt-stage;
}
.evt-face {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 800; font-size: 26px; color: #fff;
}
.evt-face[data-state="a"] { background: linear-gradient(120deg, var(--a1), var(--a2)); }
.evt-face[data-state="b"] { background: linear-gradient(120deg, var(--a3), var(--a2)); }

/* ── 147 · scroll-driven range ────────────────────────────── */
.demo-scroll { align-items: stretch; justify-content: center; gap: 12px; }
.scrolltrack {
  height: 12px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); overflow: hidden;
}
.scrollfill {
  height: 100%; background: var(--spectrum);
  transform-origin: left; transform: scaleX(.03);
  animation: scrollgrow linear both;
  animation-timeline: scroll(root);
}
@keyframes scrollgrow { to { transform: scaleX(1); } }
@supports not (animation-timeline: scroll()) {
  .scrollfill { animation: none; transform: scaleX(.45); }
}

/* ── 147 · SVG textPath path attribute ────────────────────── */
.demo-textpath { align-items: center; justify-content: center; }
.textpath svg { width: 100%; height: 140px; overflow: visible; }
.textpath text { font-family: var(--f-display); font-weight: 700; font-size: 19px; fill: url(#tpGrad); letter-spacing: .04em; }
.textpath .guide { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 3 4; }

/* ── 147 · Math.sumPrecise (also generic .kv) ─────────────── */
/* uses .kv */

/* ── 148 · text-decoration-skip-ink ───────────────────────── */
.demo-skipink { align-items: flex-start; justify-content: center; }
.skipink {
  margin: 0; font-size: 26px; line-height: 1.7; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--a2);
  text-decoration-thickness: 2px; text-underline-offset: 2px;
  text-decoration-skip-ink: all;
}
.skipink.is-noskip { text-decoration-skip-ink: none; }

/* ── 148 · revert-rule ────────────────────────────────────── */
.demo-revert { align-items: center; }
.rr-chip {
  width: 100%; height: 84px; border-radius: 12px; display: grid; place-items: center;
  color: #fff; font-family: var(--f-mono); font-size: 13px;
  background: var(--a3);           /* base rule */
}
.rr-chip { background: var(--a1); } /* later rule wins → violet */
.rr-chip.is-revert { background: revert-rule; } /* rolls back to teal */
@supports not (background: revert-rule) {
  .rr-chip.is-revert { background: var(--a3); }
}

/* ── 148 · @supports at-rule() panel ──────────────────────── */
/* uses .kv */

/* ── 148 · text-overflow reveal ───────────────────────────── */
.demo-tof { align-items: stretch; justify-content: center; }
.tof {
  width: 100%; font: 500 15px var(--f-body); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  padding: 11px 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tof.is-clip { overflow: auto; text-overflow: clip; }

/* ── 148 · Prompt API (on-device AI) ──────────────────────── */
.demo-ai { align-items: stretch; gap: 12px; }
.ai-out {
  min-height: 62px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); padding: 11px 13px; font-size: 13.5px; color: var(--ink);
}
.ai-out .muted { color: var(--muted); }
.ai-in { display: flex; gap: 8px; }
.ai-in input {
  flex: 1; font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
}
.ai-in input:disabled { opacity: .55; }

/* ── 148 · name-only container query ──────────────────────── */
.demo-nq { align-items: stretch; }
.nq {
  container-name: panel; container-type: inline-size;
  width: 250px; min-width: 180px; max-width: 100%;
  resize: horizontal; overflow: hidden;
  border: 1px dashed var(--line); border-radius: 12px; padding: 12px; background: var(--surface);
}
.nq-inner { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.nq-media { width: 100%; height: 58px; border-radius: 8px; background: var(--spectrum); flex-shrink: 0; }
.nq-badge {
  font-family: var(--f-mono); font-size: 10px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px;
}
.nq-badge::before { content: "stacked"; }
@container panel (width > 20rem) {
  .nq-inner { flex-direction: row; align-items: center; }
  .nq-media { width: 88px; height: 64px; }
  .nq-badge::before { content: "row"; }
}

/* ── 149 · gap decorations ────────────────────────────────── */
.demo-gap { align-items: stretch; justify-content: center; }
.gapdeco {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  column-rule: 2px solid var(--a2);
  row-rule: 2px dashed var(--a3);
  column-rule-inset: 6px;
  row-rule-inset: 6px;
}
.gapdeco > span {
  aspect-ratio: 1.6; border-radius: 8px; background: var(--surface-2);
  border: 1px solid var(--line); display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 12px; color: var(--muted);
}

/* ── 149 · shape-outside path() ───────────────────────────── */
.demo-shape { align-items: stretch; justify-content: flex-start; display: block; padding: 18px; }
.floater {
  float: left; width: 132px; height: 132px; margin: 0 14px 6px 0;
  background: var(--spectrum);
  shape-outside: path("M0,0 L132,0 L132,86 Q66,168 0,86 Z");
  clip-path: path("M0,0 L132,0 L132,86 Q66,168 0,86 Z");
}
.shape-copy { margin: 0; font-size: 13px; line-height: 1.65; color: var(--ink); }

/* ── 149 · image-rendering: crisp-edges ───────────────────── */
.demo-pixel { align-items: stretch; }
.pxrow { display: flex; gap: 14px; }
.px {
  flex: 1; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line);
  background-color: var(--surface);
  background-image: var(--px);
  background-repeat: no-repeat; background-position: center; background-size: 74%;
  position: relative;
}
.px--smooth { image-rendering: auto; }
.px--crisp  { image-rendering: crisp-edges; image-rendering: pixelated; }
.px::after {
  content: attr(data-label); position: absolute; left: 8px; bottom: 8px;
  font-family: var(--f-mono); font-size: 10px; color: var(--muted);
  background: color-mix(in oklab, var(--surface) 80%, transparent); padding: 1px 5px; border-radius: 5px;
}

/* ── 149 · path-length ────────────────────────────────────── */
.demo-pl { align-items: center; justify-content: center; }
.demo-pl svg { width: 100%; height: 120px; }
.plpath {
  fill: none; stroke: url(#plGrad); stroke-width: 5; stroke-linecap: round;
  path-length: 100;
  stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: pldraw 3.2s ease-in-out infinite;
}
@keyframes pldraw {
  0%   { stroke-dashoffset: 100; }
  55%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}

/* ── 149 · Intl.Locale.variants + clipboard use .kv ───────── */

/* ---- motion off --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
  .card { opacity: 1; transform: none; }
}
