/*
 * Base stylesheet: design tokens, reset, layout, and the shared components
 * (docs/architecture.md section 6.2). The public pages and the admin console
 * both use only these classes, so a re-brand in /css/site.css reaches every
 * screen.
 *
 * Rules for this file:
 *   - Every color is a token. Components never name a hex value, so dark mode
 *     and a client's brand change one place each.
 *   - No global sizing rules on elements (no `input { width: 80% }`).
 *     LogisticsSite's sheet had them and every page fought them with
 *     overrides. Form controls are full width only inside a .field.
 *   - State is the `hidden` attribute or a class. The CSP blocks style=""
 *     attributes, so nothing can rely on one.
 *
 * Text tokens meet WCAG AA (4.5:1) against --color-bg, --color-surface and
 * --color-surface-alt in both color schemes; --color-border-strong and
 * --color-focus meet the 3:1 needed for control edges and focus rings. Check
 * the ratios again after changing any of them.
 */

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

:root {
  color-scheme: light dark;

  /* Brand defaults. /css/site.css overrides these per client. */
  --color-primary: #2556a6;
  --color-primary-hover: #1c437f;
  --color-primary-contrast: #ffffff;
  --color-primary-soft: #e4ecf8;
  --font-body:
    system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --font-heading: var(--font-body);
  --font-mono: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Menlo, Consolas, monospace;
  --hero-bg: linear-gradient(135deg, #2556a6, #1c3f73);
  --hero-text: #ffffff;
  --hero-muted: #dbe6f6;
  --hero-cta-bg: #ffffff;
  --hero-cta-text: #1c437f;

  /* Neutrals */
  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-surface-alt: #edf1f5;
  --color-text: #1a2230;
  --color-muted: #55606f;
  --color-border: #d9dfe7;
  --color-border-strong: #7d8796;
  --color-focus: var(--color-primary);
  --color-backdrop: rgb(15 20 27 / 55%);

  /* Status. The plain token is the text/icon color; -soft is its tinted background. */
  --color-danger: #b42318;
  --color-danger-soft: #fdecea;
  --color-danger-contrast: #ffffff;
  --color-success: #17713a;
  --color-success-soft: #e5f4ea;
  --color-warning: #8a5300;
  --color-warning-soft: #fdf3dc;
  --color-info: #1f5a9e;
  --color-info-soft: #e6effa;

  /* Shape and depth */
  --radius-sm: 0.375rem;
  --radius: 0.625rem;
  --radius-lg: 1rem;
  --shadow: 0 1px 2px rgb(15 20 27 / 6%), 0 2px 8px rgb(15 20 27 / 6%);
  --shadow-lg: 0 12px 40px rgb(15 20 27 / 22%);

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  --container-max: 72rem;
  --container-narrow: 30rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #7aa7f0;
    --color-primary-hover: #a0c0f5;
    --color-primary-contrast: #0b1220;
    --color-primary-soft: #1b2a44;
    --hero-bg: linear-gradient(135deg, #1b2f52, #142238);
    --hero-text: #f1f5fb;
    --hero-muted: #bfcde3;
    --hero-cta-bg: #7aa7f0;
    --hero-cta-text: #0b1220;

    --color-bg: #0f141b;
    --color-surface: #18202a;
    --color-surface-alt: #222b37;
    --color-text: #e6eaf0;
    --color-muted: #a3aebd;
    --color-border: #2e3846;
    --color-border-strong: #6b7686;
    --color-backdrop: rgb(0 0 0 / 65%);

    --color-danger: #ff8f85;
    --color-danger-soft: #3a1d1d;
    --color-danger-contrast: #1a0606;
    --color-success: #5fd38a;
    --color-success-soft: #15301f;
    --color-warning: #f0c254;
    --color-warning-soft: #352a12;
    --color-info: #8cb8f5;
    --color-info-soft: #172a44;

    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 2px 8px rgb(0 0 0 / 30%);
    --shadow-lg: 0 12px 40px rgb(0 0 0 / 60%);
  }
}

/* ---------- Reset and base elements ---------- */

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

/* Global: the attribute always wins over a component's display value. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

body > main {
  flex: 1 0 auto;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--color-text);
}

h1 {
  font-size: clamp(1.75rem, 1.35rem + 1.8vw, 2.5rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.875rem);
}

h3 {
  font-size: 1.2rem;
}

h4 {
  font-size: 1rem;
}

p,
ul,
ol,
dl,
figure,
blockquote {
  margin: 0;
}

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

a {
  color: var(--color-primary);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--color-primary-hover);
}

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

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-5) 0;
}

::selection {
  background: var(--color-primary-soft);
  color: var(--color-text);
}

/* Visible keyboard focus everywhere. Mouse clicks do not show it. */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 48rem) {
  .container {
    padding-inline: var(--space-5);
  }
}

.container--narrow {
  max-width: calc(var(--container-narrow) + 2 * var(--space-5));
}

main.container {
  padding-block: var(--space-6) var(--space-7);
}

.section {
  padding-block: var(--space-7);
}

.section:first-child {
  padding-top: 0;
}

/* Vertical rhythm: space between direct children; .stack--sm and .stack--lg
   change it. A flex gap, not sibling margins, so a child hidden with the
   `hidden` attribute (a flash waiting for a message) leaves no space behind.
   Buttons keep their own width instead of stretching. The modifiers set `gap`
   itself rather than a custom property, because a custom property inherits
   and would widen every stack nested inside a .stack--lg. */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.stack > * {
  min-width: 0;
  margin-block: 0;
}

.stack > .btn,
.stack > button {
  align-self: flex-start;
}

.stack--sm {
  gap: var(--space-2);
}

.stack--lg {
  gap: var(--space-6);
}

/* A wrapping row of items with a gap (buttons, badges, toolbar controls). */
.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.grid-2,
.grid-3 {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 48rem) {
  .grid-2,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

.small {
  font-size: 0.875rem;
}

/* Hidden on screen, still read by screen readers. It is absolutely
   positioned, so a scroller clips it only when the scroller, or an element
   between the two, is positioned; otherwise it can widen the page. A table
   gets that from .table-wrap. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  color: var(--color-primary-contrast);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-sm {
  min-height: 2.25rem;
  padding: var(--space-1) var(--space-3);
  font-size: 0.875rem;
}

/* On a phone a long label is wider than the screen ("Email" and a long address,
   from data-contact-links="buttons", pushed a 360px page to 388px), so there a
   button may wrap, breaking an address anywhere if it must. */
@media (max-width: 30rem) {
  .btn {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  color: var(--color-primary-contrast);
}

.btn-secondary {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.btn-danger {
  background: var(--color-danger);
  color: var(--color-danger-contrast);
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(0.92);
  color: var(--color-danger-contrast);
}

/* Reads as a link; may wrap, since it often carries a sentence. */
.btn-link {
  min-height: auto;
  padding-inline: var(--space-1);
  color: var(--color-primary);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  white-space: normal;
}

.btn-link:hover:not(:disabled) {
  color: var(--color-primary-hover);
}

.btn-link.btn-sm {
  min-height: 2.25rem;
}

/* setBusy() sets aria-busy; the spinner takes the button's own text color. */
.btn[aria-busy='true'] {
  cursor: progress;
}

.btn[aria-busy='true']::before {
  content: '';
  width: 1em;
  height: 1em;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Forms ---------- */

/* Zero-specificity defaults, so any component can restyle a control. */
:where(
  input:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file']),
  select,
  textarea
) {
  padding: 0.625rem var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  line-height: 1.4;
}

:where(input, select, textarea, button) {
  font: inherit;
}

:where(textarea) {
  min-height: 7rem;
  resize: vertical;
}

:where(input, select, textarea)[readonly] {
  background: var(--color-surface-alt);
  color: var(--color-muted);
}

:where(input, select, textarea):disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

::placeholder {
  color: var(--color-muted);
  opacity: 1;
}

input[type='checkbox'],
input[type='radio'] {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  flex: none;
  accent-color: var(--color-primary);
}

/* A label, its control, a hint, and an error message, stacked. */
.field {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.field > label,
.field-label {
  font-weight: 600;
}

.field input:not([type='checkbox'], [type='radio']),
.field select,
.field textarea {
  width: 100%;
}

.field-hint {
  color: var(--color-muted);
  font-size: 0.875rem;
}

.field-error {
  color: var(--color-danger);
  font-size: 0.875rem;
  font-weight: 600;
}

.field-error:empty {
  display: none;
}

.field--invalid input,
.field--invalid select,
.field--invalid textarea {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 1px var(--color-danger);
}

/* Fields side by side, wrapping to one column when narrow. */
.form-row {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

/* A <label class="checkbox"> wrapping its checkbox and text. */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

legend {
  padding: 0;
  font-weight: 600;
}

/* ---------- Messages ---------- */

.flash {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.flash-error {
  border-color: var(--color-danger);
  background: var(--color-danger-soft);
}

.flash-success {
  border-color: var(--color-success);
  background: var(--color-success-soft);
}

.flash-info {
  border-color: var(--color-info);
  background: var(--color-info-soft);
}

.flash-warning {
  border-color: var(--color-warning);
  background: var(--color-warning-soft);
}

.flash:focus {
  outline: none;
}

.flash:focus-visible {
  outline: 3px solid var(--color-focus);
}

/* ---------- Surfaces ---------- */

.card {
  min-width: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.card__header h2,
.card__header h3 {
  font-size: 1.2rem;
}

.card__body {
  padding: var(--space-5);
}

@media (max-width: 30rem) {
  .card__header {
    padding-inline: var(--space-4);
  }

  .card__body {
    padding: var(--space-4);
  }
}

/* ---------- Gallery ---------- */

/* Pictures with captions in a grid that fills the width: a portfolio's site
   screenshots, a maker's finished pieces. Markup:
     <ul class="gallery"><li><figure class="gallery__item">
       <a href="..."><img src="..." alt="..." width="..." height="..." /></a>
       <figcaption>...</figcaption>
     </figure></li></ul>
   The link is optional: to a larger copy on the same site, or out to the
   piece's own page. A brochure carries no script, so there is no lightbox.
   Every img gets its width and height so its space is kept while it loads,
   and loading="lazy" below the first row. */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-5);
  padding: 0;
  list-style: none;
}

.gallery__item {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.gallery__item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery__item figcaption {
  padding: var(--space-3) var(--space-4) var(--space-4);
}

/* ---------- Prose ---------- */

/* Text a client writes in the admin console and the server draws: a post's
   body (server/content/markdown.js lists what it can hold: paragraphs, h2 to
   h4, lists, quotations, rules, inline code, links). The reset above takes
   every block's margin away; this puts space back between blocks, indents
   lists, marks a quotation, and lets a long address wrap instead of widening a
   phone-width page. Not a .stack: its gap would add to these margins. */
.prose {
  max-width: 44rem;
  overflow-wrap: anywhere;
}

.prose > * + * {
  margin-top: var(--space-4);
}

.prose > * + h2,
.prose > * + h3,
.prose > * + h4 {
  margin-top: var(--space-6);
}

.prose ul,
.prose ol {
  padding-left: 1.5rem;
}

.prose li + li {
  margin-top: var(--space-2);
}

.prose blockquote {
  padding-left: var(--space-4);
  border-left: 3px solid var(--color-border);
  color: var(--color-muted);
}

/* ---------- Data ---------- */

/* A table that scrolls sideways inside its own box on a narrow screen. It is
   positioned so that it is the containing block of anything absolutely
   positioned in the table, such as a .visually-hidden "Actions" header.
   Otherwise that box belongs to the page, escapes the scroller's clipping,
   and stretches a phone-width page to the table's full width; a phone then
   centres dialogs in that wider page, partly off-screen. */
.table-wrap {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

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

.table th {
  color: var(--color-muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table tbody tr:hover {
  background: var(--color-surface-alt);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-width: 1.5em;
  justify-content: center;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--color-surface-alt);
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-success {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.badge-danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.badge-muted {
  background: var(--color-surface-alt);
  color: var(--color-muted);
}

.empty {
  padding: var(--space-6) var(--space-4);
  color: var(--color-muted);
  text-align: center;
}

/* ---------- Dialogs ---------- */

/* A native <dialog class="modal">, opened with showModal(). Never set display
   on it: the browser hides a closed dialog through display. The :not([open])
   rule below is that same hiding, for a browser with no <dialog>, which would
   otherwise show a closed dialog's text and buttons inline (the sign-in page
   then asks with window.confirm() instead). */
.modal {
  width: min(40rem, calc(100vw - 2 * var(--space-4)));
  max-height: calc(100dvh - 2 * var(--space-4));
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-lg);
}

.modal[open] {
  display: flex;
  flex-direction: column;
}

.modal:not([open]) {
  display: none;
}

.modal::backdrop {
  background: var(--color-backdrop);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.modal__header h2,
.modal__header h3 {
  font-size: 1.2rem;
}

.modal__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--space-5);
}

.modal__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  border-bottom: 1px solid var(--color-border);
  scrollbar-width: thin;
}

.tab {
  flex: none;
  margin-bottom: -1px;
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--color-muted);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

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

.tab[aria-selected='true'] {
  border-bottom-color: var(--color-primary);
  color: var(--color-text);
}

/* ---------- Site chrome ---------- */

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  min-height: 4rem;
  padding-block: var(--space-2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-right: auto;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  text-decoration: none;
}

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

.brand img {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.site-nav a[aria-current='page'] {
  background: var(--color-primary-soft);
  color: var(--color-text);
}

.site-account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.site-account:empty {
  display: none;
}

.site-account__name {
  font-weight: 600;
}

.site-account .btn {
  white-space: nowrap;
}

.site-account .badge {
  margin-left: var(--space-1);
}

/* Narrow screens: brand and account on the first row, nav on its own row. */
@media (max-width: 47.99rem) {
  .site-nav {
    order: 3;
    flex-basis: 100%;
  }

  .site-nav a {
    padding-inline: var(--space-2);
  }
}

@media (max-width: 30rem) {
  .site-account__name {
    display: none;
  }
}

.site-footer {
  padding-block: var(--space-6);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  padding: 0;
  list-style: none;
}

/* The web admin's credit: a quieter row of its own under the rest. */
.site-credit {
  flex-basis: 100%;
  font-size: 0.8125rem;
}

/* ---------- Hero ---------- */

.hero {
  --color-focus: var(--hero-text);
  display: grid;
  gap: var(--space-6);
  align-items: center;
  padding: clamp(var(--space-6), 6vw, var(--space-8)) clamp(var(--space-5), 5vw, var(--space-8));
  border-radius: var(--radius-lg);
  background: var(--hero-bg);
  color: var(--hero-text);
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}

.hero h1,
.hero h2,
.hero a:not(.btn) {
  color: var(--hero-text);
}

.hero__eyebrow {
  color: var(--hero-muted);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__lead {
  max-width: 38rem;
  color: var(--hero-muted);
  font-size: 1.125rem;
}

.hero .btn-primary {
  background: var(--hero-cta-bg);
  color: var(--hero-cta-text);
}

.hero .btn-primary:hover:not(:disabled) {
  background: var(--hero-cta-bg);
  color: var(--hero-cta-text);
  filter: brightness(0.94);
}

.hero .btn-secondary {
  background: transparent;
  border-color: var(--hero-text);
  color: var(--hero-text);
}

.hero .btn-secondary:hover:not(:disabled) {
  background: rgb(255 255 255 / 12%);
  color: var(--hero-text);
}

.hero__art {
  justify-self: center;
  width: min(100%, 20rem);
  color: var(--hero-text);
}

@media (max-width: 55.99rem) {
  .hero__art {
    display: none;
  }
}

/* ---------- Content helpers used by the sample pages ---------- */

/* A heading with its supporting paragraph. */
.section-intro {
  max-width: 44rem;
}

.card__icon {
  width: 2.75rem;
  height: 2.75rem;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

/* A list whose items carry a check mark drawn in CSS. */
.checklist {
  display: grid;
  gap: var(--space-4);
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-left: 2.25rem;
}

.checklist li::before {
  content: '';
  position: absolute;
  top: 0.15em;
  left: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--color-primary-soft);
}

.checklist li::after {
  content: '';
  position: absolute;
  top: 0.5em;
  left: 0.5rem;
  width: 0.5rem;
  height: 0.8rem;
  border: solid var(--color-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
