/*
  PaskalCPP™ Programming Language

  Copyright © 2026-present tinyBigGAMES™ LLC
  All Rights Reserved.

  https://paskalcpp.org

  SPDX-License-Identifier: MPL-2.0

  This Source Code Form is subject to the terms of the
  Mozilla Public License, v. 2.0. If a copy of the MPL
  was not distributed with this file, You can obtain one
  at https://mozilla.org/MPL/2.0/.

  ---

  Design system: base styles and components, shared by the website and the
  docs (online and offline). Needs tokens.css first. Every class starts with
  ds- so a page's own styles never collide. components.html shows each one.
*/

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--ds-nav-h) + var(--ds-sp-4));
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ds-bg);
  color: var(--ds-text);
  font-family: var(--ds-sans);
  font-size: var(--ds-fs-md);
  line-height: var(--ds-lh);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--ds-sp-4);
  line-height: var(--ds-lh-tight);
  letter-spacing: -0.01em;
}

h1 {
  font-family: var(--ds-serif);
  font-weight: 800;
  font-size: var(--ds-fs-3xl);
}

h2 {
  font-family: var(--ds-serif);
  font-weight: 800;
  font-size: var(--ds-fs-2xl);
}

h3 {
  font-size: var(--ds-fs-xl);
  font-weight: 700;
}

h4 {
  font-size: var(--ds-fs-lg);
  font-weight: 700;
}

p,
ul,
ol,
table,
pre,
figure {
  margin: 0 0 var(--ds-sp-4);
}

a {
  color: var(--ds-link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--ds-link) 40%, transparent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ds-link-hover);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--ds-cyan);
  outline-offset: 3px;
  border-radius: var(--ds-radius-sm);
}

code,
kbd,
pre,
samp {
  font-family: var(--ds-mono);
  font-size: 0.92em;
  /* Code shows the characters written: a coding font's ligatures would draw
     <> := -> as one glyph a reader may take for another operator */
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}

:not(pre) > code {
  padding: 0.12em 0.4em;
  border-radius: var(--ds-radius-sm);
  background: var(--ds-surface-2);
  border: 1px solid var(--ds-line);
  color: var(--ds-text);
  overflow-wrap: anywhere;
}

/* An inline code span with no space is one word (the generators set the class): it moves to
   the next line whole instead of breaking at a '-', a line-break opportunity (`--` was split
   over two lines). One longer than the line still wraps inside, so a phone never scrolls
   sideways. The line height keeps the box inside the text's line */
:not(pre) > code.ds-code-word {
  display: inline-block;
  max-width: 100%;
  line-height: 1.25;
}

kbd {
  display: inline-block;
  padding: 0.1em 0.5em;
  border-radius: var(--ds-radius-sm);
  background: var(--ds-surface-2);
  border: 1px solid var(--ds-line-strong);
  border-bottom-width: 3px;
  font-size: 0.85em;
  white-space: nowrap;
}

hr {
  border: 0;
  height: 1px;
  background: var(--ds-line);
  margin: var(--ds-sp-6) 0;
}

::selection {
  background: color-mix(in srgb, var(--ds-blue) 40%, transparent);
}

.ds-skip {
  position: absolute;
  left: var(--ds-sp-4);
  top: -80px;
  z-index: 200;
  padding: var(--ds-sp-2) var(--ds-sp-4);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-cyan);
  color: var(--ds-on-accent);
  font-weight: 700;
}

.ds-skip:focus {
  top: var(--ds-sp-3);
}

.ds-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Layout */
.ds-shell {
  width: min(calc(100% - 2 * var(--ds-gutter)), var(--ds-max));
  margin-inline: auto;
}

.ds-section {
  padding-block: var(--ds-sp-8);
}

.ds-section--tight {
  padding-block: var(--ds-sp-6);
}

.ds-band {
  background: var(--ds-bg-2);
  border-block: 1px solid var(--ds-line);
}

.ds-grid {
  display: grid;
  gap: var(--ds-sp-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.ds-stack > * + * {
  margin-top: var(--ds-sp-4);
}

.ds-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ds-sp-3);
}

.ds-prose {
  max-width: var(--ds-max-text);
}

.ds-prose li + li {
  margin-top: var(--ds-sp-1);
}

/* Text helpers */
.ds-kicker {
  display: inline-block;
  margin-bottom: var(--ds-sp-3);
  font-size: var(--ds-fs-xs);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ds-cyan);
}

.ds-lead {
  font-size: var(--ds-fs-lg);
  color: var(--ds-muted);
  max-width: var(--ds-max-text);
}

.ds-muted {
  color: var(--ds-muted);
}

/* inline-block: the gradient spans the text, not the whole line */
.ds-gradient-text {
  display: inline-block;
  background: var(--ds-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* The wordmark: "Paskal" serif + "CPP" sans in the brand gradient */
.ds-wordmark {
  display: inline-flex;
  align-items: baseline;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}

.ds-wordmark .ds-wm-paskal {
  font-family: var(--ds-serif);
  color: var(--ds-text);
}

.ds-wordmark .ds-wm-cpp {
  font-family: var(--ds-sans);
  font-weight: 900;
  background: var(--ds-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Buttons */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-sp-2);
  min-height: 44px;
  padding: 0 var(--ds-sp-5);
  border: 1px solid transparent;
  border-radius: 999px;
  font: 700 var(--ds-fs-md) / 1 var(--ds-sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s var(--ds-ease), box-shadow 0.18s var(--ds-ease), background 0.18s var(--ds-ease);
}

.ds-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.ds-btn--primary {
  background: var(--ds-brand);
  color: #ffffff;
  box-shadow: var(--ds-glow);
}

.ds-btn--primary:hover {
  color: #ffffff;
  box-shadow: var(--ds-glow-strong);
}

.ds-btn--ghost {
  background: transparent;
  color: var(--ds-text);
  border-color: var(--ds-line-strong);
}

.ds-btn--ghost:hover {
  color: var(--ds-text);
  border-color: var(--ds-cyan);
  background: var(--ds-brand-soft);
}

.ds-btn--subtle {
  background: var(--ds-surface-2);
  color: var(--ds-text);
  border-color: var(--ds-line);
}

.ds-btn--subtle:hover {
  color: var(--ds-text);
  background: var(--ds-surface-3);
}

.ds-btn--sm {
  min-height: 34px;
  padding: 0 var(--ds-sp-4);
  font-size: var(--ds-fs-sm);
}

.ds-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--ds-line);
  background: var(--ds-surface);
  color: var(--ds-text);
  cursor: pointer;
}

.ds-icon-btn:hover {
  border-color: var(--ds-line-strong);
  background: var(--ds-surface-2);
}

.ds-icon-btn svg {
  width: 20px;
  height: 20px;
}

/* Navigation bar */
.ds-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--ds-bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--ds-line);
}

.ds-nav-inner {
  display: flex;
  align-items: center;
  gap: var(--ds-sp-4);
  min-height: var(--ds-nav-h);
}

.ds-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-sp-2);
  margin-right: auto;
  color: var(--ds-text);
  font-size: 1.35rem;
  text-decoration: none;
}

.ds-brand:hover {
  color: var(--ds-text);
}

/* The mark beside the wordmark is favicon.ico (the P++ mark, no lettering:
   the logo's own lettering cannot be read at nav size) */
.ds-brand img {
  width: 32px;
  height: 32px;
}

.ds-nav-links {
  display: flex;
  align-items: center;
  gap: var(--ds-sp-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-nav-links a {
  color: var(--ds-muted);
  font-weight: 600;
  font-size: var(--ds-fs-sm);
  text-decoration: none;
}

.ds-nav-links a:hover,
.ds-nav-links a[aria-current="page"] {
  color: var(--ds-text);
}

.ds-nav-menu {
  display: none;
}

@media (max-width: 760px) {
  .ds-nav-menu {
    display: inline-grid;
  }

  .ds-nav-links {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--ds-sp-2) var(--ds-gutter) var(--ds-sp-4);
    background: var(--ds-bg);
    border-bottom: 1px solid var(--ds-line);
  }

  .ds-nav[data-open] .ds-nav-links {
    display: flex;
  }

  .ds-nav-links a {
    display: block;
    padding: var(--ds-sp-3) 0;
    font-size: var(--ds-fs-md);
  }
}

/* Hero */
.ds-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: var(--ds-sp-8) var(--ds-sp-8);
  text-align: center;
  color-scheme: dark;
  background: var(--ds-stage-bg) url("../media/stage.svg") center bottom / cover no-repeat;
  color: var(--ds-stage-text);

  /* The stage's own colors for what sits on it (lead, inline code, ghost button,
     focus): light mode's surface and line would wash out on the dark stage */
  --ds-text: var(--ds-stage-text);
  --ds-muted: var(--ds-stage-muted);
  --ds-line: var(--ds-stage-line);
  --ds-line-strong: var(--ds-stage-line-strong);
  --ds-surface-2: var(--ds-stage-surface-2);
  --ds-brand-soft: linear-gradient(135deg, rgba(31, 139, 255, 0.22), rgba(139, 92, 255, 0.18));
}

/* The stage is stage.svg (social.jpg's scene in vectors, generated by
   scripts\docs\gen_stage.py). A soft dark pool behind the title and lead
   keeps them readable over it. */
.ds-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(34rem 22rem at 50% 45%, rgba(4, 9, 32, 0.55), transparent 70%);
}

/* The glowing horizon line under the hero */
.ds-hero::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 0;
  height: 2px;
  z-index: -1;
  background: linear-gradient(90deg, transparent, var(--ds-cyan), var(--ds-violet), transparent);
  box-shadow: var(--ds-glow-strong);
}

/* The title IS the logo: logo.png already holds "PaskalCPP" and
   "Programming Language", so no text wordmark repeats it. The <h1> keeps the
   name for readers and search through the image's alt text. */
.ds-hero-title {
  margin: 0 0 var(--ds-sp-5);
  line-height: 0;
}

.ds-hero-mark {
  width: min(400px, 82vw);
  margin: 0 auto;
  filter: drop-shadow(0 0 34px rgba(47, 211, 255, 0.35));
}

.ds-hero .ds-lead {
  margin-inline: auto;
}

.ds-hero .ds-row {
  justify-content: center;
}

/* Cards */
.ds-card {
  position: relative;
  padding: var(--ds-sp-5);
  border-radius: var(--ds-radius);
  background: var(--ds-surface);
  border: 1px solid var(--ds-line);
  transition: border-color 0.2s var(--ds-ease), transform 0.2s var(--ds-ease), box-shadow 0.2s var(--ds-ease);
}

.ds-card > :last-child {
  margin-bottom: 0;
}

.ds-card h3 {
  margin-bottom: var(--ds-sp-2);
}

.ds-card p {
  color: var(--ds-muted);
}

a.ds-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

a.ds-card:hover,
.ds-card--interactive:hover {
  border-color: var(--ds-line-strong);
  transform: translateY(-2px);
  box-shadow: var(--ds-glow);
}

.ds-card--feature {
  background: var(--ds-brand-soft), var(--ds-surface);
}

.ds-card-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: var(--ds-sp-4);
  border-radius: var(--ds-radius);
  background: var(--ds-brand);
  color: #ffffff;
  box-shadow: var(--ds-glow);
}

.ds-card-icon svg {
  width: 22px;
  height: 22px;
}

/* Badges */
.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-sp-1);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--ds-fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--ds-surface-2);
  border: 1px solid var(--ds-line-strong);
  color: var(--ds-text);
}

.ds-badge--ok { color: var(--ds-ok); border-color: color-mix(in srgb, var(--ds-ok) 45%, transparent); }
.ds-badge--warn { color: var(--ds-warn); border-color: color-mix(in srgb, var(--ds-warn) 45%, transparent); }
.ds-badge--err { color: var(--ds-err); border-color: color-mix(in srgb, var(--ds-err) 45%, transparent); }
.ds-badge--brand { background: var(--ds-brand); color: #ffffff; border-color: transparent; }

/* Code block: a figure with a title bar, a copy button and the code */
.ds-code {
  margin: 0 0 var(--ds-sp-5);
  border-radius: var(--ds-radius);
  background: var(--ds-code-bg);
  border: 1px solid var(--ds-line-strong);
  box-shadow: var(--ds-shadow);
  overflow: hidden;
}

.ds-code-bar {
  display: flex;
  align-items: center;
  gap: var(--ds-sp-3);
  padding: var(--ds-sp-2) var(--ds-sp-3) var(--ds-sp-2) var(--ds-sp-4);
  border-bottom: 1px solid rgba(70, 150, 255, 0.22);
  color: #a8b6e2;
  font: 600 var(--ds-fs-xs) / 1.4 var(--ds-mono);
}

.ds-code-bar .ds-code-title {
  margin-right: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-code-copy {
  padding: 4px 10px;
  border-radius: var(--ds-radius-sm);
  border: 1px solid rgba(70, 170, 255, 0.40);
  background: transparent;
  color: #dfe8ff;
  font: 600 var(--ds-fs-xs) / 1.4 var(--ds-sans);
  cursor: pointer;
}

.ds-code-copy:hover {
  background: rgba(47, 211, 255, 0.12);
}

.ds-code pre {
  margin: 0;
  padding: var(--ds-sp-4) var(--ds-sp-5);
  overflow-x: auto;
  color: var(--ds-code-text);
  font-size: 0.88rem;
  line-height: 1.7;
  tab-size: 2;
}

.ds-code--output pre {
  color: #c9d6ff;
}

.ds-code--output .ds-code-bar {
  color: var(--ds-ok);
}

/* Token classes: PaskalCPP keywords / types / literals, and a C++ region */
.tk-k { color: var(--ds-tk-keyword); font-weight: 600; }
.tk-t { color: var(--ds-tk-type); }
.tk-s { color: var(--ds-tk-string); }
.tk-n { color: var(--ds-tk-number); }
.tk-c { color: var(--ds-tk-comment); font-style: italic; }
.tk-d { color: var(--ds-tk-directive); }
/* The marker sits in the gutter left of the text (pre's padding), never on the
   first character: the negative margin and the padding cancel, so columns stay */
.tk-cpp {
  display: inline-block;
  min-width: calc(100% + 0.7em);
  margin-left: -0.7em;
  padding-left: 0.7em;
  background: var(--ds-tk-cpp-bg);
  box-shadow: inset 3px 0 0 var(--ds-violet);
}

/* Output lines, colored like a terminal (the generators mark them): a pass, a failure and
   its detail, a run's summary or banner, the heap report */
.ds-code--output .out-ok { color: var(--ds-out-ok); }
.ds-code--output .out-err { color: var(--ds-out-err); }
.ds-code--output .out-note { color: color-mix(in srgb, var(--ds-out-err) 70%, var(--ds-code-text)); }
.ds-code--output .out-info { color: var(--ds-out-info); }
.ds-code--output .out-dim { color: var(--ds-tk-comment); }

/* Tabs (target tabs, example tabs). ds.js wires the keyboard. */
.ds-tabs {
  margin: 0 0 var(--ds-sp-5);
}

.ds-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-sp-1);
  margin-bottom: var(--ds-sp-3);
  padding: var(--ds-sp-1);
  /* Not a pill: tabs that wrap to a second row on a phone keep a tidy frame */
  border-radius: var(--ds-radius-lg);
  background: var(--ds-surface);
  border: 1px solid var(--ds-line);
  width: fit-content;
  max-width: 100%;
}

.ds-tab {
  min-height: 34px;
  padding: 0 var(--ds-sp-4);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ds-muted);
  font: 600 var(--ds-fs-sm) / 1 var(--ds-sans);
  cursor: pointer;
}

.ds-tab:hover {
  color: var(--ds-text);
}

.ds-tab[aria-selected="true"] {
  background: var(--ds-brand);
  color: #ffffff;
}

.ds-tabpanel[hidden] {
  display: none;
}

/* Details: collapsible entries (FAQ), a native <details> with no script */
.ds-details {
  margin: 0 0 var(--ds-sp-4);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius);
  background: var(--ds-surface);
}

.ds-details-title {
  cursor: pointer;
  padding: var(--ds-sp-4) var(--ds-sp-5);
  font-weight: 600;
}

.ds-details-title:hover,
.ds-details[open] > .ds-details-title {
  color: var(--ds-brand);
}

.ds-details[open] > .ds-details-title {
  border-bottom: 1px solid var(--ds-line);
}

.ds-details-body {
  padding: var(--ds-sp-4) var(--ds-sp-5);
}

.ds-details-body > :last-child {
  margin-bottom: 0;
}

/* Callouts */
.ds-callout {
  margin: 0 0 var(--ds-sp-5);
  padding: var(--ds-sp-4) var(--ds-sp-5);
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-line);
  border-left: 4px solid var(--ds-callout-color, var(--ds-blue));
  background: color-mix(in srgb, var(--ds-callout-color, var(--ds-blue)) 8%, var(--ds-surface));
}

.ds-callout > :last-child {
  margin-bottom: 0;
}

.ds-callout-title {
  display: block;
  margin-bottom: var(--ds-sp-1);
  font-weight: 700;
  color: var(--ds-callout-color, var(--ds-blue));
}

.ds-callout--tip { --ds-callout-color: var(--ds-ok); }
.ds-callout--warn { --ds-callout-color: var(--ds-warn); }
.ds-callout--danger { --ds-callout-color: var(--ds-err); }
.ds-callout--cpp { --ds-callout-color: var(--ds-violet); }

/* Diagnostic: a compiler message as pcpp prints it, laid out */
.ds-diag {
  margin: 0 0 var(--ds-sp-5);
  padding: var(--ds-sp-3) var(--ds-sp-4);
  border-radius: var(--ds-radius);
  background: var(--ds-code-bg);
  border: 1px solid color-mix(in srgb, var(--ds-diag-color, var(--ds-err)) 45%, transparent);
  color: var(--ds-code-text);
  font: var(--ds-fs-sm) / 1.6 var(--ds-mono);
  overflow-x: auto;
}

.ds-diag-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--ds-sp-2);
}

.ds-diag-sev {
  font-weight: 700;
  text-transform: lowercase;
  color: var(--ds-diag-color, var(--ds-err));
}

.ds-diag-code {
  padding: 0 6px;
  border-radius: var(--ds-radius-sm);
  background: color-mix(in srgb, var(--ds-diag-color, var(--ds-err)) 18%, transparent);
  color: var(--ds-diag-color, var(--ds-err));
  font-weight: 700;
}

.ds-diag-loc {
  color: #8fa0d8;
}

.ds-diag-msg {
  display: block;
  margin-top: var(--ds-sp-1);
  white-space: pre-wrap;
}

.ds-diag-note {
  display: block;
  margin-top: var(--ds-sp-1);
  padding-left: var(--ds-sp-4);
  color: #a8b6e2;
}

.ds-diag--warning { --ds-diag-color: #ffb547; }
.ds-diag--hint { --ds-diag-color: #8fa6ff; }

/* Tables */
.ds-table-wrap {
  margin: 0 0 var(--ds-sp-5);
  overflow-x: auto;
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-line);
}

.ds-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: var(--ds-fs-sm);
}

.ds-table th,
.ds-table td {
  padding: var(--ds-sp-3) var(--ds-sp-4);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--ds-line);
}

.ds-table th {
  background: var(--ds-surface-2);
  font-weight: 700;
  white-space: nowrap;
}

/* A word in a table cell stays whole (a name broken mid-word reads as two); a narrow
   screen scrolls the table inside its wrap instead */
.ds-table td :not(pre) > code,
.ds-table td > code {
  overflow-wrap: normal;
  white-space: nowrap;
}

.ds-table tr:last-child td {
  border-bottom: 0;
}

.ds-table tbody tr:hover td {
  background: var(--ds-brand-soft);
}

/* Docs layout: a side navigation, the article, an on-page table of contents */
.ds-docs {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 210px;
  gap: var(--ds-sp-6);
  padding-block: var(--ds-sp-6);
}

.ds-sidenav,
.ds-toc {
  position: sticky;
  top: calc(var(--ds-nav-h) + var(--ds-sp-4));
  align-self: start;
  max-height: calc(100vh - var(--ds-nav-h) - var(--ds-sp-6));
  overflow-y: auto;
  font-size: var(--ds-fs-sm);
}

.ds-sidenav h4,
.ds-toc h4 {
  margin: var(--ds-sp-4) 0 var(--ds-sp-2);
  font-size: var(--ds-fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ds-muted-2);
}

.ds-sidenav ul,
.ds-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-sidenav a,
.ds-toc a {
  display: block;
  padding: 5px var(--ds-sp-3);
  border-left: 2px solid transparent;
  color: var(--ds-muted);
  text-decoration: none;
}

.ds-sidenav a:hover,
.ds-toc a:hover {
  color: var(--ds-text);
}

.ds-sidenav a[aria-current="page"],
.ds-toc a[aria-current="true"] {
  color: var(--ds-text);
  border-left-color: var(--ds-cyan);
  background: var(--ds-brand-soft);
}

.ds-article {
  min-width: 0;
}

.ds-article h2 {
  margin-top: var(--ds-sp-7);
  padding-top: var(--ds-sp-2);
}

.ds-article h3 {
  margin-top: var(--ds-sp-6);
}

@media (max-width: 1100px) {
  .ds-docs {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .ds-toc {
    display: none;
  }
}

@media (max-width: 760px) {
  .ds-docs {
    grid-template-columns: minmax(0, 1fr);
  }

  .ds-sidenav {
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--ds-line);
    padding-bottom: var(--ds-sp-4);
  }
}

/* Footer */
.ds-footer {
  padding-block: var(--ds-sp-7) var(--ds-sp-5);
  border-top: 1px solid var(--ds-line);
  background: var(--ds-bg-2);
  color: var(--ds-muted);
  font-size: var(--ds-fs-sm);
}

.ds-footer-cols {
  display: grid;
  gap: var(--ds-sp-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.ds-footer h4 {
  font-size: var(--ds-fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ds-text);
}

.ds-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-footer li + li {
  margin-top: var(--ds-sp-2);
}

.ds-footer a {
  color: var(--ds-muted);
  text-decoration: none;
}

.ds-footer a:hover {
  color: var(--ds-text);
}

.ds-footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--ds-sp-3);
  margin-top: var(--ds-sp-6);
  padding-top: var(--ds-sp-4);
  border-top: 1px solid var(--ds-line);
  color: var(--ds-muted-2);
  font-size: var(--ds-fs-xs);
}

/* Theme toggle icons: the page shows the one for the theme it would switch to */
.ds-theme-toggle .ds-icon-sun,
.ds-theme-toggle .ds-icon-moon {
  display: none;
}

:root[data-theme-now="dark"] .ds-theme-toggle .ds-icon-sun,
:root[data-theme-now="light"] .ds-theme-toggle .ds-icon-moon {
  display: block;
}

/* Phone width */
@media (max-width: 560px) {
  .ds-section {
    padding-block: var(--ds-sp-7);
  }

  .ds-hero {
    padding-block: var(--ds-sp-6) var(--ds-sp-7);
  }

  .ds-code pre {
    padding: var(--ds-sp-3) var(--ds-sp-4);
    font-size: 0.82rem;
  }

  /* Action rows stack full width; a button elsewhere keeps its size */
  .ds-row .ds-btn {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ds-btn,
  .ds-card {
    transition: none;
  }

  .ds-btn:hover,
  a.ds-card:hover,
  .ds-card--interactive:hover {
    transform: none;
  }
}

@media print {
  .ds-nav,
  .ds-sidenav,
  .ds-toc,
  .ds-code-copy,
  .ds-theme-toggle {
    display: none;
  }
}
