/* The per-tool page. One narrow column of prose and command lines on the
   shared design system, re-coloured by whichever variation's tokens.css the
   page loads. Generous: one idea per screen, long gaps between sections, and
   nothing on the page that is not a fact about the tool. */

.dd { --content-max: 980px; }

/* ---------- hero ---------- */

.dd-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(3.5rem, 10vw, 7rem) clamp(2.5rem, 7vw, 5rem);
}
.dd-hero-wash {
  position: absolute;
  inset: -35% -20% 0 -20%;
  z-index: -1;
  background-image: var(--dither-checker-25);
  background-size: calc(var(--dither-cell) * 3) calc(var(--dither-cell) * 3);
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(65% 60% at 30% 25%, #000, transparent 100%);
  mask-image: radial-gradient(65% 60% at 30% 25%, #000, transparent 100%);
  will-change: transform;
}
.dd-hero-inner { position: relative; }
.dd-hero h1.dd-title {
  font-size: var(--display-1);
  line-height: var(--leading-display);
  letter-spacing: -0.03em;
  text-transform: none;
}
.dd-tagline {
  margin: var(--space-16) 0 0;
  font-size: var(--display-3);
  color: var(--accent-hi);
  max-width: 34ch;
}
.dd-lead { margin: var(--space-20) 0 0; max-width: 60ch; }
.dd-facts {
  margin: var(--space-20) 0 0;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.dd-facts span { color: var(--accent); padding-inline: var(--space-4); }
.dd-actions { margin-top: clamp(2rem, 4vw, 3rem); gap: var(--space-16); }
.dd-hero-cmd-row { margin-top: var(--space-24); }

.dd-cmd {
  display: inline-flex;
  align-items: center;
  gap: var(--space-10);
  max-width: 100%;
  padding: var(--space-10) var(--space-14);
  --fill: var(--surface);
}
.dd-cmd-text { overflow-x: auto; white-space: nowrap; }

/* ---------- copy button ---------- */

.dd-copy {
  flex: none;
  min-height: 32px;
  padding: var(--space-4) var(--space-10);
  background: none;
  border: 1px solid var(--border-2);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: var(--text-3xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--dur-base) ease, border-color var(--dur-base) ease, transform var(--dur-base) var(--ease-out);
}
.dd-copy:hover, .dd-copy.is-hover { border-color: var(--accent); transform: translateY(-2px); }
.dd-copy.is-copied { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.dd-copy-block { align-self: flex-start; }

/* ---------- sections ---------- */

.dd-band { border-block: 1px solid var(--border-2); }
.dd-section { position: relative; }
.dd-h2 {
  font-size: var(--display-2);
  line-height: var(--leading-display);
  letter-spacing: -0.02em;
  margin-bottom: clamp(1.75rem, 4vw, 3rem);
}
.dd-prose p { color: var(--text-dim); font-size: var(--text-xl); line-height: var(--leading-relaxed); max-width: 66ch; margin-bottom: var(--space-20); }
.dd-prose p:last-child { margin-bottom: 0; }
.dd-audience { color: var(--text) !important; border-left: 3px solid var(--accent); padding-left: var(--space-20); }
.dd-prose code { font-size: 0.9em; }

/* ---------- what it does ---------- */

.dd-caps { display: flex; flex-direction: column; gap: var(--space-4); max-width: 72ch; }
.dd-cap {
  position: relative;
  padding: var(--space-16) var(--space-16) var(--space-16) var(--space-48);
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  color: var(--text-dim);
  line-height: var(--leading-relaxed);
  transition: border-color var(--dur-base) ease;
}
.dd-cap::before {
  content: "";
  position: absolute;
  left: var(--space-20);
  top: 1.45em;
  width: 10px;
  height: 10px;
  background: var(--accent);
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-base) ease;
}
.dd-cap:hover, .dd-cap.is-hover {
  border-left-color: var(--accent);
  border-bottom-color: var(--accent);
}
.dd-cap.is-near { border-left-color: var(--border-2); }
.dd-cap:hover::before, .dd-cap.is-hover::before { transform: rotate(45deg) scale(1.2); }

/* ---------- install ---------- */

.dd-installs { display: flex; flex-direction: column; gap: var(--space-24); max-width: 62rem; }
.dd-install-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  border-left: 3px solid transparent;
  padding-left: var(--space-14);
  transition: border-color var(--dur-base) ease;
}
.dd-install-label { color: var(--accent-hi); }
.dd-install-row pre { border-color: var(--border-2); transition: border-color var(--dur-base) ease; }
.dd-install-row:hover, .dd-install-row.is-hover { border-left-color: var(--accent); }
.dd-install-row:hover pre, .dd-install-row.is-hover pre { border-color: var(--accent); }
.dd-install-row.is-near { border-left-color: var(--border-2); }
.dd-install-row.is-near pre { border-color: var(--accent-a40); }
.dd-none { color: var(--text-dim); }

.dd-packages { margin-top: clamp(2rem, 4vw, 3rem); padding: var(--space-24); --fill: var(--surface); width: fit-content; min-width: min(100%, 22rem); }
.dd-pkgs { margin-top: var(--space-16); display: flex; flex-direction: column; gap: var(--space-8); }
.dd-pkgs li { display: flex; justify-content: space-between; gap: var(--space-24); font-family: var(--font-mono); font-size: var(--text-xs); }
.dd-pkg-key { color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.12em; }
.dd-pkg-val { color: var(--text); }

/* ---------- the terminal demo ---------- */

/* An animated SVG that carries its own animation: no script, no libraries,
   and the alt text says what it shows. Desktop gets it at the width of the
   column; a phone gets it narrower and shorter, sized on its own line. */
.dd-demo-figure { margin: 0; }
/* A replaced element cannot carry the notch's painted layers, so the demo
   takes the same treatment directly: a hairline outline and the black offset
   shadow every other block on the site casts. */
.dd-demo-img {
  width: min(100%, 60rem);
  height: auto;
  background: var(--surface);
  border: var(--line-w) solid var(--border-2);
  box-shadow: var(--shadow-x) var(--shadow-y) 0 var(--shadow-color);
}
.dd-demo-figure figcaption {
  margin-top: var(--space-14);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

/* ---------- more tools ---------- */

.dd-more { display: grid; gap: clamp(1.25rem, 2.5vw, 2rem); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.dd-nl { max-width: 46rem; }

/* ---------- mobile (390px) ---------- */

@media (max-width: 899px) {
  .dd-title { font-size: clamp(2rem, 11vw, 3rem); }
  .dd-tagline { font-size: var(--text-2xl); }
  .dd-prose p { font-size: var(--text-lg); }
  .dd-actions { flex-direction: column; align-items: stretch; }
  .dd-actions .st-btn { width: 100%; }
  .dd-cmd { width: 100%; }
  .dd-hero-wash { display: none; }
  .dd-cap { padding-left: var(--space-28); }
  .dd-cap::before { left: var(--space-8); }
  .dd-pkgs li { flex-direction: column; gap: var(--space-2); }
  /* A phone column is narrower than a terminal line: the demo keeps a legible
     height and the figure scrolls sideways, the way an install command does,
     rather than shrinking the type to nothing. */
  .dd-demo-figure { overflow-x: auto; }
  .dd-demo-img { width: auto; max-width: none; height: clamp(150px, 42vw, 220px); box-shadow: none; }
}
