/* ==========================================================================
   KC DESIGN SYSTEM  v1.0
   --------------------------------------------------------------------------
   A token-driven design system distilled from the existing resume site
   (Inter typography, ink-black 2px borders, periwinkle #7371FC accent,
   violet #A594F9 support, desaturate->saturate imagery, underline-grow
   hover treatment).

   Used by: /blog, /blog/{slug}, /design-system
   Namespace: every class is prefixed "ds-" so this file can coexist with
   the legacy theme stylesheets without collisions.

   Contents
   --------
    1. Design tokens (:root custom properties)
    2. Base & reset
    3. Layout primitives (container, grid)
    4. Site header & navigation
    5. Site footer
    6. Identity details (kicker, accent lines, label chip)
    7. Buttons
    8. Chips / tags
    9. Meta rows
   10. Cards
   11. Page hero
   12. Author block
   13. Prose (long-form article content)
   14. Code blocks + syntax token theme
   15. Callouts
   16. Media blocks (figures, embeds, galleries, tables)
   17. Post navigation (prev / next)
   18. Style-guide helpers
   19. Utilities
   20. Responsive rules
   ========================================================================== */


/* --------------------------------------------------------------------------
   0. SELF-HOSTED TYPE — Inter variable font (no CDN dependency)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/inter-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/inter-var-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}


/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Color: core neutrals (from existing site) */
  --ds-ink:            #000000;  /* primary text, signature borders          */
  --ds-ink-soft:       #2e353b;  /* charcoal headings/hover (.text-gray)     */
  --ds-text:           #2e353b;  /* default body text                        */
  --ds-text-secondary: #595959;  /* article body (.second-color)             */
  --ds-text-muted:     #767676;  /* meta text (was #8f8f8f; darkened to meet WCAG AA 4.5:1 on white) */
  --ds-hairline:       #ececec;  /* thin separators (.slide-title-col)       */
  --ds-chip-bg:        #e5e5e5;  /* tag chips (.nav-tag-item)                */
  --ds-surface:        #ffffff;
  --ds-surface-dark:   #202020;  /* sticky header dark                       */
  --ds-surface-code:   #141414;  /* code block canvas                        */

  /* Color: brand accents (from existing site) */
  --ds-accent:         #7371FC;  /* periwinkle (.text-magenta / .bg-magenta) */
  --ds-accent-soft:    #A594F9;  /* violet (.bg-violet)                      */
  --ds-accent-tint:    rgba(115, 113, 252, 0.08);
  --ds-accent-soft-tint: rgba(165, 148, 249, 0.12);

  /* Color: semantic (design-system extension for feedback states) */
  --ds-info:           #7371FC;
  --ds-success:        #2f9461;
  --ds-warning:        #b7791f;
  --ds-danger:         #c0392b;
  --ds-info-tint:      rgba(115, 113, 252, 0.08);
  --ds-success-tint:   rgba(47, 148, 97, 0.08);
  --ds-warning-tint:   rgba(183, 121, 31, 0.09);
  --ds-danger-tint:    rgba(192, 57, 43, 0.07);

  /* Typography */
  --ds-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ds-font-mono: 'Cascadia Code', Consolas, ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Type scale (mapped from legacy helpers) */
  --ds-text-xs:   0.8125rem;  /* 13px  meta/kicker                 */
  --ds-text-sm:   0.875rem;   /* 14px  (.ex-sm-font)               */
  --ds-text-base: 1rem;       /* 16px  (.sm-font)                  */
  --ds-text-md:   1.125rem;   /* 18px  (.sm-md-font, prose body)   */
  --ds-text-lg:   1.25rem;    /* 20px  (site body / lead)          */
  --ds-text-xl:   1.5rem;     /* 24px  h3                          */
  --ds-text-2xl:  1.875rem;   /* 30px  (.salv-news-title) h2       */
  --ds-text-3xl:  2.125rem;   /* 34px  (.blog-title)               */
  --ds-text-4xl:  2.875rem;   /* 46px  (.blog-main-title)          */
  --ds-text-5xl:  4rem;       /* 64px  (.lg-font) display          */

  --ds-leading-tight: 1.2;
  --ds-leading-snug:  1.35;
  --ds-leading-base:  1.67;   /* 30px @ 18px — site's 20/30 rhythm */

  --ds-weight-light:    300;
  --ds-weight-regular:  400;
  --ds-weight-medium:   500;
  --ds-weight-semibold: 600;
  --ds-weight-bold:     700;
  --ds-weight-black:    900;

  /* Spacing scale (4px base) */
  --ds-space-1: 0.25rem;   /*  4px */
  --ds-space-2: 0.5rem;    /*  8px */
  --ds-space-3: 0.75rem;   /* 12px */
  --ds-space-4: 1rem;      /* 16px */
  --ds-space-5: 1.5rem;    /* 24px */
  --ds-space-6: 2rem;      /* 32px */
  --ds-space-7: 3rem;      /* 48px */
  --ds-space-8: 4rem;      /* 64px */
  --ds-space-9: 6rem;      /* 96px */

  /* Borders, radii, shadows */
  --ds-border-width: 2px;                                /* signature border */
  --ds-border: var(--ds-border-width) solid var(--ds-ink);
  --ds-radius-sm: 5px;     /* cards  (.salv-blog-wrap)   */
  --ds-radius-md: 10px;    /* chips  (.nav-tag-item)     */
  --ds-radius-lg: 12px;    /* buttons (.salv-comme-button)*/
  --ds-shadow-pop:      8px 8px 0 var(--ds-ink);         /* hover lift       */
  --ds-shadow-pop-soft: 6px 6px 0 var(--ds-accent);

  /* Motion */
  --ds-ease: cubic-bezier(0.19, 1, 0.22, 1);             /* theme easing     */
  --ds-dur-fast: 0.18s;
  --ds-dur-base: 0.35s;
  --ds-dur-slow: 0.7s;
  --ds-transition-fast: var(--ds-dur-fast) var(--ds-ease);
  --ds-transition: var(--ds-dur-base) var(--ds-ease);

  /* Layout */
  --ds-container: 1240px;
  --ds-prose-width: 760px;
  --ds-header-height: 81px;
}


/* --------------------------------------------------------------------------
   2. BASE & RESET (scoped to pages that load this sheet standalone)
   -------------------------------------------------------------------------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

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

.ds-page {
  margin: 0;
  background: var(--ds-surface);
  color: var(--ds-text);
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-md);
  line-height: var(--ds-leading-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.ds-page ::selection { background: var(--ds-accent); color: #fff; }

.ds-page a {
  text-decoration: none;
  cursor: pointer;
}
/* buttons own their colour — keep the inherit reset off .ds-btn so anchors
   don't pick up the dark page text colour over the white/ink button colour */
.ds-page a:not(.ds-btn) { color: inherit; }

.ds-page :focus-visible {
  outline: 3px solid var(--ds-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.ds-page img { max-width: 100%; height: auto; }

/* Underline-grow treatment (from .salv-news-title) — reusable mixin class */
.ds-underline-grow {
  display: inline;
  background-image: linear-gradient(transparent calc(100% - 2px), currentColor 2px);
  background-size: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.5s var(--ds-ease);
}
a:hover .ds-underline-grow,
.ds-underline-grow:hover { background-size: 100% 100%; }


/* --------------------------------------------------------------------------
   3. LAYOUT PRIMITIVES
   -------------------------------------------------------------------------- */
.ds-container {
  max-width: var(--ds-container);
  margin: 0 auto;
  padding-left: var(--ds-space-6);
  padding-right: var(--ds-space-6);
}

.ds-container--narrow { max-width: 920px; }

.ds-section { padding: var(--ds-space-8) 0; }

.ds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: var(--ds-space-6);
}


/* --------------------------------------------------------------------------
   4. SITE HEADER & NAVIGATION (echoes .salva-header)
   -------------------------------------------------------------------------- */
.ds-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ds-surface);
  border-bottom: var(--ds-border);
}

.ds-header__inner {
  max-width: var(--ds-container);
  margin: 0 auto;
  padding: var(--ds-space-4) var(--ds-space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-5);
  min-height: var(--ds-header-height);
}

.ds-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-3);
  font-size: var(--ds-text-md);
  font-weight: var(--ds-weight-bold);
  letter-spacing: 0.02em;
  color: var(--ds-ink);
}

.ds-brand img { width: 40px; height: 40px; display: block; }

.ds-nav {
  display: flex;
  align-items: center;
  gap: var(--ds-space-5);
}

.ds-nav__link {
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ds-ink-soft);
  padding: var(--ds-space-2) 0;
  background-image: linear-gradient(var(--ds-accent), var(--ds-accent));
  background-size: 0 3px;
  background-repeat: no-repeat;
  background-position: left calc(100% - 4px);
  transition: background-size 0.4s var(--ds-ease), color var(--ds-transition-fast);
}

.ds-nav__link:hover { color: var(--ds-ink); background-size: 100% 3px; }

.ds-nav__link.is-active {
  color: var(--ds-ink);
  background-size: 100% 3px;
}

/* Mobile menu toggle */
.ds-nav-toggle {
  display: none;
  background: none;
  border: var(--ds-border);
  border-radius: var(--ds-radius-sm);
  padding: 10px 12px;
  cursor: pointer;
}

.ds-nav-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ds-ink);
  transition: transform var(--ds-transition-fast), opacity var(--ds-transition-fast);
}
.ds-nav-toggle__bar + .ds-nav-toggle__bar { margin-top: 5px; }

.ds-nav-toggle[aria-expanded="true"] .ds-nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ds-nav-toggle[aria-expanded="true"] .ds-nav-toggle__bar:nth-child(2) { opacity: 0; }
.ds-nav-toggle[aria-expanded="true"] .ds-nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* --------------------------------------------------------------------------
   5. SITE FOOTER (echoes menu-left-bottom)
   -------------------------------------------------------------------------- */
.ds-footer {
  border-top: var(--ds-border);
  margin-top: var(--ds-space-9);
}

.ds-footer__inner {
  max-width: var(--ds-container);
  margin: 0 auto;
  padding: var(--ds-space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-4);
  flex-wrap: wrap;
}

.ds-footer__copy {
  font-size: var(--ds-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ds-text-muted);
  font-weight: var(--ds-weight-regular);
}

.ds-footer__social {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-4);
}

.ds-footer__social a {
  display: inline-flex;
  color: var(--ds-text-muted);
  transition: color var(--ds-transition-fast), transform var(--ds-transition-fast);
}
.ds-footer__social a:hover { color: var(--ds-accent); transform: translateY(-2px); }
.ds-footer__social svg { width: 20px; height: 20px; fill: currentColor; }


/* --------------------------------------------------------------------------
   6. IDENTITY DETAILS — kicker, accent lines, label chip
   -------------------------------------------------------------------------- */
/* Accent lines (.small-line 28x6 / .extra-small-line 21x3) */
.ds-line,
.ds-line-sm {
  display: inline-block;
  background: var(--ds-accent);
  vertical-align: middle;
}
.ds-line    { width: 28px; height: 6px; margin-right: 8px; }
.ds-line-sm { width: 21px; height: 3px; margin-right: 12px; }

/* Kicker — small uppercase section label (slide-title pattern) */
.ds-kicker {
  display: inline-flex;
  align-items: center;
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ds-ink-soft);
}

/* Label chip — solid black tab with notch (from .data-title "Hello") */
.ds-label {
  position: relative;
  display: inline-block;
  background: var(--ds-ink);
  color: #fff;
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1;
  padding: 7px 16px 8px;
}
.ds-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 10px;
  border-right: 14px solid transparent;
  border-top: 10px solid var(--ds-ink);
}
.ds-label--accent { background: var(--ds-accent); }
.ds-label--accent::after { border-top-color: var(--ds-accent); }


/* --------------------------------------------------------------------------
   7. BUTTONS (from .btn-black / highlight-button-magenta / .salv-comme-button)
   -------------------------------------------------------------------------- */
.ds-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  padding: 16px 30px;
  border: 2px solid var(--ds-ink);
  border-radius: 0;                              /* square, like the original */
  background: var(--ds-ink);
  color: #fff;
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
  cursor: pointer;
  overflow: hidden;
  z-index: 0;
  transition: color 0.3s ease-in-out, transform 0.2s ease;
}
.ds-btn > * { position: relative; z-index: 1; }
.ds-btn svg { width: 18px; height: 18px; fill: currentColor; position: relative; z-index: 1; }

/* primary (solid): light panel wipes across left→right, ink text + bounce */
.ds-btn:not(.ds-btn--ghost)::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 0; height: 100%;
  background: var(--ds-chip-bg);
  transition: width 0.4s ease-in-out;
  z-index: -1;
}
.ds-btn:not(.ds-btn--ghost):hover::after { right: auto; left: 0; width: 100%; }
.ds-btn:not(.ds-btn--ghost):hover { color: var(--ds-ink); animation: ds-btn-pop 0.3s ease-in-out; }
@keyframes ds-btn-pop { 0% { transform: scale(1); } 50% { transform: scale(0.96); } 100% { transform: scale(1); } }
.ds-btn:active { transform: scale(0.98); filter: brightness(0.92); }

/* accent (primary / brand): periwinkle base, charcoal wipe on hover, text stays white
   (mirrors .highlight-button-magenta: #7371FC -> #2e353b) */
.ds-btn--accent { background: var(--ds-accent); border-color: var(--ds-accent); color: #fff; }
.ds-btn--accent::after { background: var(--ds-ink-soft); }
.ds-btn--accent:not(.ds-btn--ghost):hover { color: #fff; }

/* ghost (outline): ink fill sweeps in from centre, text + icon invert */
.ds-btn--ghost { background: transparent; color: var(--ds-ink); }
.ds-btn--ghost::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ds-ink);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.4s var(--ds-ease);
  z-index: -1;
}
.ds-btn--ghost:hover { color: #fff; }
.ds-btn--ghost:hover::after { transform: scaleX(1); }

.ds-btn--sm { padding: 11px 20px; font-size: var(--ds-text-xs); }


/* --------------------------------------------------------------------------
   8. CHIPS / TAGS (from .nav-tag-item and .tag-cloud .border-link)
   -------------------------------------------------------------------------- */
.ds-chip {
  display: inline-block;
  background: var(--ds-chip-bg);
  color: var(--ds-ink-soft);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-medium);
  line-height: 1;
  padding: 9px 14px 10px;
  border-radius: var(--ds-radius-md);
  border: 2px solid transparent;
  transition: background var(--ds-transition-fast), color var(--ds-transition-fast),
              border-color var(--ds-transition-fast);
}
a.ds-chip:hover { background: var(--ds-ink); color: #fff; }

/* .ds-page a:not(.ds-btn) { color: inherit } is (0,2,1); the anchor variant
   must match it or active chips silently render ink-on-accent. */
.ds-chip--active,
.ds-page a.ds-chip--active { background: var(--ds-accent); color: #fff; }

.ds-chip--outline {
  background: transparent;
  border-color: var(--ds-ink);
}
a.ds-chip--outline:hover { background: var(--ds-ink); color: #fff; }

.ds-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-2);
  align-items: center;
}

/* Preview marker — authoring-only, shown on the article page when
   BLOG_SHOW_DRAFTS is on and the post is a coming-up (draft/scheduled) one,
   so a previewer knows it is not yet live. Warning-tinted with a solid outline
   so it never reads as a normal category/tag chip. Text uses a darker amber
   than --ds-warning to clear WCAG AA (>=6:1 on the tint / on white). */
.ds-draft-badge {
  display: inline-block;
  vertical-align: middle;
  background: var(--ds-warning-tint);
  color: #8a5300;
  border: 1px solid var(--ds-warning);
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 7px 4px;
  border-radius: var(--ds-radius-md);
}


/* --------------------------------------------------------------------------
   9. META ROWS (date / author / reading time)
   -------------------------------------------------------------------------- */
.ds-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ds-space-2);
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
  font-weight: var(--ds-weight-regular);
}

.ds-meta a { color: var(--ds-text-muted); transition: color var(--ds-transition-fast); }
.ds-meta a:hover { color: var(--ds-accent); }

.ds-meta__item { display: inline-flex; align-items: center; }
.ds-meta__item + .ds-meta__item::before {
  content: '·';
  margin: 0 var(--ds-space-2);
  color: var(--ds-hairline);
  font-weight: var(--ds-weight-bold);
}

/* Stat strip — one mono line of dot-separated counters on section heroes
   ("22 parts · ≈ 348 min · 7 published"); the accent dot marks the live
   count. Course-masthead grammar: scope + freshness at a glance. */
.ds-statline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ds-space-3);
  margin: var(--ds-space-4) 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--ds-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
}
.ds-statline li { display: inline-flex; align-items: center; gap: 6px; }
.ds-statline strong { color: var(--ds-text); font-weight: var(--ds-weight-bold); }
.ds-statline__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--ds-accent);
  animation: ds-statline-pulse 2s ease-in-out infinite;
}
@keyframes ds-statline-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(115, 113, 252, 0.45); }
  50%      { box-shadow: 0 0 0 4px rgba(115, 113, 252, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .ds-statline__dot { animation: none; }
}


/* --------------------------------------------------------------------------
   10. CARDS (from .salv-blog-wrap: 2px ink border, 5px radius, photo zoom)
   -------------------------------------------------------------------------- */

/* Featured split card — the index flagship ("ds-flagship" - ds-feature is the
   home-page tile). Text left, cover right; square corners and no pop shadow
   (the floating-card look stays on the deck). */
.ds-flagship {
  display: grid;
  border: var(--ds-border);
  background: var(--ds-surface);
  color: inherit;
}
.ds-flagship__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--ds-space-3);
  padding: var(--ds-space-6);
}
.ds-flagship__title {
  margin: 0;
  font-size: var(--ds-text-2xl);
  line-height: var(--ds-leading-tight);
  font-weight: var(--ds-weight-black);
}
.ds-flagship__title .ds-underline-grow {
  background-image: linear-gradient(transparent calc(100% - 4px), var(--ds-accent) 4px);
}
.ds-flagship:hover .ds-underline-grow,
.ds-flagship:focus-visible .ds-underline-grow { background-size: 100% 100%; }
.ds-flagship__dek {
  margin: 0;
  color: var(--ds-text-secondary);
}
.ds-flagship__media {
  display: none;
  margin: 0;
}
.ds-flagship__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (min-width: 900px) {
  .ds-flagship { grid-template-columns: 1fr minmax(0, 46%); }
  .ds-flagship__media {
    display: block;
    border-left: var(--ds-border);
  }
}

.ds-card {
  display: flex;
  flex-direction: column;
  background: var(--ds-surface);
  border: var(--ds-border);
  border-radius: var(--ds-radius-sm);
  overflow: hidden;
  transition: transform var(--ds-transition), box-shadow var(--ds-transition);
}

.ds-card:hover,
.ds-card:focus-within {
  transform: translate(-4px, -4px);
  box-shadow: var(--ds-shadow-pop);
}

.ds-card__media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: var(--ds-border);
  background: var(--ds-accent-tint);
}

.ds-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0);
  transition: filter 0.45s var(--ds-ease), transform 0.45s var(--ds-ease);
}

.ds-card:hover .ds-card__media img { filter: saturate(1); transform: scale(1.05); }

.ds-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-3);
  padding: var(--ds-space-5);
  flex: 1;
}

.ds-card__title {
  margin: 0;
  font-size: var(--ds-text-xl);
  line-height: var(--ds-leading-snug);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-ink);
}

/* underline-grow on the title when the card link is hovered */
.ds-card__title .ds-underline-grow {
  background-image: linear-gradient(transparent calc(100% - 3px), var(--ds-accent) 3px);
}
.ds-card a:hover .ds-underline-grow { background-size: 100% 100%; }

.ds-card__excerpt {
  margin: 0;
  font-size: var(--ds-text-base);
  color: var(--ds-text-secondary);
}

.ds-card__footer {
  margin-top: auto;
  padding-top: var(--ds-space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-3);
}

.ds-card__more {
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ds-ink);
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
  transition: color var(--ds-transition-fast), gap var(--ds-transition-fast);
}
.ds-card__more:hover { color: var(--ds-accent); gap: var(--ds-space-3); }

/* full-card clickable: the title link stretches to cover the whole card */
.ds-card--link { position: relative; }
.ds-card--link .ds-card__link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.ds-card--link:hover .ds-card__more { color: var(--ds-accent); }
.ds-card--link:hover .ds-underline-grow { background-size: 100% 100%; }

/* blog teaser slide: section heading + "more articles" cta on one row */
.ds-blog-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--ds-space-5);
  flex-wrap: wrap;
  margin-bottom: var(--ds-space-6);
}
.ds-blog-head .ds-section__title { margin: 0; }
.ds-blog-head .ds-section__lead { margin: var(--ds-space-3) 0 0; }
.ds-blog-head .ds-btn { flex: none; }

.ds-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ds-grid--3 .ds-card__media { aspect-ratio: 16 / 7; }
.ds-grid--3 .ds-card__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 991px) {
  .ds-grid--3 { grid-template-columns: 1fr; }
  .ds-blog-head { align-items: flex-start; }
}


/* --------------------------------------------------------------------------
   11. PAGE HERO
   -------------------------------------------------------------------------- */
.ds-page-hero {
  padding: var(--ds-space-9) 0 var(--ds-space-7);
  border-bottom: 1px solid var(--ds-hairline);
}

.ds-page-hero__title {
  margin: var(--ds-space-4) 0 var(--ds-space-4);
  font-size: clamp(var(--ds-text-3xl), 5.5vw, var(--ds-text-5xl));
  line-height: var(--ds-leading-tight);
  font-weight: var(--ds-weight-black);
  color: var(--ds-ink);
  letter-spacing: -0.01em;
}

.ds-page-hero__lead {
  margin: 0;
  max-width: 62ch;
  font-size: var(--ds-text-lg);
  font-weight: var(--ds-weight-light);
  color: var(--ds-text-secondary);
}

/* Article variant */
.ds-post-hero { padding: var(--ds-space-8) 0 var(--ds-space-6); }

.ds-post-hero__title {
  margin: var(--ds-space-4) 0;
  max-width: 22ch;
  font-size: clamp(var(--ds-text-3xl), 4.5vw, var(--ds-text-4xl));
  line-height: var(--ds-leading-tight);
  font-weight: var(--ds-weight-black);
  color: var(--ds-ink);
  letter-spacing: -0.01em;
}

.ds-post-hero__summary {
  margin: 0 0 var(--ds-space-5);
  max-width: 66ch;
  font-size: var(--ds-text-lg);
  font-weight: var(--ds-weight-light);
  color: var(--ds-text-secondary);
}

.ds-post-hero__figure {
  margin: var(--ds-space-6) 0 0;
  border: var(--ds-border);
  border-radius: var(--ds-radius-sm);
  overflow: hidden;
}
.ds-post-hero__figure img { display: block; width: 100%; }


/* --------------------------------------------------------------------------
   12. AUTHOR BLOCK (from .about-author / .comment-user-img)
   -------------------------------------------------------------------------- */
.ds-author {
  display: flex;
  gap: var(--ds-space-5);
  align-items: center;
  border: var(--ds-border);
  border-radius: var(--ds-radius-sm);
  padding: var(--ds-space-5);
  margin: var(--ds-space-7) 0 0;
}

.ds-author__avatar {
  flex: none;
  width: 84px;
  height: 84px;
  border-radius: 100%;
  border: var(--ds-border);
  object-fit: cover;
  filter: saturate(0);
  transition: filter 0.45s var(--ds-ease);
}
.ds-author:hover .ds-author__avatar { filter: saturate(1); }

/* monogram fallback when no photo is available */
.ds-author__avatar--monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ds-accent);
  color: #fff;
  font-size: var(--ds-text-xl);
  font-weight: var(--ds-weight-black);
  letter-spacing: 0.05em;
  filter: none;
}

.ds-author__eyebrow {
  font-size: var(--ds-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ds-text-muted);
  font-weight: var(--ds-weight-semibold);
}

.ds-author__name {
  margin: 2px 0 4px;
  font-size: var(--ds-text-md);
  font-weight: var(--ds-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ds-author__bio {
  margin: 0;
  font-size: var(--ds-text-base);
  color: var(--ds-text-secondary);
}


/* --------------------------------------------------------------------------
   13. PROSE — long-form article content rendered from Markdown
   -------------------------------------------------------------------------- */
.ds-prose {
  max-width: var(--ds-prose-width);
  font-size: var(--ds-text-md);
  line-height: var(--ds-leading-base);
  color: var(--ds-text-secondary);
}

.ds-prose > :first-child { margin-top: 0; }
.ds-prose > :last-child { margin-bottom: 0; }

.ds-prose p { margin: 0 0 var(--ds-space-5); }

.ds-prose strong { color: var(--ds-ink); font-weight: var(--ds-weight-semibold); }

.ds-prose a {
  color: var(--ds-ink);
  font-weight: var(--ds-weight-medium);
  text-decoration: underline;
  text-decoration-color: var(--ds-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color var(--ds-transition-fast), background var(--ds-transition-fast);
}
.ds-prose a:hover { color: var(--ds-accent); }

/* Headings — black ink, tight leading, generous top rhythm */
.ds-prose h2,
.ds-prose h3,
.ds-prose h4 {
  color: var(--ds-ink);
  line-height: var(--ds-leading-snug);
  margin: var(--ds-space-7) 0 var(--ds-space-4);
  scroll-margin-top: calc(var(--ds-header-height) + var(--ds-space-4));
}

.ds-prose h2 {
  font-size: var(--ds-text-2xl);
  font-weight: var(--ds-weight-bold);
  padding-top: var(--ds-space-5);
  position: relative;
}
/* each h2 carries the accent line signature */
.ds-prose h2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 6px;
  background: var(--ds-accent);
}

.ds-prose h3 { font-size: var(--ds-text-xl); font-weight: var(--ds-weight-bold); }
.ds-prose h4 { font-size: var(--ds-text-md); font-weight: var(--ds-weight-semibold); text-transform: uppercase; letter-spacing: 0.06em; }

/* Lists — square accent markers */
.ds-prose ul,
.ds-prose ol { margin: 0 0 var(--ds-space-5); padding-left: var(--ds-space-5); }

.ds-prose li { margin-bottom: var(--ds-space-2); }
.ds-prose li::marker { color: var(--ds-accent); font-weight: var(--ds-weight-bold); }
.ds-prose ul > li { list-style-type: square; }

.ds-prose ul.contains-task-list { list-style: none; padding-left: var(--ds-space-2); }
.ds-prose .task-list-item input { accent-color: var(--ds-accent); margin-right: var(--ds-space-2); }

/* Blockquote (from .blog-quote: 4px ink left bar) */
.ds-prose blockquote {
  margin: var(--ds-space-6) 0;
  padding: var(--ds-space-2) 0 var(--ds-space-2) var(--ds-space-5);
  border-left: 4px solid var(--ds-ink);
}

.ds-prose blockquote p {
  font-size: var(--ds-text-xl);
  line-height: 1.5;
  font-weight: var(--ds-weight-medium);
  color: var(--ds-ink-soft);
  margin-bottom: var(--ds-space-3);
}
.ds-prose blockquote p:last-child { margin-bottom: 0; }

/* attribution line: last em inside a blockquote, prefixed by accent line */
.ds-prose blockquote em:last-child {
  display: inline-flex;
  align-items: center;
  font-style: normal;
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ds-text-muted);
}
.ds-prose blockquote em:last-child::before {
  content: '';
  width: 21px;
  height: 3px;
  background: var(--ds-accent);
  margin-right: 12px;
}

/* Horizontal rule — short accent stroke, left aligned */
.ds-prose hr {
  border: 0;
  width: 56px;
  height: 6px;
  background: var(--ds-accent);
  margin: var(--ds-space-7) 0;
}

.ds-prose kbd {
  font-family: var(--ds-font-mono);
  font-size: 0.8em;
  background: var(--ds-surface);
  border: 1px solid var(--ds-text-muted);
  border-bottom-width: 3px;
  border-radius: var(--ds-radius-sm);
  padding: 2px 7px;
  color: var(--ds-ink-soft);
}

.ds-prose mark {
  background: var(--ds-accent-soft-tint);
  box-shadow: inset 0 -2px 0 var(--ds-accent-soft);
  color: var(--ds-ink-soft);
  padding: 0 3px;
}


/* --------------------------------------------------------------------------
   14. CODE — inline code, code blocks, syntax token theme
   -------------------------------------------------------------------------- */
/* Inline code */
.ds-prose code {
  font-family: var(--ds-font-mono);
  font-size: 0.86em;
  background: var(--ds-chip-bg);
  color: var(--ds-ink);
  border-radius: var(--ds-radius-sm);
  padding: 2px 7px 3px;
}

/* Code block frame (pre is wrapped in .ds-code by blog.js; the bare pre
   still renders correctly when JS is unavailable) */
.ds-code {
  margin: var(--ds-space-6) 0;
  border: var(--ds-border);
  border-radius: var(--ds-radius-sm);
  overflow: hidden;
  background: var(--ds-surface-code);
}

.ds-code__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-3);
  background: var(--ds-surface-dark);
  border-bottom: 1px solid #2b2b2b;
  padding: 8px 14px;
}

.ds-code__lang {
  font-family: var(--ds-font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ds-text-muted);
}
.ds-code__lang::before {
  content: '';
  display: inline-block;
  width: 21px;
  height: 3px;
  background: var(--ds-accent);
  margin-right: 10px;
  vertical-align: middle;
}

.ds-code__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--ds-text-muted);
  border: 1px solid #3a3a3a;
  border-radius: var(--ds-radius-sm);
  font-family: var(--ds-font-sans);
  font-size: 11px;
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  cursor: pointer;
  transition: color var(--ds-transition-fast), border-color var(--ds-transition-fast),
              background var(--ds-transition-fast);
}
.ds-code__copy:hover { color: #fff; border-color: var(--ds-accent); background: var(--ds-accent-tint); }
.ds-code__copy.is-copied { color: #fff; background: var(--ds-accent); border-color: var(--ds-accent); }
.ds-code__copy svg { width: 13px; height: 13px; fill: currentColor; }

.ds-prose pre,
.ds-code pre {
  margin: var(--ds-space-6) 0;
  background: var(--ds-surface-code);
  color: #e5e5e5;
  font-family: var(--ds-font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  padding: var(--ds-space-5);
  overflow-x: auto;
  border-radius: var(--ds-radius-sm);
  tab-size: 4;
  /* standardised thin scrollbar (dark code surface) */
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a transparent;
}
.ds-prose pre::-webkit-scrollbar,
.ds-code pre::-webkit-scrollbar { height: 8px; width: 8px; }
.ds-prose pre::-webkit-scrollbar-track,
.ds-code pre::-webkit-scrollbar-track { background: transparent; }
.ds-prose pre::-webkit-scrollbar-thumb,
.ds-code pre::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 4px; }
.ds-prose pre:hover::-webkit-scrollbar-thumb,
.ds-code pre:hover::-webkit-scrollbar-thumb { background: var(--ds-accent); }

/* inside the JS-built frame the pre loses its own chrome */
.ds-code pre {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.ds-prose pre code,
.ds-code pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* Syntax token theme — brand-tuned for the #141414 canvas
   (selectors follow Prism's token classes) */
.ds-code .token.comment,
.ds-prose pre .token.comment,
.token.prolog, .token.doctype, .token.cdata { color: #6f7680; font-style: italic; }

.token.punctuation { color: #9aa0a6; }

.token.keyword,
.token.atrule,
.token.rule,
.token.important { color: var(--ds-accent-soft); }

.token.boolean,
.token.constant,
.token.symbol { color: #c4b5fd; }

.token.string,
.token.char,
.token.attr-value,
.token.inserted { color: #a6e3a1; }

.token.number { color: #f9c97c; }

.token.function,
.token.selector { color: #9b99ff; }

.token.class-name,
.token.namespace,
.token.builtin { color: #7dd3fc; }

.token.tag { color: var(--ds-accent-soft); }
.token.attr-name { color: #f9c97c; }

.token.operator,
.token.entity,
.token.url { color: #c9cdd3; }

.token.variable,
.token.property { color: #e5e5e5; }

.token.regex { color: #f2a9a9; }
.token.deleted { color: #f2a9a9; }

.token.bold { font-weight: var(--ds-weight-bold); }
.token.italic { font-style: italic; }


/* --------------------------------------------------------------------------
   15. CALLOUTS — markdown custom containers (:::note / :::tip / :::warning)
   -------------------------------------------------------------------------- */
.ds-callout,
.ds-prose .note,
.ds-prose .tip,
.ds-prose .warning,
.ds-prose .danger {
  position: relative;
  margin: var(--ds-space-6) 0;
  padding: var(--ds-space-5) var(--ds-space-5) var(--ds-space-5) calc(var(--ds-space-5) + 6px);
  border-radius: var(--ds-radius-sm);
  border: 1px solid var(--ds-hairline);
  overflow: hidden;
}

.ds-callout::before,
.ds-prose .note::before,
.ds-prose .tip::before,
.ds-prose .warning::before,
.ds-prose .danger::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
}

/* small-caps heading injected via CSS so markdown stays clean */
.ds-callout::after,
.ds-prose .note::after,
.ds-prose .tip::after,
.ds-prose .warning::after,
.ds-prose .danger::after {
  display: block;
  order: -1;
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: var(--ds-space-2);
}

.ds-callout,
.ds-prose .note,
.ds-prose .tip,
.ds-prose .warning,
.ds-prose .danger { display: flex; flex-direction: column; }

.ds-prose .note    { background: var(--ds-info-tint); }
.ds-prose .note::before { background: var(--ds-info); }
.ds-prose .note::after  { content: 'Note'; color: var(--ds-info); }

.ds-prose .tip     { background: var(--ds-success-tint); }
.ds-prose .tip::before { background: var(--ds-success); }
.ds-prose .tip::after  { content: 'Tip'; color: var(--ds-success); }

.ds-prose .warning { background: var(--ds-warning-tint); }
.ds-prose .warning::before { background: var(--ds-warning); }
.ds-prose .warning::after  { content: 'Warning'; color: var(--ds-warning); }

.ds-prose .danger  { background: var(--ds-danger-tint); }
.ds-prose .danger::before { background: var(--ds-danger); }
.ds-prose .danger::after  { content: 'Caution'; color: var(--ds-danger); }

.ds-prose .note > :last-child,
.ds-prose .tip > :last-child,
.ds-prose .warning > :last-child,
.ds-prose .danger > :last-child { margin-bottom: 0; }

/* GitHub-style alerts ( > [!NOTE] etc. ) — same look as :::note callouts,
   but Markdig emits a .markdown-alert-title paragraph we style directly. */
.ds-prose .markdown-alert {
  position: relative;
  margin: var(--ds-space-6) 0;
  padding: var(--ds-space-5) var(--ds-space-5) var(--ds-space-5) calc(var(--ds-space-5) + 6px);
  border: 1px solid var(--ds-hairline);
  border-left-width: 6px;
  border-radius: var(--ds-radius-sm);
}
.ds-prose .markdown-alert > :last-child { margin-bottom: 0; }
.ds-prose .markdown-alert-title {
  display: block;
  margin: 0 0 var(--ds-space-2);
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.ds-prose .markdown-alert-note      { background: var(--ds-info-tint);    border-left-color: var(--ds-info); }
.ds-prose .markdown-alert-note .markdown-alert-title      { color: var(--ds-info); }
.ds-prose .markdown-alert-tip       { background: var(--ds-success-tint); border-left-color: var(--ds-success); }
.ds-prose .markdown-alert-tip .markdown-alert-title       { color: var(--ds-success); }
.ds-prose .markdown-alert-important { background: var(--ds-accent-tint);  border-left-color: var(--ds-accent); }
.ds-prose .markdown-alert-important .markdown-alert-title { color: var(--ds-accent); }
.ds-prose .markdown-alert-warning   { background: var(--ds-warning-tint); border-left-color: var(--ds-warning); }
.ds-prose .markdown-alert-warning .markdown-alert-title   { color: var(--ds-warning); }
.ds-prose .markdown-alert-caution   { background: var(--ds-danger-tint);  border-left-color: var(--ds-danger); }
.ds-prose .markdown-alert-caution .markdown-alert-title   { color: var(--ds-danger); }

/* Footnotes — reference superscripts and the back-linked list at the foot. */
.ds-prose .footnote-ref a,
.ds-prose a.footnote-ref { font-weight: var(--ds-weight-bold); color: var(--ds-accent); text-decoration: none; }
.ds-prose sup { line-height: 0; }
.ds-prose .footnotes {
  margin-top: var(--ds-space-7);
  padding-top: var(--ds-space-5);
  border-top: var(--ds-border);
  font-size: var(--ds-text-sm);
  color: var(--ds-text-secondary);
}
.ds-prose .footnotes > hr { display: none; }
.ds-prose .footnotes ol { padding-left: var(--ds-space-5); }
.ds-prose .footnotes li { margin-bottom: var(--ds-space-3); }
.ds-prose .footnotes li::marker { color: var(--ds-text-muted); font-weight: var(--ds-weight-bold); }
.ds-prose .footnote-back-ref { margin-left: var(--ds-space-2); text-decoration: none; color: var(--ds-accent); }

/* Definition lists ( Term / : definition ). */
.ds-prose dl { margin: 0 0 var(--ds-space-5); }
.ds-prose dt { font-weight: var(--ds-weight-bold); color: var(--ds-ink); margin-top: var(--ds-space-4); }
.ds-prose dd {
  margin: var(--ds-space-1) 0 0;
  padding-left: var(--ds-space-4);
  border-left: 2px solid var(--ds-hairline);
  color: var(--ds-text-secondary);
}

/* Emphasis extras + semantic inlines. */
.ds-prose del { color: var(--ds-text-muted); }
.ds-prose ins { text-decoration: none; background: var(--ds-success-tint); box-shadow: inset 0 -2px 0 var(--ds-success); border-radius: 2px; padding: 0 2px; }
.ds-prose sub, .ds-prose sup { font-size: 0.75em; }
.ds-prose abbr[title] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.ds-prose cite { color: var(--ds-text-muted); }

/* Math (KaTeX). Block math centers and scrolls; inline stays in the flow. */
.ds-prose div.math { margin: var(--ds-space-6) 0; overflow-x: auto; overflow-y: hidden; text-align: center;
  scrollbar-width: thin; scrollbar-color: var(--ds-chip-bg) transparent; }
.ds-prose div.math::-webkit-scrollbar { height: 8px; }
.ds-prose div.math::-webkit-scrollbar-thumb { background: var(--ds-chip-bg); border-radius: 4px; }
.ds-prose .katex { font-size: 1.05em; }
.ds-prose span.math:not([data-ds-math]),
.ds-prose div.math:not([data-ds-math]) { font-family: var(--ds-font-mono); color: var(--ds-text-secondary); }

/* Hover anchor on prose headings. */
.ds-prose h2, .ds-prose h3 { scroll-margin-top: calc(var(--ds-header-height) + var(--ds-space-4)); }
.ds-heading-anchor {
  display: inline-flex;
  align-items: center;
  margin-left: var(--ds-space-2);
  opacity: 0;
  color: var(--ds-text-muted);
  transition: opacity var(--ds-transition-fast), color var(--ds-transition-fast);
}
.ds-heading-anchor svg { width: 0.7em; height: 0.7em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ds-prose h2:hover .ds-heading-anchor,
.ds-prose h3:hover .ds-heading-anchor,
.ds-heading-anchor:focus { opacity: 1; color: var(--ds-accent); }


/* --------------------------------------------------------------------------
   16. MEDIA BLOCKS — figures, embeds, galleries, tables
   -------------------------------------------------------------------------- */
/* Article images */
.ds-prose img {
  display: block;
  width: 100%;
  border: 1px solid var(--ds-hairline);
  border-radius: var(--ds-radius-sm);
  margin: var(--ds-space-6) 0;
}

/* Figures with captions (markdown ^^^ figure syntax or manual <figure>) */
.ds-prose figure {
  margin: var(--ds-space-6) 0;
}
.ds-prose figure img { margin: 0; }

.ds-prose figcaption {
  display: flex;
  align-items: center;
  margin-top: var(--ds-space-3);
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ds-text-muted);
}
.ds-prose figcaption::before {
  content: '';
  flex: none;
  width: 21px;
  height: 3px;
  background: var(--ds-accent);
  margin-right: 12px;
}

/* Responsive embeds — Markdig media links render iframes with a host class
   (youtube / vimeo) or .ds-embed for plain video/audio files */
.ds-prose iframe,
.ds-prose video.ds-embed,
.ds-embed-frame iframe,
.ds-embed-frame video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  background: var(--ds-surface-code);
}

.ds-prose iframe,
.ds-prose video.ds-embed {
  border: var(--ds-border);
  border-radius: var(--ds-radius-sm);
  margin: var(--ds-space-6) 0;
}

/* paragraph that contains only an embed loses extra spacing */
.ds-prose p:has(> iframe:only-child),
.ds-prose p:has(> video:only-child) { margin: 0; }

/* Gallery — apply with ::: {.ds-gallery} container or manual div */
.ds-prose .ds-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--ds-space-4);
  margin: var(--ds-space-6) 0;
}
.ds-prose .ds-gallery img,
.ds-prose .ds-gallery figure { margin: 0; }

/* Tables — strong ink header rule, hairline rows */
.ds-table-scroll {
  overflow-x: auto;
  margin: var(--ds-space-6) 0;
  /* standardised thin scrollbar (light surface) */
  scrollbar-width: thin;
  scrollbar-color: var(--ds-chip-bg) transparent;
}
.ds-table-scroll::-webkit-scrollbar { height: 8px; }
.ds-table-scroll::-webkit-scrollbar-track { background: transparent; }
.ds-table-scroll::-webkit-scrollbar-thumb { background: var(--ds-chip-bg); border-radius: 4px; }
.ds-table-scroll:hover::-webkit-scrollbar-thumb { background: var(--ds-accent-soft); }
.ds-table-scroll table { margin: 0; }

/* Mermaid diagrams — rendered SVG sits on a framed, centered light panel.
   Until the library renders it, the raw source shows as muted mono so the
   block degrades gracefully when JS is unavailable. */
.ds-mermaid {
  margin: var(--ds-space-6) 0;
  padding: var(--ds-space-5);
  background: var(--ds-surface);
  border: var(--ds-border);
  border-radius: var(--ds-radius-sm);
  text-align: center;
  overflow-x: auto;
  /* standardised thin scrollbar (light surface) */
  scrollbar-width: thin;
  scrollbar-color: var(--ds-chip-bg) transparent;
}
.ds-mermaid::-webkit-scrollbar { height: 8px; }
.ds-mermaid::-webkit-scrollbar-track { background: transparent; }
.ds-mermaid::-webkit-scrollbar-thumb { background: var(--ds-chip-bg); border-radius: 4px; }
.ds-mermaid:hover::-webkit-scrollbar-thumb { background: var(--ds-accent-soft); }
.ds-mermaid[data-processed] > svg { max-width: 100%; height: auto; }
.ds-mermaid:not([data-processed]) {
  text-align: left;
  white-space: pre-wrap;
  font: var(--ds-text-sm) / 1.6 var(--ds-font-mono);
  color: var(--ds-text-muted);
}

.ds-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--ds-space-6) 0;
  font-size: var(--ds-text-base);
}

.ds-prose thead th {
  text-align: left;
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ds-ink);
  border-bottom: var(--ds-border);
  padding: var(--ds-space-3) var(--ds-space-4) var(--ds-space-3) 0;
}

.ds-prose tbody td {
  padding: var(--ds-space-3) var(--ds-space-4) var(--ds-space-3) 0;
  border-bottom: 1px solid var(--ds-hairline);
  color: var(--ds-text-secondary);
  vertical-align: top;
}

.ds-prose tbody tr:hover td { background: var(--ds-accent-tint); }


/* --------------------------------------------------------------------------
   17. POST NAVIGATION (prev / next)
   -------------------------------------------------------------------------- */
.ds-pagenav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ds-space-5);
  margin-top: var(--ds-space-7);
}

.ds-pagenav__item {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-2);
  border: var(--ds-border);
  border-radius: var(--ds-radius-sm);
  padding: var(--ds-space-5);
  transition: transform var(--ds-transition), box-shadow var(--ds-transition);
}
.ds-pagenav__item:hover { transform: translate(-3px, -3px); box-shadow: var(--ds-shadow-pop-soft); }

.ds-pagenav__item--next { text-align: right; align-items: flex-end; }
.ds-pagenav__item--placeholder { border-style: dashed; border-color: var(--ds-hairline); }

.ds-pagenav__dir {
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ds-text-muted);
}

.ds-pagenav__title {
  font-size: var(--ds-text-md);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-ink);
  line-height: var(--ds-leading-snug);
}


/* --------------------------------------------------------------------------
   17b. RESUME COMPONENTS — the one-page resume rebuilt on the system
   -------------------------------------------------------------------------- */
/* Anchored sections clear the sticky header */
.ds-anchor { scroll-margin-top: calc(var(--ds-header-height) + var(--ds-space-4)); }

/* Section header block */
.ds-section__head { margin-bottom: var(--ds-space-6); }
.ds-section__title {
  margin: var(--ds-space-3) 0 var(--ds-space-3);
  font-size: clamp(var(--ds-text-2xl), 3.4vw, var(--ds-text-3xl));
  line-height: var(--ds-leading-tight);
  font-weight: var(--ds-weight-black);
  color: var(--ds-ink);
  letter-spacing: -0.01em;
}
.ds-section__lead {
  margin: 0;
  max-width: 68ch;
  font-size: var(--ds-text-base);
  color: var(--ds-text-secondary);
}
.ds-section--alt { background: #fafafa; border-top: 1px solid var(--ds-hairline); border-bottom: 1px solid var(--ds-hairline); }

/* --- Home hero ------------------------------------------------------------ */
.ds-hero {
  padding: var(--ds-space-9) 0 var(--ds-space-8);
  border-bottom: 1px solid var(--ds-hairline);
}

/* "Hello! / My name is" — a large heading, as in the original */
.ds-hero__greeting {
  display: block;
  margin: 0 0 var(--ds-space-3);
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  line-height: 1.1;
  font-weight: var(--ds-weight-black);
  color: var(--ds-ink-soft);
  letter-spacing: -0.01em;
}

.ds-hero__name {
  position: relative;
  display: inline-block;
  margin: 0 0 calc(var(--ds-space-6) + 8px);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1.05;
  font-weight: var(--ds-weight-black);
  letter-spacing: -0.02em;
  color: var(--ds-ink-soft);
}
/* signature 100px black bar below the name */
.ds-hero__name::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: calc(-1 * var(--ds-space-4));
  width: 100px;
  height: 4px;
  background: var(--ds-ink);
}
/* optional accent highlight kept for the secondary hero lines */
.ds-hero__name .ds-accent-block {
  background-image: linear-gradient(transparent 76%, var(--ds-accent-soft) 76%);
  background-repeat: no-repeat;
}

.ds-hero__role {
  margin: var(--ds-space-5) 0 var(--ds-space-4);
  font-size: var(--ds-text-xl);
  font-weight: var(--ds-weight-semibold);
  color: var(--ds-ink-soft);
}

.ds-hero__lead {
  margin: 0 0 var(--ds-space-6);
  max-width: 52ch;
  font-size: var(--ds-text-lg);
  font-weight: var(--ds-weight-regular);
  color: var(--ds-accent);
}

.ds-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-4);
  align-items: center;
}

/* gentle entrance */
@keyframes ds-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.ds-hero > .ds-container > * { animation: ds-rise 0.7s var(--ds-ease) backwards; }
.ds-hero > .ds-container > *:nth-child(2) { animation-delay: 0.08s; }
.ds-hero > .ds-container > *:nth-child(3) { animation-delay: 0.16s; }
.ds-hero > .ds-container > *:nth-child(4) { animation-delay: 0.24s; }
.ds-hero > .ds-container > *:nth-child(5) { animation-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  .ds-hero > .ds-container > * { animation: none; }
}

/* --- Intro / value cards ---------------------------------------------------- */
.ds-intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--ds-space-6);
}

/* --- Info list (about facts) ------------------------------------------------ */
.ds-info-list { margin: 0; }
.ds-info-list > div {
  display: flex;
  gap: var(--ds-space-4);
  padding: var(--ds-space-3) 0;
  border-bottom: 1px solid var(--ds-hairline);
}
.ds-info-list > div:last-child { border-bottom: 0; }
.ds-info-list dt {
  flex: none;
  width: 110px;
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ds-text-muted);
  padding-top: 3px;
}
.ds-info-list dd {
  margin: 0;
  font-size: var(--ds-text-base);
  font-weight: var(--ds-weight-medium);
  color: var(--ds-ink);
  overflow-wrap: anywhere;
}
.ds-info-list dd a { text-decoration: underline; text-decoration-color: var(--ds-accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ds-info-list dd a:hover { color: var(--ds-accent); }

/* --- Notecard (violet "short history" block) -------------------------------- */
.ds-notecard {
  position: relative;
  background: var(--ds-accent-soft);
  border: var(--ds-border);
  border-radius: var(--ds-radius-sm);
  padding: var(--ds-space-6);
}
.ds-notecard > .ds-label { position: absolute; top: calc(-1 * var(--ds-space-3)); left: var(--ds-space-6); }
.ds-notecard__title {
  margin: var(--ds-space-2) 0 var(--ds-space-3);
  font-size: var(--ds-text-xl);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-ink);
}
.ds-notecard p { color: var(--ds-ink-soft); }
.ds-notecard > :last-child { margin-bottom: 0; }

/* --- Feature card (skills strengths) — ripple-fill-from-corner hover --------- */
.ds-feature {
  position: relative;
  display: flex;
  gap: var(--ds-space-4);
  border: 2px solid var(--ds-hairline);
  border-radius: var(--ds-radius-sm);
  padding: var(--ds-space-5);
  background: var(--ds-surface);
  overflow: hidden;
  z-index: 0;
  transition: border-color var(--ds-transition-fast);
}
.ds-feature::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: -16px;
  right: -16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ds-ink);
  transform: scale(1);
  transform-origin: 50% 50%;
  transition: transform 0.45s ease-out;
}
.ds-feature:hover { border-color: var(--ds-ink); }
.ds-feature:hover::before { transform: scale(24); }
.ds-feature:hover .ds-feature__icon,
.ds-feature:hover .ds-feature__title,
.ds-feature:hover .ds-feature__text { color: #fff; }
.ds-feature:hover .ds-feature__body { border-left-color: #fff; }

.ds-feature__icon {
  flex: none;
  width: 44px;
  height: 44px;
  color: var(--ds-accent);
  transition: color var(--ds-transition-fast);
}
.ds-feature__icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.6; }

.ds-feature__body { border-left: 3px solid var(--ds-accent); padding-left: var(--ds-space-4); transition: border-color var(--ds-transition-fast); }

.ds-feature__title {
  margin: 0 0 var(--ds-space-2);
  font-size: var(--ds-text-base);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-ink);
  transition: color var(--ds-transition-fast);
}

.ds-feature__text {
  margin: 0;
  font-size: var(--ds-text-sm);
  line-height: 1.6;
  color: var(--ds-text-muted);
  transition: color var(--ds-transition-fast);
}

/* --- Stats (counters) --------------------------------------------------------- */
.ds-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--ds-space-5);
}

.ds-stat { border-top: 6px solid var(--ds-accent); padding-top: var(--ds-space-3); }

.ds-stat__num {
  display: block;
  font-size: var(--ds-text-4xl);
  line-height: 1.1;
  font-weight: var(--ds-weight-black);
  color: var(--ds-ink);
  font-variant-numeric: tabular-nums;
}
.ds-stat__num::after { content: '+'; color: var(--ds-accent); }
.ds-stat__num--plain::after { content: none; }

.ds-stat__label {
  display: block;
  margin-top: var(--ds-space-1);
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ds-text-muted);
}

/* --- Skills detail layout : groups carousel (left) + portfolio counters (right) --- */
.ds-rule {
  border: 0;
  border-top: 1px solid var(--ds-hairline);
  margin: var(--ds-space-5) 0;
}

/* keep the whole skills detail within the card height (no inner scrollbar) */
html.ds-deck-on #skills .ds-panel__body { padding-top: var(--ds-space-5); padding-bottom: var(--ds-space-5); }
.ds-skills-detail .ds-carousel-nav { margin-top: var(--ds-space-3); }

/* force four strengths across on the skills detail (reference: col-lg-3) */
.ds-intro-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ds-intro-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Numbered variant of the feature tile: an editorial step numeral takes the
   icon slot (home "how I deliver" slide). */
.ds-feature__step {
  flex: none;
  min-width: 44px;
  font-size: var(--ds-text-2xl);
  line-height: 1.1;
  font-weight: var(--ds-weight-black);
  letter-spacing: -0.02em;
  color: var(--ds-accent);
  transition: color var(--ds-transition-fast);
}
.ds-feature:hover .ds-feature__step { color: #fff; }

.ds-skills-detail { align-items: start; }
/* The carousel column and the statboard must be allowed to shrink below their
   content width. On mobile the split collapses to a single `1fr` track, which is
   `minmax(auto, 1fr)` -- an auto minimum that otherwise refuses to shrink and lets
   the scroll-snap carousel overflow the viewport instead of scrolling internally. */
.ds-skills-detail > * { min-width: 0; }
/* borderless skill groups inside the carousel, like the reference */
.ds-skills-detail .ds-skill-group { border: 0; padding: 0; background: none; }

/* column heading: uppercase label + a rule that extends right with a left tick (⊢) */
.ds-colhead {
  display: flex;
  align-items: center;
  gap: var(--ds-space-4);
  margin: 0 0 var(--ds-space-5);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ds-ink);
  white-space: nowrap;
}
.ds-colhead::after {
  content: '';
  flex: 1 1 auto;
  height: 12px;
  border-left: 2px solid var(--ds-ink);
  background: linear-gradient(var(--ds-ink), var(--ds-ink)) left center / 100% 2px no-repeat;
}

/* portfolio counters, 2 x 2 with an icon (reference: the .counter-number block) */
.ds-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ds-space-6) var(--ds-space-5);
}
.ds-statc { display: flex; gap: var(--ds-space-3); align-items: flex-start; }
.ds-statc__icon { flex: none; width: 40px; height: 40px; color: var(--ds-accent); }
.ds-statc__icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ds-statc__num {
  display: block;
  font-size: var(--ds-text-3xl);
  line-height: 1;
  font-weight: var(--ds-weight-black);
  color: var(--ds-ink);
  font-variant-numeric: tabular-nums;
}
.ds-statc__label {
  display: block;
  margin-top: var(--ds-space-1);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-medium);
  color: var(--ds-text-muted);
}

@media (max-width: 1199px) {
  .ds-intro-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-intro-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 479px) {
  .ds-intro-grid--4 { grid-template-columns: 1fr; }
  .ds-intro-grid--3 { grid-template-columns: 1fr; }
  .ds-stat-grid { grid-template-columns: 1fr; }
}

/* --- Skill bars : label left, meter right, percent above the bar (reference) ----- */
.ds-skillbar {
  display: grid;
  grid-template-columns: minmax(80px, 140px) minmax(0, 1fr);
  align-items: center;
  gap: var(--ds-space-4);
  margin-bottom: var(--ds-space-4);
}
.ds-skillbar:last-child { margin-bottom: 0; }

.ds-skillbar__name {
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-ink);
}

.ds-skillbar__meter { position: relative; min-width: 0; }

.ds-skillbar__value {
  position: absolute;
  right: 0;
  top: -16px;
  font-family: var(--ds-font-mono);
  font-size: 12px;
  color: var(--ds-text-muted);
}

.ds-skillbar__track {
  height: 8px;
  background: var(--ds-chip-bg);
  border-radius: 4px;
  overflow: hidden;
}

.ds-skillbar__fill {
  display: block;
  height: 100%;
  width: var(--bar, 0%);
  background: linear-gradient(90deg, var(--ds-accent), var(--ds-accent-soft));
  transition: width 1.1s var(--ds-ease);
}
/* before reveal (JS adds .is-inview to the group) collapse the fill */
.js .ds-skill-reveal:not(.is-inview) .ds-skillbar__fill { width: 0; }
@media (prefers-reduced-motion: reduce) {
  .ds-skillbar__fill { transition: none; }
  .js .ds-skill-reveal:not(.is-inview) .ds-skillbar__fill { width: var(--bar, 0%); }
}

/* --- Skill group card -------------------------------------------------------------- */
.ds-skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: var(--ds-space-5);
}

.ds-skill-group {
  border: var(--ds-border);
  border-radius: var(--ds-radius-sm);
  padding: var(--ds-space-5);
  background: var(--ds-surface);
}

.ds-skill-group__title {
  display: flex;
  align-items: center;
  margin: 0 0 var(--ds-space-4);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ds-ink);
}
.ds-skill-group__title::before {
  content: '';
  width: 21px;
  height: 3px;
  background: var(--ds-accent);
  margin-right: 12px;
}

.ds-exp-summary {
  margin: 0 0 var(--ds-space-5);
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
}
.ds-exp-summary strong {
  color: var(--ds-accent);
  font-weight: var(--ds-weight-bold);
}

/* --- Education cards ------------------------------------------------------------------ */
.ds-edu {
  position: relative;
  display: flex;
  gap: var(--ds-space-4);
  border: 2px solid var(--ds-hairline);
  padding: var(--ds-space-5);
  margin-bottom: var(--ds-space-4);
  transition: border-color 0.4s;
}
.ds-edu:last-child { margin-bottom: 0; }
/* animated border that draws in from the centre on hover */
.ds-edu::before,
.ds-edu::after {
  content: '';
  position: absolute;
  border-color: transparent;
  border-style: solid;
  transition: all 0.4s;
  pointer-events: none;
}
.ds-edu::before { width: 100%; height: 50%; left: 0; top: 25%; border-width: 0 2px; }
.ds-edu::after  { width: 50%; height: 100%; left: 25%; top: 0; border-width: 2px 0; }
.ds-edu:hover { border-color: transparent; }
.ds-edu:hover::before { height: 100%; top: 0; border-color: var(--ds-ink); }
.ds-edu:hover::after  { width: 100%; left: 0; border-color: var(--ds-ink); }

.ds-edu__level {
  flex: none;
  font-size: var(--ds-text-2xl);
  font-weight: var(--ds-weight-light);
  color: var(--ds-accent);
  line-height: 1;
  padding-top: 2px;
}

.ds-edu__title {
  position: relative;
  display: inline-block;
  margin: 0 0 var(--ds-space-1);
  font-size: var(--ds-text-md);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-ink);
}
.ds-edu__title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 2px;
  width: 0;
  background: var(--ds-ink);
  transition: width 0.4s ease-out;
}
.ds-edu:hover .ds-edu__title::after { width: 100%; }

.ds-edu__detail {
  margin: 0;
  font-size: var(--ds-text-sm);
  line-height: 1.6;
  color: var(--ds-text-muted);
}

/* --- Timeline (employment) -------------------------------------------------------------- */
.ds-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.ds-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--ds-hairline);
}

.ds-timeline__item {
  position: relative;
  padding: 0 0 var(--ds-space-6) var(--ds-space-6);
}
.ds-timeline__item:last-child { padding-bottom: 0; }
.ds-timeline__item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 12px;
  height: 12px;
  background: var(--ds-accent);
  border: 2px solid var(--ds-ink);
}

.ds-timeline__date {
  display: inline-block;
  background: var(--ds-accent);
  color: #fff;
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 6px 10px 7px;
  border-radius: var(--ds-radius-sm);
  margin-bottom: var(--ds-space-2);
}

.ds-timeline__title {
  margin: var(--ds-space-2) 0 var(--ds-space-1);
  font-size: var(--ds-text-md);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-ink);
}

.ds-timeline__text {
  margin: 0;
  font-size: var(--ds-text-sm);
  line-height: 1.6;
  color: var(--ds-text-muted);
  max-width: 56ch;
}

/* employment timeline: hover treatment mirroring the education cards
   (title underline draws in; the node grows with a soft accent ring) */
.ds-timeline__title {
  position: relative;
  display: inline-block;
}
.ds-timeline__title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 2px;
  width: 0;
  background: var(--ds-accent);
  transition: width 0.4s var(--ds-ease);
}
.ds-timeline__item:hover .ds-timeline__title::after { width: 100%; }
.ds-timeline__item::before {
  transition: transform 0.3s var(--ds-ease), box-shadow 0.3s var(--ds-ease);
}
.ds-timeline__item:hover::before {
  transform: scale(1.5);
  box-shadow: 0 0 0 4px rgba(115, 113, 252, 0.18);
}

/* --- Certification cards --------------------------------------------------------------------- */
.ds-cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: var(--ds-space-5);
}

.ds-cert {
  display: flex;
  gap: var(--ds-space-5);
  border: var(--ds-border);
  border-radius: var(--ds-radius-sm);
  padding: var(--ds-space-5);
  background: var(--ds-surface);
  transition: transform var(--ds-transition), box-shadow var(--ds-transition);
}
.ds-cert:hover { transform: translate(-3px, -3px); box-shadow: var(--ds-shadow-pop-soft); }

.ds-cert__badge {
  flex: none;
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.ds-cert__title {
  margin: 0 0 var(--ds-space-1);
  font-size: var(--ds-text-base);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-ink);
  line-height: var(--ds-leading-snug);
}

.ds-cert__subtitle {
  margin: 0 0 var(--ds-space-3);
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
}

.ds-cert__date {
  display: inline-block;
  background: var(--ds-accent);
  color: #fff;
  font-size: 11px;
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1;
  padding: 5px 9px 6px;
  border-radius: var(--ds-radius-sm);
}

.ds-cert__date--prep {
  background: transparent;
  color: var(--ds-accent);
  border: 1px dashed var(--ds-accent);
  padding: 4px 8px 5px;
}

.ds-cert details { margin-top: var(--ds-space-3); }
.ds-cert summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ds-ink);
}
.ds-cert summary::-webkit-details-marker { display: none; }
.ds-cert summary::after { content: '+'; color: var(--ds-accent); font-size: var(--ds-text-base); font-weight: var(--ds-weight-bold); }
.ds-cert details[open] summary::after { content: '\2212'; }
.ds-cert summary:hover { color: var(--ds-accent); }

.ds-cert details p {
  margin: var(--ds-space-3) 0 0;
  font-size: var(--ds-text-sm);
  line-height: 1.7;
  color: var(--ds-text-secondary);
}

/* --- Project case-study cards ------------------------------------------------------------------- */
/* A compact case study: a scannable face (role, name, outcome headline, key
   stack) over a structured deep-dive. Role is encoded by colour so the filter
   row doubles as a legend: Architect = ink, Lead = accent, Developer = accent
   outline, R&D = violet. */
.ds-project {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-3);
  border: var(--ds-border);
  border-radius: var(--ds-radius-sm);
  padding: var(--ds-space-5);
  background: var(--ds-surface);
  transition: transform var(--ds-transition), box-shadow var(--ds-transition);
}
.ds-project:hover { transform: translate(-3px, -3px); box-shadow: var(--ds-shadow-pop-soft); }

.ds-project__head { display: flex; flex-direction: column; gap: var(--ds-space-2); }

/* role pill — colour carries the role */
.ds-project__role {
  align-self: flex-start;
  display: inline-block;
  font-size: 11px;
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1;
  padding: 5px 9px 6px;
  border-radius: var(--ds-radius-sm);
  border: 1px solid transparent;
}
.ds-project__role--architect { background: var(--ds-ink); color: #fff; }
.ds-project__role--lead { background: var(--ds-accent); color: #fff; }
.ds-project__role--developer { background: transparent; color: var(--ds-accent); border-color: var(--ds-accent); }
.ds-project__role--rnd { background: var(--ds-accent-soft); color: #fff; }

.ds-project__name {
  margin: 0;
  font-size: var(--ds-text-xl);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-ink);
  line-height: var(--ds-leading-snug);
}

.ds-project__headline {
  margin: 0;
  font-size: var(--ds-text-base);
  font-weight: var(--ds-weight-medium);
  color: var(--ds-ink-soft);
  line-height: var(--ds-leading-snug);
}

/* tech chip row — small, quiet, monospaced to read as a stack */
.ds-project__tech { display: flex; flex-wrap: wrap; gap: var(--ds-space-2); }
.ds-tech-chip {
  display: inline-block;
  font-family: var(--ds-font-mono);
  font-size: 11px;
  line-height: 1;
  padding: 5px 8px 6px;
  border-radius: var(--ds-radius-sm);
  background: var(--ds-chip-bg);
  color: var(--ds-ink-soft);
}

/* structured deep-dive (Context / What I did / Outcome) */
.ds-project details { margin-top: var(--ds-space-1); }
.ds-project summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ds-ink);
}
.ds-project summary::-webkit-details-marker { display: none; }
.ds-project summary::after { content: '+'; color: var(--ds-accent); font-size: var(--ds-text-base); font-weight: var(--ds-weight-bold); }
.ds-project details[open] summary::after { content: '\2212'; }
.ds-project summary:hover { color: var(--ds-accent); }

.ds-project__detail { margin: var(--ds-space-3) 0 0; }
.ds-project__detail dt {
  font-size: 11px;
  font-weight: var(--ds-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ds-accent);
  margin-top: var(--ds-space-3);
}
.ds-project__detail dt:first-child { margin-top: 0; }
.ds-project__detail dd {
  margin: var(--ds-space-1) 0 0;
  font-size: var(--ds-text-sm);
  line-height: 1.7;
  color: var(--ds-text-secondary);
}

/* series call-to-action (rendered only when posts exist for the tag) */
.ds-project__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ds-ink);
  transition: color var(--ds-transition-fast), gap var(--ds-transition-fast);
}
.ds-project__cta svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.ds-project__cta:hover { color: var(--ds-accent); gap: var(--ds-space-3); }
.ds-project__cta-count { color: var(--ds-text-muted); font-weight: var(--ds-weight-regular); letter-spacing: 0; text-transform: none; }

/* featured variant — accent top rule, used on the intro grid */
.ds-project--featured { border-top: 6px solid var(--ds-accent); }

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

/* filter chips — toggle the catalogue and double as the role legend */
.ds-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-2);
  margin-bottom: var(--ds-space-5);
}
.ds-filter-chip {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 2px solid var(--ds-ink);
  border-radius: var(--ds-radius-md);
  color: var(--ds-ink-soft);
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-medium);
  line-height: 1;
  padding: 8px 14px;
  cursor: pointer;
  transition: background var(--ds-transition-fast), color var(--ds-transition-fast),
              border-color var(--ds-transition-fast);
}
.ds-filter-chip:hover { background: var(--ds-ink); color: #fff; }
.ds-filter-chip.is-active { background: var(--ds-accent); border-color: var(--ds-accent); color: #fff; }

/* a filtered-out carousel item collapses so the carousel re-measures cleanly */
.ds-carousel > .is-filtered-out { display: none; }

/* the whole card toggles its single <details> on click (see expandableCards in
   design-system.js); show the pointer where the native cursor is in play */
.ds-project:has(details),
.ds-cert:has(details) { cursor: pointer; }

@media (max-width: 767px) {
  .ds-project-grid { grid-template-columns: 1fr; }
}

/* --- Pull-quote strip (skills / certification intros) ------------------------------------------ */
.ds-quote {
  border-left: 4px solid var(--ds-ink);
  padding: var(--ds-space-2) 0 var(--ds-space-2) var(--ds-space-5);
  margin: 0 0 var(--ds-space-5);
}
.ds-quote p {
  margin: 0;
  font-size: var(--ds-text-lg);
  line-height: 1.5;
  font-weight: var(--ds-weight-medium);
  color: var(--ds-ink-soft);
}

/* --- Split layout (two-column content rows) ----------------------------------------------------- */
.ds-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--ds-space-7);
  align-items: start;
}
.ds-split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* media frame (skills logos / certificate collage on the intro slides) */
.ds-media-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--ds-space-4);
}
.ds-media-frame img {
  width: 100%;
  height: auto;
  max-height: 46vh;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.92;
  transition: filter 0.5s var(--ds-ease), opacity 0.5s var(--ds-ease);
}
.ds-media-frame:hover img { filter: grayscale(0); opacity: 1; }

/* Badge wall: individual certification badges in centred rows inside the
   media frame, inheriting its grayscale-until-hover treatment. */
.ds-badge-wall {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-5);
}
.ds-badge-wall__row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--ds-space-6);
}
.ds-media-frame .ds-badge-wall img {
  width: auto;
  height: clamp(84px, 13vh, 124px);
  max-height: none;
}

@media (max-width: 991px) {
  .ds-split, .ds-split--even { grid-template-columns: 1fr; gap: var(--ds-space-6); }
  .ds-cert-grid { grid-template-columns: 1fr; }
  .ds-media-frame { display: none; }       /* keep intros compact on small screens */
}

@media (max-width: 767px) {
  .ds-hero { padding: var(--ds-space-7) 0; }
  .ds-cert { flex-direction: column; }
  .ds-stat__num { font-size: var(--ds-text-3xl); }
  /* keep the long name from overflowing narrow viewports */
  .ds-hero__name { font-size: clamp(1.85rem, 8.5vw, 2.6rem); overflow-wrap: break-word; }
}


/* --------------------------------------------------------------------------
   17c. SLIDE EXPERIENCE & MOTION — design ideas carried over from the
        original slideshow theme, rebuilt natively (no libraries).
        Everything here is progressive enhancement: without JS or with
        prefers-reduced-motion the site renders as a static document.
   -------------------------------------------------------------------------- */

/* --- Transform-paged deck (faithful rebuild of the original slideshow) -------
   Default (mobile / no-JS / reduced-motion) = natural document flow.
   JS adds html.ds-deck-on at >=992px to engage the fixed paged stage:
   the track pages VERTICALLY (0.6s) between panels and, inside panels with
   sub-slides, a strip pages HORIZONTALLY (0.6s). Content sits on a floating
   white card with a faded 0.8->1 reveal, exactly like the original. */

/* base (flow) -------------------------------------------------------------- */
.ds-deck { position: relative; }
.ds-deck__track { position: relative; }

.ds-panel { position: relative; }

.ds-substrip { display: block; }          /* subs stack in flow */
.ds-sub { position: relative; }

.ds-panel__card {
  position: relative;
  background: var(--ds-surface);
  padding: var(--ds-space-7) 0;
}

/* rotated title rail — flat kicker in flow, rotated on the deck */
.ds-panel__title {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-3);
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ds-ink-soft);
  margin-bottom: var(--ds-space-4);
}
.ds-panel__title .ds-line { width: 28px; height: 6px; margin: 0; }

.ds-panel__body { position: relative; }

/* slide number — hidden in flow, shown on the deck */
.ds-slidenum { display: none; }

/* hero divider (content / empty right) — only meaningful on the deck */
.ds-hero__divider { display: none; }

/* hero portrait — shown only on the deck, beside the divider */
.ds-hero__portrait { display: none; }

/* alternating-tint sections retained for the flow layout */
.ds-panel--alt .ds-panel__card { background: #fafafa; }

/* deck-engaged (desktop) --------------------------------------------------- */
html.ds-deck-on { overflow: hidden; }
html.ds-deck-on body { overflow: hidden; height: 100vh; }

html.ds-deck-on .ds-header { position: fixed; top: 0; left: 0; right: 0; z-index: 40; }
html.ds-deck-on .ds-footer { display: none; }

html.ds-deck-on .ds-deck {
  position: fixed;
  left: 0; right: 0;
  top: var(--ds-header-height);
  bottom: 0;
  overflow: hidden;
  z-index: 1;
  background: #e9e9ef;                       /* gutter behind the cards */
}
/* the stage is a drag-to-page surface: disable text selection so a drag is a
   clean gesture (the custom cursor shows the grab state) and stop media from
   starting a native drag that would swallow the gesture */
html.ds-deck-on .ds-deck { -webkit-user-select: none; user-select: none; }
html.ds-deck-on .ds-deck input,
html.ds-deck-on .ds-deck textarea { -webkit-user-select: text; user-select: text; }
html.ds-deck-on .ds-deck img,
html.ds-deck-on .ds-deck svg { -webkit-user-drag: none; }

html.ds-deck-on .ds-deck__track {
  transition: transform var(--ds-dur-slow) var(--ds-ease);
  will-change: transform;
}
html.ds-deck-on .ds-deck.is-instant .ds-deck__track,
html.ds-deck-on .ds-deck.is-instant .ds-substrip { transition: none; }

/* each main panel fills the stage exactly */
html.ds-deck-on .ds-panel {
  height: calc(100vh - var(--ds-header-height));
  overflow: hidden;
}

/* horizontal sub-slide strip */
html.ds-deck-on .ds-substrip {
  display: flex;
  height: 100%;
  transition: transform var(--ds-dur-slow) var(--ds-ease);
  will-change: transform;
}
html.ds-deck-on .ds-sub { flex: 0 0 100vw; height: 100%; }

/* the floating content card */
html.ds-deck-on .ds-panel__card {
  width: 90vw;
  max-width: 1400px;
  height: calc(100% - 4.4vh);
  margin: 2.2vh auto;
  padding: 0;
  border: 1px solid var(--ds-hairline);
  border-radius: var(--ds-radius-sm);
  box-shadow: 0 18px 50px -28px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  opacity: 0.5;
  transition: opacity var(--ds-dur-slow) var(--ds-ease);
}
/* active panel / active sub fades fully in */
html.ds-deck-on .ds-panel.is-active > .ds-panel__card,
html.ds-deck-on .ds-panel.is-active .ds-sub.is-current .ds-panel__card { opacity: 1; }
html.ds-deck-on .ds-panel--alt .ds-panel__card { background: var(--ds-surface); }

/* scrollable body for content taller than the card (slimScroll replacement) */
html.ds-deck-on .ds-panel__body {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--ds-space-7) 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
html.ds-deck-on .ds-panel__body--top { justify-content: flex-start; }
html.ds-deck-on .ds-panel__body::-webkit-scrollbar { width: 7px; }
html.ds-deck-on .ds-panel__body::-webkit-scrollbar-thumb { background: var(--ds-chip-bg); border-radius: 4px; }
html.ds-deck-on .ds-panel__body { scrollbar-width: thin; scrollbar-color: var(--ds-chip-bg) transparent; }

/* rotated vertical title rail on the left edge of the card */
html.ds-deck-on .ds-panel__title {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 58px;
  margin: 0;
  border-right: 1px solid var(--ds-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.22em;
  z-index: 3;
  background: var(--ds-surface);
}
html.ds-deck-on .ds-panel__title .ds-line { width: 6px; height: 28px; }
/* indent the body to clear the title rail when present */
html.ds-deck-on .ds-panel__card--titled .ds-panel__body { padding-left: 58px; }

/* Experience panel (deck): the card stays fixed, only the employment
   timeline scrolls. A flex chain hands the leftover height to the list. */
html.ds-deck-on #experience .ds-panel__body { overflow: hidden; }
html.ds-deck-on #experience .ds-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
html.ds-deck-on #experience .ds-split--even {
  flex: 1;
  min-height: 0;
  align-items: stretch;
}
html.ds-deck-on #experience .ds-split--even > div {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
html.ds-deck-on #experience .ds-timeline {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-anchor: none;
  padding-right: var(--ds-space-4);
  scrollbar-width: thin;
  scrollbar-color: var(--ds-chip-bg) transparent;
}
html.ds-deck-on #experience .ds-timeline::-webkit-scrollbar { width: 7px; }
html.ds-deck-on #experience .ds-timeline::-webkit-scrollbar-thumb { background: var(--ds-chip-bg); border-radius: 4px; }

/* slide number "01 / 03" centered at the bottom of the card */
html.ds-deck-on .ds-slidenum {
  display: block;
  position: absolute;
  bottom: 14px; left: 0; right: 0;
  text-align: center;
  font-size: var(--ds-text-lg);
  font-weight: var(--ds-weight-light);
  color: var(--ds-accent);
  letter-spacing: 0.05em;
  z-index: 3;
}
html.ds-deck-on .ds-slidenum span {
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-light);
  color: var(--ds-text-muted);
  margin: 0 16px;
  vertical-align: middle;
}

/* hero vertical divider (content left / open right), like the original */
html.ds-deck-on .ds-hero__divider {
  display: block;
  position: absolute;
  top: 12%; bottom: 12%;
  left: 66%;
  width: 1px;
  background: var(--ds-hairline);
}

/* hero portrait — a scaled-down portrait in the open right of the intro slide,
   blended into the card: multiply drops the light photo background, and the mask
   feathers the edge facing the divider so it dissolves into the card. */
html.ds-deck-on #home .ds-hero__portrait {
  display: block;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: clamp(1rem, 3vw, 52px);
  height: 62%;
  width: auto;
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 15%, #000 85%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 10%, #000 86%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 15%, #000 85%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 10%, #000 86%, transparent 100%);
  mask-composite: intersect;
}

/* home hero content sits in the left column, clear of the divider
   (reference: col-md-8 border-right + padding-eleven-left + width-70) */
html.ds-deck-on #home .ds-container {
  max-width: 62%;
  margin: 0;
  padding-left: clamp(1.5rem, 6.5vw, 130px);
}
html.ds-deck-on #home .ds-hero__name { font-size: clamp(2.2rem, 4.4vw, 3.2rem); }
html.ds-deck-on #home .ds-hero__lead { max-width: 42ch; }

/* --- Indication arrows (pulsing periwinkle circles, JS-managed) -------------- */
.ds-indicator { display: none; }
html.ds-deck-on .ds-indicator {
  position: fixed;
  z-index: 35;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 0;
  padding: 0;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
html.ds-deck-on .ds-indicator.is-shown { display: block; opacity: 1; visibility: visible; }

.ds-indicator__dot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--ds-accent-soft);
  color: #fff;
}
.ds-indicator__dot svg { width: 15px; height: 15px; fill: currentColor; }
.ds-indicator::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ds-accent-soft);
  animation: ds-pulse 1s infinite;
  animation-delay: 0.4s;
}

@keyframes ds-pulse {
  0%   { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.3); opacity: 0; }
}

.ds-ind-bottom { bottom: 18px; left: 50%; transform: translateX(-50%); }
.ds-ind-right  { right: 18px;  top: 50%;  transform: translateY(-50%); }
.ds-ind-left   { left: 18px;   top: 50%;  transform: translateY(-50%); }

@media (prefers-reduced-motion: reduce) {
  .ds-indicator::after { animation: none; }
}

/* --- Scroll reveal (AOS replacement) ------------------------------------------ */
.js [data-ds-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity var(--ds-dur-slow) ease, transform var(--ds-dur-slow) var(--ds-ease);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
.js [data-ds-reveal].is-revealed { opacity: 1; transform: none; }

/* --- Letter-by-letter title (anime.js ml3 replacement) ------------------------- */
.ds-letters .ds-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.45em);
  animation: ds-letter 0.6s var(--ds-ease) forwards;
  animation-delay: calc(var(--i) * 0.034s + 0.15s);
}

@keyframes ds-letter {
  to { opacity: 1; transform: none; }
}

/* --- Page loader (banter boxes + door reveal, shown once per session) ----------- */
.ds-loader { display: none; }

html.ds-loading .ds-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: 200;
}

html.ds-loading { overflow: hidden; }

.ds-loader__door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.5%;
  background: var(--ds-ink);
  transition: transform 0.55s var(--ds-ease) 0.1s;
}
.ds-loader__door--left  { left: 0; }
.ds-loader__door--right { right: 0; }

.ds-loader__boxes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 14px);
  gap: 5px;
  z-index: 1;
  transition: opacity 0.25s ease;
}

.ds-loader__box {
  width: 14px;
  height: 14px;
  background: var(--ds-accent);
  animation: ds-banter 1.1s ease-in-out infinite;
}
.ds-loader__box:nth-child(1) { animation-delay: 0s; }
.ds-loader__box:nth-child(2) { animation-delay: 0.08s; }
.ds-loader__box:nth-child(3) { animation-delay: 0.16s; }
.ds-loader__box:nth-child(4) { animation-delay: 0.08s; }
.ds-loader__box:nth-child(5) { animation-delay: 0.16s; background: var(--ds-accent-soft); }
.ds-loader__box:nth-child(6) { animation-delay: 0.24s; }
.ds-loader__box:nth-child(7) { animation-delay: 0.16s; }
.ds-loader__box:nth-child(8) { animation-delay: 0.24s; }
.ds-loader__box:nth-child(9) { animation-delay: 0.32s; }

@keyframes ds-banter {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(0.45); opacity: 0.35; }
}

/* leaving state: doors part, boxes fade */
html.ds-loading.ds-loaded .ds-loader__door--left  { transform: translateX(-101%); }
html.ds-loading.ds-loaded .ds-loader__door--right { transform: translateX(101%); }
html.ds-loading.ds-loaded .ds-loader__boxes { opacity: 0; }
html.ds-loading.ds-loaded { overflow: auto; }

/* --- Custom cursor (two-ball follower) -------------------------------------------- */
.ds-cursor,
.ds-cursor-ring { display: none; }

@media (hover: hover) and (pointer: fine) {
  /* the custom cursor stands in for the OS pointer, so hide the native one
     wherever it is active; text-entry fields keep a caret so typing stays
     legible (overrides the per-element cursor:pointer rules, hence important) */
  html.ds-cursor-on,
  html.ds-cursor-on * { cursor: none !important; }
  html.ds-cursor-on input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]),
  html.ds-cursor-on textarea,
  html.ds-cursor-on [contenteditable="true"] { cursor: text !important; }

  html.ds-cursor-on .ds-cursor {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: var(--ds-accent);
    pointer-events: none;
    z-index: 150;
  }

  html.ds-cursor-on .ds-cursor-ring {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 2px solid var(--ds-ink);
    border-radius: 50%;
    pointer-events: none;
    z-index: 149;
    transition: transform 0.25s var(--ds-ease), border-color 0.25s var(--ds-ease),
                opacity 0.25s ease;
  }

  html.ds-cursor-on .ds-cursor-ring.is-hover {
    transform: scale(1.55);
    border-color: var(--ds-accent);
  }

  /* dragging the deck: the ring pinches in (scale set inline by JS) and
     turns accent, so the custom cursor reads as a "grab" */
  html.ds-cursor-on.ds-dragging .ds-cursor-ring { border-color: var(--ds-accent); }

  html.ds-cursor-on .ds-cursor.is-hidden,
  html.ds-cursor-on .ds-cursor-ring.is-hidden { opacity: 0; }
}

/* --- Carousel (owl-carousel replacement) -------------------------------------------- */
.ds-carousel {
  display: flex;
  gap: var(--ds-space-5);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: var(--ds-space-1);
  margin: calc(-1 * var(--ds-space-1));
}
.ds-carousel::-webkit-scrollbar { display: none; }

.ds-carousel > * {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-width: 0;
}

.ds-carousel--peek > * { flex: 0 0 min(400px, 100%); }

.ds-carousel-nav {
  display: flex;
  align-items: center;
  gap: var(--ds-space-4);
  margin-top: var(--ds-space-5);
}

.ds-carousel-nav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: var(--ds-border);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-surface);
  color: var(--ds-ink);
  cursor: pointer;
  transition: background var(--ds-transition-fast), color var(--ds-transition-fast),
              opacity var(--ds-transition-fast);
}
.ds-carousel-nav__btn:hover { background: var(--ds-ink); color: #fff; }
.ds-carousel-nav__btn:disabled { opacity: 0.3; cursor: default; }
.ds-carousel-nav__btn:disabled:hover { background: var(--ds-surface); color: var(--ds-ink); }
.ds-carousel-nav__btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; }

.ds-carousel-nav__counter {
  font-family: var(--ds-font-mono);
  font-size: var(--ds-text-sm);
  color: var(--ds-accent);
  font-weight: var(--ds-weight-semibold);
  letter-spacing: 0.1em;
}
.ds-carousel-nav__counter span { color: var(--ds-text-muted); font-weight: var(--ds-weight-light); }

/* --- Dark sticky header on scroll (the old .salva-header.sticky idea) ----------------- */
.ds-header {
  transition: background var(--ds-dur-base) ease, border-color var(--ds-dur-base) ease;
}

.ds-header.is-scrolled { background: var(--ds-surface-dark); border-bottom-color: var(--ds-surface-dark); }
.ds-header.is-scrolled .ds-brand { color: #fff; }
.ds-header.is-scrolled .ds-brand img { filter: invert(1) brightness(1.6); }
.ds-header.is-scrolled .ds-nav__link { color: var(--ds-chip-bg); }
.ds-header.is-scrolled .ds-nav__link:hover,
.ds-header.is-scrolled .ds-nav__link.is-active { color: #fff; }
.ds-header.is-scrolled .ds-nav-toggle { border-color: #fff; }
.ds-header.is-scrolled .ds-nav-toggle__bar { background: #fff; }
/* solid button would read black-on-dark here, so flip it to periwinkle (matches the mobile overlay) */
.ds-header.is-scrolled .ds-btn {
  background: var(--ds-accent);
  border-color: var(--ds-accent);
  color: #fff;
}
.ds-header.is-scrolled .ds-btn:not(.ds-btn--ghost)::after { background: #fff; }
.ds-header.is-scrolled .ds-btn:not(.ds-btn--ghost):hover { color: var(--ds-accent); }
.ds-header.is-scrolled .ds-btn--ghost { background: transparent; border-color: #fff; color: #fff; }
.ds-header.is-scrolled .ds-btn--ghost::after { background: #fff; }
.ds-header.is-scrolled .ds-btn--ghost:hover { color: var(--ds-ink); }

/* --- Full-screen overlay navigation (mobile, from the old split menu) ------------------ */
@media (max-width: 767px) {
  .ds-nav {
    position: fixed;
    inset: 0;
    top: 0;
    height: 100vh;
    height: 100svh;
    background: var(--ds-ink);
    border-bottom: 0;
    padding: calc(var(--ds-header-height) + var(--ds-space-6)) var(--ds-space-6) var(--ds-space-6);
    counter-reset: ds-menu;
    z-index: 45;
    justify-content: flex-start;
  }

  .ds-nav.is-open { display: flex; animation: ds-nav-in 0.4s var(--ds-ease); }

  @keyframes ds-nav-in {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: none; }
  }

  .ds-nav .ds-nav__link {
    counter-increment: ds-menu;
    color: #fff;
    font-size: var(--ds-text-xl);
    font-weight: var(--ds-weight-bold);
    text-transform: none;
    letter-spacing: 0;
    padding: var(--ds-space-3) 0;
    width: 100%;
    border-bottom: 1px solid #2b2b2b;
  }
  .ds-nav .ds-nav__link::before {
    content: counter(ds-menu, decimal-leading-zero) '  ';
    font-family: var(--ds-font-mono);
    font-size: var(--ds-text-xs);
    color: var(--ds-accent);
    vertical-align: 4px;
    letter-spacing: 0.1em;
    margin-right: var(--ds-space-2);
  }
  .ds-nav .ds-nav__link:hover,
  .ds-nav .ds-nav__link.is-active { color: var(--ds-accent-soft); background-size: 0 3px; }

  .ds-nav .ds-btn {
    margin-top: var(--ds-space-5);
    background: var(--ds-accent);
    border-color: var(--ds-accent);
  }

  body.ds-nav-open { overflow: hidden; }
  /* keep the toggle visible above the overlay */
  .ds-nav-toggle { position: relative; z-index: 50; }
  body.ds-nav-open .ds-nav-toggle { border-color: #fff; }
  body.ds-nav-open .ds-nav-toggle__bar { background: #fff; }
}

/* --- Reduced motion: switch the whole layer off ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  /* the deck never engages under reduced motion (JS also checks this) — the
     page stays a natural, fully-visible document */
  html.ds-deck-on,
  html.ds-deck-on body { overflow: auto; height: auto; }
  html.ds-deck-on .ds-deck { position: relative; top: 0; background: transparent; }
  html.ds-deck-on .ds-header { position: sticky; }
  html.ds-deck-on .ds-footer { display: flex; }

  .js [data-ds-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .ds-letters .ds-letter {
    opacity: 1;
    transform: none;
    animation: none;
  }

  html.ds-loading .ds-loader { display: none; }
  html.ds-loading { overflow: auto; }

  .ds-loader__box { animation: none; }

  html.ds-cursor-on .ds-cursor,
  html.ds-cursor-on .ds-cursor-ring { display: none; }

  .ds-carousel { scroll-behavior: auto; }
}


/* --------------------------------------------------------------------------
   18. STYLE-GUIDE HELPERS (used by /design-system)
   -------------------------------------------------------------------------- */
.ds-spec { padding: var(--ds-space-7) 0 0; }

.ds-spec__head { margin-bottom: var(--ds-space-5); }

.ds-spec__title {
  margin: var(--ds-space-2) 0 var(--ds-space-2);
  font-size: var(--ds-text-2xl);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-ink);
}

.ds-spec__desc {
  margin: 0;
  max-width: 70ch;
  color: var(--ds-text-secondary);
  font-size: var(--ds-text-base);
}

.ds-demo {
  border: 1px solid var(--ds-hairline);
  border-radius: var(--ds-radius-sm);
  padding: var(--ds-space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-4);
  align-items: center;
}

.ds-demo--stack { display: block; }

/* Color swatches */
.ds-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--ds-space-4);
}

.ds-swatch {
  border: 1px solid var(--ds-hairline);
  border-radius: var(--ds-radius-sm);
  overflow: hidden;
}

.ds-swatch__chip { height: 84px; border-bottom: 1px solid var(--ds-hairline); }

.ds-swatch__info { padding: var(--ds-space-3); }

.ds-swatch__name {
  display: block;
  font-family: var(--ds-font-mono);
  font-size: 12px;
  color: var(--ds-ink);
}

.ds-swatch__value {
  display: block;
  font-family: var(--ds-font-mono);
  font-size: 11px;
  color: var(--ds-text-muted);
  text-transform: uppercase;
}

/* Type specimens */
.ds-type-row {
  display: flex;
  align-items: baseline;
  gap: var(--ds-space-5);
  padding: var(--ds-space-4) 0;
  border-bottom: 1px solid var(--ds-hairline);
}
.ds-type-row:last-child { border-bottom: 0; }

.ds-type-row__token {
  flex: none;
  width: 150px;
  font-family: var(--ds-font-mono);
  font-size: 12px;
  color: var(--ds-text-muted);
}

/* Spacing specimens */
.ds-space-row { display: flex; align-items: center; gap: var(--ds-space-4); padding: var(--ds-space-2) 0; }
.ds-space-row__bar { height: 18px; background: var(--ds-accent-soft); }
.ds-space-row__token { font-family: var(--ds-font-mono); font-size: 12px; color: var(--ds-text-muted); }


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

.ds-skip-link {
  position: absolute;
  left: var(--ds-space-4);
  top: -100px;
  z-index: 100;
  background: var(--ds-ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--ds-radius-sm) var(--ds-radius-sm);
  font-size: var(--ds-text-sm);
  transition: top var(--ds-transition-fast);
}
.ds-skip-link:focus { top: 0; }


/* --------------------------------------------------------------------------
   20. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  :root { --ds-header-height: 73px; }

  .ds-section { padding: var(--ds-space-7) 0; }
  .ds-page-hero { padding: var(--ds-space-7) 0 var(--ds-space-6); }
}

@media (max-width: 767px) {
  .ds-container { padding-left: var(--ds-space-4); padding-right: var(--ds-space-4); }

  /* collapse nav into toggled panel */
  .ds-nav-toggle { display: inline-flex; flex-direction: column; }

  .ds-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--ds-surface);
    border-bottom: var(--ds-border);
    padding: var(--ds-space-3) var(--ds-space-4) var(--ds-space-5);
    display: none;
  }
  .ds-nav.is-open { display: flex; }

  .ds-nav__link { padding: var(--ds-space-3) 0; font-size: var(--ds-text-base); }
  .ds-nav .ds-btn { margin-top: var(--ds-space-3); }

  .ds-grid { grid-template-columns: 1fr; }

  .ds-pagenav { grid-template-columns: 1fr; }
  .ds-pagenav__item--next { text-align: left; align-items: flex-start; }

  .ds-author { flex-direction: column; align-items: flex-start; }

  .ds-prose .ds-gallery { grid-template-columns: 1fr; }

  .ds-prose pre,
  .ds-code pre { font-size: 0.8125rem; padding: var(--ds-space-4); }

  .ds-type-row { flex-direction: column; gap: var(--ds-space-1); align-items: flex-start; }
}


/* --------------------------------------------------------------------------
   21. MAINTENANCE / COMING-SOON SPLASH
   Standalone single-screen page (see _MaintenanceLayout.cshtml). Reuses the
   hero signature (black display heading + 100px accent bar, periwinkle lead);
   the one moving part is a pulsing accent status dot.
   -------------------------------------------------------------------------- */
.ds-page--maint {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.ds-page--maint #ds-main {
  flex: 1 0 auto;
  display: flex;
}
.ds-page--maint .ds-header {
  position: static;
  background: var(--ds-surface);
  border-bottom: 1px solid var(--ds-hairline);
}

.ds-maint {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--ds-space-8) 0;
}
.ds-maint__inner {
  max-width: 720px;
}

.ds-maint__dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: var(--ds-space-2);
  border-radius: 50%;
  background: var(--ds-accent);
  box-shadow: 0 0 0 0 var(--ds-accent-soft-tint);
  animation: ds-maint-pulse 2s var(--ds-ease) infinite;
}
@keyframes ds-maint-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(115, 113, 252, 0.45); }
  70%  { box-shadow: 0 0 0 10px rgba(115, 113, 252, 0); }
  100% { box-shadow: 0 0 0 0 rgba(115, 113, 252, 0); }
}

.ds-maint__title {
  position: relative;
  display: inline-block;
  margin: var(--ds-space-4) 0 calc(var(--ds-space-6) + 8px);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1.05;
  font-weight: var(--ds-weight-black);
  letter-spacing: -0.02em;
  color: var(--ds-ink-soft);
}
.ds-maint__title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: calc(-1 * var(--ds-space-4));
  width: 100px;
  height: 4px;
  background: var(--ds-ink);
}

.ds-maint__lead {
  margin: 0 0 var(--ds-space-6);
  max-width: 52ch;
  font-size: var(--ds-text-lg);
  color: var(--ds-accent);
}

.ds-maint__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-4);
  align-items: center;
}

/* gentle entrance, matching the hero */
.ds-maint__inner > * { animation: ds-rise 0.7s var(--ds-ease) backwards; }
.ds-maint__inner > *:nth-child(2) { animation-delay: 0.08s; }
.ds-maint__inner > *:nth-child(3) { animation-delay: 0.16s; }
.ds-maint__inner > *:nth-child(4) { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .ds-maint__dot { animation: none; }
  .ds-maint__inner > * { animation: none; }
}


/* --------------------------------------------------------------------------
   22. STATUS PAGES (404 and friends)
   In-layout page (header/footer stay) reached via status-code re-execution.
   Signature: a giant outlined status numeral over the hero typography, same
   black display heading + accent bar as the maintenance splash.
   -------------------------------------------------------------------------- */
.ds-status {
  padding: var(--ds-space-8) 0 var(--ds-space-9);
  border-bottom: 1px solid var(--ds-hairline);
}

.ds-status__inner {
  max-width: 720px;
}

.ds-status__code {
  display: block;
  margin-bottom: var(--ds-space-4);
  font-size: clamp(5rem, 18vw, 10rem);
  line-height: 1;
  font-weight: var(--ds-weight-black);
  letter-spacing: -0.04em;
  color: var(--ds-hairline);
}
@supports (-webkit-text-stroke: 2px black) {
  .ds-status__code {
    color: var(--ds-surface);
    -webkit-text-stroke: 2px var(--ds-ink);
  }
}

.ds-status__title {
  position: relative;
  display: inline-block;
  margin: var(--ds-space-4) 0 calc(var(--ds-space-6) + 8px);
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  line-height: 1.05;
  font-weight: var(--ds-weight-black);
  color: var(--ds-ink);
}
.ds-status__title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: calc(-1 * var(--ds-space-4));
  width: 100px;
  height: 4px;
  background: var(--ds-accent);
}

.ds-status__lead {
  margin: 0 0 var(--ds-space-6);
  max-width: 52ch;
  font-size: var(--ds-text-lg);
  color: var(--ds-text-secondary);
}

.ds-status__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-4);
  align-items: center;
}

.ds-status__inner > * { animation: ds-rise 0.7s var(--ds-ease) backwards; }
.ds-status__inner > *:nth-child(2) { animation-delay: 0.08s; }
.ds-status__inner > *:nth-child(3) { animation-delay: 0.16s; }
.ds-status__inner > *:nth-child(4) { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .ds-status__inner > * { animation: none; }
}


/* --------------------------------------------------------------------------
   TAXONOMY (breadcrumb, topic/series chips, series lists, load-more)
   -------------------------------------------------------------------------- */

/* Breadcrumb — quiet meta trail above hero titles */
.ds-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ds-space-2);
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
  margin-bottom: var(--ds-space-4);
}
.ds-breadcrumb a {
  color: var(--ds-text-muted);
  transition: color var(--ds-transition-fast);
}
.ds-breadcrumb a:hover { color: var(--ds-accent); }
.ds-breadcrumb [aria-current="page"] {
  color: var(--ds-ink-soft);
  font-weight: var(--ds-weight-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 34ch;
}
.ds-breadcrumb__sep { color: var(--ds-accent); font-weight: var(--ds-weight-bold); }

/* Topic chip count badge */
.ds-chip__count {
  display: inline-block;
  margin-left: var(--ds-space-2);
  color: var(--ds-text-muted);
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
}
a.ds-chip:hover .ds-chip__count { color: #fff; }

/* Series membership chip — accent-tinted to read differently from topics/tags */
.ds-chip--series { background: var(--ds-accent-tint); color: var(--ds-accent); }
a.ds-chip--series:hover { background: var(--ds-accent); color: #fff; }

/* Series rows on a category landing (one row per series) */
.ds-series-list { display: grid; gap: var(--ds-space-3); }

.ds-series-row {
  display: flex;
  align-items: center;
  gap: var(--ds-space-4);
  padding: var(--ds-space-4) var(--ds-space-5);
  background: var(--ds-surface);
  border: 2px solid var(--ds-ink);
  border-radius: var(--ds-radius-sm);
  color: var(--ds-ink);
  transition: transform var(--ds-transition), box-shadow var(--ds-transition);
}
.ds-series-row:hover {
  transform: translate(-4px, -4px);
  box-shadow: var(--ds-shadow-pop);
}
.ds-series-row__name { font-weight: var(--ds-weight-semibold); }
.ds-series-row__count { color: var(--ds-text-muted); font-size: var(--ds-text-sm); }
.ds-series-row__arrow { margin-left: auto; color: var(--ds-accent); }

/* Ordered part rows on a series landing */
.ds-series-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--ds-space-5);
  padding: var(--ds-space-5);
  background: var(--ds-surface);
  border: 2px solid var(--ds-ink);
  border-radius: var(--ds-radius-sm);
  transition: transform var(--ds-transition), box-shadow var(--ds-transition);
}
.ds-series-item:hover,
.ds-series-item:focus-within {
  transform: translate(-4px, -4px);
  box-shadow: var(--ds-shadow-pop);
}
.ds-series-item__num {
  font-size: var(--ds-text-2xl);
  font-weight: var(--ds-weight-black);
  line-height: 1;
  color: var(--ds-accent);
  min-width: 2ch;
}
.ds-series-item__body { min-width: 0; }
.ds-series-item__title {
  margin: var(--ds-space-2) 0;
  font-size: var(--ds-text-xl);
  line-height: var(--ds-leading-tight);
  font-weight: var(--ds-weight-bold);
}
.ds-series-item__title .ds-underline-grow {
  background-image: linear-gradient(transparent calc(100% - 3px), var(--ds-accent) 3px);
}
.ds-series-item:hover .ds-underline-grow,
.ds-series-item:focus-within .ds-underline-grow { background-size: 100% 100%; }
/* full-row clickable, matching .ds-card--link behaviour (soon rows have no link) */
.ds-series-item .ds-card__link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.ds-series-item__excerpt {
  margin: 0;
  color: var(--ds-text-secondary);
  font-size: var(--ds-text-sm);
}
.ds-series-item__arrow {
  margin-left: auto;
  align-self: center;
  color: var(--ds-accent);
  transition: transform var(--ds-transition-fast);
}
.ds-series-item:hover .ds-series-item__arrow { transform: translateX(4px); }

/* "Coming soon" rows — unpublished parts shown as roadmap, not hidden.
   Dimmed via explicit colors, not row opacity: whole-row opacity drags the
   text below WCAG AA. Unlinked, inert: no hover lift, no arrow, no hooks. */
.ds-series-item--soon { border-color: #c9c9c9; }
.ds-series-item--soon:hover,
.ds-series-item--soon:focus-within {
  transform: none;
  box-shadow: none;
}
.ds-series-item--soon .ds-series-item__num { color: var(--ds-text-muted); }
.ds-series-item--soon .ds-series-item__title { color: var(--ds-text-muted); }
.ds-series-item--soon .ds-series-item__excerpt { color: var(--ds-text-muted); }
.ds-series-item__soon-label {
  color: var(--ds-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
}

/* "Start here"/"Next up" — the reader's one glowing row (localStorage-driven,
   JS adds the class; exactly one per list). Accent left edge + solid chip. */
.ds-series-item--next { border-left: 6px solid var(--ds-accent); }
.ds-series-item__next-label {
  display: inline-block;
  padding: 2px 8px 3px;
  border-radius: 999px;
  background: var(--ds-accent);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  line-height: 1.2;
}

/* Lesson progress (seriesProgress module, localStorage-driven). The toggle
   is JS-injected so rows stay clean without it, and sits above the full-row
   link overlay. A done row keeps its link but reads as settled: muted via
   explicit colors (whole-row opacity drags text below WCAG AA), with a
   check under the part number. */
.ds-series-item__toggle {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--ds-space-3);
  padding: 5px 10px;
  background: var(--ds-surface);
  color: var(--ds-text-muted);
  border: 1px solid #c9c9c9;
  border-radius: var(--ds-radius-sm);
  font-family: var(--ds-font-sans);
  font-size: 11px;
  font-weight: var(--ds-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color var(--ds-transition-fast), border-color var(--ds-transition-fast),
              background var(--ds-transition-fast);
}
.ds-series-item__toggle:hover {
  color: var(--ds-accent);
  border-color: var(--ds-accent);
  background: var(--ds-accent-tint);
}
.ds-series-item__toggle[aria-pressed="true"] {
  color: #fff;
  background: var(--ds-accent);
  border-color: var(--ds-accent);
}
.ds-series-item__toggle svg { width: 13px; height: 13px; fill: currentColor; }

.ds-series-item--done { border-color: #c9c9c9; }
.ds-series-item--done .ds-series-item__num { color: var(--ds-text-muted); }
.ds-series-item--done .ds-series-item__num::after {
  content: '\2713';
  display: block;
  margin-top: var(--ds-space-1);
  font-size: var(--ds-text-base);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-success);
}
.ds-series-item--done .ds-series-item__title { color: var(--ds-text-muted); }
.ds-series-item--done .ds-series-item__excerpt { color: var(--ds-text-muted); }
.ds-series-item--done:hover .ds-series-item__title,
.ds-series-item--done:focus-within .ds-series-item__title { color: var(--ds-text); }

/* Series-hero progress: mono done/total fraction beside a 2px hairline
   track whose accent fill JS keeps at done/total. The server renders the
   mount hidden and empty; it shows once the reader has marked anything. */
.ds-series-progress {
  display: flex;
  align-items: center;
  gap: var(--ds-space-3);
  max-width: 420px;
  margin-top: var(--ds-space-4);
  font-family: var(--ds-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
}
.ds-series-progress[hidden] { display: none; }
.ds-series-progress__count { white-space: nowrap; }
.ds-series-progress__count strong { color: var(--ds-text); font-weight: var(--ds-weight-bold); }
.ds-series-progress__track {
  flex: 1;
  height: 2px;
  background: var(--ds-hairline);
}
.ds-series-progress__fill {
  display: block;
  height: 100%;
  background: var(--ds-accent);
  transition: width var(--ds-transition);
}

/* Continue-reading shelf (continueReading module, localStorage-driven).
   The blog index serves the [data-ds-continue] mount hidden and empty; JS
   builds this card from kc:reading:last or removes the mount, so the page
   holds its layout either way. Accent left edge marks it as the reader's
   own row, like the series "Next up" treatment. */
.ds-continue {
  position: relative;
  max-width: 620px;
  padding: var(--ds-space-5) var(--ds-space-6);
  padding-right: var(--ds-space-8);
  background: var(--ds-surface);
  border: var(--ds-border);
  border-left: 6px solid var(--ds-accent);
}
.ds-continue__title {
  display: inline-block;
  margin-top: var(--ds-space-3);
  font-size: var(--ds-text-xl);
  font-weight: var(--ds-weight-bold);
  line-height: var(--ds-leading-snug);
  color: var(--ds-ink);
  text-decoration: none;
  background-image: linear-gradient(var(--ds-accent), var(--ds-accent));
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: 0 100%;
  transition: background-size 0.4s var(--ds-ease);
}
.ds-continue__title:hover { background-size: 100% 2px; }
.ds-continue .ds-meta { margin-top: var(--ds-space-2); }
.ds-continue__track {
  display: block;
  height: 2px;
  margin-top: var(--ds-space-4);
  background: var(--ds-hairline);
}
.ds-continue__fill {
  display: block;
  height: 100%;
  background: var(--ds-accent);
}
.ds-continue__dismiss {
  position: absolute;
  top: var(--ds-space-3);
  right: var(--ds-space-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--ds-surface);
  color: var(--ds-text-muted);
  border: 1px solid #c9c9c9;
  border-radius: var(--ds-radius-sm);
  font-size: var(--ds-text-base);
  line-height: 1;
  cursor: pointer;
  transition: color var(--ds-transition-fast), border-color var(--ds-transition-fast),
              background var(--ds-transition-fast);
}
.ds-continue__dismiss:hover {
  color: var(--ds-ink);
  border-color: var(--ds-ink);
  background: var(--ds-hairline);
}

/* In-post series map — native <details>, zero JS. The <summary> is the
   series-context header (kicker + mono "Part n/N" count + collapse chevron,
   series name, and a 2px progress bar flush along the bottom edge at this
   part's position); the body is the full arc with quiet mono part numbers
   (ds-toc__num treatment), one note-style current row, and coming-soon
   rows. Square surface per the radius standard. */
.ds-series-map {
  margin: 0 0 var(--ds-space-6);
  border: var(--ds-border);
  background: var(--ds-surface);
}
.ds-series-map__summary {
  position: relative;
  display: block;
  padding: var(--ds-space-4) var(--ds-space-5) calc(var(--ds-space-4) + 4px);
  cursor: pointer;
  list-style: none;
}
.ds-series-map__summary::-webkit-details-marker { display: none; }
/* header row: kicker left, mono part-count + collapse chevron right — the
   chevron is the collapse affordance and stays visible in every mode */
.ds-series-map__head {
  display: flex;
  align-items: center;
  gap: var(--ds-space-2);
}
.ds-series-map__count {
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--ds-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--ds-text-xs);
  white-space: nowrap;
  color: var(--ds-text-muted);
}
.ds-series-map__name {
  display: block;
  margin-top: var(--ds-space-1);
  font-size: var(--ds-text-lg);
  font-weight: var(--ds-weight-bold);
  line-height: var(--ds-leading-tight);
}
.ds-series-map__chevron {
  flex-shrink: 0;
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
  transition: transform var(--ds-transition-fast);
}
.ds-series-map__summary:hover .ds-series-map__chevron { color: var(--ds-accent); }
.ds-series-map[open] .ds-series-map__chevron { transform: rotate(180deg); }
.ds-series-map__track {
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--ds-hairline);
}
.ds-series-map__fill {
  display: block;
  height: 100%;
  background: var(--ds-accent);
}
.ds-series-map__list {
  margin: 0;
  padding: var(--ds-space-4) var(--ds-space-5);
  border-top: 1px solid var(--ds-hairline);
  list-style: none;
  display: grid;
  gap: var(--ds-space-2);
}
.ds-series-map__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--ds-space-3);
  padding: var(--ds-space-1) var(--ds-space-2);
  border-left: 3px solid transparent;
  font-size: var(--ds-text-sm);
}
/* full-row clickable + row-level hover (current/soon rows have no link) */
.ds-series-map__item a.ds-series-map__title::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.ds-series-map__item:hover a.ds-series-map__title { color: var(--ds-accent); }
/* part number — same quiet mono treatment as the TOC's ds-toc__num */
.ds-series-map__num {
  flex-shrink: 0;
  font-family: var(--ds-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
}
.ds-series-map__title { min-width: 0; }
a.ds-series-map__title:hover { color: var(--ds-accent); }
.ds-series-map__min {
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--ds-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
}
.ds-series-map__state {
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  color: var(--ds-text-secondary);
}
/* current row — mini version of the ds-prose note callout: accent edge
   bar + accent tint wash instead of a filled badge */
.ds-series-map__item--current {
  background: var(--ds-accent-tint);
  border-left-color: var(--ds-accent);
}
.ds-series-map__item--current .ds-series-map__num {
  color: var(--ds-accent);
  font-weight: var(--ds-weight-bold);
}
.ds-series-map__item--current .ds-series-map__title {
  font-weight: var(--ds-weight-semibold);
  color: var(--ds-ink);
}
.ds-series-map__item--current .ds-series-map__state { color: var(--ds-accent); }
/* Soon rows dim via explicit colors, not opacity (WCAG AA — see series TOC). */
.ds-series-map__item--soon .ds-series-map__title { color: var(--ds-text-muted); }
.ds-series-map__item--soon .ds-series-map__num { color: #c9c9c9; }
.ds-series-map__viewall {
  display: block;
  padding: var(--ds-space-3) var(--ds-space-5);
  border-top: 1px solid var(--ds-hairline);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-semibold);
}
.ds-series-map__viewall:hover { color: var(--ds-accent); }

/* "More in {category}" — light related cards closing a non-series post:
   title + two-line clamped description only, no image/date/meta. */
.ds-related-wrap { margin-top: var(--ds-space-7); }
.ds-related {
  display: grid;
  gap: var(--ds-space-4);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: var(--ds-space-4);
}
.ds-related__card {
  display: block;
  padding: var(--ds-space-4);
  border: var(--ds-border);
  background: var(--ds-surface);
  color: inherit;
}
.ds-related__card:hover .ds-related__title { color: var(--ds-accent); }
.ds-related__title {
  display: block;
  font-weight: var(--ds-weight-bold);
  line-height: var(--ds-leading-tight);
  transition: color var(--ds-transition-fast);
}
.ds-related__desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: var(--ds-space-2) 0 0;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-secondary);
}
.ds-related__back {
  display: inline-block;
  margin-top: var(--ds-space-5);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-semibold);
}
.ds-related__back:hover { color: var(--ds-accent); }

/* Article layout — one grid for the whole page. Hero and prose share the
   centre column (single 856px flow on most viewports, series map between
   hero and prose); at >=1450px it becomes three panes: series map in a
   sticky LEFT rail, hero + prose centre, "On this page" TOC in a sticky
   RIGHT rail — both rails span the full page height, hero row included.
   Narrow viewports get the inline <details> TOC. */
.ds-post-layout__hero {
  max-width: 856px;
  margin: 0 auto;
}
.ds-post-layout__main {
  max-width: 856px;
  margin: 0 auto;
  min-width: 0;
}
.ds-post-layout__series {
  max-width: 856px;
  margin: 0 auto;
}
.ds-post-layout__rail { display: none; }
@media (min-width: 1450px) {
  .ds-post-layout {
    /* lift the ds-container cap: the rails float in the true page gutters
       while the centre track stays put */
    max-width: none;
    display: grid;
    /* equal side tracks keep the article column on the viewport centreline;
       no row gap — the hero's own padding sets the vertical rhythm */
    grid-template-columns: 260px minmax(0, 856px) 260px;
    grid-template-rows: auto auto;
    justify-content: center;
    gap: 0 var(--ds-space-7);
  }
  /* centre-column items: auto margins would size them to fit-content and
     overflow the track — let the grid place and stretch them instead */
  .ds-post-layout__hero {
    grid-column: 2;
    grid-row: 1;
    max-width: none;
    margin: 0;
  }
  /* posts without a series: keep the two right panes in their columns */
  .ds-post-layout__main {
    grid-column: 2;
    grid-row: 2;
    max-width: none;
    margin: 0;
  }
  .ds-post-layout__rail { grid-column: 3; grid-row: 1 / 3; }
  .ds-post-layout__series {
    grid-column: 1;
    grid-row: 1 / 3;
    max-width: none;
    /* top margin lines the panel up with the hero's breadcrumb */
    margin: var(--ds-space-8) 0 0;
    position: sticky;
    top: 110px;
    align-self: start;
  }
  /* long series: the summary header and view-all footer stay pinned and
     only the part list scrolls (never the whole panel). The <details> body
     lives in the ::details-content box, so that box must pass the flex
     sizing through; browsers without ::details-content support fall back
     to the map's own overflow and scroll the whole panel. */
  .ds-post-layout__series .ds-series-map {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
  .ds-post-layout__series .ds-series-map::details-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .ds-post-layout__series .ds-series-map__summary,
  .ds-post-layout__series .ds-series-map__viewall { flex-shrink: 0; }
  .ds-post-layout__series .ds-series-map__list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .ds-post-layout__series .ds-series-map__list::-webkit-scrollbar { width: 8px; }
  .ds-post-layout__series .ds-series-map__list::-webkit-scrollbar-track { background: transparent; }
  .ds-post-layout__series .ds-series-map__list::-webkit-scrollbar-thumb {
    background: var(--ds-hairline);
    border-radius: 4px;
  }
  .ds-post-layout__series .ds-series-map__list:hover::-webkit-scrollbar-thumb { background: var(--ds-accent); }
  /* compact sidebar mode for the series map */
  .ds-post-layout__series .ds-series-map__name { font-size: var(--ds-text-sm); }
  .ds-post-layout__series .ds-series-map__summary { padding: var(--ds-space-3) var(--ds-space-4) calc(var(--ds-space-3) + 4px); }
  .ds-post-layout__series .ds-series-map__list { padding: var(--ds-space-3) var(--ds-space-4); }
  .ds-post-layout__series .ds-series-map__item { font-size: var(--ds-text-xs); }
  .ds-post-layout__series .ds-series-map__min,
  .ds-post-layout__series .ds-series-map__state { display: none; }
  .ds-post-layout__series .ds-series-map__num { font-size: 0.625rem; }
  .ds-post-layout__series .ds-series-map__viewall { padding: var(--ds-space-2) var(--ds-space-4); font-size: var(--ds-text-xs); }
  .ds-post-layout__rail:not([hidden]) {
    display: block;
    position: sticky;
    top: 110px;
    align-self: start;
    /* top margin lines the panel up with the hero's breadcrumb */
    margin-top: var(--ds-space-8);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding-left: var(--ds-space-4);
    border-left: 1px solid var(--ds-hairline);
  }
}

/* TOC — numbered mono entries; the active item grows a 2px accent bar */
.ds-toc__head {
  display: block;
  margin-bottom: var(--ds-space-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  color: var(--ds-text-muted);
}
.ds-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--ds-space-2);
}
.ds-toc__item--sub { padding-left: var(--ds-space-5); }
.ds-toc__link {
  position: relative;
  display: flex;
  gap: var(--ds-space-2);
  padding-left: var(--ds-space-2);
  border-left: 2px solid transparent;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-secondary);
  transition: color var(--ds-transition-fast), border-color var(--ds-transition-fast);
}
.ds-toc__link:hover { color: var(--ds-accent); }
.ds-toc__link.is-active {
  border-left-color: var(--ds-accent);
  color: var(--ds-text);
  font-weight: var(--ds-weight-semibold);
}
.ds-toc__num {
  font-family: var(--ds-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
  line-height: inherit;
}

/* Inline TOC for narrow viewports (hidden when the rail is shown) */
.ds-toc-inline {
  margin: 0 0 var(--ds-space-6);
  border: var(--ds-border);
  background: var(--ds-surface);
}
.ds-toc-inline__summary {
  padding: var(--ds-space-3) var(--ds-space-5);
  cursor: pointer;
  list-style: none;
  font-family: var(--ds-font-mono);
  font-size: var(--ds-text-sm);
}
.ds-toc-inline__summary::-webkit-details-marker { display: none; }
.ds-toc-inline .ds-toc__list {
  padding: var(--ds-space-3) var(--ds-space-5) var(--ds-space-4);
  border-top: 1px solid var(--ds-hairline);
}
@media (min-width: 1450px) {
  .ds-toc-inline { display: none; }
}

/* (code-block copy button ships with frameCodeBlocks — styles at §ds-code) */

/* Reading progress — a 2px accent rail fixed at the top of the viewport */
.ds-read-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  background: transparent;
  pointer-events: none;
}
.ds-read-progress__fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ds-accent);
}

/* Back to top — appears after ~1.5 viewports of scroll */
.ds-backtop {
  position: fixed;
  right: var(--ds-space-5);
  bottom: var(--ds-space-5);
  z-index: 55;
  width: 44px;
  height: 44px;
  border: var(--ds-border);
  border-radius: 6px;
  background: var(--ds-surface);
  font-size: var(--ds-text-lg);
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--ds-transition-fast), transform var(--ds-transition-fast);
}
.ds-backtop.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.ds-backtop:hover { background: var(--ds-accent); border-color: var(--ds-accent); color: #fff; }

/* Archive search — a GET form; the input is a control (6px radius) */
.ds-search {
  display: flex;
  gap: var(--ds-space-3);
  max-width: 560px;
}
.ds-input {
  flex: 1;
  min-width: 0;
  padding: 11px 16px;
  border: var(--ds-border);
  border-radius: 6px;
  background: var(--ds-surface);
  font: inherit;
  font-size: var(--ds-text-sm);
  color: var(--ds-text);
}
.ds-input:focus-visible {
  outline: 3px solid var(--ds-accent);
  outline-offset: 1px;
}

/* Dense row list container */
.ds-post-list { margin-top: var(--ds-space-2); }

/* Compact post row — the dense sibling of the article card (P1.4): date,
   title, category + minutes on a hairline-separated line. Whole-row click +
   row-level hover underline, matching the card conventions. */
.ds-post-row {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: var(--ds-space-4);
  padding: var(--ds-space-3) var(--ds-space-2);
  border-top: 1px solid var(--ds-hairline);
}
.ds-post-row:last-child { border-bottom: 1px solid var(--ds-hairline); }
.ds-post-row__date {
  flex: none;
  width: 7.5em;
  font-family: var(--ds-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
}
.ds-post-row__title {
  margin: 0;
  min-width: 0;
  font-size: var(--ds-text-base, 1rem);
  line-height: var(--ds-leading-tight);
  font-weight: var(--ds-weight-semibold);
}
.ds-post-row .ds-card__link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.ds-post-row:hover .ds-underline-grow,
.ds-post-row:focus-within .ds-underline-grow { background-size: 100% 100%; }
.ds-post-row__meta {
  margin-left: auto;
  flex-shrink: 0;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
}
.ds-post-row__arrow {
  flex-shrink: 0;
  color: var(--ds-accent);
  transition: transform var(--ds-transition-fast);
}
.ds-post-row:hover .ds-post-row__arrow { transform: translateX(4px); }
@media (max-width: 640px) {
  .ds-post-row { flex-wrap: wrap; }
  .ds-post-row__date { width: auto; }
  .ds-post-row__title { flex-basis: 100%; order: -1; }
}

/* Year separator injected between rows by design-system.js (archive lists) */
.ds-post-year {
  padding: var(--ds-space-6) var(--ds-space-2) var(--ds-space-2);
}

/* Load more — centred beneath a paginated grid/list */
.ds-loadmore {
  display: flex;
  justify-content: center;
  margin-top: var(--ds-space-6);
}
.ds-loadmore.is-loading { opacity: 0.5; pointer-events: none; }

/* Empty state — the quiet placeholder where a list has nothing to show */
.ds-empty {
  margin-top: var(--ds-space-5);
  padding: var(--ds-space-6) 0;
  border-top: 1px solid var(--ds-hairline);
}
.ds-empty__line {
  display: block;
  width: 28px;
  height: 6px;
  background: var(--ds-accent);
  margin-bottom: var(--ds-space-4);
}
.ds-empty__message {
  margin: 0;
  max-width: 62ch;
  font-size: var(--ds-text-lg);
  font-weight: var(--ds-weight-light);
  color: var(--ds-text-secondary);
}
.ds-empty__hint {
  margin: var(--ds-space-2) 0 0;
  font-size: var(--ds-text-base);
  color: var(--ds-text-muted);
}
.ds-empty__link {
  display: inline-block;
  margin-top: var(--ds-space-4);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-semibold);
  color: var(--ds-ink);
}
.ds-empty__link:hover { color: var(--ds-accent); }

/* AJAX card payloads unwrap into the surrounding grid/list layout */
[data-ds-cards] { display: contents; }

@media (max-width: 640px) {
  .ds-series-item { flex-direction: column; gap: var(--ds-space-3); }
  .ds-series-item__arrow { display: none; }
  .ds-breadcrumb [aria-current="page"] { max-width: 18ch; }
}


/* --------------------------------------------------------------------------
   TAXONOMY TIERS — three facets, three visual weights.
   Topics  = navigation  -> bold tiles (heaviest)
   Series  = collections -> stacked cards with a label tab (ordered, medium)
   Tags    = filters     -> quiet #chips (lightest)
   -------------------------------------------------------------------------- */

/* Topic tile — a navigational block, deliberately heavier than any chip */
.ds-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--ds-space-4);
}

.ds-topic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-2);
  padding: var(--ds-space-5);
  background: var(--ds-surface);
  border: 2px solid var(--ds-ink);
  border-radius: var(--ds-radius-sm);
  color: var(--ds-ink);
  overflow: hidden;
  transition: transform var(--ds-transition), box-shadow var(--ds-transition);
}
/* ink wipe on hover — inverts like the primary button, unmistakably "a place to go" */
.ds-topic-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ds-ink);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.35s var(--ds-ease);
  z-index: 0;
}
.ds-topic-card:hover { transform: translate(-4px, -4px); box-shadow: var(--ds-shadow-pop-soft); }
.ds-topic-card:hover::after { transform: scaleY(1); }
.ds-topic-card > * { position: relative; z-index: 1; }

.ds-topic-card__name {
  font-size: var(--ds-text-xl);
  font-weight: var(--ds-weight-black);
  line-height: var(--ds-leading-tight);
  letter-spacing: -0.01em;
  transition: color var(--ds-transition-fast);
}
.ds-topic-card__meta {
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
  transition: color var(--ds-transition-fast);
}
.ds-topic-card__arrow {
  margin-top: var(--ds-space-2);
  color: var(--ds-accent);
  transition: transform var(--ds-transition-fast);
}
.ds-topic-card:hover .ds-topic-card__name { color: #fff; }
.ds-topic-card:hover .ds-topic-card__meta { color: rgba(255, 255, 255, 0.75); }
.ds-topic-card:hover .ds-topic-card__arrow { transform: translateX(4px); }

/* Series collection card — stacked sheets behind it say "multi-part" at a glance */
.ds-series-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--ds-surface);
  border: 2px solid var(--ds-ink);
  border-radius: var(--ds-radius-sm);
  /* stacked sheets: two hard-shadow "pages" behind the card */
  box-shadow:
    7px 7px 0 -2px var(--ds-surface), 7px 7px 0 0 var(--ds-ink),
    14px 14px 0 -2px var(--ds-accent-soft), 14px 14px 0 0 var(--ds-ink);
  transition: transform var(--ds-transition), box-shadow var(--ds-transition);
}
.ds-series-card:hover,
.ds-series-card:focus-within {
  transform: translate(-4px, -4px);
  box-shadow:
    9px 9px 0 -2px var(--ds-surface), 9px 9px 0 0 var(--ds-ink),
    18px 18px 0 -2px var(--ds-accent-soft), 18px 18px 0 0 var(--ds-ink);
}

.ds-series-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--ds-space-3);
  padding: var(--ds-space-5);
}
.ds-series-card__label { align-self: flex-start; }
.ds-series-card__title {
  margin: 0;
  font-size: var(--ds-text-xl);
  line-height: var(--ds-leading-tight);
  font-weight: var(--ds-weight-bold);
}
.ds-series-card__title a { color: var(--ds-ink); }
.ds-series-card__title .ds-underline-grow {
  background-image: linear-gradient(transparent calc(100% - 3px), var(--ds-accent) 3px);
}
.ds-series-card:hover .ds-underline-grow,
.ds-series-card:focus-within .ds-underline-grow { background-size: 100% 100%; }
.ds-series-card__excerpt {
  margin: 0;
  color: var(--ds-text-secondary);
  font-size: var(--ds-text-sm);
  flex: 1;
}
.ds-series-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-3);
  padding-top: var(--ds-space-3);
  border-top: 1px solid var(--ds-hairline);
}
/* "N of M read" — JS-injected echo of the reader's lesson progress */
.ds-series-card__read { color: var(--ds-accent); font-weight: var(--ds-weight-semibold); }
/* room for the stacked sheets so they never overlap a neighbour */
.ds-series-rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--ds-space-6); padding: 0 18px 18px 0; }

/* full-card clickable, matching .ds-card--link behaviour */
.ds-series-card__link::after { content: ''; position: absolute; inset: 0; z-index: 1; }

/* "Coming soon" article card — a scheduled/draft post shown as roadmap.
   Dimmed via explicit colors; grayscale hero; unlinked, no hover lift. */
.ds-card--soon { border-color: #c9c9c9; }
.ds-card--soon:hover,
.ds-card--soon:focus-within {
  transform: none;
  box-shadow: none;
}
.ds-card--soon .ds-card__media img { filter: grayscale(1); }
.ds-card--soon .ds-card__title { color: var(--ds-text-muted); }
.ds-card--soon .ds-card__excerpt { color: var(--ds-text-muted); }
.ds-card__soon-pill {
  display: inline-block;
  padding: 2px 8px 3px;
  border-radius: 999px;
  background: var(--ds-text-muted);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  line-height: 1.2;
}

/* "Coming soon" topic tile — a category whose content is all unpublished */
.ds-topic-card--soon {
  border-color: #c9c9c9;
  cursor: default;
}
.ds-topic-card--soon:hover {
  background: var(--ds-surface);
  transform: none;
  box-shadow: none;
}
.ds-topic-card--soon .ds-topic-card__name,
.ds-topic-card--soon:hover .ds-topic-card__name { color: var(--ds-text-muted); }
.ds-topic-card--soon .ds-topic-card__meta,
.ds-topic-card--soon:hover .ds-topic-card__meta { color: var(--ds-text-muted); }
/* In draft preview the soon tile renders as an <a>; keep the dimmed palette
   but restore the link affordance. */
a.ds-topic-card--soon { cursor: pointer; }
a.ds-topic-card--soon:hover .ds-topic-card__name { color: var(--ds-text); }

/* "Coming soon" series card — exists only as drafts/scheduled posts.
   Dimmed via explicit colors (never opacity), gray sheets, no hover lift. */
.ds-label--soon { background: var(--ds-text-muted); }
.ds-label--soon::after { border-top-color: var(--ds-text-muted); }
.ds-series-card--soon {
  border-color: #c9c9c9;
  box-shadow:
    7px 7px 0 -2px var(--ds-surface), 7px 7px 0 0 #c9c9c9,
    14px 14px 0 -2px var(--ds-hairline), 14px 14px 0 0 #c9c9c9;
}
.ds-series-card--soon:hover,
.ds-series-card--soon:focus-within {
  transform: none;
  box-shadow:
    7px 7px 0 -2px var(--ds-surface), 7px 7px 0 0 #c9c9c9,
    14px 14px 0 -2px var(--ds-hairline), 14px 14px 0 0 #c9c9c9;
}
.ds-series-card--soon .ds-series-card__title { color: var(--ds-text-muted); }
.ds-series-card--soon .ds-series-card__excerpt { color: var(--ds-text-muted); }

/* "+N more series" indicator card — closes a capped rail, links to the shelf */
.ds-series-card--more {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--ds-space-2);
  padding: var(--ds-space-6) var(--ds-space-5);
  color: inherit;
}
.ds-series-card--more__num {
  font-size: 3rem;
  font-weight: var(--ds-weight-black);
  line-height: 1;
  color: var(--ds-accent);
}
.ds-series-card--more__label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  color: var(--ds-text-secondary);
}
.ds-series-card--more .ds-card__more { margin-top: var(--ds-space-3); }

/* Skeleton placeholders — appended by loadMore() while a page is in flight */
.ds-skel {
  position: relative;
  overflow: hidden;
  background: #efefef;
  border-radius: 4px;
}
.ds-skel::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: ds-skel-sweep 1.1s infinite;
}
@keyframes ds-skel-sweep {
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .ds-skel::after { animation: none; }
}
.ds-skel-card {
  border: 2px solid var(--ds-hairline);
  border-radius: var(--ds-radius-sm);
  overflow: hidden;
}
.ds-skel-card__media { height: 170px; border-radius: 0; }
.ds-skel-card__body { padding: var(--ds-space-5); display: grid; gap: var(--ds-space-3); }
.ds-skel-card__line { height: 13px; }
.ds-skel-row {
  height: 18px;
  margin: var(--ds-space-4) var(--ds-space-2);
}

/* Tag chip — quietest tier: hairline, muted, #-prefixed; a filter, not a place */
.ds-chip--tag {
  background: transparent;
  border: 1px solid var(--ds-hairline);
  color: var(--ds-text-muted);
  font-size: var(--ds-text-xs);
  padding: 7px 12px 8px;
}
.ds-chip--tag::before { content: '#'; opacity: 0.55; margin-right: 2px; }
a.ds-chip--tag:hover { background: var(--ds-ink); border-color: var(--ds-ink); color: #fff; }
.ds-chip--tag.ds-chip--active,
a.ds-chip--tag.ds-chip--active { background: var(--ds-accent); border-color: var(--ds-accent); color: #fff; }

@media (max-width: 640px) {
  .ds-topic-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
