/* Generated by scripts/css-bundle.mjs — do not edit by hand. */
/* /public/css/routes/surfaces/home.css */
@layer routes {
/* ==========================================================================
   home-surface.css
   --------------------------------------------------------------------------
   CSS for the rewritten homepage HTML:
   - quieter kernel hero
   - separate operator field
   - separate climate tuning layer
   - distinct reading-layer panels
   - token-driven, parser-tolerant
   ========================================================================== */


/* ==========================================================================
   1. Home surface tokens
   ========================================================================== */

:where(body[data-spw-surface="home"]) {
  --home-accent-primary: color-mix(in oklab, var(--teal, #0f7f7d) 86%, #f2c46d 14%);
  --home-accent-secondary: color-mix(in oklab, var(--home-accent-primary) 42%, var(--amber, #c79a3b));
  --home-accent-tertiary: color-mix(in oklab, var(--home-accent-primary) 24%, transparent);
  --home-accent-ember: color-mix(in oklab, var(--amber, #c79a3b) 72%, #ff6f4f 28%);
  --home-accent-blue: color-mix(in oklab, var(--home-accent-primary) 54%, #6aa3ff 46%);

  --home-accent-ink: color-mix(in oklab, var(--ink, #1b1f23) 82%, var(--home-accent-primary) 18%);
  --home-accent-line: color-mix(in oklab, var(--home-accent-primary) 24%, var(--line, rgba(15, 127, 125, 0.14)));
  --home-accent-line-strong: color-mix(in oklab, var(--home-accent-primary) 42%, var(--line, rgba(15, 127, 125, 0.14)));
  --home-accent-wash-soft: color-mix(in oklab, var(--home-accent-primary) 7%, transparent);
  --home-accent-wash: color-mix(in oklab, var(--home-accent-primary) 12%, transparent);
  --home-accent-wash-strong: color-mix(in oklab, var(--home-accent-primary) 18%, transparent);

  --home-surface-bg: color-mix(in oklab, var(--surface, rgba(255, 255, 255, 0.92)) 82%, var(--home-accent-primary) 4%);
  --home-surface-bg-strong: color-mix(in oklab, var(--surface-strong, rgba(255, 255, 255, 0.98)) 88%, var(--home-accent-primary) 5%);
  --home-surface-bg-muted: color-mix(in oklab, var(--home-surface-bg-strong) 84%, var(--bg, #f7f4ee));
  --home-surface-border: 1px solid var(--home-accent-line);
  --home-surface-border-strong: 1px solid var(--home-accent-line-strong);

  --home-shadow: 0 18px 48px color-mix(in oklab, var(--bg, #111) 72%, transparent);
  --home-shadow-active:
      0 22px 58px color-mix(in oklab, var(--home-accent-primary) 12%, transparent),
      0 16px 38px color-mix(in oklab, var(--bg, #111) 70%, transparent);
  --home-shadow-quiet: 0 8px 22px color-mix(in oklab, var(--bg, #111) 46%, transparent);

  --home-gap-xs: 0.38rem;
  --home-gap-sm: 0.62rem;
  --home-gap-md: 0.9rem;
  --home-gap-lg: 1.25rem;
  --home-gap-xl: 1.7rem;
  --home-gap-2xl: 2.2rem;

  --home-radius-sm: var(--shape-component, 8px);
  --home-radius-md: var(--shape-surface, 12px);
  --home-radius-lg: var(--shape-floating, 18px);
  --home-radius-pill: 999px;

  --home-measure-tight: 46ch;
  --home-measure: 62ch;
  --home-measure-wide: 74ch;

  --home-transition-fast: var(--duration-fast, 120ms) var(--ease-mechanical, ease);
  --home-transition-base: var(--duration-base, 180ms) var(--ease-mechanical, ease);
  --home-transition-slow: var(--duration-deliberate, 260ms) var(--ease-mechanical, ease);

  --home-hero-padding: clamp(0.85rem, 2vw, 1.3rem);
  --home-frame-padding: clamp(0.95rem, 2vw, 1.35rem);
  --home-section-max: 82rem;
  --spw-main-display: grid;
  --spw-main-padding-block-start: clamp(0.8rem, 1.8vw, 1.4rem);
  --spw-main-gap: var(--home-gap-xl);
}

@media (prefers-color-scheme: dark) {
  :where(html[data-spw-color-mode="auto"] body[data-spw-surface="home"]) {
    --bg: hsl(28 18% 8%);
    --bg-field: hsl(30 16% 11%);
    --paper: hsl(30 15% 12%);
    --surface: rgba(31, 25, 20, 0.82);
    --surface-strong: rgba(44, 35, 28, 0.95);
    --surface-panel: rgba(39, 31, 25, 0.92);
    --surface-panel-strong: rgba(52, 41, 32, 0.96);
    --teal: hsl(180 64% 61%);
    --amber: hsl(38 82% 64%);
    --violet: hsl(270 54% 72%);
    --ink-strong: rgba(255, 247, 235, 0.98);
    --ink: rgba(246, 238, 226, 0.94);
    --ink-soft: rgba(220, 204, 185, 0.84);
    --ink-mid: rgba(220, 204, 185, 0.68);
    --line: rgba(247, 226, 198, 0.15);
    --line-strong: rgba(121, 220, 214, 0.36);
    --home-accent-primary: color-mix(in oklab, var(--teal) 80%, var(--amber) 20%);
    --home-accent-line-strong: color-mix(in oklab, var(--home-accent-primary) 46%, var(--line));
    --home-surface-bg: color-mix(in oklab, var(--surface-panel) 84%, var(--home-accent-primary) 6%);
    --home-surface-bg-strong: color-mix(in oklab, var(--surface-panel-strong) 88%, var(--home-accent-primary) 8%);
    --home-shadow: 0 20px 52px color-mix(in oklab, #000 80%, transparent);
    --home-shadow-active:
        0 24px 62px color-mix(in oklab, var(--home-accent-primary) 16%, transparent),
        0 18px 42px color-mix(in oklab, #000 78%, transparent);
  }
}

html[data-spw-color-mode="dark"] body[data-spw-surface="home"] {
  --home-accent-primary: color-mix(in oklab, var(--teal, hsl(180 64% 61%)) 80%, var(--amber, hsl(38 82% 64%)) 20%);
  --home-accent-line-strong: color-mix(in oklab, var(--home-accent-primary) 46%, var(--line));
  --home-surface-bg: color-mix(in oklab, var(--surface-panel, var(--surface)) 84%, var(--home-accent-primary) 6%);
  --home-surface-bg-strong: color-mix(in oklab, var(--surface-panel-strong, var(--surface-strong)) 88%, var(--home-accent-primary) 8%);
  --home-shadow: 0 20px 52px color-mix(in oklab, #000 80%, transparent);
}


/* ==========================================================================
   2. Home page scoping
   ========================================================================== */

:where(body[data-spw-surface="home"]) {
  --component-accent: var(--semantic-accent, var(--home-accent-primary));
  --component-surface: var(--home-surface-bg);
  --component-surface-strong: var(--home-surface-bg-strong);
  --component-surface-soft: color-mix(in oklab, var(--home-surface-bg) 76%, transparent);
  --card-border-emphasis: var(--home-accent-line);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--home-accent-primary) 18%, transparent);
  background:
      radial-gradient(circle at 18% 4%, color-mix(in oklab, var(--home-accent-primary) 16%, transparent), transparent 28rem),
      radial-gradient(circle at 88% 18%, color-mix(in oklab, var(--home-accent-ember) 12%, transparent), transparent 30rem),
      linear-gradient(135deg, color-mix(in oklab, var(--bg-field, #111) 78%, var(--home-accent-blue) 7%), var(--bg, #111));
}

:where(body[data-spw-surface="home"] main > .site-frame) {
  max-inline-size: var(--home-section-max);
  inline-size: min(100%, var(--home-section-max));
  margin-inline: auto;
}


/* ==========================================================================
   3. Kernel hero
   ========================================================================== */

:where(#home-frame.site-hero) {
  position: relative;
  display: grid;
  gap: clamp(0.9rem, 1.8vw, 1.35rem);
  padding: var(--home-hero-padding);
  border: var(--home-surface-border);
  border-radius: var(--home-radius-lg);
  background:
      radial-gradient(
          circle at 87% 17%,
          color-mix(in oklab, var(--home-accent-primary) 18%, transparent),
          transparent 24rem
      ),
      radial-gradient(
          circle at 18% 74%,
          color-mix(in oklab, var(--home-accent-ember) 11%, transparent),
          transparent 28rem
      ),
      linear-gradient(
          180deg,
          var(--home-accent-wash-soft),
          transparent 28%
      ),
      var(--home-surface-bg);
  box-shadow: var(--home-shadow);
  overflow: clip;
}

:where(#home-frame.site-hero) {
  max-inline-size: min(100%, var(--home-section-max));
}

:where(#home-frame.site-hero)::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
      radial-gradient(
          circle at 86% 16%,
          color-mix(in oklab, var(--home-accent-primary) 12%, transparent),
          transparent 26%
      ),
      linear-gradient(
          90deg,
          color-mix(in oklab, var(--home-accent-primary) 7%, transparent),
          transparent 38%,
          color-mix(in oklab, var(--home-accent-ember) 7%, transparent)
      );
  opacity: 0.78;
}

:where(#home-frame .frame-topline) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
      "brace identity meta"
      "modes modes modes"
      "preview preview preview"
      "inspect inspect inspect";
  align-items: center;
  gap: 0.38rem 0.46rem;
  min-width: 0;
  padding: 0.3rem 0 0.48rem;
  border-bottom: 1px solid color-mix(in srgb, var(--home-accent-line) 72%, transparent);
}

:where(#home-frame .frame-topline > .spw-delimiter) {
  grid-area: brace;
  justify-self: start;
}

:where(#home-frame .frame-topline > .frame-sigil) {
  grid-area: identity;
  justify-self: start;
}

:where(#home-frame .frame-topline > .mode-switch) {
  grid-area: modes;
  justify-self: stretch;
}

:where(#home-frame .frame-topline > .home-lens-preview) {
  grid-area: preview;
}

:where(#home-frame .frame-topline > .home-copy-inspector) {
  grid-area: inspect;
}

:where(#home-frame .frame-topline > .spw-component-meta) {
  grid-area: meta;
  justify-self: end;
  margin-left: 0;
}

@media (max-width: 32rem) {
  :where(#home-frame.site-hero) {
    padding: clamp(0.72rem, 2.4vw, 0.95rem);
    gap: clamp(0.72rem, 1.6vw, 1rem);
  }

  :where(#home-frame .frame-topline) {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "brace identity"
      "meta meta"
      "modes modes"
      "preview preview"
      "inspect inspect";
    padding: 0.28rem 0 0.48rem;
    gap: 0.38rem 0.42rem;
  }

  :where(#home-frame .frame-topline > .spw-component-meta) {
    justify-self: start;
  }

  :where(#home-frame h1) {
    font-size: clamp(1.82rem, 1.35rem + 3vw, 3.4rem);
  }

  :where(#home-frame .page-lede) {
    font-size: clamp(0.96rem, 0.9rem + 0.35vw, 1.08rem);
    line-height: 1.52;
  }
}

:where(#home-frame .page-kicker) {
  margin: 0;
  font-family: var(--site-mono-font, "JetBrains Mono", monospace);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--home-accent-primary) 58%, var(--ink-soft, rgba(27, 31, 35, 0.68)));
}

:where(#home-frame h1) {
  max-inline-size: 14ch;
  margin: 0;
  color: var(--home-accent-ink);
  font-size: clamp(2rem, 1.4rem + 3.4vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

:where(#home-frame .home-tagline) {
  max-inline-size: 18ch;
  margin: 0;
  color: color-mix(in srgb, var(--home-accent-ink) 88%, var(--ink-soft, rgba(27, 31, 35, 0.68)) 12%);
  font-size: clamp(1.1rem, 0.95rem + 0.8vw, 1.55rem);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

:where(#home-frame .page-lede) {
  max-inline-size: var(--home-measure);
  margin: 0;
  color: color-mix(in srgb, var(--ink, #1b1f23) 90%, transparent);
  font-size: clamp(1rem, 0.92rem + 0.48vw, 1.16rem);
  font-weight: 500;
  line-height: 1.58;
  text-wrap: pretty;
}

:where(#home-frame .frame-note) {
  max-inline-size: var(--home-measure-wide);
  margin: 0;
  color: var(--ink-soft, rgba(27, 31, 35, 0.68));
  font-size: 0.98rem;
  line-height: 1.62;
  text-wrap: pretty;
}

:where(#home-frame .home-hero-skim) {
  display: none;
  max-inline-size: var(--home-measure);
  font-size: 0.86rem;
  line-height: 1.5;
  color: color-mix(in srgb, var(--ink-soft, rgba(27, 31, 35, 0.68)) 88%, var(--home-accent-primary) 12%);
}

:where(html[data-spw-semantic-density="rich"] #home-frame .home-hero-skim) {
  display: block;
}

:where(#home-frame .home-hero-copy > .frame-note:not(.home-hero-note, .home-hero-skim)) {
  max-inline-size: var(--home-measure);
  font-size: 0.9rem;
  line-height: 1.54;
  color: color-mix(in srgb, var(--ink-soft, rgba(27, 31, 35, 0.68)) 92%, transparent);
}

:where(html:not([data-spw-semantic-density="rich"]) #home-frame .home-hero-copy > .frame-note:not(.home-hero-note, .home-hero-skim):nth-of-type(n + 2)) {
  display: none;
}

:where(#home-frame .home-hero-grid) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: clamp(1rem, 2.3vw, 2rem);
  min-width: 0;
}

:where(#home-frame .home-hero-copy) {
  display: grid;
  align-content: start;
  gap: var(--home-gap-lg);
  min-width: 0;
  max-inline-size: none;
}

/* Identity leads; hook and skim layers follow once the headline lands. */
:where(#home-frame .page-kicker) {
  order: 1;
}

:where(#home-frame h1) {
  order: 2;
}

:where(#home-frame .home-tagline) {
  order: 3;
}

:where(#home-frame .page-lede) {
  order: 4;
}

:where(#home-frame .home-hero-note) {
  order: 5;
}

:where(#home-frame .hook-call) {
  order: 6;
}

:where(#home-frame .home-hero-skim) {
  order: 7;
}

:where(#home-frame .home-hero-copy > .frame-note:not(.home-hero-note, .home-hero-skim)) {
  order: 8;
}

:where(#home-frame .spw-copy-motif-strip) {
  order: 9;
}

:where(#home-frame .spw-reason-strip) {
  order: 10;
}

:where(#home-frame .spw-narration) {
  order: 11;
}

:where(#home-frame .hook-call) {
  min-width: 0;
  max-inline-size: min(100%, var(--home-measure-wide));
  display: grid;
  gap: 0.42rem;
  margin-block-start: 0.15rem;
}

:where(#home-frame .hook-call .spw-playable-hook) {
  margin-block: 0;
  padding: 0.52rem 0.68rem;
  border-inline-start-width: 0.18rem;
  font-size: clamp(0.92rem, 0.88rem + 0.2vw, 1.02rem);
  font-weight: 620;
  line-height: 1.44;
  background: color-mix(in srgb, var(--home-surface-bg-strong) 92%, var(--home-accent-primary) 8%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--home-accent-primary) 10%, transparent);
}

:where(#home-frame .hook-call .hook-sub),
:where(#home-frame .hook-call .hook-invitation) {
  display: none;
}

:where(html[data-spw-semantic-density="rich"] #home-frame .hook-call .hook-sub),
:where(html[data-spw-semantic-density="rich"] #home-frame .hook-call .hook-invitation) {
  display: block;
}

:where(#home-frame .hook-call .hook-sub),
:where(#home-frame .hook-call .hook-invitation) {
  margin: 0;
  max-inline-size: var(--home-measure-wide);
  color: color-mix(in srgb, var(--ink-soft, rgba(27, 31, 35, 0.68)) 86%, var(--home-accent-primary) 14%);
  font-size: 0.86rem;
  line-height: 1.48;
  text-wrap: pretty;
}

:where(#home-frame .hook-call [data-spw-perspective="objective"]),
:where(#home-frame .hook-call [data-spw-perspective="subjective"]) {
  color: color-mix(in srgb, var(--home-accent-primary) 68%, var(--ink-soft, rgba(27, 31, 35, 0.68)) 32%);
  font-family: var(--site-mono-font, "JetBrains Mono", monospace);
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

:where(#home-frame .home-brand-plate) {
  justify-self: center;
  align-self: start;
  display: grid;
  place-items: center;
  inline-size: min(100%, 16.5rem);
  margin: 0;
  padding: 0.68rem;
  border: 1px solid color-mix(in srgb, var(--home-accent-line) 78%, transparent);
  border-radius: var(--home-radius-md);
  background:
      radial-gradient(
          circle at 80% 12%,
          color-mix(in oklab, var(--home-accent-ember) 10%, transparent),
          transparent 48%
      ),
      linear-gradient(
          180deg,
          color-mix(in srgb, #fff 14%, transparent),
          transparent 62%
      ),
      color-mix(in srgb, var(--home-surface-bg-muted) 94%, transparent);
  box-shadow: 0 6px 18px color-mix(in oklab, var(--bg, #111) 28%, transparent);
  z-index: 1;
}

:where(#home-frame .home-brand-plate img) {
  display: block;
  inline-size: 100%;
  block-size: auto;
  border-radius: calc(var(--home-radius-md) - 4px);
}

:where(#home-frame .home-brand-plate-links) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  align-items: center;
  justify-content: center;
  margin: 0.65rem 0 0;
  color: var(--ink-soft, rgba(27, 31, 35, 0.68));
  font-size: 0.82rem;
}

:where(#home-frame .home-brand-plate-links__label) {
  font-family: var(--site-mono-font, "JetBrains Mono", monospace);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (min-width: 72rem) {
  :where(#home-frame .home-hero-grid) {
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 20rem);
    column-gap: clamp(1.4rem, 2.6vw, 2.4rem);
  }

  :where(#home-frame .home-hero-copy) {
    grid-column: 1 / -1;
    grid-row: 1;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 20rem);
    column-gap: clamp(1.4rem, 2.6vw, 2.4rem);
  }

  :where(
    #home-frame .page-kicker,
    #home-frame h1,
    #home-frame .home-hero-copy > .home-tagline,
    #home-frame #home-frame-note,
    #home-frame .home-hero-note,
    #home-frame .spw-playable-hook,
    #home-frame .home-hero-skim,
    #home-frame .spw-copy-motif-strip
  ) {
    grid-column: 1;
  }

  :where(#home-frame .hook-call) {
    grid-column: 1;
    justify-self: start;
  }

  :where(#home-frame .home-brand-plate) {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    inline-size: min(100%, 16rem);
    margin-block-start: 2.4rem;
    position: sticky;
    top: calc(var(--header-height, 4rem) + 1rem);
  }

  :where(#home-frame .spw-reason-strip) {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  :where(#home-frame .spw-narration) {
    grid-column: 1;
    align-self: stretch;
  }

  :where(#home-frame .spw-role-hooks) {
    grid-column: 2;
    grid-row: 10;
    margin-block-start: 0;
  }

  :where(#home-frame .spw-resonance-lab) {
    grid-column: 2;
    grid-row: 11;
    margin-block-start: 0;
  }

  :where(#home-frame .frame-operators) {
    grid-column: 1 / -1;
  }

  :where(#home-frame .home-hero-copy > p[data-spw-copy-depth]) {
    grid-column: 2;
    grid-row: 12;
    align-self: start;
    margin: 0;
  }

  :where(#home-frame .spw-route-bridge) {
    grid-column: 1 / -1;
  }

  :where(#home-frame .frame-grid--dense) {
    grid-column: 1 / -1;
  }
}

@container (min-width: 70rem) {
  :where(#home-frame.site-hero--split-figure) > [data-spw-slot="body"] {
    grid-column: 1 / -1;
  }
}

/* ==========================================================================
   4. Shared frame headings + sigils
   ========================================================================== */

:where(body[data-spw-surface="home"] .site-frame .frame-heading) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--home-gap-sm);
  min-width: 0;
}

:where(body[data-spw-surface="home"] .site-frame .frame-heading h2) {
  margin: 0;
  color: var(--home-accent-ink);
  font-size: clamp(1.08rem, 0.96rem + 0.65vw, 1.42rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
}

:where(body[data-spw-surface="home"] .frame-sigil) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.24rem;
  min-height: 1.8rem;
  padding: 0.18rem 0.56rem;
  border: 1px solid color-mix(in srgb, var(--home-accent-primary) 18%, transparent);
  border-radius: var(--home-radius-pill);
  background: color-mix(in srgb, var(--home-surface-bg-strong) 94%, var(--home-accent-primary) 6%);
  color: color-mix(in srgb, var(--home-accent-primary) 76%, var(--ink-soft, rgba(27, 31, 35, 0.68)) 24%);
  font-family: var(--site-mono-font, "JetBrains Mono", monospace);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05em;
  text-decoration: none;
  white-space: nowrap;
  transition:
      border-color var(--home-transition-fast),
      background-color var(--home-transition-fast),
      color var(--home-transition-fast),
      transform var(--home-transition-fast);
}

:where(body[data-spw-surface="home"] .frame-sigil:is(:hover, :focus-visible)) {
  border-color: color-mix(in srgb, var(--home-accent-primary) 34%, transparent);
  color: var(--home-accent-primary);
  transform: translateY(-1px);
}


/* ==========================================================================
   5. Home lens switch
   ========================================================================== */

:where(body[data-spw-surface="home"] .mode-switch) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
  align-items: center;
  min-width: 0;
}

:where(#home-frame .mode-switch) {
  display: grid;
  grid-template-columns: max-content repeat(4, minmax(0, 1fr));
  align-items: stretch;
  width: 100%;
  max-inline-size: none;
  padding: 0.2rem;
  border: 1px solid color-mix(in oklab, var(--home-accent-primary) 18%, transparent);
  border-radius: var(--home-radius-sm);
  background:
      linear-gradient(
          90deg,
          color-mix(in oklab, var(--home-accent-primary) 7%, transparent),
          color-mix(in oklab, var(--home-surface-bg-strong) 84%, transparent)
  );
  box-shadow:
      inset 0 1px 0 color-mix(in oklab, var(--ink-strong, white) 10%, transparent),
      0 0 0 1px color-mix(in oklab, var(--home-accent-primary) 10%, transparent);
}

@media (prefers-color-scheme: dark) {
  html[data-spw-color-mode="auto"] #home-frame .mode-switch,
  html[data-spw-color-mode="dark"] #home-frame .mode-switch {
    background:
        linear-gradient(
            90deg,
            color-mix(in oklab, var(--home-accent-primary) 14%, transparent),
            color-mix(in oklab, var(--home-surface-bg-strong) 76%, transparent)
        );
    box-shadow:
        inset 0 1px 0 color-mix(in oklab, var(--ink-strong) 12%, transparent),
        0 0 0 1px color-mix(in oklab, var(--home-accent-primary) 14%, transparent);
  }

  html[data-spw-color-mode="auto"] #home-frame .hook-call .spw-playable-hook,
  html[data-spw-color-mode="dark"] #home-frame .hook-call .spw-playable-hook {
    --active-op-color: color-mix(in oklab, var(--home-accent-blue) 72%, var(--home-accent-primary) 28%);
    border-inline-start-width: 0.28rem;
    background: color-mix(in oklab, var(--home-surface-bg-strong) 80%, var(--home-accent-blue) 20%);
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--home-accent-blue) 24%, transparent);
    color: var(--ink-strong, var(--ink));
  }

  html[data-spw-color-mode="auto"] #home-frame .hook-call .hook-sub,
  html[data-spw-color-mode="auto"] #home-frame .hook-call .hook-invitation,
  html[data-spw-color-mode="dark"] #home-frame .hook-call .hook-sub,
  html[data-spw-color-mode="dark"] #home-frame .hook-call .hook-invitation {
    color: color-mix(in srgb, var(--ink) 90%, var(--home-accent-primary) 10%);
  }

  html[data-spw-color-mode="auto"] #home-frame .hook-call .spw-living-term:is(:hover, :focus-visible),
  html[data-spw-color-mode="dark"] #home-frame .hook-call .spw-living-term:is(:hover, :focus-visible) {
    background: color-mix(in srgb, var(--home-accent-primary) 14%, transparent);
    border-bottom-color: color-mix(in srgb, var(--home-accent-primary) 72%, transparent);
  }
}

/* Specificity must beat .mode-switch[aria-label]::before in operators.css (:where() is zero-specificity). */
#home-frame .mode-switch[aria-label]::before {
  content: "choose lens \2192";
  display: inline-flex;
  align-items: center;
  min-block-size: 2rem;
  margin-inline-end: 0;
  padding-inline: 0.42rem 0.58rem;
  border: 0;
  border-radius: 0;
  color: color-mix(in oklab, var(--ink-soft, currentColor) 78%, var(--home-accent-primary) 22%);
  font-family: var(--site-mono-font, "JetBrains Mono", monospace);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
  text-overflow: clip;
  max-inline-size: none;
  overflow: visible;
  white-space: normal;
  text-wrap: balance;
}

:where(#home-frame .mode-switch > .frame-sigil) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 0;
  min-block-size: 2rem;
}

@media (max-width: 56rem) {
  #home-frame .mode-switch[aria-label]::before {
    justify-content: flex-start;
    min-block-size: 1.75rem;
    padding-block: 0.12rem;
  }

  :where(#home-frame .mode-switch > .frame-sigil) {
    min-block-size: 2.15rem;
    letter-spacing: 0.03em;
  }
}

@media (max-width: 24rem) {
  #home-frame .mode-switch[aria-label]::before {
    content: "lens \2192";
    letter-spacing: 0.08em;
  }
}

:where(#home-frame .home-lens-preview) {
  display: none;
  min-width: 0;
  padding: 0.34rem 0.46rem;
  border: 1px solid color-mix(in srgb, var(--home-accent-primary) 10%, transparent);
  border-radius: var(--home-radius-sm);
  background: color-mix(in srgb, var(--home-surface-bg-strong) 72%, transparent);
}

:where(
  #home-frame .frame-topline:has(.mode-switch:is(:hover, :focus-within)) .home-lens-preview,
  #home-frame .frame-topline:has(.mode-switch [data-set-mode]:not([data-set-mode="surface"])[aria-pressed="true"]) .home-lens-preview
) {
  display: block;
}

:where(#home-frame .home-lens-preview p) {
  margin: 0;
  color: color-mix(in srgb, var(--ink-soft, rgba(27, 31, 35, 0.68)) 92%, var(--home-accent-primary) 8%);
  font-size: 0.78rem;
  line-height: 1.38;
  text-wrap: pretty;
}

:where(#home-frame .home-copy-inspector) {
  --brace-corner-offset: 0.3rem;
  --brace-corner-width: 1.1rem;
  --brace-corner-height: 0.82rem;
  position: relative;
  min-width: 0;
  padding: 0.24rem 0.4rem;
  border: 1px solid color-mix(in srgb, var(--home-accent-primary) 10%, transparent);
  border-radius: var(--home-radius-sm);
  background: color-mix(in srgb, var(--home-surface-bg-strong) 70%, transparent);
}

:where(#home-frame .home-copy-inspector > summary) {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  color: color-mix(in srgb, var(--ink-soft, rgba(27, 31, 35, 0.68)) 88%, var(--home-accent-primary) 12%);
  cursor: pointer;
  font-family: var(--site-mono-font, "JetBrains Mono", monospace);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  list-style: none;
  text-transform: uppercase;
}

:where(#home-frame .home-copy-inspector:not([open])) {
  border-color: transparent;
  background: transparent;
  padding-inline: 0;
}

#home-frame .home-copy-inspector > summary::-webkit-details-marker {
  display: none;
}

:where(#home-frame .home-copy-inspector__sigil) {
  color: var(--home-accent-primary);
}

:where(#home-frame .home-copy-inspector__body) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  padding-block-start: 0.5rem;
}

:where(#home-frame .home-copy-inspector__body a) {
  display: inline-flex;
  min-height: 1.8rem;
  align-items: center;
  padding: 0.14rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--home-accent-primary) 18%, transparent);
  border-radius: var(--home-radius-sm);
  background: color-mix(in srgb, var(--home-accent-primary) 5%, var(--home-surface-bg-strong));
  color: color-mix(in srgb, var(--home-accent-primary) 72%, var(--ink, #1b1f23) 28%);
  font-family: var(--site-mono-font, "JetBrains Mono", monospace);
  font-size: 0.72rem;
  font-weight: 720;
  text-decoration: none;
}

:where(#home-frame .spw-component-meta) {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.28rem;
  min-width: max-content;
  opacity: 0.82;
}

:where(#home-frame .frame-topline .spw-component-tag) {
  min-height: 1.55rem;
  padding: 0.1rem 0.42rem;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
}

@media (min-width: 48rem) {
  :where(#home-frame .frame-topline) {
    grid-template-areas:
        "brace identity meta"
        "modes modes modes"
        "inspect inspect inspect";
    gap: 0.32rem 0.42rem;
    padding-block-end: 0.38rem;
  }

  :where(#home-frame .frame-topline:has(.mode-switch:is(:hover, :focus-within), .mode-switch [data-set-mode]:not([data-set-mode="surface"])[aria-pressed="true"])) {
    grid-template-areas:
        "brace identity meta"
        "modes modes modes"
        "preview preview preview"
        "inspect inspect inspect";
  }

  :where(#home-frame .home-lens-preview) {
    grid-area: preview;
    padding-block: 0.28rem;
    border-style: dashed;
    background: color-mix(in srgb, var(--home-surface-bg-strong) 64%, transparent);
  }

  :where(#home-frame .home-copy-inspector) {
    grid-area: inspect;
  }

  :where(#home-frame .home-copy-inspector[open]) {
    border-color: color-mix(in srgb, var(--home-accent-primary) 10%, transparent);
    background: color-mix(in srgb, var(--home-surface-bg-strong) 70%, transparent);
    padding: 0.24rem 0.4rem;
  }
}

@media (min-width: 72rem) {
  html:has(body[data-spw-surface="home"]) :where(.spw-state-inspector[data-spw-state-inspector="open"]) {
    inline-size: min(19rem, calc(100vw - 2.4rem));
    max-block-size: min(32dvh, calc(100dvh - 7rem));
  }

  :where(#home-frame .home-brand-plate) {
    margin-block-start: 0.35rem;
  }
}

:where(body[data-spw-surface="home"] .mode-switch .frame-sigil[aria-pressed="true"]) {
  border-color: color-mix(in srgb, var(--home-accent-primary) 40%, transparent);
  background: color-mix(in srgb, var(--home-accent-primary) 12%, var(--home-surface-bg-strong));
  color: var(--home-accent-primary);
  box-shadow:
      0 0 0 1px color-mix(in srgb, var(--home-accent-primary) 12%, transparent),
      0 0 18px color-mix(in srgb, var(--home-accent-primary) 14%, transparent);
}

@media (prefers-color-scheme: dark) {
  html[data-spw-color-mode="auto"] body[data-spw-surface="home"] .mode-switch .frame-sigil[aria-pressed="true"],
  html[data-spw-color-mode="dark"] body[data-spw-surface="home"] .mode-switch .frame-sigil[aria-pressed="true"] {
    border-color: color-mix(in srgb, var(--home-accent-primary) 52%, transparent);
    background: color-mix(in srgb, var(--home-accent-primary) 18%, var(--home-surface-bg-strong));
    color: color-mix(in srgb, var(--home-accent-primary) 88%, var(--ink-strong) 12%);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--home-accent-primary) 18%, transparent),
        0 0 22px color-mix(in srgb, var(--home-accent-primary) 20%, transparent);
  }
}

:where(#home-frame .spw-reason-strip > [data-spw-form="brace"]) {
  --brace-corner-offset: 0.26rem;
  --brace-corner-width: 1.05rem;
  --brace-corner-height: 0.78rem;
  position: relative;
  scroll-margin-top: calc(var(--header-height, 4rem) + 1rem);
}

:where(#home-frame .spw-reason-strip > [data-spw-form="brace"]:is(:target, :focus-within, :hover)) {
  outline: 1px solid color-mix(in srgb, var(--home-accent-primary) 28%, transparent);
  outline-offset: 3px;
}


/* ==========================================================================
   6. Shared supporting text
   ========================================================================== */

:where(body[data-spw-surface="home"] .inline-note, body[data-spw-surface="home"] .frame-note) {
  margin: 0;
  max-inline-size: var(--home-measure);
  color: var(--ink-soft, rgba(27, 31, 35, 0.68));
  line-height: 1.58;
  text-wrap: pretty;
}

:where(body[data-spw-surface="home"] .frame-panel),
:where(body[data-spw-surface="home"] .frame-card) {
  --component-shadow: var(--home-shadow-quiet);
  --component-shadow-active: var(--home-shadow-active);
  border-color: color-mix(in oklab, var(--home-accent-primary) 18%, var(--line, transparent));
  background:
      radial-gradient(
          circle at 12% 0%,
          color-mix(in oklab, var(--home-accent-primary) 10%, transparent),
          transparent 42%
      ),
      linear-gradient(
          155deg,
          color-mix(in oklab, var(--home-surface-bg-strong) 92%, var(--home-accent-primary) 4%),
          color-mix(in oklab, var(--home-surface-bg) 94%, var(--home-accent-ember) 3%)
      );
}

:where(body[data-spw-surface="home"] .frame-panel h3),
:where(body[data-spw-surface="home"] .frame-card h3),
:where(body[data-spw-surface="home"] .frame-card strong) {
  letter-spacing: -0.015em;
}

:where(body[data-spw-surface="home"] .frame-panel p) {
  max-inline-size: 54ch;
}

:where(body[data-spw-surface="home"] .frame-grid--dense) {
  --spw-grid-min-base: 18rem;
  gap: clamp(0.65rem, 1.15vw, 0.9rem);
}

:where(#choose-your-entrance .frame-grid--dense) {
  align-items: stretch;
}

:where(#choose-your-entrance .frame-panel) {
  min-height: auto;
  align-content: start;
}

:where(#choose-your-entrance .spw-card-reason) {
  margin-top: 0.15rem;
}

:where(#living-concepts .living-concepts-grid) {
  --spw-grid-min-base: 16rem;
  align-items: stretch;
}

:where(#living-concepts .living-concept-card) {
  --component-shadow: var(--home-shadow-quiet);
  --component-shadow-active: var(--home-shadow-active);
  position: relative;
  min-height: 0;
  padding: 0;
  overflow: clip;
  border: 1px solid color-mix(in oklab, var(--home-accent-primary) 18%, var(--line, transparent));
  border-radius: var(--shape-card, 0.75rem);
  background:
      radial-gradient(
          circle at 12% 0%,
          color-mix(in oklab, var(--home-accent-primary) 10%, transparent),
          transparent 42%
      ),
      linear-gradient(
          155deg,
          color-mix(in oklab, var(--home-surface-bg-strong) 92%, var(--home-accent-primary) 4%),
          color-mix(in oklab, var(--home-surface-bg) 94%, var(--home-accent-ember) 3%)
      );
  box-shadow: var(--component-shadow);
}

:where(#living-concepts .living-concept-card > summary) {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.35rem;
  min-height: 5.75rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
  list-style: none;
}

#living-concepts .living-concept-card > summary::-webkit-details-marker {
  display: none;
}

:where(#living-concepts .living-concept-card > summary::after) {
  content: "+";
  position: absolute;
  top: 0.82rem;
  right: 0.9rem;
  color: color-mix(in srgb, var(--home-accent-primary) 72%, var(--ink, #1b1f23) 28%);
  font-family: var(--site-mono-font, "JetBrains Mono", monospace);
  font-weight: 800;
}

:where(#living-concepts .living-concept-card[open] > summary::after) {
  content: "-";
}

:where(#living-concepts .living-concept-card__name) {
  max-inline-size: calc(100% - 1.6rem);
  color: var(--ink, #1b1f23);
  font-size: 1rem;
  font-weight: 780;
  line-height: 1.2;
}

:where(#living-concepts .living-concept-card__short) {
  color: color-mix(in srgb, var(--ink-soft, rgba(27, 31, 35, 0.68)) 82%, var(--home-accent-primary) 18%);
  font-family: var(--site-mono-font, "JetBrains Mono", monospace);
  font-size: 0.74rem;
  line-height: 1.35;
}

:where(#living-concepts .living-concept-card__body) {
  display: grid;
  gap: 0.7rem;
  padding: 0 1rem 1rem;
}

:where(#living-concepts .living-concept-card__body p) {
  margin: 0;
}

:where(#living-concepts .living-concept-card .frame-operators) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
}

/* /public/css/routes/surfaces/home-panels.css */
@layer routes {
/* ==========================================================================
   routes/surfaces/home-panels.css
   --------------------------------------------------------------------------
   Home route panel stack: operators, climate tuning, entry loops, reading.
   ========================================================================== */

/* ==========================================================================
   7. Operator field
   ========================================================================== */

:where(#operator-field) {
  display: grid;
  gap: var(--home-gap-lg);
  padding: var(--home-frame-padding);
  border: var(--home-surface-border);
  border-radius: var(--home-radius-md);
  background:
      linear-gradient(
          180deg,
          color-mix(in srgb, var(--home-accent-primary) 4%, transparent),
          transparent 24%
      ),
      var(--home-surface-bg);
  box-shadow: var(--home-shadow);
}

:where(body[data-spw-surface="home"] .frame-operators) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
  align-items: center;
  min-width: 0;
}

:where(body[data-spw-surface="home"] .frame-operators--probe) {
  padding-top: 0.1rem;
}

:where(body[data-spw-surface="home"] .operator-chip) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.1rem;
  padding: 0.22rem 0.68rem;
  border: 1px solid color-mix(in srgb, var(--home-accent-primary) 18%, transparent);
  border-radius: var(--home-radius-pill);
  background: color-mix(in srgb, var(--home-accent-primary) 6%, var(--home-surface-bg-strong));
  color: color-mix(in srgb, var(--home-accent-primary) 76%, var(--ink, #1b1f23) 24%);
  font-family: var(--site-mono-font, "JetBrains Mono", monospace);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition:
      border-color var(--home-transition-fast),
      background-color var(--home-transition-fast),
      color var(--home-transition-fast),
      transform var(--home-transition-fast),
      box-shadow var(--home-transition-fast);
}

:where(body[data-spw-surface="home"] .operator-chip:is(:hover, :focus-visible)) {
  border-color: color-mix(in srgb, var(--home-accent-primary) 34%, transparent);
  background: color-mix(in srgb, var(--home-accent-primary) 12%, var(--home-surface-bg-strong));
  color: var(--home-accent-primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--home-accent-primary) 12%, transparent);
  transform: translateY(-1px);
}

:where(body[data-spw-surface="home"] .operator-chip[aria-pressed="true"], body[data-spw-surface="home"] .operator-chip[data-site-setting-active="true"]) {
  border-color: color-mix(in srgb, var(--home-accent-primary) 40%, transparent);
  background: color-mix(in srgb, var(--home-accent-primary) 14%, var(--home-surface-bg-strong));
  color: var(--home-accent-primary);
}


/* ==========================================================================
   8. Climate tuning surface
   ========================================================================== */

:where(#climate-tuning) {
  display: grid;
  gap: var(--home-gap-lg);
  padding: var(--home-frame-padding);
  border: var(--home-surface-border);
  border-radius: var(--home-radius-md);
  background:
      linear-gradient(
          180deg,
          color-mix(in srgb, var(--home-accent-secondary) 5%, transparent),
          transparent 26%
      ),
      var(--home-surface-bg);
  box-shadow: var(--home-shadow);
}

:where(body[data-spw-surface="home"] .vibe-widget-grid) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: var(--home-gap-md);
  min-width: 0;
}

:where(body[data-spw-surface="home"] .vibe-widget-grid--compact) {
  gap: var(--home-gap-sm);
}

:where(body[data-spw-surface="home"] .vibe-widget) {
  display: grid;
  align-content: start;
  gap: var(--home-gap-sm);
  min-width: 0;
  min-height: 100%;
  padding: 0.95rem;
  border: 1px solid color-mix(in srgb, var(--home-accent-primary) 14%, var(--line, rgba(15, 127, 125, 0.14)));
  border-radius: var(--home-radius-sm);
  background: color-mix(in srgb, var(--home-surface-bg-strong) 88%, transparent);
  box-shadow: var(--home-shadow-quiet);
}

:where(body[data-spw-surface="home"] .vibe-widget-header) {
  display: grid;
  gap: 0.22rem;
}

:where(body[data-spw-surface="home"] .vibe-widget-kicker) {
  margin: 0;
  font-family: var(--site-mono-font, "JetBrains Mono", monospace);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--home-accent-primary) 54%, var(--ink-soft, rgba(27, 31, 35, 0.68)));
}

:where(body[data-spw-surface="home"] .vibe-widget-title) {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--home-accent-ink);
}

:where(body[data-spw-surface="home"] .vibe-widget-meta),
:where(body[data-spw-surface="home"] .vibe-widget-actions),
:where(body[data-spw-surface="home"] .theme-pack-chip-row) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
}

:where(body[data-spw-surface="home"] .theme-pack-chip-btn) {
  inline-size: 2rem;
  block-size: 2rem;
  border: 1px solid color-mix(in srgb, var(--home-accent-primary) 18%, transparent);
  border-radius: 999px;
  background: var(--home-surface-bg-muted);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition:
      transform var(--home-transition-fast),
      border-color var(--home-transition-fast),
      box-shadow var(--home-transition-fast);
}

:where(body[data-spw-surface="home"] .theme-pack-chip-btn:is(:hover, :focus-visible)) {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--home-accent-primary) 34%, transparent);
}

:where(body[data-spw-surface="home"] .theme-pack-chip-btn[data-site-setting-active="true"]) {
  border-color: color-mix(in srgb, var(--home-accent-primary) 44%, transparent);
  box-shadow:
      0 0 0 1px color-mix(in srgb, var(--home-accent-primary) 16%, transparent),
      inset 0 0 0 1px rgba(255, 255, 255, 0.36);
}

:where(body[data-spw-surface="home"] .theme-pack-chip-btn[data-theme-pack-preview="neutral-paper"]) {
  background:
      linear-gradient(135deg, #f6f2ea, #e7ebe9);
}

:where(body[data-spw-surface="home"] .theme-pack-chip-btn[data-theme-pack-preview="oxide-ledger"]) {
  background:
      linear-gradient(135deg, #ece5d7, #8a6b53);
}

:where(body[data-spw-surface="home"] .theme-pack-chip-btn[data-theme-pack-preview="electric-studio"]) {
  background:
      linear-gradient(135deg, #d6f6ff, #4a5ff0);
}

:where(body[data-spw-surface="home"] .theme-pack-chip-btn[data-theme-pack-preview="ritual-vellum"]) {
  background:
      linear-gradient(135deg, #f2eadf, #6d4b63);
}

:where(body[data-spw-surface="home"] .theme-pack-chip-btn[data-theme-pack-preview="copper-brace"]) {
  background:
      linear-gradient(135deg, #f0d8bf, #8d6a57);
}

:where(body[data-spw-surface="home"] .theme-pack-chip-btn[data-theme-pack-preview="glass-console"]) {
  background:
      linear-gradient(135deg, #dfe9ee, #8ba9b1);
}

:where(body[data-spw-surface="home"] .spec-pill) {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  min-height: 1.85rem;
  padding: 0.16rem 0.56rem;
  border: 1px solid color-mix(in srgb, var(--home-accent-primary) 16%, transparent);
  border-radius: var(--home-radius-pill);
  background: color-mix(in srgb, var(--home-surface-bg-strong) 92%, var(--home-accent-primary) 8%);
  color: color-mix(in srgb, var(--home-accent-primary) 70%, var(--ink-soft, rgba(27, 31, 35, 0.68)) 30%);
  font-family: var(--site-mono-font, "JetBrains Mono", monospace);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.1;
  white-space: nowrap;
}

:where(body[data-spw-surface="home"] .vibe-widget-status) {
  color: var(--ink-soft, rgba(27, 31, 35, 0.68));
  font-size: 0.88rem;
  line-height: 1.4;
}


/* ==========================================================================
   9. Entry loops
   ========================================================================== */

:where(#entry-loops) {
  display: grid;
  gap: var(--home-gap-lg);
  padding: var(--home-frame-padding);
  border: var(--home-surface-border);
  border-radius: var(--home-radius-md);
  background: var(--home-surface-bg);
  box-shadow: var(--home-shadow);
}

:where(body[data-spw-surface="home"] .site-frame > .frame-actions:has(> .spw-delimiter:only-child)) {
  align-self: end;
  inline-size: auto;
  margin-block-start: calc(-1 * var(--home-gap-xs));
  padding-block-start: 0;
}

:where(body[data-spw-surface="home"] .site-frame > .frame-actions:has(> .spw-delimiter:only-child) > .spw-delimiter) {
  min-inline-size: 1.05rem;
  min-block-size: 1.25rem;
  border-color: color-mix(in srgb, var(--home-accent-primary) 20%, transparent);
  background: transparent;
  opacity: 0.64;
}

:where(body[data-spw-surface="home"] #returner-drift .returner-grid) {
  gap: clamp(0.78rem, 1.4vw, 1rem);
}

:where(body[data-spw-surface="home"] #returner-drift .returner-card, body[data-spw-surface="home"] #returner-drift .returner-ledger) {
  border-radius: var(--home-radius-sm);
}

:where(body[data-spw-surface="home"] #returner-drift .returner-card--warm) {
  border-inline-start: 0.22rem solid color-mix(in srgb, var(--home-accent-ember) 46%, transparent);
}

:where(body[data-spw-surface="home"] #town-library-gateway) {
  --brace-corner-offset: 0.42rem;
  --brace-corner-width: 1.65rem;
  --brace-corner-height: 1.15rem;
}

:where(body[data-spw-surface="home"] #town-library-gateway .frame-body) {
  gap: var(--home-gap-md);
}

:where(body[data-spw-surface="home"] #town-library-gateway .frame-grid--dense) {
  margin-block-start: 0.15rem;
}

/* ==========================================================================
  10. Reading layers / mode panels
  ========================================================================== */

:where(#reading-layers) {
  display: grid;
  gap: var(--home-gap-lg);
  padding: var(--home-frame-padding);
  border: var(--home-surface-border);
  border-radius: var(--home-radius-md);
  background:
      linear-gradient(
          180deg,
          color-mix(in srgb, var(--home-accent-primary) 4%, transparent),
          transparent 22%
      ),
      var(--home-surface-bg);
  box-shadow: var(--home-shadow);
}

:where(body[data-spw-surface="home"] .mode-panels) {
  display: grid;
  gap: var(--home-gap-md);
}

:where(body[data-spw-surface="home"] .mode-panel) {
  display: grid;
  gap: var(--home-gap-md);
  min-width: 0;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--home-accent-primary) 14%, transparent);
  border-radius: var(--home-radius-sm);
  background: color-mix(in srgb, var(--home-surface-bg-strong) 92%, transparent);
  box-shadow: var(--home-shadow-quiet);
}

:where(body[data-spw-surface="home"] .mode-panel[hidden]) {
  display: none !important;
}

:where(body[data-spw-surface="home"] .mode-panel p) {
  max-inline-size: var(--home-measure-wide);
  margin: 0;
  line-height: 1.62;
  text-wrap: pretty;
}

:where(body[data-spw-surface="home"] .mode-panel pre) {
  max-inline-size: 100%;
  margin: 0;
  padding: 0.95rem;
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--home-accent-primary) 14%, transparent);
  border-radius: var(--home-radius-sm);
  background: color-mix(in srgb, var(--home-surface-bg-muted) 96%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

:where(body[data-spw-surface="home"] .mode-panel code) {
  font-family: var(--site-mono-font, "JetBrains Mono", monospace);
  font-size: 0.9rem;
  line-height: 1.55;
}

:where(body[data-spw-surface="home"] .syntax-token),
:where(body[data-spw-surface="home"] .spw-topic),
:where(body[data-spw-surface="home"] .spw-delimiter) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.5rem;
  padding: 0.02rem 0.34rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--home-accent-primary) 8%, transparent);
  color: color-mix(in srgb, var(--home-accent-primary) 78%, var(--ink, #1b1f23) 22%);
  font-family: var(--site-mono-font, "JetBrains Mono", monospace);
  font-size: 0.88em;
}

:where(body[data-spw-surface="home"] .sr-only) {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  white-space: nowrap;
  clip: rect(0, 0, 0, 0);
}


/* ==========================================================================
   11. Link treatment inside home frames
   ========================================================================== */

:where(#home-frame a, #reading-layers a) {
  color: color-mix(in srgb, var(--home-accent-primary) 74%, var(--ink, #1b1f23) 26%);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

:where(#home-frame a:is(:hover, :focus-visible), #reading-layers a:is(:hover, :focus-visible)) {
  color: var(--home-accent-primary);
}


/* ==========================================================================
   12. Responsive layout
   ========================================================================== */

@media (max-width: 980px) {
  :where(#home-frame .home-hero-grid) {
    grid-template-columns: minmax(0, 1fr);
  }

  :where(#home-frame .home-brand-plate) {
    justify-self: start;
    inline-size: min(100%, 15rem);
  }
}

@media (min-width: 48rem) and (max-width: 71.99rem) {
  :where(#home-frame .home-brand-plate) {
    inline-size: min(100%, 14.5rem);
    padding: 0.58rem;
  }

  :where(#home-frame .home-hero-grid) {
    row-gap: clamp(0.85rem, 1.6vw, 1.2rem);
  }
}

@media (max-width: 760px) {
  :where(#home-frame.site-hero),
  :where(#operator-field),
  :where(#climate-tuning),
  :where(#entry-loops),
  :where(#returner-drift),
  :where(#town-library-gateway),
  :where(#reading-layers) {
    padding: 0.9rem;
    border-radius: var(--home-radius-sm);
  }

  :where(#home-frame h1) {
    max-inline-size: 12ch;
    font-size: clamp(1.8rem, 1.25rem + 3vw, 3rem);
  }

  :where(body[data-spw-surface="home"] .frame-topline),
  :where(body[data-spw-surface="home"] .frame-heading) {
    align-items: flex-start;
  }

  :where(#home-frame .frame-topline) {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "brace identity"
        "meta meta"
        "modes modes"
        "preview preview"
        "inspect inspect";
  }

  :where(#home-frame .frame-topline > .mode-switch),
  :where(#home-frame .frame-topline > .spw-component-meta),
  :where(#home-frame .frame-topline > .home-lens-preview),
  :where(#home-frame .frame-topline > .home-copy-inspector) {
    justify-self: stretch;
    justify-content: flex-start;
  }

  :where(#home-frame .spw-component-meta) {
    min-width: 0;
    gap: var(--handle-gap, 0.38rem); /* more generous than the tight metadata-on default for inspector views */
  }

  /* Visual refinement for the kernel/component tags in the exact context
     of the reference screenshot (read/inspect mode on the semantic-portal home).
     Makes the tags feel like elegant slips even when the surrounding meta
     carries the dense data-spw-* attributes shown in DevTools. */
  :where(body[data-spw-surface="home"] .spw-component-tag) {
    letter-spacing: 0.05em;
    border-color: color-mix(in srgb, var(--home-accent-primary, var(--teal)) 22%, var(--handle-line-soft, rgba(0,0,0,0.12)) 78%);
    min-inline-size: 3.2rem; /* better resistance to clipping in dense inspector headers */
    padding-inline: 0.52rem;
  }

  :where(body[data-spw-surface="home"] #town-library-gateway .spw-component-tag) {
    background: color-mix(in srgb, var(--home-surface-bg-strong, #fff) 88%, var(--home-accent-primary, var(--teal)) 12%);
    box-shadow:
      var(--projection-lift-xs, 1px) var(--projection-lift-xs, 1px) 0 color-mix(in srgb, var(--home-accent-primary, var(--teal)) 14%, transparent),
      inset 0 0.5px 0 rgba(255, 255, 255, 0.5);
  }

  :where(body[data-spw-surface="home"] .mode-switch) {
    width: 100%;
  }

  :where(body[data-spw-surface="home"] #returner-drift .returner-card, body[data-spw-surface="home"] #returner-drift .returner-ledger) {
    padding: 0.86rem;
  }

  :where(body[data-spw-surface="home"] #town-library-gateway .frame-heading) {
    gap: 0.55rem;
  }
}

@media (max-width: 520px) {
  :where(body[data-spw-surface="home"] .vibe-widget-grid),
  :where(body[data-spw-surface="home"] .frame-grid) {
    grid-template-columns: 1fr;
  }

  :where(body[data-spw-surface="home"] .operator-chip),
  :where(body[data-spw-surface="home"] .spec-pill),
  :where(body[data-spw-surface="home"] .frame-sigil) {
    white-space: normal;
  }

  :where(#home-frame .page-lede),
  :where(#home-frame .frame-note),
  :where(body[data-spw-surface="home"] .inline-note),
  :where(body[data-spw-surface="home"] .frame-note) {
    font-size: 0.95rem;
  }
}


/* ==========================================================================
   13. Dark mode
   ========================================================================== */

html[data-spw-color-mode="dark"] body[data-spw-surface="home"] {
  --home-accent-ink: color-mix(in oklab, white 84%, var(--home-accent-primary) 16%);
  --home-surface-bg: color-mix(in oklab, rgba(31, 25, 20, 0.92) 86%, var(--home-accent-primary) 4%);
  --home-surface-bg-strong: color-mix(in oklab, rgba(48, 39, 31, 0.97) 88%, var(--home-accent-primary) 5%);
  --home-surface-bg-muted: color-mix(in oklab, rgba(42, 34, 28, 0.97) 88%, var(--home-accent-ember) 5%);
  --home-surface-border: 1px solid color-mix(in oklab, var(--home-accent-primary) 26%, rgba(255, 236, 210, 0.11));
  --home-surface-border-strong: 1px solid color-mix(in oklab, var(--home-accent-primary) 46%, rgba(255, 236, 210, 0.16));
  --home-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --home-shadow-active:
      0 22px 58px color-mix(in oklab, var(--home-accent-primary) 12%, transparent),
      0 18px 44px rgba(0, 0, 0, 0.38);
  --home-shadow-quiet: 0 9px 24px rgba(0, 0, 0, 0.24);
}

@media (prefers-color-scheme: dark) {
  html:not([data-spw-color-mode="light"]) body[data-spw-surface="home"] {
    --home-accent-ink: color-mix(in oklab, white 84%, var(--home-accent-primary) 16%);
    --home-surface-bg: color-mix(in oklab, rgba(31, 25, 20, 0.92) 86%, var(--home-accent-primary) 4%);
    --home-surface-bg-strong: color-mix(in oklab, rgba(48, 39, 31, 0.97) 88%, var(--home-accent-primary) 5%);
    --home-surface-bg-muted: color-mix(in oklab, rgba(42, 34, 28, 0.97) 88%, var(--home-accent-ember) 5%);
    --home-surface-border: 1px solid color-mix(in oklab, var(--home-accent-primary) 26%, rgba(255, 236, 210, 0.11));
    --home-surface-border-strong: 1px solid color-mix(in oklab, var(--home-accent-primary) 46%, rgba(255, 236, 210, 0.16));
    --home-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
    --home-shadow-active:
        0 22px 58px color-mix(in oklab, var(--home-accent-primary) 12%, transparent),
        0 18px 44px rgba(0, 0, 0, 0.38);
    --home-shadow-quiet: 0 9px 24px rgba(0, 0, 0, 0.24);
  }
}


/* ==========================================================================
   14. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  :where(
    #home-frame,
    #operator-field,
    #climate-tuning,
    #entry-loops,
    #reading-layers,
    body[data-spw-surface="home"] .frame-card,
    body[data-spw-surface="home"] .operator-chip,
    body[data-spw-surface="home"] .frame-sigil,
    body[data-spw-surface="home"] .theme-pack-chip-btn,
    body[data-spw-surface="home"] .vibe-widget,
    body[data-spw-surface="home"] .mode-panel
  ) {
    transition: none !important;
    animation: none !important;
  }
}

:where(html[data-spw-reduce-motion="on"]) :where(
  #home-frame,
  #operator-field,
  #climate-tuning,
  #entry-loops,
  #reading-layers,
  body[data-spw-surface="home"] .frame-card,
  body[data-spw-surface="home"] .operator-chip,
  body[data-spw-surface="home"] .frame-sigil,
  body[data-spw-surface="home"] .theme-pack-chip-btn,
  body[data-spw-surface="home"] .vibe-widget,
  body[data-spw-surface="home"] .mode-panel
) {
  transition: none !important;
  animation: none !important;
}
}
