/* M12 · Soft Tactile Squircle & Warm Paper-Ink Atelier — @nb-corp/nb-speak-dsh */
:root,
[data-movement="M12"] {
  --h-paper: 80;
  --h-forest: 156;
  --bg: oklch(97.0% 0.008 var(--h-paper));
  --bezel-tray: oklch(93.0% 0.011 var(--h-paper));
  --pod-core: oklch(99.2% 0.004 var(--h-paper));
  --surface-subtle: oklch(95.2% 0.009 var(--h-paper));
  --ink: oklch(18.5% 0.012 var(--h-paper));
  --muted: oklch(40.5% 0.012 var(--h-paper));
  --rim: oklch(18% 0.012 var(--h-paper) / 0.08);
  --rim-strong: oklch(18% 0.012 var(--h-paper) / 0.15);
  --accent: oklch(33.5% 0.076 var(--h-forest));
  --accent-soft: oklch(93.2% 0.026 var(--h-forest));
  --accent-ink: oklch(25.0% 0.068 var(--h-forest));
  --err-bg: oklch(94.2% 0.032 28);
  --err-ink: oklch(34% 0.12 26);

  --r-outer: 28px;
  --bezel-pad: 6px;
  --r-inner: calc(var(--r-outer) - var(--bezel-pad));

  --font-sans: "Plus Jakarta Sans", "Figtree", -apple-system, BlinkMacSystemFont, "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Noto Sans SC", "Microsoft YaHei UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Consolas, monospace;

  font-synthesis: none;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

html[lang^="zh"] body {
  line-height: 1.7;
  line-break: strict;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

code,
pre,
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px clamp(16px, 3vw, 36px) 88px;
}

/* 1. Concentric Pill Masthead */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px 6px 16px;
  border-radius: 999px;
  background: var(--bezel-tray);
  border: 1px solid var(--rim);
  box-shadow: 0 14px 32px -18px oklch(20% 0.02 var(--h-paper) / 0.10);
  margin-bottom: clamp(24px, 3.2vw, 38px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.015em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--accent);
  color: #faf8f4;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-pill {
  min-height: 38px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  transition: background 180ms ease, color 180ms ease;
}

.nav-pill:hover,
.nav-pill[aria-current="page"] {
  background: var(--pod-core);
  color: var(--ink);
}

.pill-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 5px 6px 5px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #faf8f4;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease;
}

.pill-cta__orb {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
}

.pill-cta:hover {
  opacity: 0.94;
}

/* 2. Hero + Zero-Clone Command Bar */
.hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.hero-copy {
  max-width: 680px;
}

.eyebrow-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 10px;
}

.hero-title {
  margin: 0 0 10px;
  font-size: clamp(30px, 3.8vw, 46px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.028em;
}

.hero-sub {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
  max-width: 60ch;
}

.hero-cmd-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 18px;
  border-radius: 999px;
  background: var(--pod-core);
  border: 1px solid var(--rim-strong);
  box-shadow: 0 10px 26px -18px oklch(18% 0.02 var(--h-paper) / 0.16);
  margin-bottom: 22px;
  max-width: 100%;
}

.hero-cmd-code {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-ink);
  overflow-x: auto;
  white-space: nowrap;
}

.copy-pill-btn {
  appearance: none;
  min-height: 38px;
  padding: 6px 15px;
  border-radius: 999px;
  border: 1px solid var(--rim-strong);
  background: var(--accent);
  color: #faf8f4;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 150ms ease, background 150ms ease;
}

.copy-pill-btn[data-copied="true"] {
  background: oklch(28% 0.085 var(--h-forest));
}

.scenario-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.scenario-tab {
  appearance: none;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--rim);
  background: var(--pod-core);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.scenario-tab[aria-selected="true"] {
  background: var(--accent);
  color: #faf8f4;
  border-color: var(--accent);
}

/* 3. Concentric M12 Tray + Split Stage */
.m12-bezel-shell {
  padding: var(--bezel-pad);
  border-radius: var(--r-outer);
  background: var(--bezel-tray);
  border: 1px solid var(--rim);
  box-shadow: 0 22px 48px -28px oklch(18% 0.02 var(--h-paper) / 0.16);
}

.m12-bezel-core {
  border-radius: var(--r-inner);
  background: var(--pod-core);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.split-stage {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  overflow: hidden;
}

.stage-pane {
  padding: clamp(18px, 2.4vw, 26px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.stage-pane--raw {
  background: oklch(96.4% 0.009 var(--h-paper));
  border-right: 1px solid var(--rim);
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pane-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
}

.status-badge--fail {
  background: var(--err-bg);
  color: var(--err-ink);
}

.status-badge--pass {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.chat-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 360px;
}

.user-prompt-bubble {
  align-self: flex-end;
  max-width: 84%;
  padding: 10px 15px;
  border-radius: 18px 18px 5px 18px;
  background: var(--accent);
  color: #faf8f4;
  font-size: 13.5px;
  line-height: 1.48;
}

.raw-wall-box {
  padding: 14px 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid oklch(55% 0.08 28 / 0.22);
  color: var(--ink);
  font-size: 13.2px;
  line-height: 1.58;
  white-space: pre-wrap;
  max-height: 340px;
  overflow-y: auto;
}

/* Authentic DSH `conversation.chat.turnTail` Surface */
.dsh-toolstep-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 11px;
  border-radius: 14px;
  background: var(--surface-subtle);
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dsh-toolstep-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #1d5c4b;
}

.nb-speak-turn-surface {
  --nb-bubble-bg: #f2f4f8;
  --nb-bubble-border: rgba(15, 23, 42, 0.09);
  --nb-bubble-fg: #15181e;
  --nb-bubble-muted: #555e6d;
  --nb-voice-accent: #1d5c4b;
  --nb-voice-accent-soft: rgba(29, 92, 75, 0.12);
  --nb-voice-bar-idle: rgba(29, 92, 75, 0.28);
  --nb-artifact-bg: #f7f8fa;
  --nb-artifact-header: #eef1f5;
  --nb-artifact-border: rgba(15, 23, 42, 0.11);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.nb-speak-bubble-cluster {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

.nb-speak-bubble {
  max-width: min(88%, 520px);
  width: fit-content;
  padding: 9px 14px;
  border-radius: 16px 16px 16px 6px;
  background: var(--nb-bubble-bg);
  border: 1px solid var(--nb-bubble-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  color: var(--nb-bubble-fg);
  font-size: 14px;
  line-height: 1.5;
  animation: nbBubbleRise 190ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--nb-bubble-idx, 0) * 75ms);
}

.nb-speak-voice-pill {
  max-width: min(96%, 460px);
  width: 100%;
  padding: 9px 13px 8px;
  border-radius: 16px 16px 16px 4px;
  background: var(--nb-bubble-bg);
  border: 1px solid var(--nb-bubble-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nb-speak-voice-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nb-speak-voice-btn {
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: var(--nb-voice-accent);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  cursor: pointer;
}

.nb-speak-waveform {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 22px;
  flex: 1 1 auto;
}

.nb-speak-wave-bar {
  width: 3px;
  border-radius: 999px;
  background: var(--nb-voice-bar-idle);
  transition: background-color 110ms linear;
}

.nb-speak-wave-bar[data-active="true"] {
  background: var(--nb-voice-accent);
}

.nb-speak-voice-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--nb-bubble-muted);
  white-space: nowrap;
}

.nb-speak-voice-caption {
  margin: 0;
  padding-top: 5px;
  border-top: 1px solid var(--nb-bubble-border);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--nb-bubble-muted);
}

.nb-speak-artifact-card {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--nb-artifact-border);
  background: var(--nb-artifact-bg);
  overflow: hidden;
}

.nb-speak-artifact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  background: var(--nb-artifact-header);
  border-bottom: 1px solid var(--nb-artifact-border);
}

.nb-speak-artifact-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.nb-speak-artifact-title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--nb-bubble-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-speak-artifact-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--nb-voice-accent-soft);
  color: var(--nb-voice-accent);
}

.nb-speak-artifact-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nb-speak-chip-btn {
  appearance: none;
  min-height: 28px;
  border: 1px solid var(--nb-artifact-border);
  background: #ffffff;
  color: var(--nb-bubble-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
}

.nb-speak-chip-btn[data-copied="true"] {
  border-color: var(--nb-voice-accent);
  color: var(--nb-voice-accent);
}

.nb-speak-artifact-pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  max-height: 196px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.52;
  color: var(--nb-bubble-fg);
}

.nb-speak-artifact-pre[data-expanded="true"] {
  max-height: none;
}

.pane-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--rim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}

.mini-btn {
  appearance: none;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--rim-strong);
  background: var(--pod-core);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.mini-btn--accent {
  background: var(--accent-soft);
  border-color: oklch(34% 0.08 var(--h-forest) / 0.25);
  color: var(--accent-ink);
}

.code-well {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--rim);
  font-size: 12.5px;
  line-height: 1.56;
  overflow-x: auto;
}

/* Proof Strip Beneath Split Stage */
.dsh-proof-bar {
  margin-top: 14px;
  padding: 10px 14px 10px 18px;
  border-radius: 999px;
  background: var(--pod-core);
  border: 1px solid var(--rim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dsh-proof-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.dsh-proof-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
}

/* 4. Sections */
.section-gap {
  margin-top: clamp(56px, 7vw, 84px);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.section-title {
  margin: 0 0 6px;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.section-note {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  max-width: 62ch;
}

/* Interactive Zero-Clone CLI Configurator */
.cli-builder {
  padding: clamp(20px, 2.8vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cli-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.soft-select {
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--rim-strong);
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
}

.cli-output-wrap {
  position: relative;
  border-radius: 18px;
  background: oklch(19% 0.015 var(--h-paper));
  color: #f4f2ec;
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.cli-output-pre {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.cli-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

/* 3 Architectural Pillars & Trio Grid */
.pillar-grid,
.trio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.pillar-card,
.trio-card {
  padding: 22px;
  border-radius: 22px;
  background: var(--pod-core);
  border: 1px solid var(--rim);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trio-card[data-active="true"] {
  border-color: oklch(34% 0.08 var(--h-forest) / 0.35);
  background: linear-gradient(180deg, oklch(97.8% 0.012 var(--h-forest)), var(--pod-core));
}

.card-kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-ink);
}

.card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-desc {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.trio-cmd {
  margin-top: auto;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--surface-subtle);
  font-size: 11.5px;
  color: var(--accent-ink);
  overflow-wrap: break-word;
  word-break: normal;
}

/* Footer */
.site-foot {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--rim);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.foot-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-weight: 600;
}

.foot-links a:hover {
  color: var(--ink);
}

/* Full-Res DSH Lightbox Modal */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 19, 17, 0.76);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 32px);
}

.lightbox-backdrop[hidden] {
  display: none;
}

.lightbox-dialog {
  width: min(1140px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 24px;
  background: var(--pod-core);
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.lightbox-img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--rim);
}

@keyframes nbBubbleRise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .split-stage,
  .pillar-grid,
  .trio-grid {
    grid-template-columns: 1fr;
  }
  .stage-pane--raw {
    border-right: none;
    border-bottom: 1px solid var(--rim);
  }
  .cli-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .masthead {
    border-radius: 22px;
    padding: 10px 12px;
    flex-wrap: wrap;
  }
  .hero-cmd-shell {
    border-radius: 18px;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }
  .cli-controls {
    grid-template-columns: 1fr;
  }
  .cli-output-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .dsh-proof-bar {
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .nb-speak-bubble {
    animation: none;
  }
}
