/* ============================================================================
   fairyfox.io — main stylesheet
   Clean, modern, full-bleed and fluid. Light + dark via prefers-color-scheme.
   Palette: a "fairy fox" blend — mystic violet + warm fox amber.
   Contrast tuned to meet WCAG 2.1 AA.
   ========================================================================== */

:root {
  /* Brand hues */
  --violet:      #7048e8;
  --violet-soft: #9775fa;
  --amber:       #f08c00;
  --amber-soft:  #ffc078;
  --pink:        #e64980;

  /* Light theme */
  --bg:          #fbfaff;
  --bg-elev:     #ffffff;
  --bg-sunken:   #f3f0fb;
  --band-alt:    #f6f3fe;       /* alternating full-bleed band */
  --text:        #1b1726;       /* near-black ink (AAA on bg) */
  --text-soft:   #4f4866;       /* secondary text — AA on bg */
  --text-faint:  #645d79;       /* meta / small print — AA on bg */
  --border:      #e7e2f3;
  --border-strong:#d8d1ec;
  --accent:      var(--violet); /* fills, borders, large UI */
  --accent-ink:  #5a32c0;       /* violet as TEXT on light — AA-safe */
  --accent-2:    var(--amber);
  --link:        #5a32c0;
  --link-hover:  #45219c;
  --on-accent:   #ffffff;

  /* Gradients (AA-safe where they carry text) */
  --grad-ink:    linear-gradient(105deg, #6c40e0, #c2255c 92%);   /* clipped headline text */
  --grad-primary:linear-gradient(105deg, #6c40e0, #c2255c);       /* primary button, white text */
  --grad-logo:   linear-gradient(135deg, var(--violet), var(--pink) 58%, var(--amber));
  --grad-wash-a: rgba(112,72,232,.16);
  --grad-wash-b: rgba(240,140,0,.13);

  --shadow:      0 1px 2px rgba(27,23,38,.06), 0 10px 28px rgba(27,23,38,.07);
  --shadow-lg:   0 18px 48px rgba(112,72,232,.18);
  --ring:        0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);

  --radius:      16px;
  --radius-sm:   10px;
  --maxw:        1240px;
  --maxw-text:   46rem;
  --gutter:      clamp(1.25rem, 5vw, 3.25rem);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #14121c;
    --bg-elev:     #1d1a28;
    --bg-sunken:   #211d30;
    --band-alt:    #191622;
    --text:        #ece9f5;
    --text-soft:   #c3bcd6;
    --text-faint:  #9990af;
    --border:      #2c2740;
    --border-strong:#3a3354;
    --accent:      var(--violet-soft);
    --accent-ink:  #c3aaff;
    --accent-2:    var(--amber-soft);
    --link:        #c3aaff;
    --link-hover:  #d7c6ff;
    --on-accent:   #14121c;
    --grad-ink:    linear-gradient(105deg, #b49bff, #ff9fc0 92%);
    --grad-primary:linear-gradient(105deg, #7d57f0, #e64980);
    --grad-wash-a: rgba(151,117,250,.16);
    --grad-wash-b: rgba(255,192,120,.10);
    --shadow:      0 1px 2px rgba(0,0,0,.45), 0 10px 28px rgba(0,0,0,.4);
    --shadow-lg:   0 18px 48px rgba(0,0,0,.55);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;          /* sticky footer */
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }

::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

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

/* ── Layout: fluid container + full-bleed bands ──────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.band { width: 100%; }
.band > .wrap { padding-block: clamp(2.6rem, 6vw, 4.6rem); }
.band-alt { background: var(--band-alt); border-block: 1px solid var(--border); }
.band-tight > .wrap { padding-block: clamp(1.8rem, 4vw, 2.8rem); }

/* ── Links & type ────────────────────────────────────────────────────────── */
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { line-height: 1.18; font-weight: 760; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: clamp(2rem, 3.5vw, 2.6rem); margin: 0 0 .4em; }
h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin: 0 0 .5em; }
h3 { font-size: 1.2rem; margin: 1.5rem 0 .4em; }

p, ul, ol { margin: 0 0 1.05rem; }

code {
  font-family: var(--mono); font-size: .88em;
  background: var(--bg-sunken); padding: .12em .4em; border-radius: 6px;
}
pre {
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem 1.1rem; overflow-x: auto;
}
pre code { background: none; padding: 0; font-size: .85rem; }

blockquote {
  margin: 1.2rem 0; padding: .5rem 1.1rem;
  border-left: 3px solid var(--accent); color: var(--text-soft);
  background: var(--bg-sunken); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
hr { border: none; border-top: 1px solid var(--border); margin: 2.4rem 0; }
img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

table { border-collapse: collapse; width: 100%; margin: 0 0 1.2rem; font-size: .96rem; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--border); }
th { font-weight: 700; color: var(--text); }

/* ── Header / nav ────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(150%) blur(10px);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid var(--border);
}
.site-header > .wrap {
  display: flex; align-items: center; gap: 1rem; height: 66px; position: relative;
}

.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 760; }
.brand:hover { text-decoration: none; }
.brand-logo {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad-logo); color: #fff; font-size: .82rem; font-weight: 800;
  letter-spacing: .03em; box-shadow: var(--shadow);
}
.brand-name { font-size: 1.1rem; letter-spacing: -.01em; }

.nav { margin-left: auto; display: flex; align-items: center; gap: .15rem; }
.nav > a, .nav summary {
  display: inline-flex; align-items: center; gap: .25rem;
  color: var(--text-soft); padding: .45rem .7rem; border-radius: 999px;
  font-size: .95rem; font-weight: 600; cursor: pointer; white-space: nowrap; list-style: none;
}
.nav summary::-webkit-details-marker { display: none; }
.nav summary::after {
  content: ""; width: .42em; height: .42em; margin-left: .1em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px); transition: transform .15s ease;
}
.nav details[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.nav > a:hover, .nav summary:hover { color: var(--text); background: var(--bg-sunken); text-decoration: none; }
.nav .active { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent); }

.dd { position: relative; }
.dd-panel {
  position: absolute; top: calc(100% + .5rem); right: 0;
  min-width: 260px; max-width: 88vw;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: .5rem; display: flex; flex-direction: column; gap: .1rem; z-index: 60;
}
.dd-group { padding: .35rem .35rem .15rem; }
.dd-group + .dd-group { border-top: 1px solid var(--border); margin-top: .15rem; }
.dd-group-title {
  display: block; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-faint); padding: .1rem .5rem .25rem;
}
.dd-links { display: flex; flex-direction: column; }
.dd-links a {
  color: var(--text-soft); font-size: .93rem; font-weight: 550;
  padding: .4rem .55rem; border-radius: 8px;
}
.dd-links a:hover { color: var(--text); background: var(--bg-sunken); text-decoration: none; }
.dd-foot {
  margin-top: .15rem; padding: .55rem; border-top: 1px solid var(--border);
  font-size: .9rem; font-weight: 650; color: var(--accent-ink);
}
.dd-foot:hover { text-decoration: none; background: var(--bg-sunken); border-radius: 0 0 10px 10px; }

.nav-toggle {
  display: none; margin-left: auto; width: 42px; height: 42px; padding: 10px;
  background: none; border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  flex-direction: column; justify-content: space-between;
}
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: .1rem;
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .5rem; display: none;
  }
  .site-header.nav-open .nav { display: flex; }
  .nav > a, .nav summary { width: 100%; justify-content: space-between; }
  .dd-panel {
    position: static; min-width: 0; max-width: none; box-shadow: none;
    border: none; border-radius: 0; padding: .15rem .15rem .15rem .6rem; margin-top: .1rem;
  }
}

/* ── Hero (full-bleed) ───────────────────────────────────────────────────── */
.hero { position: relative; overflow: clip; border-bottom: 1px solid var(--border); }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 130%;
  background:
    radial-gradient(48% 70% at 12% 0%, var(--grad-wash-a), transparent 70%),
    radial-gradient(42% 65% at 88% 5%, var(--grad-wash-b), transparent 72%);
  z-index: 0; pointer-events: none;
}
.hero > .wrap { position: relative; z-index: 1; padding-block: clamp(3.4rem, 8vw, 6rem) clamp(2.4rem, 5vw, 3.6rem); }
.hero-inner { max-width: 56rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.1rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  padding: .3rem .7rem; border-radius: 999px;
}
.eyebrow .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--grad-logo); }
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); line-height: 1.08; margin-bottom: .35em; }
.hero h1 .grad {
  background: var(--grad-ink); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero .lede { font-size: clamp(1.1rem, 1.7vw, 1.32rem); color: var(--text-soft); max-width: 44rem; }
.hero .cta { margin-top: 1.6rem; display: flex; gap: .7rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .65rem 1.2rem;
  border-radius: 999px; font-weight: 650; font-size: .98rem;
  border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--text);
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.btn.primary { background: var(--grad-primary); color: #fff; border-color: transparent; }
.btn.primary:hover { color: #fff; }

/* ── Section headers ─────────────────────────────────────────────────────── */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem;
}
.section-head .label { max-width: 42rem; }
.section-head h2 { margin: 0 0 .2em; }
.section-head .sub { margin: 0; color: var(--text-soft); }
.section-head a.more { font-size: .94rem; font-weight: 650; white-space: nowrap; color: var(--accent-ink); }

/* ── Cards & grids ───────────────────────────────────────────────────────── */
.grid { display: grid; gap: 1.2rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }

.card {
  display: block; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 1.6rem; box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
a.card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card h3 { margin: 0 0 .4rem; }
.card p { margin: 0 0 .7rem; color: var(--text-soft); font-size: .99rem; }
.card-links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .92rem; font-weight: 600; }
.card-links a { color: var(--accent-ink); }

/* Project card (richer) */
.proj-card { display: flex; flex-direction: column; }
.proj-card .proj-top { display: flex; align-items: center; gap: .7rem; margin-bottom: .5rem; }
.proj-glyph {
  flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  font-weight: 800; font-size: 1rem; color: #fff; background: var(--grad-logo); box-shadow: var(--shadow);
}
.proj-card h3 { margin: 0; font-size: 1.18rem; }
.proj-card .blurb { flex: 1 0 auto; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: .2rem 0 .9rem; }

.tag {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase; padding: .18rem .55rem; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-ink);
}
.tag.amber { background: color-mix(in srgb, var(--amber) 20%, transparent); color: #8a4d00; }
.tag.muted { background: var(--bg-sunken); color: var(--text-faint); border: 1px solid var(--border); }
@media (prefers-color-scheme: dark) { .tag.amber { color: var(--amber-soft); } }

/* ── Doc-category preview (home) ─────────────────────────────────────────── */
.doc-cats { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.doc-cat { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1.4rem; box-shadow: var(--shadow); }
.doc-cat .cat-title { display: flex; align-items: center; gap: .55rem; font-weight: 730; font-size: 1.02rem; margin-bottom: .7rem; color: var(--text); }
.doc-cat .cat-title .bar { width: .35rem; height: 1.1rem; border-radius: 3px; background: var(--grad-logo); }
.doc-cat ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .1rem; }
.doc-cat li a { display: block; color: var(--text-soft); padding: .3rem .4rem; border-radius: 7px; font-size: .95rem; }
.doc-cat li a:hover { color: var(--text); background: var(--bg-sunken); text-decoration: none; }

/* ── Updates (home + index) ──────────────────────────────────────────────── */
.update-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.update-card {
  display: flex; flex-direction: column; gap: .35rem; background: var(--bg-elev);
  border: 1px solid var(--border); border-left: 3px solid color-mix(in srgb, var(--accent) 55%, var(--border));
  border-radius: var(--radius-sm); padding: 1.1rem 1.25rem; box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.update-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.update-card .meta { color: var(--text-faint); font-size: .82rem; font-variant-numeric: tabular-nums; }
.update-card h3 { margin: 0; font-size: 1.06rem; }
.update-card h3 a { color: var(--text); }
.update-card h3 a:hover { color: var(--link-hover); }
.update-card p { margin: 0; color: var(--text-soft); font-size: .94rem; }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 1.15rem 0; border-bottom: 1px solid var(--border); }
.post-list li:last-child { border-bottom: none; }
.post-list .meta { color: var(--text-faint); font-size: .85rem; font-variant-numeric: tabular-nums; }
.post-list h3 { margin: .25rem 0 .3rem; }
.post-list h3 a { color: var(--text); }
.post-list p { margin: 0; color: var(--text-soft); font-size: .98rem; }

/* ── Page / article ──────────────────────────────────────────────────────── */
.page-head { border-bottom: 1px solid var(--border); }
.page-head > .wrap { padding-block: clamp(2.2rem, 5vw, 3.4rem) clamp(1.4rem, 3vw, 2rem); }
.page-head .eyebrow { margin-bottom: .8rem; }
.page-head h1 { margin: 0 0 .3em; }
.page-head .lead { font-size: 1.16rem; color: var(--text-soft); max-width: var(--maxw-text); margin: 0; }
.page-body > .wrap { padding-block: clamp(1.8rem, 4vw, 2.6rem) clamp(2.4rem, 5vw, 3.4rem); }

.article { padding: 0; }
.article > .wrap { padding-block: clamp(2rem, 5vw, 3.2rem); max-width: calc(var(--maxw-text) + 2 * var(--gutter)); }
.article .post-meta { color: var(--text-faint); font-size: .9rem; margin-bottom: 1.2rem; }
.article .content > :first-child { margin-top: 0; }
.prose { max-width: var(--maxw-text); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer { margin-top: auto; border-top: 1px solid var(--border); background: var(--bg-elev); }
.site-footer > .wrap {
  padding-block: 2.2rem; display: flex; flex-wrap: wrap; gap: .6rem 1.4rem;
  align-items: center; color: var(--text-faint); font-size: .9rem;
}
.site-footer a { color: var(--text-soft); }
.site-footer .spacer { margin-left: auto; }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.muted { color: var(--text-soft); }
.center { text-align: center; }
.lead { font-size: 1.12rem; color: var(--text-soft); }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.stack > * + * { margin-top: 1.1rem; }

@media (max-width: 540px) {
  body { font-size: 16px; }
  .site-header > .wrap { height: 60px; }
}

/* ── Documentation library ───────────────────────────────────────────────── */
.doc-wrap {
  display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 2.8rem;
  padding-block: clamp(1.8rem, 4vw, 2.6rem); align-items: start; max-width: 1180px;
}
.doc-sidebar { position: sticky; top: 84px; font-size: .93rem; }
.doc-sidebar-home { display: block; font-weight: 730; margin-bottom: 1rem; color: var(--text); }
.doc-sidebar-group { margin-bottom: 1.1rem; }
.doc-sidebar-title {
  display: block; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: .4rem;
}
.doc-sidebar ul { list-style: none; margin: 0; padding: 0; }
.doc-sidebar li a {
  display: block; color: var(--text-soft); padding: .3rem .6rem; border-radius: 7px;
  border-left: 2px solid transparent;
}
.doc-sidebar li a:hover { color: var(--text); background: var(--bg-sunken); text-decoration: none; }
.doc-sidebar li a.active {
  color: var(--accent-ink); font-weight: 650;
  background: color-mix(in srgb, var(--accent) 10%, transparent); border-left-color: var(--accent);
}
.doc-content { min-width: 0; }
.doc-content .content { max-width: var(--maxw-text); }
.doc-content > .content > :first-child { margin-top: 0; }
.doc-crumbs { color: var(--text-faint); font-size: .85rem; margin: 0 0 .6rem; }
.doc-crumbs a { color: var(--text-soft); }

@media (max-width: 860px) {
  .doc-wrap { grid-template-columns: 1fr; gap: 1.2rem; }
  .doc-sidebar {
    position: static; border-bottom: 1px solid var(--border); padding-bottom: 1rem;
  }
  .doc-sidebar-group { margin-bottom: .7rem; }
}

/* ── Downloads page ──────────────────────────────────────────────────────── */
.dl-project {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem 1.6rem; margin: 1.6rem 0; scroll-margin-top: 88px;
}
.dl-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; justify-content: space-between; }
.dl-head h2 { margin: 0; }
.dl-blurb { margin: .35rem 0 .5rem; font-size: .96rem; max-width: 46rem; }
.dl-release { margin: .2rem 0 0; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.dl-release-label { color: var(--text-faint); font-size: .9rem; font-weight: 600; }
.dl-extlinks { display: flex; flex-wrap: wrap; gap: .5rem; }
.dl-extlinks .btn { padding: .42rem .85rem; font-size: .9rem; }
.dl-note {
  margin: 1rem 0 0; padding: .7rem .9rem; font-size: .92rem; color: var(--text-soft);
  background: var(--bg-sunken); border-left: 3px solid var(--accent-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.dl-tabs { margin-top: 1.1rem; }
.dl-radio { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.dl-tablist { display: flex; flex-wrap: wrap; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.dl-tab {
  display: inline-block; cursor: pointer; padding: .5rem .9rem; font-size: .92rem; font-weight: 650;
  color: var(--text-soft); border: 1px solid transparent; border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0; margin-bottom: -1px;
  transition: color .12s ease, background .12s ease;
}
.dl-tab:hover { color: var(--text); background: var(--bg-sunken); }
.dl-radio:focus-visible + .dl-tablist .dl-tab { outline: none; }
.dl-radio:focus-visible:nth-of-type(1) ~ .dl-tablist .dl-tab:nth-of-type(1),
.dl-radio:focus-visible:nth-of-type(2) ~ .dl-tablist .dl-tab:nth-of-type(2),
.dl-radio:focus-visible:nth-of-type(3) ~ .dl-tablist .dl-tab:nth-of-type(3),
.dl-radio:focus-visible:nth-of-type(4) ~ .dl-tablist .dl-tab:nth-of-type(4),
.dl-radio:focus-visible:nth-of-type(5) ~ .dl-tablist .dl-tab:nth-of-type(5),
.dl-radio:focus-visible:nth-of-type(6) ~ .dl-tablist .dl-tab:nth-of-type(6),
.dl-radio:focus-visible:nth-of-type(7) ~ .dl-tablist .dl-tab:nth-of-type(7),
.dl-radio:focus-visible:nth-of-type(8) ~ .dl-tablist .dl-tab:nth-of-type(8) {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent);
}

.dl-panel { display: none; }
.dl-radio:nth-of-type(1):checked ~ .dl-panels .dl-panel:nth-of-type(1),
.dl-radio:nth-of-type(2):checked ~ .dl-panels .dl-panel:nth-of-type(2),
.dl-radio:nth-of-type(3):checked ~ .dl-panels .dl-panel:nth-of-type(3),
.dl-radio:nth-of-type(4):checked ~ .dl-panels .dl-panel:nth-of-type(4),
.dl-radio:nth-of-type(5):checked ~ .dl-panels .dl-panel:nth-of-type(5),
.dl-radio:nth-of-type(6):checked ~ .dl-panels .dl-panel:nth-of-type(6),
.dl-radio:nth-of-type(7):checked ~ .dl-panels .dl-panel:nth-of-type(7),
.dl-radio:nth-of-type(8):checked ~ .dl-panels .dl-panel:nth-of-type(8) { display: block; }
.dl-radio:nth-of-type(1):checked ~ .dl-tablist .dl-tab:nth-of-type(1),
.dl-radio:nth-of-type(2):checked ~ .dl-tablist .dl-tab:nth-of-type(2),
.dl-radio:nth-of-type(3):checked ~ .dl-tablist .dl-tab:nth-of-type(3),
.dl-radio:nth-of-type(4):checked ~ .dl-tablist .dl-tab:nth-of-type(4),
.dl-radio:nth-of-type(5):checked ~ .dl-tablist .dl-tab:nth-of-type(5),
.dl-radio:nth-of-type(6):checked ~ .dl-tablist .dl-tab:nth-of-type(6),
.dl-radio:nth-of-type(7):checked ~ .dl-tablist .dl-tab:nth-of-type(7),
.dl-radio:nth-of-type(8):checked ~ .dl-tablist .dl-tab:nth-of-type(8) {
  color: var(--accent-ink); background: var(--bg-elev); border-color: var(--border); border-bottom-color: var(--bg-elev);
}

.dl-intro { margin: 0 0 .9rem; color: var(--text-soft); }
.dl-getrow { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .8rem; margin: 0 0 1rem; }
.dl-filename {
  font-size: .82rem; color: var(--text-faint); background: var(--bg-sunken);
  border: 1px solid var(--border); padding: .2rem .5rem; border-radius: var(--radius-sm); word-break: break-all;
}
.dl-steps { margin: 0 0 .2rem; padding-left: 1.3rem; }
.dl-steps li { margin: .3rem 0; color: var(--text-soft); }
.dl-steps li code, .dl-intro code { font-size: .9em; }
.dl-code {
  margin: .9rem 0 0; background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .8rem 1rem; overflow-x: auto; font-size: .86rem; line-height: 1.5;
}
.dl-code code { background: none; padding: 0; }

@media (max-width: 540px) {
  .dl-project { padding: 1.2rem 1.1rem; }
  .dl-extlinks { width: 100%; }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
