/* ---------- Layout ---------- */
.dw-page {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}
.dw-top {
  grid-column: 1 / -1;
  height: 56px;
  display: flex; align-items: center;
  gap: 24px;
  padding: 0 28px;
  background: var(--dw-bg);
  border-bottom: 1px solid var(--dw-line);
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: saturate(180%) blur(6px);
}
.dw-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--dw-font-display);
  font-weight: 600;
  letter-spacing: -.01em;
  font-size: 17px;
  color: var(--dw-text);
  border: none;
}
.dw-brand__mark {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: #14161c;
  color: var(--dw-accent);
  border-radius: 6px;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
  font-family: var(--dw-font-mono);
}
.dw-brand__version {
  font-family: var(--dw-font-mono);
  font-size: 11px;
  color: var(--dw-text-mute);
  background: var(--dw-bg-soft);
  border: 1px solid var(--dw-line);
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 4px;
  font-weight: 400;
}
.dw-nav {
  display: flex; align-items: center; gap: 20px;
  margin-left: 12px;
}
.dw-nav a {
  font-size: 14px;
  color: var(--dw-text-dim);
  border: none;
}
.dw-nav a:hover { color: var(--dw-text); }
.dw-nav a.active { color: var(--dw-accent-lo); font-weight: 500; }

.dw-top__spacer { flex: 1; }
.dw-top__actions { display: flex; align-items: center; gap: 10px; }

.dw-search {
  display: flex; align-items: center; gap: 8px;
  width: 240px; height: 32px;
  padding: 0 10px;
  background: var(--dw-bg-soft);
  border: 1px solid var(--dw-line);
  border-radius: 6px;
  color: var(--dw-text-mute);
  font-size: 13px;
  cursor: text;
}
.dw-search:hover { border-color: #d4d8e0; }
.dw-search kbd {
  margin-left: auto;
  font-family: var(--dw-font-mono);
  font-size: 11px;
  background: #fff;
  border: 1px solid var(--dw-line);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--dw-text-mute);
}

.dw-sidebar {
  border-right: 1px solid var(--dw-line);
  padding: 24px 0 60px 0;
  background: var(--dw-bg);
  position: sticky;
  top: 56px;
  align-self: start;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
}
.dw-sidebar__group {
  padding: 10px 20px 4px 28px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--dw-text-mute);
  font-weight: 600;
}
.dw-sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 20px 5px 28px;
  font-size: 14px;
  color: var(--dw-text-dim);
  border: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
}
.dw-sidebar a:hover { color: var(--dw-text); background: var(--dw-bg-soft); }
.dw-sidebar a.active {
  color: var(--dw-accent-lo);
  border-left-color: var(--dw-accent);
  background: var(--dw-accent-dim);
  font-weight: 500;
}
.dw-sidebar a svg { color: var(--dw-text-mute); }
.dw-sidebar a.active svg { color: var(--dw-accent); }

.dw-main {
  padding: 56px 64px 120px;
  max-width: 1100px;
  min-width: 0;
}
@media (max-width: 1100px) { .dw-main { padding: 40px 32px 80px; } }

.dw-section { margin-bottom: 80px; scroll-margin-top: 72px; }
.dw-section__eyebrow {
  font-family: var(--dw-font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dw-text-mute);
  margin-bottom: 12px;
}
.dw-section__lead {
  font-size: 18px;
  color: var(--dw-text-dim);
  margin-top: 12px;
  max-width: 64ch;
  line-height: 1.55;
}

/* Hamburger (mobile only) toggles the sidebar drawer; scrim dims behind it. */
.dw-hamburger {
  display: none;
  align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-left: -6px;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--dw-text-dim); cursor: pointer;
}
.dw-hamburger:hover { background: var(--dw-bg-soft); color: var(--dw-text); }
.dw-scrim { display: none; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .dw-page { grid-template-columns: 1fr; }
  .dw-top { gap: 10px; padding: 0 14px; }
  .dw-hamburger { display: inline-flex; }
  .dw-nav { display: none; }
  .dw-brand__version { display: none; }

  /* Sidebar becomes an off-canvas drawer. */
  .dw-sidebar {
    position: fixed; top: 56px; left: 0; bottom: 0;
    width: 272px; max-height: none; z-index: 45;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 0 16px 48px rgba(16, 24, 40, .28);
  }
  .dw-sidebar--open { transform: none; }
  .dw-scrim {
    display: block; position: fixed; inset: 56px 0 0 0;
    background: rgba(16, 22, 34, .42); z-index: 44;
  }

  .dw-main { padding: 28px 18px 80px; }
  .dw-section { margin-bottom: 56px; }
  .dw-section__lead { font-size: 16px; }
  /* (Demo horizontal-scroll lives in _02-cards.scss so it lands after the
     base .dw-demo overflow:hidden and actually wins.) */
}

@media (max-width: 560px) {
  .dw-main h2 { font-size: 24px; }
}
