/* ---------- Cards ---------- */
.dw-card {
  background: var(--dw-bg);
  border: 1px solid var(--dw-line);
  border-radius: var(--dw-radius);
  overflow: hidden;
}
.dw-card__head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--dw-bg-soft);
  border-bottom: 1px solid var(--dw-line);
  font-size: 13px;
  color: var(--dw-text-dim);
}
.dw-card__head .dw-card__title {
  font-weight: 500; color: var(--dw-text);
  font-family: var(--dw-font-mono);
  font-size: 12px;
  letter-spacing: .03em;
}
.dw-card__body { padding: 28px; }

/* Demo container — embeds a dark DCC panel cleanly */
.dw-demo {
  border-radius: var(--dw-radius);
  border: 1px solid #14161c;
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.dw-demo--panel { background: #2a2e38; }   /* matches default .dcs-bg — for bare-widget demos */
.dw-demo--app   { background: #1f222a; }   /* matches .dcs-bg-app — for Panel/Dock demos */
.dw-demo--checker {
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.02) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.02) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,.02) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.02) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}
.dw-demo--inset { padding: 0; }

/* ── Inline notes inside a demo card ──────────────────────────────
   `.dw-note` is the standard small-print description used inside
   demos (and elsewhere). On the light docs page it reads as dim grey;
   inside a dark `.dw-demo--app`/`--panel` it switches to the dark
   palette so the text stays legible against the panel background.
   Inline `<code>` is similarly re-skinned for the dark context. */
.dw-note {
  font-size: 13px;
  line-height: 1.65;
  color: var(--dw-text-dim);
}
.dw-note strong { color: var(--dw-text); font-weight: 600; }
.dw-note p { margin: 0 0 .6em; color: inherit; }
.dw-note p:last-child { margin-bottom: 0; }

.dw-demo--app .dw-note,
.dw-demo--panel .dw-note { color: var(--dcs-text-dim); }
.dw-demo--app .dw-note strong,
.dw-demo--panel .dw-note strong { color: var(--dcs-text); }

/* Inline <code> inside a dark demo — light bg/dark text would flash
   against the panel; use a translucent dark chip with accent text. */
.dw-demo--app :not(pre) > code,
.dw-demo--panel :not(pre) > code {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .10);
  color: var(--dcs-accent-hi, #8fc1ff);
}

/* On small screens, let demos scroll horizontally rather than collapse/clip.
   Must sit AFTER the base `overflow: hidden` above so it wins. Demos that can
   shrink to fit (e.g. the node graph) simply do; complex demos hold their
   layout via the Demo `minw` prop / inline min-width and scroll. An
   always-visible scrollbar makes the affordance obvious (overlay scrollbars
   otherwise stay hidden until you scroll). */
@media (max-width: 860px) {
  .dw-demo { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  .dw-demo::-webkit-scrollbar { height: 10px; }
  .dw-demo::-webkit-scrollbar-track { background: rgba(0, 0, 0, .05); }
  .dw-demo::-webkit-scrollbar-thumb {
    background: var(--dw-text-mute); border-radius: 5px;
    border: 2px solid transparent; background-clip: padding-box;
  }
}

.dw-demo__caption {
  margin-top: 10px;
  font-size: 12px;
  color: var(--dw-text-mute);
  font-family: var(--dw-font-mono);
  display: flex; align-items: center; gap: 8px;
}

/* Two-column demo + code */
.dw-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .dw-split { grid-template-columns: 1fr; } }

.dw-stack { display: grid; gap: 16px; }
.dw-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* Footnotes, captions */
.dw-caption {
  font-size: 12px;
  color: var(--dw-text-mute);
  font-family: var(--dw-font-mono);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.dw-meta {
  font-family: var(--dw-font-mono);
  font-size: 11px;
  color: var(--dw-text-mute);
}

/* Pill / tag in the light system */
.dw-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--dw-font-mono);
  font-size: 11px;
  height: 22px; padding: 0 9px;
  background: var(--dw-bg-soft);
  border: 1px solid var(--dw-line);
  border-radius: 999px;
  color: var(--dw-text-dim);
  letter-spacing: .03em;
}
.dw-pill--accent {
  background: var(--dw-accent-dim);
  border-color: rgba(77,159,255,.35);
  color: var(--dw-accent-lo);
}
.dw-pill--dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}

/* Big install snippet */
.dw-install {
  display: flex; align-items: center; gap: 12px;
  background: #0f1218;
  color: #d8dade;
  border-radius: 10px;
  padding: 14px 18px;
  font-family: var(--dw-font-mono);
  font-size: 14px;
  border: 1px solid #1c2230;
}
.dw-install__prompt { color: #4d9fff; user-select: none; }
.dw-install__cmd { flex: 1; }
.dw-install__copy {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  color: #aab0bd;
  border: 1px solid #2a3142;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--dw-font-mono);
}
.dw-install__copy:hover { color: #fff; background: #1c2230; }

/* Hero — feels like the site, but with one big DCC artifact */
.dw-hero {
  padding-top: 48px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-bottom: 64px;
}
.dw-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--dw-font-mono);
  font-size: 12px;
  color: var(--dw-text-mute);
  margin-bottom: 16px;
}
.dw-hero__eyebrow::before {
  content: ""; width: 24px; height: 1px; background: var(--dw-accent);
}
.dw-hero > * { min-width: 0; }   /* let columns shrink so wide deck/text never force page overflow */
.dw-hero h1 { max-width: 18ch; }
.dw-hero p.lede {
  margin-top: 18px;
  font-size: 19px;
  line-height: 1.5;
  color: var(--dw-text-dim);
  max-width: 56ch;
}
.dw-hero__actions {
  margin-top: 28px;
  display: flex; gap: 12px; align-items: center;
  flex-wrap: wrap;   /* wrap to a second row rather than cram/overflow */
}
.dw-cta {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--dw-font);
}
.dw-cta--primary {
  background: #14161c;
  color: #fff;
  border-color: #14161c;
}
.dw-cta--primary:hover { background: #2a2e38; }
.dw-cta--ghost {
  background: transparent;
  color: var(--dw-text);
  border-color: var(--dw-line);
}
.dw-cta--ghost:hover { border-color: #c8cdd6; background: var(--dw-bg-soft); }

/* Narrow / sidebar-present widths: stack the hero CTAs as full-width buttons
   instead of a cramped, wrapping row. Kicks in well before phone widths
   because the sidebar eats horizontal room. The MIT pill stays a small chip,
   and the verbose download sub-label drops. */
@media (max-width: 1000px) {
  .dw-hero__actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .dw-hero__actions .dw-cta { width: 100%; justify-content: center; }
  .dw-hero__actions .dw-pill { align-self: flex-start; }
  .dw-cta__sub { display: none; }
}

/* Featured stage — large dark embed */
.dw-stage {
  background: var(--dcs-bg-app, #1f222a);
  border-radius: 14px;
  border: 1px solid #14161c;
  padding: 0;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,.5) inset,
    0 30px 80px -20px rgba(20,30,60,.25),
    0 12px 24px -10px rgba(20,30,60,.18);
  position: relative;
}
.dw-stage__chrome {
  display: flex; align-items: center; gap: 10px;
  height: 28px;
  padding: 0 12px;
  background: linear-gradient(180deg, #3c424f, #2a2e38);
  border-bottom: 1px solid #14161c;
}
.dw-stage__lights { display: flex; gap: 6px; }
.dw-stage__light { width: 10px; height: 10px; border-radius: 50%; background: #555d6e; }
.dw-stage__title {
  flex: 1;
  text-align: center;
  font-family: var(--dw-font-mono);
  font-size: 11px;
  color: #aab0bd;
  letter-spacing: .04em;
}

/* In-page links */
.dw-anchor {
  font-family: var(--dw-font-mono);
  font-size: 12px;
  color: var(--dw-text-mute);
  text-decoration: none;
  margin-left: 12px;
  opacity: 0;
  border: none;
}
.dw-section h2:hover .dw-anchor,
.dw-section h3:hover .dw-anchor { opacity: 1; }

/* Subgrid headings */
.dw-subhead {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--dw-line);
}
.dw-subhead h3 { margin: 0; }
.dw-subhead__meta {
  font-family: var(--dw-font-mono);
  font-size: 11px;
  color: var(--dw-text-mute);
}

/* Foot */
.dw-foot {
  border-top: 1px solid var(--dw-line);
  padding: 32px 64px;
  font-size: 13px;
  color: var(--dw-text-mute);
  grid-column: 1 / -1;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  align-items: center;
}
.dw-foot a { color: var(--dw-text-dim); border: none; }
.dw-foot a:hover { color: var(--dw-text); }

/* Right-side ToC (optional) */
.dw-toc {
  position: fixed;
  top: 88px; right: 24px;
  width: 200px;
  font-size: 12px;
  color: var(--dw-text-mute);
  display: none;
}
@media (min-width: 1400px) { .dw-toc { display: block; } }
.dw-toc__title {
  font-family: var(--dw-font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--dw-text-mute);
  margin-bottom: 10px;
}
.dw-toc a {
  display: block;
  padding: 3px 0;
  border: none;
  color: var(--dw-text-dim);
}
.dw-toc a:hover { color: var(--dw-text); }
.dw-toc a.active { color: var(--dw-accent-lo); font-weight: 500; }

/* "Why" feature grid */
.dw-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
}
@media (max-width: 900px) { .dw-feature-grid { grid-template-columns: 1fr; } }
.dw-feature {
  padding: 24px;
  border: 1px solid var(--dw-line);
  border-radius: var(--dw-radius);
  background: var(--dw-bg);
}
.dw-feature__icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--dw-accent-dim);
  color: var(--dw-accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.dw-feature h4 { margin-bottom: 6px; }
.dw-feature p { font-size: 14px; line-height: 1.55; color: var(--dw-text-dim); }
