/* ============================================================
   Dan Sanderson — theme layout
   ------------------------------------------------------------
   Site chrome (header, nav, footer), page templates, the
   WordPress content (block) styles, and all responsive rules.
   Built entirely on the design tokens; depends on tokens.css
   and components.css. No literal colours/sizes except where a
   token genuinely doesn't exist.
   ============================================================ */

/* ---------- Accessibility helpers ---------- */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--surface-ink); color: var(--text-on-ink);
  padding: var(--space-3) var(--space-5);
  border-radius: 0 0 var(--radius-md) 0;
  font-family: var(--font-body); font-weight: var(--weight-semibold);
}
.skip-link:focus {
  left: 0; color: var(--text-on-ink); text-decoration: underline;
  outline: 3px solid var(--focus-ring); outline-offset: 2px;
}

/* Visible focus everywhere (WCAG 2.4.7 / robust default) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Layout primitives ---------- */
.ds-container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.ds-container--md { max-width: var(--container-md); }
.ds-container--lg { max-width: var(--container-lg); }

.ds-section { padding-block: var(--space-20); }
.ds-section--tight { padding-block: var(--space-12); }
.ds-section--flush-top { padding-top: 0; } /* stack a section flush under the previous one */

body { min-height: 100vh; display: flex; flex-direction: column; }
.ds-site-main { flex: 1 0 auto; }

/* ---------- Site header ---------- */
.ds-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface-card) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: var(--border-thin) solid var(--border-hairline);
}
.ds-header__inner {
  display: flex; align-items: center; gap: var(--space-6);
  min-height: 68px;
}
.ds-brand {
  display: inline-flex; align-items: center; gap: var(--space-3);
  text-decoration: none; color: var(--text-strong); flex: none;
}
.ds-brand:hover { text-decoration: none; }
.ds-brand__mark {
  width: 38px; height: 38px; flex: none;
  border-radius: var(--radius-md);
}
.ds-brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.ds-brand__name {
  font-family: var(--font-display); font-weight: var(--weight-black);
  font-size: var(--text-md); letter-spacing: var(--tracking-tight);
  color: var(--text-strong);
}
.ds-brand__tag {
  font-family: var(--font-mono); font-size: var(--text-2xs);
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--text-muted);
}

/* Primary nav */
.ds-nav { margin-left: auto; }
.ds-nav__list {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: var(--space-2);
}
.ds-nav__list a {
  display: inline-flex; align-items: center;
  font-family: var(--font-body); font-weight: var(--weight-semibold);
  font-size: var(--text-sm); color: var(--text-body);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: var(--border-medium) solid transparent;
  transition: color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              background var(--duration-fast) var(--ease-standard);
}
.ds-nav__list a:hover { color: var(--brand); background: var(--surface-sunken); text-decoration: none; }
.ds-nav__list .current-menu-item > a,
.ds-nav__list .current_page_item > a,
.ds-nav__list [aria-current="page"] {
  color: var(--brand); border-color: var(--border-hairline);
}

/* Mobile nav toggle */
.ds-nav-toggle {
  display: none;
  margin-left: auto;
  align-items: center; justify-content: center;
  width: var(--control-h-md); height: var(--control-h-md);
  background: var(--surface-card);
  border: var(--border-medium) solid var(--neutral-900);
  border-radius: var(--radius-md); cursor: pointer; color: var(--text-strong);
}
.ds-nav-toggle:hover { color: var(--brand); border-color: var(--brand); }
.ds-nav-toggle__bars, .ds-nav-toggle__bars::before, .ds-nav-toggle__bars::after {
  content: ""; display: block; width: 18px; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform var(--duration-base) var(--ease-standard), opacity var(--duration-fast);
}
.ds-nav-toggle__bars { position: relative; }
.ds-nav-toggle__bars::before { position: absolute; top: -6px; }
.ds-nav-toggle__bars::after  { position: absolute; top: 6px; }
.ds-nav-toggle[aria-expanded="true"] .ds-nav-toggle__bars { background: transparent; }
.ds-nav-toggle[aria-expanded="true"] .ds-nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.ds-nav-toggle[aria-expanded="true"] .ds-nav-toggle__bars::after  { top: 0; transform: rotate(-45deg); }

/* Social icon button (LinkedIn) — square control that lifts into the
   signature hard-red offset shadow, matching buttons + cards. */
.ds-social {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--control-h-md); height: var(--control-h-md);
  color: var(--text-body); background: var(--surface-card);
  border: var(--border-medium) solid var(--border-hairline);
  border-radius: var(--radius-md);
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard);
}
.ds-social:hover {
  color: var(--brand); border-color: var(--brand);
  transform: translate(-2px, -2px); box-shadow: var(--shadow-hard-red);
  text-decoration: none;
}
.ds-social:active { transform: translate(0, 0); box-shadow: none; }
.ds-social__icon { width: 18px; height: 18px; display: block; }

/* ---------- Hero (front page) ---------- */
.ds-hero { padding-block: var(--space-20) var(--space-16); }
.ds-hero__grid {
  display: grid; grid-template-columns: 1.25fr 0.75fr;
  gap: var(--space-12); align-items: center;
}
.ds-hero__eyebrow {
  font-family: var(--font-mono); font-size: var(--text-sm);
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--brand); font-weight: var(--weight-semibold);
  margin: 0 0 var(--space-4);
}
.ds-hero__title {
  font-size: var(--text-5xl); line-height: 1.05; /* not leading-none: avoids descender clip on the 2–3 line wrap */
  margin: 0 0 var(--space-5);
}
.ds-hero__title .accent { color: var(--brand); }
.ds-hero__lead {
  font-size: var(--text-lg); color: var(--text-muted);
  max-width: 46ch; margin: 0 0 var(--space-8);
}
.ds-hero__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.ds-hero__portrait {
  position: relative; justify-self: end;
  width: 100%; max-width: 320px; aspect-ratio: 1; /* square framing */
}
.ds-hero__portrait img {
  width: 100%; height: 100%; object-fit: cover;
  border: var(--border-thick) solid var(--neutral-900);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-hard-red-lg);
}

/* Orchestrated page-load reveal — one staggered cascade is worth more than
   scattered micro-interactions. Guarded so reduced-motion users get the
   final state immediately (no opacity flash during the delay window). */
@media (prefers-reduced-motion: no-preference) {
  .ds-hero__eyebrow,
  .ds-hero__title,
  .ds-hero__lead,
  .ds-hero__actions,
  .ds-hero__portrait {
    animation: ds-rise var(--duration-slow) var(--ease-out) backwards;
  }
  .ds-hero__eyebrow  { animation-delay: 0.02s; }
  .ds-hero__portrait { animation-delay: 0.08s; }
  .ds-hero__title    { animation-delay: 0.10s; }
  .ds-hero__lead     { animation-delay: 0.16s; }
  .ds-hero__actions  { animation-delay: 0.22s; }
}
@keyframes ds-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Section heading ---------- */
.ds-sec-head { margin-bottom: var(--space-10); max-width: 60ch; }
.ds-sec-head__eyebrow {
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--brand); font-weight: var(--weight-semibold);
  margin: 0 0 var(--space-2);
}
.ds-sec-head__title { font-size: var(--text-3xl); margin: 0 0 var(--space-3); }
.ds-sec-head__sub { font-size: var(--text-md); color: var(--text-muted); margin: 0; }

/* ---------- Grids ---------- */
.ds-grid { display: grid; gap: var(--space-6); }
.ds-grid--posts { grid-template-columns: repeat(3, 1fr); }
.ds-grid--certs { grid-template-columns: repeat(2, 1fr); }
.ds-grid--awards { grid-template-columns: repeat(3, 1fr); }

/* Make whole post card a link target faithfully */
.ds-grid--posts .dsx-card { height: 100%; }

/* Award figure */
.ds-award { display: flex; flex-direction: column; gap: var(--space-3); }
.ds-award__img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--radius-md); border: 1px solid var(--border-hairline);
  background: var(--surface-sunken);
}
.ds-award__cap { font-size: var(--text-sm); color: var(--text-muted); margin: 0; }

/* ---------- Credentials gallery ----------
   Fluid auto-fill grid: one rule carries <360 (single column, the
   min() clamps the track to 100%) all the way to ultrawide (the page
   container caps it at ~5 columns). Each tile is a lightbox trigger. */
.ds-credgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: var(--space-6);
}
.ds-cred {
  display: flex; flex-direction: column; gap: var(--space-4);
  text-decoration: none; color: inherit;
}
.ds-cred:hover { text-decoration: none; }
/* The visible frame carries the hover/focus signature; the anchor's
   own outline is suppressed in favour of the frame ring below. */
.ds-cred:focus-visible { outline: none; }

.ds-cred__frame {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid; place-items: center;
  padding: var(--space-5);
  background:
    radial-gradient(120% 100% at 50% 0%, var(--surface-card), var(--surface-sunken));
  border: var(--border-medium) solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}
.ds-cred__frame img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; display: block;
  filter: drop-shadow(0 4px 10px rgba(27, 26, 24, 0.12));
  transition: transform var(--duration-base) var(--ease-out);
}
.ds-cred:hover .ds-cred__frame,
.ds-cred:focus-visible .ds-cred__frame {
  transform: translate(-3px, -3px);
  border-color: var(--brand);
  box-shadow: var(--shadow-hard-red);
}
.ds-cred:hover .ds-cred__frame img { transform: scale(1.03); }

/* "Expand" affordance — a brand pill that fades in on hover/focus. */
.ds-cred__zoom {
  position: absolute; top: var(--space-3); right: var(--space-3);
  width: 34px; height: 34px; display: grid; place-items: center;
  color: var(--text-on-brand); background: var(--brand);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  opacity: 0; transform: translateY(-4px) scale(0.9);
  transition: opacity var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out);
}
.ds-cred:hover .ds-cred__zoom,
.ds-cred:focus-visible .ds-cred__zoom { opacity: 1; transform: none; }

.ds-cred__body { display: flex; flex-direction: column; gap: var(--space-1); padding-inline: var(--space-1); }
.ds-cred__issuer {
  font-family: var(--font-mono); font-size: var(--text-2xs);
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--text-muted);
}
.ds-cred__title {
  font-family: var(--font-display); font-weight: var(--weight-bold);
  font-size: var(--text-md); line-height: var(--leading-tight);
  letter-spacing: var(--tracking-snug); color: var(--text-strong);
}
.ds-cred:hover .ds-cred__title { color: var(--brand); }
.ds-cred__meta {
  font-family: var(--font-mono); font-size: var(--text-2xs);
  color: var(--text-faint); margin-top: var(--space-1);
}

/* ---------- Page / article layout ---------- */
.ds-page-header { padding-block: var(--space-16) var(--space-8); border-bottom: var(--border-thin) solid var(--border-hairline); }
.ds-page-header__eyebrow {
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--brand); font-weight: var(--weight-semibold); margin: 0 0 var(--space-3);
  display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center;
}
.ds-page-header__title { font-size: var(--text-4xl); margin: 0; }
.ds-page-header__meta {
  margin-top: var(--space-4); display: flex; gap: var(--space-4); flex-wrap: wrap;
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
}

.ds-article { padding-block: var(--space-12); }
/* Featured image — square "stamp" under the post header. A fixed 1:1
   frame with object-fit:cover so square brand art is shown faithfully and
   any source stays perfectly square (never the stretched height-attr band). */
.ds-featured {
  width: min(480px, 92vw);
  margin: var(--space-12) auto var(--space-6);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: var(--border-medium) solid var(--neutral-900);
  background: var(--surface-sunken);
  box-shadow: var(--shadow-hard-red);
}
.ds-featured__img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ds-prose { max-width: var(--measure-prose); margin-inline: auto; }
.ds-prose > * + * { margin-top: 1.1em; }

/* Single posts: prose fills the full article band (container--lg) so paragraphs
   and Enlighter code blocks span the same width — text never looks squashed
   beside the wide code. `min-width:0` keeps long code lines from forcing overflow. */
.single .ds-prose { max-width: none; }
.single .ds-prose > * { min-width: 0; }
.ds-prose h2 { font-size: var(--text-2xl); margin-top: 1.6em; }
.ds-prose h3 { font-size: var(--text-xl); margin-top: 1.4em; }
.ds-prose h4 { font-size: var(--text-lg); margin-top: 1.2em; }
.ds-prose ul, .ds-prose ol { padding-left: 1.4em; }
.ds-prose li + li { margin-top: 0.4em; }
.ds-prose img { border-radius: var(--radius-md); border: 1px solid var(--border-hairline); margin-block: var(--space-4); }
.ds-prose blockquote {
  margin: var(--space-6) 0; padding: var(--space-4) var(--space-6);
  border-left: var(--border-thick) solid var(--brand);
  background: var(--surface-sunken); border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-body); font-style: italic;
}
.ds-prose blockquote p:last-child { margin-bottom: 0; }
.ds-prose table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.ds-prose th, .ds-prose td { border: 1px solid var(--border-hairline); padding: var(--space-2) var(--space-3); text-align: left; }
.ds-prose th { background: var(--surface-sunken); font-family: var(--font-display); }

/* WordPress core block alignments inside prose */
.ds-prose .alignwide { width: min(100%, var(--container-lg)); margin-inline: auto; }
.ds-prose .alignfull { width: 100%; }
.ds-prose .alignleft { float: left; margin: 0.3em var(--space-6) var(--space-4) 0; max-width: 50%; }
.ds-prose .alignright { float: right; margin: 0.3em 0 var(--space-4) var(--space-6); max-width: 50%; }
.ds-prose .aligncenter { margin-inline: auto; }
.ds-prose figure { margin: var(--space-6) 0; }
.ds-prose figcaption { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-2); text-align: center; }
.ds-prose .wp-block-button__link {
  display: inline-flex; align-items: center; gap: 0.5em;
  background: var(--brand); color: var(--text-on-brand);
  font-family: var(--font-body); font-weight: var(--weight-semibold);
  padding: 0 18px; height: var(--control-h-md); border-radius: var(--radius-md);
  border: var(--border-medium) solid var(--brand); text-decoration: none;
}
.ds-prose .wp-block-button__link:hover { background: var(--brand-hover); border-color: var(--brand-hover); text-decoration: none; transform: translate(-2px, -2px); box-shadow: var(--shadow-hard-ink); transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }

/* media-text block (used on the legacy home page content if rendered) */
.ds-prose .wp-block-media-text { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); align-items: center; }
.ds-prose .wp-block-media-text__media img { border-radius: var(--radius-lg); border: var(--border-medium) solid var(--neutral-900); box-shadow: var(--shadow-hard-red); }

/* ---------- Post listing (archive / blog) ---------- */
.ds-listing { padding-block: var(--space-12); }

/* Category chips row */
.ds-taxbar { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-8); }

/* ---------- Pagination ---------- */
.ds-pagination { margin-top: var(--space-12); display: flex; justify-content: center; }
.ds-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--control-h-md); height: var(--control-h-md); padding: 0 12px;
  margin: 0 3px; border-radius: var(--radius-md);
  border: var(--border-medium) solid var(--border-hairline);
  font-family: var(--font-body); font-weight: var(--weight-semibold);
  color: var(--text-body); text-decoration: none;
}
.ds-pagination a.page-numbers:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.ds-pagination .page-numbers.current { background: var(--brand); border-color: var(--brand); color: var(--text-on-brand); }
.ds-pagination .page-numbers.dots { border-color: transparent; }

/* ---------- Contact form ---------- */
.ds-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-12); align-items: start; }
.ds-form { display: flex; flex-direction: column; gap: var(--space-5); }
.ds-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.ds-contact-aside { display: flex; flex-direction: column; gap: var(--space-5); }
.ds-contact-aside dt { font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--text-muted); }
.ds-contact-aside dd { margin: 2px 0 var(--space-4); font-weight: var(--weight-semibold); color: var(--text-strong); }

/* ---------- Footer ---------- */
.ds-footer { background: var(--surface-ink); color: var(--text-on-ink); margin-top: var(--space-20); }
.ds-footer a { color: var(--text-on-ink); }
.ds-footer a:hover { color: var(--red-200); }
.ds-footer__top {
  display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-10);
  padding-block: var(--space-16) var(--space-12);
}
.ds-footer__brandline { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.ds-footer__brandline img { width: 36px; height: 36px; border-radius: var(--radius-md); }
.ds-footer__brandname { font-family: var(--font-display); font-weight: var(--weight-black); font-size: var(--text-lg); color: var(--text-on-ink); }
.ds-footer__blurb { color: var(--neutral-400); max-width: 42ch; font-size: var(--text-sm); }
.ds-footer__col h2 {
  font-family: var(--font-mono); font-size: var(--text-2xs);
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--neutral-400); margin: 0 0 var(--space-4); font-weight: var(--weight-semibold);
}
.ds-footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.ds-footer__col a { font-size: var(--text-sm); font-weight: var(--weight-medium); }
.ds-footer__bottom {
  border-top: var(--border-thin) solid var(--neutral-800);
  padding-block: var(--space-6);
  display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap;
  font-size: var(--text-xs); color: var(--neutral-400);
}

/* Footer social chips — mono label on the ink surface, brand-red on hover. */
.ds-footer__social { list-style: none; margin: var(--space-5) 0 0; padding: 0; display: flex; gap: var(--space-2); flex-wrap: wrap; }
.ds-footer__social a {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: var(--text-2xs);
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--neutral-400);
  border: var(--border-thin) solid var(--neutral-800);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  transition: color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              background var(--duration-fast) var(--ease-standard);
}
.ds-footer__social a:hover {
  color: var(--text-on-ink); border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  text-decoration: none;
}
.ds-footer__social-icon { width: 15px; height: 15px; display: block; }

/* ---------- Utility ---------- */
.ds-stack-sm > * + * { margin-top: var(--space-3); }
.ds-muted { color: var(--text-muted); }
.ds-center { text-align: center; }
.ds-mt-8 { margin-top: var(--space-8); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .ds-hero__grid { grid-template-columns: 1fr; gap: var(--space-10); }
  .ds-hero__portrait { justify-self: start; order: -1; max-width: 240px; }
  .ds-grid--posts { grid-template-columns: repeat(2, 1fr); }
  .ds-grid--awards { grid-template-columns: repeat(2, 1fr); }
  .ds-footer__top { grid-template-columns: 1fr 1fr; }
  .ds-contact-grid { grid-template-columns: 1fr; gap: var(--space-10); }
  .ds-prose .wp-block-media-text { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  /* Collapse nav into a toggle-driven panel */
  .ds-nav-toggle { display: inline-flex; }
  .ds-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface-card);
    border-bottom: var(--border-thin) solid var(--border-hairline);
    box-shadow: var(--shadow-md);
    padding: var(--space-3) var(--gutter) var(--space-5);
    margin-left: 0;
    display: none;
  }
  .ds-nav.is-open { display: block; }
  .ds-nav__list { flex-direction: column; align-items: stretch; gap: var(--space-1); }
  .ds-nav__list a { padding: var(--space-3); border-radius: var(--radius-md); }
  .ds-section { padding-block: var(--space-12); }
  .ds-hero { padding-block: var(--space-12) var(--space-10); }
  .ds-hero__title { font-size: var(--text-4xl); }
  .ds-grid--certs { grid-template-columns: 1fr; }
  .ds-form__row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .ds-grid--posts { grid-template-columns: 1fr; }
  .ds-grid--awards { grid-template-columns: 1fr; }
  .ds-footer__top { grid-template-columns: 1fr; gap: var(--space-8); }
  .ds-page-header__title { font-size: var(--text-3xl); }
  h1 { font-size: var(--text-3xl); }
  /* The brand tagline is too wide to share the row with the nav toggle
     + social link on phones — drop it (the name carries the brand) and
     tighten the header gap so nothing overflows the viewport. */
  .ds-header__inner { gap: var(--space-3); }
  .ds-brand__tag { display: none; }
  .ds-brand { min-width: 0; }
  .ds-brand__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Very small screens (<360px): keep brand legible, tighten gutters */
@media (max-width: 360px) {
  :root { --gutter: 16px; }
  .ds-brand__tag { display: none; }
  .ds-brand__name { font-size: var(--text-sm); }
  .ds-hero__title { font-size: var(--text-3xl); }
  .ds-hero__actions { flex-direction: column; align-items: stretch; }
  .ds-hero__actions .dsx-btn { width: 100%; }
  .ds-section { padding-block: var(--space-10); }
  .ds-prose pre { padding: var(--space-3); font-size: var(--text-xs); }
}

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