/*
  Adam™ Programming Language

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

  https://adamlang.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: the base and every shared component (nav, buttons, badges, cards, code, callouts,
  tabs, tables, details, diagnostics, footer, the ouroboros mark). Values come from tokens.css
  only. components.html shows every component in both themes. The docs layout is docs.css, the
  landing's sections and media are site.css.
*/

/* ================================================================ 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-wrap: break-word;
  transition: background-color var(--ds-slow) var(--ds-ease), color var(--ds-slow) var(--ds-ease);
}

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

img,
video {
  height: auto;
}

a {
  color: var(--ds-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--ds-fast) var(--ds-ease);
}

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

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

::selection {
  background: var(--ds-cyan-glow);
  color: var(--ds-text-strong);
}

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

h1 { font-size: var(--ds-fs-3xl); letter-spacing: -0.02em; }
h2 { font-size: var(--ds-fs-2xl); }
h3 { font-size: var(--ds-fs-xl); }
h4 { font-size: var(--ds-fs-lg); }

p {
  margin: 0 0 var(--ds-sp-4);
}

code,
kbd,
pre {
  font-family: var(--ds-mono);
  font-size: 0.92em;
}

:not(pre) > code {
  padding: 0.1em 0.38em;
  border-radius: var(--ds-radius-sm);
  background: var(--ds-inline-code-bg);
  color: var(--ds-inline-code-text);
}

/* An inline code span that is one word stays whole (gen_site.CODE_WORD_CLASS) */
.ds-code-word {
  white-space: nowrap;
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  vertical-align: bottom;
}

kbd,
.ds-kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.42em;
  border: 1px solid var(--ds-line-strong);
  border-bottom-width: 2px;
  border-radius: var(--ds-radius-sm);
  background: var(--ds-surface-2);
  color: var(--ds-muted);
  font-size: var(--ds-fs-xs);
  line-height: 1.5;
  text-align: center;
}

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

/* ================================================================ helpers */

.ds-skip {
  position: absolute;
  left: var(--ds-sp-4);
  top: -100px;
  z-index: var(--ds-z-close);
  padding: var(--ds-sp-2) var(--ds-sp-4);
  border-radius: var(--ds-radius);
  background: var(--ds-gold);
  color: var(--ds-on-accent);
  font-weight: 600;
  text-decoration: none;
}

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

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

.ds-shell {
  width: 100%;
  max-width: var(--ds-max);
  margin-inline: auto;
  padding-inline: var(--ds-gutter);
}

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

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

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

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

.ds-kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-sp-2);
  margin-bottom: var(--ds-sp-3);
  color: var(--ds-gold);
  font-family: var(--ds-mono);
  font-size: var(--ds-fs-xs);
  font-weight: 600;
  letter-spacing: var(--ds-tracking-caps);
  text-transform: uppercase;
}

/* A gold pin before the kicker: the chip's contact */
.ds-kicker::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 1px;
  background: var(--ds-gold);
  box-shadow: 0 0 10px var(--ds-gold-glow);
}

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

.ds-gradient-text {
  background: var(--ds-crystal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ds-chrome-text {
  background: var(--ds-chrome);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ================================================================ nav */

.ds-nav {
  position: sticky;
  top: 0;
  z-index: var(--ds-z-nav);
  height: var(--ds-nav-h);
  border-bottom: 1px solid var(--ds-line);
  background: color-mix(in srgb, var(--ds-bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}

/* The die's trace under the nav: a thin cyan-to-gold line */
.ds-nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ds-cyan-glow) 30%, var(--ds-gold-glow) 70%, transparent);
}

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

.ds-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-sp-3);
  margin-right: auto;
  color: var(--ds-text-strong);
  text-decoration: none;
}

.ds-brand img {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 8px var(--ds-cyan-glow));
}

.ds-wordmark {
  background: var(--ds-chrome);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: var(--ds-display);
  font-size: var(--ds-fs-xl);
  font-weight: 700;
  letter-spacing: 0.02em;
}

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

.ds-nav-links a {
  display: block;
  padding: var(--ds-sp-2) var(--ds-sp-3);
  border-radius: var(--ds-radius);
  color: var(--ds-muted);
  font-size: var(--ds-fs-sm);
  font-weight: 500;
  text-decoration: none;
}

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

.ds-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius);
  background: var(--ds-surface);
  color: var(--ds-muted);
  cursor: pointer;
  transition: color var(--ds-fast) var(--ds-ease), border-color var(--ds-fast) var(--ds-ease), box-shadow var(--ds-fast) var(--ds-ease);
}

.ds-icon-btn:hover {
  border-color: var(--ds-line-strong);
  color: var(--ds-text-strong);
  box-shadow: var(--ds-glow);
}

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

/* The theme toggle shows the theme a click switches to: the sun on dark, the moon on light */
:root[data-theme="dark"] .ds-icon-moon,
:root[data-theme="light"] .ds-icon-sun {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .ds-icon-moon {
    display: none;
  }
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .ds-icon-sun {
    display: none;
  }
}

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

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

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

  .ds-nav-links.is-open {
    display: flex;
  }

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

/* ================================================================ buttons and badges */

.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: var(--ds-radius);
  font: inherit;
  font-size: var(--ds-fs-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--ds-fast) var(--ds-ease), box-shadow var(--ds-fast) var(--ds-ease), background-color var(--ds-fast) var(--ds-ease), color var(--ds-fast) var(--ds-ease);
}

.ds-btn:active {
  transform: translateY(1px);
}

.ds-btn--primary {
  background: linear-gradient(180deg, var(--ds-cyan), color-mix(in srgb, var(--ds-cyan) 70%, var(--ds-ring)));
  color: var(--ds-on-accent);
  box-shadow: var(--ds-glow);
}

.ds-btn--primary:hover {
  color: var(--ds-on-accent);
  box-shadow: 0 0 0 1px var(--ds-cyan-glow), 0 10px 36px -8px var(--ds-cyan-glow);
}

.ds-btn--gold {
  background: linear-gradient(180deg, var(--ds-gold), color-mix(in srgb, var(--ds-gold) 75%, #000));
  color: var(--ds-on-accent);
  box-shadow: var(--ds-glow-gold);
}

.ds-btn--gold:hover {
  color: var(--ds-on-accent);
}

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

.ds-btn--ghost:hover {
  border-color: var(--ds-cyan);
  color: var(--ds-text-strong);
  box-shadow: var(--ds-glow);
}

.ds-btn--subtle {
  background: var(--ds-cyan-soft);
  color: var(--ds-link);
}

.ds-btn--subtle:hover {
  color: var(--ds-link-hover);
}

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

.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-sp-2);
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--ds-line-strong);
  border-radius: 999px;
  background: var(--ds-surface);
  color: var(--ds-muted);
  font-size: var(--ds-fs-xs);
  font-weight: 600;
  white-space: nowrap;
}

.ds-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.ds-badge--brand { border-color: var(--ds-cyan-glow); background: var(--ds-cyan-soft); color: var(--ds-cyan); }
.ds-badge--gold { border-color: var(--ds-gold-glow); background: var(--ds-gold-soft); color: var(--ds-gold); }
.ds-badge--ok { border-color: var(--ds-ok); background: var(--ds-ok-soft); color: var(--ds-ok); }
.ds-badge--warn { border-color: var(--ds-warn); background: var(--ds-warn-soft); color: var(--ds-warn); }
.ds-badge--err { border-color: var(--ds-err); background: var(--ds-err-soft); color: var(--ds-err); }

/* ================================================================ cards */

.ds-card {
  position: relative;
  padding: var(--ds-sp-5);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-lg);
  background: linear-gradient(180deg, var(--ds-surface-2), var(--ds-surface));
  box-shadow: var(--ds-shadow);
}

/* Two gold pins on the top edge: every card is a chip on the board */
.ds-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: var(--ds-sp-5);
  width: 28px;
  height: 3px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, var(--ds-gold) 0 10px, transparent 10px 18px, var(--ds-gold) 18px);
  opacity: 0.85;
}

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

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

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

.ds-card--interactive {
  transition: transform var(--ds-fast) var(--ds-ease), border-color var(--ds-fast) var(--ds-ease), box-shadow var(--ds-fast) var(--ds-ease);
}

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

.ds-card--feature {
  border-color: var(--ds-cyan-glow);
  background:
    radial-gradient(120% 80% at 0% 0%, var(--ds-cyan-soft), transparent 60%),
    linear-gradient(180deg, var(--ds-surface-2), var(--ds-surface));
}

.ds-card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: var(--ds-sp-4);
  border: 1px solid var(--ds-cyan-glow);
  border-radius: var(--ds-radius);
  background: var(--ds-cyan-soft);
  color: var(--ds-cyan);
}

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

/* ================================================================ prose */

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

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

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

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

.ds-prose h4 {
  margin-top: var(--ds-sp-5);
}

.ds-prose h2,
.ds-prose h3,
.ds-prose h4 {
  position: relative;
}

.ds-prose ul,
.ds-prose ol {
  margin: 0 0 var(--ds-sp-4);
  padding-left: 1.4em;
}

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

.ds-prose li::marker {
  color: var(--ds-cyan);
}

.ds-prose strong {
  color: var(--ds-text-strong);
}

.ds-prose .ds-code,
.ds-prose .ds-table-wrap,
.ds-prose .ds-tabs {
  max-width: 100%;
}

/* ================================================================ tables */

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

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

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

.ds-table th {
  background: var(--ds-surface-2);
  color: var(--ds-text-strong);
  font-family: var(--ds-mono);
  font-size: var(--ds-fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Code in a cell is a name (a triple, a path): whole on its line; the wrap scrolls instead */
.ds-table code {
  white-space: nowrap;
}

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

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

/* ================================================================ code */

.ds-code {
  margin: 0 0 var(--ds-sp-5);
  overflow: hidden;
  border: 1px solid var(--ds-code-line);
  border-radius: var(--ds-radius);
  background: var(--ds-code-bg);
  color: var(--ds-code-text);
  box-shadow: var(--ds-shadow);
}

.ds-code-bar {
  display: flex;
  align-items: center;
  gap: var(--ds-sp-3);
  min-height: 38px;
  padding: 0 var(--ds-sp-2) 0 var(--ds-sp-4);
  border-bottom: 1px solid var(--ds-code-line);
  background: var(--ds-code-bar);
}

/* Three pins on the bar: the die's edge contacts */
.ds-code-bar::before {
  content: "";
  flex: none;
  width: 30px;
  height: 6px;
  background: radial-gradient(circle, var(--ds-tk-type) 2.2px, transparent 2.6px) 0 0 / 10px 6px repeat-x;
  opacity: 0.75;
}

.ds-code-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ds-code-muted);
  font-family: var(--ds-mono);
  font-size: var(--ds-fs-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-code-copy {
  flex: none;
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--ds-code-line);
  border-radius: var(--ds-radius-sm);
  background: transparent;
  color: var(--ds-code-muted);
  font: inherit;
  font-family: var(--ds-mono);
  font-size: var(--ds-fs-xs);
  cursor: pointer;
  transition: color var(--ds-fast) var(--ds-ease), border-color var(--ds-fast) var(--ds-ease);
}

.ds-code-copy:hover {
  border-color: var(--ds-tk-keyword);
  color: var(--ds-tk-keyword);
}

.ds-code-copy.is-done {
  border-color: var(--ds-out-ok);
  color: var(--ds-out-ok);
}

.ds-code pre {
  margin: 0;
  padding: var(--ds-sp-4);
  overflow-x: auto;
  font-size: var(--ds-fs-sm);
  line-height: 1.6;
  tab-size: 2;
}

.ds-code code {
  font-size: inherit;
}

.ds-code--output {
  background: color-mix(in srgb, var(--ds-code-bg) 92%, var(--ds-out-ok));
}

.ds-code--output .ds-code-bar::before {
  background: radial-gradient(circle, var(--ds-out-ok) 2.2px, transparent 2.6px) 0 0 / 10px 6px repeat-x;
}

/* syntax (gen_site TOKEN_CLASS / highlight) */
.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); }

/* program output lines (gen_site OUTPUT_CLASSES) */
.out-ok { color: var(--ds-out-ok); }
.out-err { color: var(--ds-out-err); }
.out-info { color: var(--ds-out-info); }
.out-note { color: var(--ds-out-note); }
.out-dim { color: var(--ds-out-dim); }

/* ================================================================ callouts */

.ds-callout {
  position: relative;
  margin: 0 0 var(--ds-sp-5);
  padding: var(--ds-sp-4) var(--ds-sp-5) var(--ds-sp-4) calc(var(--ds-sp-5) + 4px);
  border: 1px solid var(--ds-cyan-glow);
  border-radius: var(--ds-radius);
  background: var(--ds-cyan-soft);
  --ds-callout-color: var(--ds-cyan);
}

.ds-callout::before {
  content: "";
  position: absolute;
  top: var(--ds-sp-3);
  bottom: var(--ds-sp-3);
  left: var(--ds-sp-3);
  width: 3px;
  border-radius: 3px;
  background: var(--ds-callout-color);
  box-shadow: 0 0 12px var(--ds-callout-color);
}

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

.ds-callout-title {
  display: block;
  margin-bottom: var(--ds-sp-2);
  color: var(--ds-callout-color);
  font-family: var(--ds-mono);
  font-size: var(--ds-fs-xs);
  font-weight: 700;
  letter-spacing: var(--ds-tracking-caps);
  text-transform: uppercase;
}

.ds-callout--tip {
  border-color: var(--ds-ok);
  background: var(--ds-ok-soft);
  --ds-callout-color: var(--ds-ok);
}

.ds-callout--warn {
  border-color: var(--ds-warn);
  background: var(--ds-warn-soft);
  --ds-callout-color: var(--ds-warn);
}

.ds-callout--danger {
  border-color: var(--ds-err);
  background: var(--ds-err-soft);
  --ds-callout-color: var(--ds-err);
}

/* ================================================================ tabs */

.ds-tabs {
  margin: 0 0 var(--ds-sp-5);
}

.ds-tablist {
  display: flex;
  /* Every tab in sight: a narrow view wraps them onto a second row, never hides them in a
     sideways scroll with nothing to say it is there */
  flex-wrap: wrap;
  gap: var(--ds-sp-1);
  margin-bottom: var(--ds-sp-3);
  padding: var(--ds-sp-1);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius);
  background: var(--ds-surface-2);
}

.ds-tab {
  flex: none;
  padding: var(--ds-sp-2) var(--ds-sp-4);
  border: 1px solid transparent;
  border-radius: calc(var(--ds-radius) - 2px);
  background: transparent;
  color: var(--ds-muted);
  font: inherit;
  font-family: var(--ds-mono);
  font-size: var(--ds-fs-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--ds-fast) var(--ds-ease), background-color var(--ds-fast) var(--ds-ease);
}

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

.ds-tab[aria-selected="true"] {
  border-color: var(--ds-cyan-glow);
  background: var(--ds-surface);
  color: var(--ds-cyan);
  box-shadow: 0 0 14px -4px var(--ds-cyan-glow);
}

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

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

/* ================================================================ details */

.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 {
  display: flex;
  align-items: center;
  gap: var(--ds-sp-3);
  padding: var(--ds-sp-3) var(--ds-sp-4);
  color: var(--ds-text-strong);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.ds-details-title::-webkit-details-marker {
  display: none;
}

/* A gold chevron that turns as the entry opens */
.ds-details-title::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ds-gold);
  border-bottom: 2px solid var(--ds-gold);
  transform: rotate(-45deg);
  transition: transform var(--ds-fast) var(--ds-ease);
}

.ds-details[open] > .ds-details-title::before {
  transform: rotate(45deg);
}

.ds-details-body {
  padding: 0 var(--ds-sp-4) var(--ds-sp-4) calc(var(--ds-sp-4) + 8px + var(--ds-sp-3));
}

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

/* ================================================================ diagnostics (gen_site.diagnostic_boxes) */

.ds-diag {
  margin: 0 0 var(--ds-sp-3);
  padding: var(--ds-sp-3) var(--ds-sp-4);
  border: 1px solid var(--ds-code-line);
  border-left: 3px solid var(--ds-out-err);
  border-radius: var(--ds-radius);
  background: var(--ds-code-bg);
  color: var(--ds-code-text);
  font-family: var(--ds-mono);
  font-size: var(--ds-fs-sm);
  --ds-diag-color: var(--ds-out-err);
}

.ds-diag--warning {
  border-left-color: var(--ds-out-note);
  --ds-diag-color: var(--ds-out-note);
}

.ds-diag--hint {
  border-left-color: var(--ds-tk-directive);
  --ds-diag-color: var(--ds-tk-directive);
}

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

.ds-diag-sev {
  color: var(--ds-diag-color);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--ds-fs-xs);
}

.ds-diag-code {
  padding: 0 0.4em;
  border: 1px solid var(--ds-code-line);
  border-radius: var(--ds-radius-sm);
  color: var(--ds-tk-type);
  font-size: var(--ds-fs-xs);
}

.ds-diag-loc {
  color: var(--ds-code-muted);
  font-size: var(--ds-fs-xs);
  /* Breaks at the <wbr> after each folder (gen_site); inside a name only if one folder is
     wider than the line */
  overflow-wrap: anywhere;
}

.ds-diag-msg {
  display: block;
}

/* ================================================================ footer */

.ds-footer {
  margin-top: var(--ds-sp-8);
  padding: var(--ds-sp-6) 0;
  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;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: var(--ds-sp-5);
  margin-bottom: var(--ds-sp-6);
}

.ds-footer-cols h4 {
  margin-bottom: var(--ds-sp-3);
  color: var(--ds-text-strong);
  font-family: var(--ds-mono);
  font-size: var(--ds-fs-xs);
  letter-spacing: var(--ds-tracking-caps);
  text-transform: uppercase;
}

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

.ds-footer-cols li {
  margin-bottom: var(--ds-sp-2);
}

/* The footer's wordmark is a step smaller than the top bar's: it names the language in full */
.ds-footer .ds-wordmark {
  font-size: var(--ds-fs-lg);
}

/* The brand (first) column spans two tracks once five fit (5 x 11rem + gaps), so a long
   wordmark stays on one line; narrower views keep the equal tracks */
@media (min-width: 70rem) {
  .ds-footer-cols > :first-child {
    grid-column: span 2;
  }
}

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

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

.ds-footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--ds-sp-2) var(--ds-sp-5);
  font-size: var(--ds-fs-xs);
}

/* ================================================================ the ouroboros (the self-hosting mark) */

/* An inline SVG: a ring of circuit traces (.ds-ouro-ring) turning slowly, a gold head
   (.ds-ouro-head) chasing its own tail. components.html holds the markup. */
.ds-ouroboros {
  width: 120px;
  height: 120px;
  color: var(--ds-cyan);
  filter: drop-shadow(0 0 12px var(--ds-cyan-glow));
}

.ds-ouro-track {
  fill: none;
  stroke: var(--ds-line-strong);
  stroke-width: 2;
}

.ds-ouro-ring {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 14 6 4 6;
  transform-origin: 50% 50%;
}

.ds-ouro-head {
  fill: var(--ds-gold);
  transform-origin: 50% 50%;
  filter: drop-shadow(0 0 6px var(--ds-gold-glow));
}

@media (prefers-reduced-motion: no-preference) {
  .ds-ouro-ring {
    animation: ds-ouro-turn 24s linear infinite;
  }

  .ds-ouro-head {
    animation: ds-ouro-turn 6s linear infinite;
  }
}

@keyframes ds-ouro-turn {
  to {
    transform: rotate(360deg);
  }
}
