/* ============================================================
   25 — Quickstart
   Scope: .docs-qs* · .docs-win* · .docs-cmd* · .dtok-* (under .docs-qs)
   Light section, dark windows. The window metrics live here and are
   reused verbatim by 45-objects.css for the dark section, which is
   why every one of them is a custom property.
   ============================================================ */

.docs-qs {
  /* ---- window palette: one dark surface, five accents, three greys ---- */
  --w-bg:      var(--c-navy-deep);
  --w-bar:     color-mix(in srgb, var(--c-white)  4%, var(--c-navy-deep));
  --w-hair:    color-mix(in srgb, var(--c-white) 11%, transparent);
  --w-hair-hi: color-mix(in srgb, var(--c-white) 22%, transparent);
  --w-fg:      color-mix(in srgb, var(--c-white) 90%, transparent);
  --w-dim:     color-mix(in srgb, var(--c-white) 60%, transparent); /* 5.5:1 on --w-bg */

  --dtk-fn:   color-mix(in srgb, var(--c-cyan)  62%, var(--c-white));
  --dtk-str:  var(--c-lime);
  --dtk-num:  var(--c-orange);
  --dtk-kw:   color-mix(in srgb, var(--c-brand) 52%, var(--c-white));
  --dtk-com:  color-mix(in srgb, var(--c-white) 54%, transparent);
  --dtk-punc: color-mix(in srgb, var(--c-white) 52%, transparent);
  --dtk-op:   color-mix(in srgb, var(--c-white) 64%, transparent);

  /* ---- code metrics: fixed line box so a tab switch cannot reflow ---- */
  --w-fs:   var(--fs-xs);
  --w-lh:   1.55rem;
  --w-padY: var(--s-5);
}

.docs-qs__head { max-width: 46ch; }
.docs-qs__title { margin-block: var(--s-4) 0; }
.docs-qs__lead { margin-block-start: var(--s-5); }

/* ---------------- Language tablist ---------------- */

.docs-qs__tabs { margin-block-start: var(--s-9); }

.docs-qs__tablist {
  display: flex;
  gap: var(--s-1);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding-block-end: var(--s-1);
  border-block-end: 1px solid var(--border);
}
.docs-qs__tablist::-webkit-scrollbar { display: none; }

.docs-qs__tab {
  position: relative;
  flex: none;
  min-width: 44px;
  height: calc(var(--s-9) - var(--s-1));           /* 44px touch target */
  padding-inline: var(--s-4);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-snug);
  color: var(--text-muted);
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease-out);
}
.docs-qs__tab::after {
  content: "";
  position: absolute;
  inset: auto var(--s-3) calc(var(--s-1) * -1 - 1px);
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--c-brand);
  transform: scaleX(0);
  opacity: 0;
  transition: transform var(--t-base) var(--ease-expo), opacity var(--t-base) var(--ease-out);
}
.docs-qs__tab:hover { color: var(--text-strong); }
.docs-qs__tab:focus-visible { outline-offset: -3px; }   /* strip is a scroll box */
.docs-qs__tab.is-active { color: var(--text-strong); font-weight: var(--fw-semi); }
.docs-qs__tab.is-active::after { transform: none; opacity: 1; }

/* Belt to the fixed window heights' braces: even if a future snippet runs
   long, the stage cannot collapse under the tallest panel's resting height. */
.docs-qs__stage { padding-block-start: var(--s-8); }
@media (min-width: 900px) {
  .docs-qs__stage { min-height: calc(var(--s-14) * 4); }
}

.docs-qs__panel[hidden] { display: none; }

/* ---------------- Steps ---------------- */

.docs-qs__steps {
  display: grid;
  gap: var(--s-9);
  counter-reset: docs-step;
}

.docs-qs__step {
  display: grid;
  gap: var(--s-4);
  counter-increment: docs-step;
  min-width: 0;
}

@media (min-width: 900px) {
  .docs-qs__steps { gap: var(--s-10); }
  .docs-qs__step {
    grid-template-columns: minmax(0, 30fr) minmax(0, 70fr);
    gap: var(--s-9);
    align-items: start;
  }
  /* optical: the say column's cap-height sits with the window's chrome bar */
  .docs-qs__say { padding-block-start: var(--s-1); }
}

.docs-qs__st {
  position: relative;
  padding-inline-start: calc(var(--s-7) + var(--s-2));
  font-size: var(--fs-h4);
  font-weight: var(--fw-semi);
  color: var(--text-strong);
  letter-spacing: var(--tracking-snug);
  line-height: var(--lh-snug);
}
.docs-qs__st::before {
  content: counter(docs-step);
  position: absolute;
  inset-block-start: calc((1em * var(--lh-snug) - var(--s-7)) / 2);
  inset-inline-start: 0;
  display: grid;
  place-items: center;
  width: var(--s-7);
  height: var(--s-7);
  border-radius: var(--r-pill);
  background: var(--c-brand-tint);
  color: var(--c-brand-press);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-normal);
}

.docs-qs__sb {
  margin-block-start: var(--s-2);
  padding-inline-start: calc(var(--s-7) + var(--s-2));
  max-width: 40ch;
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--text-body);
}

.docs-qs__inline {
  padding: 0.1em var(--s-1);
  border-radius: var(--r-xs);
  background: var(--surface-alt);
  box-shadow: inset 0 0 0 1px var(--c-hairline-soft);
  font-size: 0.92em;
  color: var(--text-strong);
  overflow-wrap: anywhere;
}

.docs-qs__do { min-width: 0; }

/* ---------------- Install command row ---------------- */

.docs-cmd {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: var(--s-9);
  padding-inline: var(--s-5) var(--s-3);
  border-radius: var(--r-md);
  background: var(--w-bg);
  box-shadow: inset 0 0 0 1px var(--w-hair), var(--sh-sm);
}

.docs-cmd__code {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  padding-block: var(--s-3);
  font-size: var(--w-fs);
  color: var(--w-fg);
  scrollbar-width: none;
}
.docs-cmd__code::-webkit-scrollbar { display: none; }
/* The prompt is decoration, so it lives outside the DOM the copy button reads. */
.docs-cmd__code::before {
  content: "$";
  margin-inline-end: var(--s-2);
  color: var(--dtk-fn);
  -webkit-user-select: none;
  user-select: none;
}

/* ---------------- Code window ---------------- */

.docs-win {
  margin: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--w-bg);
  box-shadow: inset 0 0 0 1px var(--w-hair),
              0 2px 6px -2px rgb(10 37 64 / .18),
              0 18px 40px -24px rgb(6 28 51 / .55);
}

.docs-win__bar {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: var(--s-9);
  padding-inline: var(--s-5) var(--s-3);
  background: var(--w-bar);
  border-block-end: 1px solid var(--w-hair);
}

.docs-win__file {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--w-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-win__copy {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: var(--s-7);
  height: var(--s-7);
  border-radius: var(--r-sm);
  color: var(--w-dim);
  transition: color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
/* 32px control, 44px hit area. */
.docs-win__copy::after { content: ""; position: absolute; inset: calc(var(--s-2) * -.75); }
.docs-win__copy:hover { color: var(--w-fg); background: var(--w-hair); }
.docs-win__copy.is-copied { color: var(--c-lime); }

.docs-win__copy-a, .docs-win__copy-b {
  grid-area: 1 / 1;
  width: var(--s-4);
  height: var(--s-4);
  transition: opacity var(--t-fast) var(--ease-out), transform var(--t-base) var(--ease-out);
}
.docs-win__copy-b { opacity: 0; transform: translateY(3px); }
.docs-win__copy.is-copied .docs-win__copy-a { opacity: 0; transform: translateY(-3px); }
.docs-win__copy.is-copied .docs-win__copy-b { opacity: 1; transform: none; }

.docs-win__pre {
  margin: 0;
  padding: var(--w-padY) var(--s-5);
  overflow: auto;
  color: var(--w-fg);
  font-size: var(--w-fs);
  line-height: var(--w-lh);
  tab-size: 2;
  scrollbar-width: thin;
  scrollbar-color: var(--w-hair-hi) transparent;
}
.docs-win__pre:focus-visible { outline-offset: -3px; }
.docs-win__pre::-webkit-scrollbar { width: var(--s-2); height: var(--s-2); }
.docs-win__pre::-webkit-scrollbar-thumb { background: var(--w-hair-hi); border-radius: var(--r-pill); }
/* base.css types `code` one step up; the window runs tighter than body copy. */
.docs-win__pre code { font-size: var(--w-fs); }

/* Fixed heights, sized to the longest snippet in each step (Python at 8 lines,
   Go at 15). Switching language therefore never moves anything below. */
.docs-win__pre--auth { height: calc(8 * var(--w-lh) + var(--w-padY) * 2); }
.docs-win__pre--req  { height: calc(15 * var(--w-lh) + var(--w-padY) * 2); }

/* ---------------- Tokens ---------------- */

.docs-qs .dtok-fn,
.docs-qs .dtok-type { color: var(--dtk-fn); }
.docs-qs .dtok-str  { color: var(--dtk-str); }
.docs-qs .dtok-num,
.docs-qs .dtok-var  { color: var(--dtk-num); }
.docs-qs .dtok-kw   { color: var(--dtk-kw); }
.docs-qs .dtok-com  { color: var(--dtk-com); }
.docs-qs .dtok-punc { color: var(--dtk-punc); }
.docs-qs .dtok-op   { color: var(--dtk-op); }

/* ---------------- Footnote ---------------- */

.docs-qs__foot {
  margin-block-start: var(--s-9);
  padding-block-start: var(--s-6);
  border-block-start: 1px solid var(--border);
  max-width: 74ch;
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--text-body);
}
.docs-qs__foot .arrow-link { margin-inline-start: var(--s-2); }

@media (max-width: 419px) {
  .docs-qs { --w-fs: 0.75rem; --w-lh: 1.4rem; }
  .docs-win__pre { padding-inline: var(--s-4); }
  .docs-cmd { padding-inline: var(--s-4) var(--s-2); }
}
