/* ==========================================================================
   BarqType — editorial stylesheet (blog + tutorial library)

   Loaded only by the blog and tutorial pages, from the layout's `head`
   section. CLAUDE.md asks for one stylesheet per area; this is the editorial
   area, and keeping it out of site.css matters for a reason beyond tidiness:
   site.css is already 200 KB and every page on the site pays for it. Fifty
   kilobytes of article typography has no business loading on the checkout.

   It reads the same tokens as site.css and defines no colours of its own
   beyond the three paint slots a motif needs.

   Motion: five primitives, every one with a reduced-motion end state —
     1. the reveal (once, staggered, IntersectionObserver)
     2. the reading progress bar (scroll timeline, pure CSS)
     3. motif art (ambient on a hero, hover-triggered on a card)
     4. the table-of-contents active marker
     5. tab and accordion transitions
   Nothing is linked to the pointer, nothing loops in the viewport except the
   single hero motif, and every animation stops when the tab is hidden.

   Class prefixes: `ed-` for editorial layout and components, `mo-` for the
   generated cover art (see app/Helpers/motifs.php).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Cover art — the generated motifs

   A motif is an <svg> with a CSS background. Three paint slots per tone:
   --mo-ink for line work, --mo-accent for the single highlight each
   composition is allowed, --mo-soft for fills and texture.
   -------------------------------------------------------------------------- */

.mo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 400 / 250;
    border-radius: inherit;
    background-color: var(--mo-paper);
    background-image: radial-gradient(circle, var(--mo-dot) 1.1px, transparent 1.4px);
    background-size: 14px 14px;
    background-position: -1px -1px;
}

.mo--cream {
    --mo-paper:  var(--bt-cream-2);
    --mo-dot:    rgba(16, 17, 20, 0.07);
    --mo-ink:    var(--bt-ink);
    --mo-accent: var(--bt-yellow);
    --mo-soft:   var(--bt-white);
}

.mo--paper {
    --mo-paper:  var(--bt-white);
    --mo-dot:    rgba(16, 17, 20, 0.055);
    --mo-ink:    var(--bt-ink);
    --mo-accent: var(--bt-yellow);
    --mo-soft:   var(--bt-cream);
}

.mo--yellow {
    --mo-paper:  var(--bt-yellow);
    --mo-dot:    rgba(16, 17, 20, 0.10);
    --mo-ink:    var(--bt-ink);
    --mo-accent: var(--bt-white);
    --mo-soft:   #FFE27A;
}

.mo--mint {
    --mo-paper:  #E6F5EE;
    --mo-dot:    rgba(15, 123, 85, 0.12);
    --mo-ink:    #0B4B34;
    --mo-accent: var(--bt-mint);
    --mo-soft:   var(--bt-white);
}

.mo--blue {
    --mo-paper:  #E8ECFD;
    --mo-dot:    rgba(47, 84, 235, 0.12);
    --mo-ink:    #16226B;
    --mo-accent: var(--bt-blue);
    --mo-soft:   var(--bt-white);
}

/*
 * `--mo-soft` is a raised surface in the light tones, where it is white or
 * cream against a tinted paper. Night was given --bt-night-3, which is a panel
 * colour and only a shade off the paper behind it — so any motif that fills a
 * foreground shape with it and gives it no stroke vanished. The waveform, whose
 * bars are exactly that, drew as an empty black rectangle.
 *
 * This is lifted well clear of the paper instead. It still reads as a recessed
 * surface under the ink line work, and shapes made of it are now visible.
 */
.mo--night {
    --mo-paper:  var(--bt-night-2);
    --mo-dot:    rgba(255, 255, 255, 0.07);
    --mo-ink:    var(--bt-fog);
    --mo-accent: var(--bt-yellow);
    --mo-soft:   #434852;
}

/* The paint slots, applied. Stroke widths are set once here so a motif
   definition never carries one unless it deliberately differs. */
.mo-ink-fill   { fill: var(--mo-ink); }
.mo-accent-fill{ fill: var(--mo-accent); }
.mo-soft-fill  { fill: var(--mo-soft); }

.mo-stroke,
.mo-ink-stroke { stroke: var(--mo-ink); stroke-width: 2.4; }
.mo-accent-stroke { stroke: var(--mo-accent); stroke-width: 2.4; }
.mo-soft-stroke   { stroke: var(--mo-soft); stroke-width: 2.4; }
.mo-soft          { fill: var(--mo-soft); }
.mo-dim           { opacity: 0.42; }

.mo-art > * { vector-effect: non-scaling-stroke; }

/* ---- Motif motion -------------------------------------------------------
   Animations are declared paused and only run where a container opts in:
   `.ed-motif--live` (a hero, always on) or `:hover`/`:focus-visible` on a
   card. Twelve looping SVGs in one grid is a measurable amount of main-thread
   work for decoration nobody is looking at.
   -------------------------------------------------------------------------- */

/*
 * A motif at rest must run no animation at all — not a paused one.
 *
 * The first attempt declared these `animation-play-state: paused` and flipped
 * them to running on hover. That is wrong, and measurably so: a paused
 * animation sitting at time zero still applies its own 0% keyframe, whatever
 * the fill mode. Since several of these animate *in* from nothing, every card
 * in the grid rendered with pieces of its line work missing until the pointer
 * touched it — and the "offline" motif lost the slash that cancels the cloud,
 * leaving a picture that said the opposite of what the article was about.
 *
 * So each class now only names its keyframes in a custom property, and
 * `animation-name` is read from that property in exactly one rule, scoped to
 * the containers that opt in. Where nothing opts in, `animation-name` is never
 * set, no keyframes apply, and each shape renders from its own markup — which
 * is what a static cover should be.
 *
 * `var(--anim)` with the property unset makes the declaration invalid at
 * computed-value time, so `animation-name` falls back to its initial value of
 * `none`. That is the mechanism doing the work here.
 */
.mo-bar, .mo-line, .mo-cap, .mo-seg, .mo-fan, .mo-slide, .mo-drop,
.mo-tick, .mo-twinkle, .mo-trace, .mo-ring, .mo-pulse, .mo-caret,
.mo-press, .mo-bolt, .mo-progress, .mo-sweep, .mo-needle, .mo-spin,
.mo-play, .mo-orbit, .mo-highlight, .mo-flow, .mo-slash {
    animation-duration: 1.6s;
    animation-timing-function: var(--bt-ease-out);
    animation-iteration-count: infinite;
    animation-delay: calc(var(--n, 0) * 90ms);
}

.ed-motif--live .mo-art *,
.ed-card:hover .mo-art *,
.ed-card:focus-within .mo-art *,
.ed-lead:hover .mo-art * {
    animation-name: var(--anim);
}

/*
 * A percentage transform-origin on an SVG shape resolves against the whole
 * 400x250 viewBox unless the box is switched — so a waveform bar asked to scale
 * about its own centre would pivot about the middle of the picture instead.
 *
 * Applied only to the classes that use a percentage origin. The three that use
 * a pixel origin (mo-needle, mo-spin, mo-orbit) are coordinates in the viewBox
 * and must keep the default box, or they pivot about a point measured from
 * their own bounding box and swing off the canvas.
 */
.mo-bar, .mo-line, .mo-cap, .mo-seg, .mo-tick, .mo-twinkle,
.mo-ring, .mo-pulse, .mo-play, .mo-progress, .mo-highlight {
    transform-box: fill-box;
}

.mo-bar      { --anim: mo-bar;      transform-origin: 50% 50%; }
.mo-line     { --anim: mo-line;     transform-origin: 0% 50%; }
.mo-cap      { --anim: mo-line;     transform-origin: 0% 50%; }
.mo-seg      { --anim: mo-line;     transform-origin: 0% 50%; }
.mo-fan      { --anim: mo-fan; }
.mo-slide    { --anim: mo-slide; }
.mo-drop     { --anim: mo-drop; }
.mo-tick     { --anim: mo-tick;     transform-origin: 50% 50%; }
.mo-twinkle  { --anim: mo-twinkle;  transform-origin: 50% 50%; }
.mo-trace    { --anim: mo-trace;    stroke-dasharray: 10 54; }
.mo-ring     { --anim: mo-ring;     transform-origin: 50% 50%; fill: none; opacity: 0; }
.mo-pulse    { --anim: mo-pulse;    transform-origin: 50% 50%; }
.mo-caret    { --anim: mo-caret;    animation-timing-function: steps(2, jump-none); animation-duration: 1.1s; }
.mo-press    { --anim: mo-press; }
.mo-bolt     { --anim: mo-bolt; }
/* The resting width is authored into the rect itself rather than applied as a
   transform, so a progress bar reads as progress with no animation running at
   all. The keyframes grow it from nearly nothing back to that width. */
.mo-progress { --anim: mo-progress; transform-origin: 0% 50%; }
.mo-sweep    { --anim: mo-sweep;    stroke-dasharray: 380; }
.mo-needle   { --anim: mo-needle;   transform-origin: 200px 172px; }
.mo-spin     { --anim: mo-spin;     transform-origin: 118px 130px; animation-duration: 4s; animation-timing-function: linear; }
.mo-play     { --anim: mo-pulse;    transform-origin: 50% 50%; }
.mo-orbit    { --anim: mo-orbit;    transform-origin: 200px 125px; animation-duration: 6s; animation-timing-function: linear; }
.mo-highlight{ --anim: mo-highlight;transform-origin: 0% 50%; }
.mo-flow     { --anim: mo-flow;     stroke-dasharray: 8 10; }
.mo-slash    { --anim: mo-slash;    stroke-dasharray: 200; }

@keyframes mo-bar      { 0%, 100% { transform: scaleY(0.55); } 50% { transform: scaleY(1.18); } }
@keyframes mo-line     { 0%       { transform: scaleX(0); opacity: 0; } 24%, 100% { transform: scaleX(1); opacity: 1; } }
@keyframes mo-fan      { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-8px) rotate(-2deg); } }
@keyframes mo-slide    { 0%       { transform: translateX(-14px); opacity: 0; } 30%, 100% { transform: translateX(0); opacity: 1; } }
@keyframes mo-drop     { 0%       { transform: translateY(-18px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(96px); opacity: 0; } }
@keyframes mo-tick     { 0%       { transform: scale(0); } 40%, 100% { transform: scale(1); } }
@keyframes mo-twinkle  { 0%, 100% { transform: scale(0.72); opacity: 0.5; } 50% { transform: scale(1.1); opacity: 1; } }
@keyframes mo-trace    { 0%       { stroke-dashoffset: 64; } 100% { stroke-dashoffset: 0; } }
@keyframes mo-ring     { 0%       { transform: scale(0.4); opacity: 0.55; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes mo-pulse    { 0%, 100% { transform: scale(0.88); opacity: 0.85; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes mo-caret    { 0%, 49%  { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes mo-press    { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
@keyframes mo-bolt     { 0%, 100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(5px); opacity: 0.7; } }
@keyframes mo-progress { 0%       { transform: scaleX(0.08); } 100% { transform: scaleX(1); } }
@keyframes mo-sweep    { 0%       { stroke-dashoffset: 380; } 100% { stroke-dashoffset: 110; } }
@keyframes mo-needle   { 0%       { transform: rotate(-62deg); } 100% { transform: rotate(0deg); } }
@keyframes mo-spin     { 0%       { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes mo-orbit    { 0%       { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes mo-highlight{ 0%       { transform: scaleX(0); } 45%, 100% { transform: scaleX(1); } }
@keyframes mo-flow     { 0%       { stroke-dashoffset: 36; } 100% { stroke-dashoffset: 0; } }
@keyframes mo-slash    { 0%       { stroke-dashoffset: 200; } 55%, 100% { stroke-dashoffset: 0; } }

/* --------------------------------------------------------------------------
   2. Shared editorial furniture
   -------------------------------------------------------------------------- */

.ed-wrap {
    width: 100%;
    max-width: var(--bt-max);
    margin-inline: auto;
    padding-inline: var(--bt-gutter);
}

.ed-section { padding-block: var(--bt-section-y); }
.ed-section--tight { padding-block: clamp(32px, 3.5vw, 52px); }

/*
 * A section whose first child is its own heading does not need the full
 * rhythm above it — the filter bar directly above already separates them, and
 * a full 70px on top of that reads as a band of empty grey rather than as
 * breathing room.
 */
.ed-section--groups { padding-top: clamp(26px, 2.6vw, 38px); }
.ed-section--white { background: var(--bt-white); }
.ed-section--cream { background: var(--bt-cream-2); }

/* The reveal. Mirrors site.js's own primitive but with its own selector, so
   the two lists never have to be kept in step with each other. */
.js .ed-reveal {
    opacity: 0;
    transform: translateY(14px);
}

.js .ed-reveal.is-in {
    opacity: 1;
    transform: none;
    transition:
        opacity   var(--bt-dur-long) var(--bt-ease-out) calc(var(--i, 0) * 55ms),
        transform var(--bt-dur-long) var(--bt-ease-out) calc(var(--i, 0) * 55ms);
}

/* ---- Breadcrumb ---- */
.ed-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--bt-ink-3);
}

.ed-crumbs li { display: inline-flex; align-items: center; gap: 8px; }
.ed-crumbs li + li::before { content: "/"; color: var(--bt-line-2); }
.ed-crumbs a { color: var(--bt-ink-2); text-decoration: none; }
.ed-crumbs a:hover { color: var(--bt-ink); text-decoration: underline; text-underline-offset: 3px; }
.ed-crumbs [aria-current] { color: var(--bt-ink); font-weight: 600; }

/* ---- Chips and meta ---- */
.ed-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--bt-line-2);
    background: var(--bt-white);
    font-size: 12.5px;
    font-weight: 650;
    color: var(--bt-ink-2);
    line-height: 1.3;
    white-space: nowrap;
}

.ed-chip--voice-typing,
.ed-chip--dictation       { background: var(--bt-yellow-14); border-color: var(--bt-yellow-35); color: #7A5C00; }
.ed-chip--guides,
.ed-chip--getting-started { background: var(--bt-ink-05); border-color: var(--bt-line-2); color: var(--bt-ink-2); }
.ed-chip--comparisons,
.ed-chip--features        { background: var(--bt-mint-16); border-color: rgba(15, 123, 85, 0.28); color: #0B4B34; }
.ed-chip--privacy,
.ed-chip--troubleshooting { background: var(--bt-night); border-color: var(--bt-night-line); color: var(--bt-white); }
.ed-chip--advanced        { background: #E8ECFD; border-color: rgba(47, 84, 235, 0.28); color: #16226B; }

.ed-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    font-family: var(--bt-mono);
    font-size: 12.5px;
    color: var(--bt-ink-3);
}

.ed-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.ed-meta svg { flex: none; opacity: 0.75; }

/* --------------------------------------------------------------------------
   3. Hero
   -------------------------------------------------------------------------- */

.ed-hero {
    position: relative;
    overflow: clip;
    padding-block: clamp(44px, 5vw, 76px) clamp(28px, 3vw, 44px);
    background: var(--bt-cream);
    border-bottom: 1px solid var(--bt-line);
}

/* The field behind the hero: two gradient washes and the dot grid, drawn in
   CSS so it costs no element and no request. Static — the one moving thing in
   a hero is the motif, which is enough. */
.ed-hero::before {
    content: "";
    position: absolute;
    inset: -40% -10% auto;
    height: 150%;
    background:
        radial-gradient(60% 50% at 18% 0%, var(--bt-yellow-14), transparent 70%),
        radial-gradient(50% 45% at 88% 10%, var(--bt-mint-08), transparent 72%),
        var(--bt-dots-ink, radial-gradient(circle, rgba(16, 17, 20, 0.05) 1.1px, transparent 1.4px));
    background-size: auto, auto, 22px 22px;
    pointer-events: none;
}

.ed-hero__inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: center;
    gap: clamp(28px, 4vw, 64px);
}

.ed-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 16px;
    font-family: var(--bt-mono);
    font-size: 12.5px;
    color: var(--bt-ink-2);
}

.ed-hero__eyebrow::before {
    content: "";
    width: 22px;
    height: 2px;
    border-radius: 1px;
    background: var(--bt-yellow-deep);
}

.ed-hero__title {
    margin: 0;
    font-family: var(--bt-display);
    font-weight: 700;
    font-size: clamp(34px, 4.6vw, 58px);
    line-height: 1.04;
    letter-spacing: -0.022em;
    color: var(--bt-ink);
    text-wrap: balance;
}

.ed-hero__sub {
    margin: 18px 0 0;
    max-width: 56ch;
    font-size: clamp(16px, 1.25vw, 18.5px);
    line-height: 1.6;
    color: var(--bt-ink-2);
}

.ed-hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
}

.ed-hero__stats li {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ed-hero__stats b {
    font-family: var(--bt-display);
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    color: var(--bt-ink);
}

.ed-hero__stats span {
    font-family: var(--bt-mono);
    font-size: 11.5px;
    color: var(--bt-ink-3);
}

/*
 * Keep the drifting field out of the text column.
 *
 * Its positions are percentages of the field box, and with the box spanning the
 * whole hero the left-most glyph lands exactly where the headline starts: at
 * 1300px the gutter puts text at 78px and the 6% glyph at 78px too, so a
 * microphone sat on top of the "L". Insetting the box to the right half maps
 * every position into the space the cover art and its surroundings occupy,
 * which is empty or opaque — no percentage tuning, and it holds at every width
 * down to the 900px breakpoint where the field is dropped altogether.
 */
.ed-hero .bt-iconfield { left: 52%; }

.ed-hero__art {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--bt-line-2);
    box-shadow: var(--shadow-md);
    rotate: 1.4deg;
}

@media (max-width: 900px) {
    .ed-hero__inner { grid-template-columns: minmax(0, 1fr); }
    .ed-hero__art { display: none; }

    /*
     * The drifting field goes with the cover art, and for the same reason.
     *
     * Its positions are hand-placed to sit in the space the art occupies and
     * the margins beside the text. Once the art is gone the headline and
     * standfirst span the whole hero, and those same positions put a
     * microphone through the middle of the headline and a waveform across the
     * second line of the paragraph. There is no arrangement of a dozen glyphs
     * that keeps clear of full-width running text, so below this width the
     * field is simply not drawn.
     */
    .ed-hero .bt-iconfield,
    .ed-art-head .bt-iconfield {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   4. Filters
   -------------------------------------------------------------------------- */

.ed-filters {
    position: relative;
    background: var(--bt-cream);
    border-bottom: 1px solid var(--bt-line);
}

.ed-filters__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-block: 22px;
}

/*
 * The two-row variant, for a page filtering on more than one axis. A label
 * column and a wrapping row of pills per axis, sharing one left edge so the
 * second row reads as the other half of the same control rather than as
 * something left over.
 */
.ed-filters__grid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 12px 16px;
    padding-block: 20px;
}

.ed-filters__grid .ed-filters__label {
    margin: 0;
    /* Optically centred against the first line of pills rather than the whole
       wrapped block, which is where a start-aligned label would sit. */
    padding-top: 9px;
}

.ed-filters__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

@media (max-width: 620px) {
    /* The label moves above its pills; a side-by-side label leaves too little
       room for a pill with an icon, a word and a count. */
    .ed-filters__grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .ed-filters__grid .ed-filters__label { padding-top: 6px; }
    .ed-filters__row:not(:last-child) { margin-bottom: 6px; }
}

.ed-filters__label {
    margin-right: 4px;
    font-family: var(--bt-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bt-ink-3);
}

.ed-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid var(--bt-line-2);
    border-radius: var(--radius-pill);
    background: var(--bt-white);
    font-size: 14px;
    font-weight: 600;
    color: var(--bt-ink-2);
    text-decoration: none;
    transition:
        background   var(--bt-dur-micro) var(--bt-ease-out),
        border-color var(--bt-dur-micro) var(--bt-ease-out),
        color        var(--bt-dur-micro) var(--bt-ease-out),
        transform    var(--bt-dur-micro) var(--bt-ease-out);
}

.ed-filter:hover {
    border-color: var(--bt-ink);
    color: var(--bt-ink);
    transform: translateY(-1px);
}

/* The glyph is an aid to scanning, not the label — it sits a step back from the
   text so the word still reads first, and never shrinks when a row wraps. */
.ed-filter > svg {
    flex: none;
    opacity: 0.6;
}

.ed-filter[aria-current="page"] > svg { opacity: 0.85; }

.ed-filter__count {
    min-width: 21px;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    background: var(--bt-cream-2);
    font-family: var(--bt-mono);
    font-size: 11.5px;
    text-align: center;
    color: var(--bt-ink-3);
}

.ed-filter[aria-current="page"] {
    background: var(--bt-ink);
    border-color: var(--bt-ink);
    color: var(--bt-white);
}

.ed-filter[aria-current="page"] .ed-filter__count {
    background: var(--bt-white-16);
    color: var(--bt-white);
}


/* --------------------------------------------------------------------------
   5. Cards
   -------------------------------------------------------------------------- */

.ed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: clamp(20px, 2.4vw, 30px);
}

.ed-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bt-white);
    border: 1px solid var(--bt-line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition:
        transform    var(--bt-dur-short) var(--bt-ease-out),
        box-shadow   var(--bt-dur-short) var(--bt-ease-out),
        border-color var(--bt-dur-short) var(--bt-ease-out);
}

.ed-card:hover,
.ed-card:focus-within {
    transform: translateY(-4px);
    border-color: var(--bt-line-2);
    box-shadow: var(--shadow-lg);
}

.ed-card__thumb {
    position: relative;
    border-bottom: 1px solid var(--bt-line);
    border-radius: 0;
    overflow: hidden;
}

.ed-card__badges {
    position: absolute;
    inset: 12px 12px auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    pointer-events: none;
}

.ed-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
    padding: 20px 22px 22px;
}

.ed-card__title {
    margin: 0;
    font-family: var(--bt-display);
    font-size: 20px;
    font-weight: 650;
    line-height: 1.22;
    letter-spacing: -0.013em;
    color: var(--bt-ink);
    text-wrap: balance;
}

/* The whole card is the link target. The anchor stays wrapped around the
   title for assistive technology and for the focus ring, and its ::after
   covers the card — so a reader clicking the thumbnail gets the article, and
   a screen reader still hears a link named after the headline. */
.ed-card__title a { color: inherit; text-decoration: none; }

.ed-card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.ed-card__title a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.ed-card__title a:focus-visible { outline: none; }
.ed-card:has(a:focus-visible) { outline: 3px solid var(--bt-focus); outline-offset: 3px; }

.ed-card__excerpt {
    margin: 0;
    flex: 1;
    font-size: 14.75px;
    line-height: 1.6;
    color: var(--bt-ink-2);
}

.ed-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px solid var(--bt-line);
}

.ed-card__arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 650;
    color: var(--bt-ink);
}

.ed-card__arrow svg { transition: transform var(--bt-dur-short) var(--bt-ease-out); }
.ed-card:hover .ed-card__arrow svg { transform: translateX(4px); }

/* ---- The lead card ---- */
.ed-lead {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 0;
    margin-bottom: clamp(24px, 3vw, 38px);
    background: var(--bt-white);
    border: 1px solid var(--bt-line);
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    transition:
        transform  var(--bt-dur-short) var(--bt-ease-out),
        box-shadow var(--bt-dur-short) var(--bt-ease-out);
}

.ed-lead:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.ed-lead__thumb { border-right: 1px solid var(--bt-line); }
.ed-lead__thumb .mo { height: 100%; aspect-ratio: auto; min-height: 280px; }

.ed-lead__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: clamp(24px, 3vw, 40px);
}

.ed-lead__flag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    align-self: flex-start;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    background: var(--bt-yellow);
    font-family: var(--bt-mono);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--bt-ink);
}

.ed-lead__title {
    margin: 0;
    font-family: var(--bt-display);
    font-size: clamp(25px, 2.7vw, 36px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--bt-ink);
    text-wrap: balance;
}

.ed-lead__title a { color: inherit; text-decoration: none; }
.ed-lead__title a::after { content: ""; position: absolute; inset: 0; }
.ed-lead__title a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }

.ed-lead__excerpt {
    margin: 0;
    font-size: clamp(15.5px, 1.2vw, 17px);
    line-height: 1.62;
    color: var(--bt-ink-2);
}

@media (max-width: 860px) {
    .ed-lead { grid-template-columns: minmax(0, 1fr); }
    .ed-lead__thumb { border-right: 0; border-bottom: 1px solid var(--bt-line); }
    .ed-lead__thumb .mo { aspect-ratio: 400 / 250; min-height: 0; }
}

/* --------------------------------------------------------------------------
   6. Pagination
   -------------------------------------------------------------------------- */

.ed-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: clamp(32px, 4vw, 52px);
}

.ed-pager a,
.ed-pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding-inline: 14px;
    border: 1px solid var(--bt-line-2);
    border-radius: var(--radius-sm);
    background: var(--bt-white);
    font-family: var(--bt-mono);
    font-size: 14px;
    color: var(--bt-ink-2);
    text-decoration: none;
}

.ed-pager a:hover { border-color: var(--bt-ink); color: var(--bt-ink); }
.ed-pager [aria-current="page"] { background: var(--bt-ink); border-color: var(--bt-ink); color: var(--bt-white); }
.ed-pager__gap { border: 0; background: none; min-width: 20px; padding-inline: 0; }

/* --------------------------------------------------------------------------
   7. The article

   A three-column frame: a table of contents that sticks, the prose at a fixed
   measure, and a right rail that is empty on purpose at this width — the
   measure is the point, and filling the space beside it with a newsletter box
   is how a reading column becomes a dashboard.
   -------------------------------------------------------------------------- */

.ed-article {
    display: grid;
    grid-template-columns: minmax(0, 250px) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 68px);
    align-items: start;
    padding-block: clamp(32px, 4vw, 56px);
}

@media (max-width: 1040px) {
    .ed-article { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Article header ---- */
.ed-art-head {
    position: relative;
    padding-block: clamp(32px, 4vw, 52px) 0;
    background: var(--bt-cream);
    border-bottom: 1px solid var(--bt-line);
    overflow: clip;
}

.ed-art-head::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(52% 70% at 12% 0%, var(--bt-yellow-10), transparent 70%);
    pointer-events: none;
}

.ed-art-head__inner { position: relative; }

.ed-art-head__title {
    margin: 14px 0 0;
    max-width: 20ch;
    font-family: var(--bt-display);
    font-size: clamp(31px, 4.2vw, 52px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.022em;
    color: var(--bt-ink);
    text-wrap: balance;
}

.ed-art-head__standfirst {
    margin: 18px 0 0;
    max-width: 62ch;
    font-size: clamp(16.5px, 1.35vw, 19.5px);
    line-height: 1.58;
    color: var(--bt-ink-2);
}

.ed-art-head__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin: 24px 0 0;
    padding-block: 18px;
    border-top: 1px solid var(--bt-line);
}

.ed-art-head__art {
    margin: clamp(20px, 2.5vw, 32px) 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    border: 1px solid var(--bt-line-2);
    border-bottom: 0;
}

/* Shorter than a card and much wider. The motif fits rather than fills (see
   motifs.php), so the tone colour carries the band either side of the drawing. */
.ed-art-head__art .mo { aspect-ratio: 1200 / 300; }

@media (max-width: 700px) {
    /* At phone width a 4:1 band leaves the drawing too small to read, so the
       header art goes back to something nearer the card proportions. */
    .ed-art-head__art .mo { aspect-ratio: 1200 / 520; }
}

/* ---- Reading progress ----
   A scroll-timeline bar under the sticky header. No listener, no script: where
   the browser has no scroll timelines it simply does not draw. */
.ed-progress {
    position: fixed;
    inset: var(--header-h) 0 auto;
    height: 3px;
    z-index: 40;
    background: var(--bt-yellow);
    transform-origin: 0 50%;
    scale: 0 1;
    pointer-events: none;
}

@supports (animation-timeline: scroll(root)) {
    .ed-progress {
        animation: ed-progress linear both;
        animation-timeline: scroll(root);
    }
}

@keyframes ed-progress { to { scale: 1 1; } }

/* ---- Table of contents ---- */
.ed-toc {
    position: sticky;
    top: calc(var(--header-h) + 20px);
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.ed-toc__title {
    margin: 0 0 12px;
    font-family: var(--bt-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bt-ink-3);
}

.ed-toc__list {
    margin: 0;
    padding: 0 0 0 1px;
    list-style: none;
    border-left: 2px solid var(--bt-line);
}

.ed-toc__list a {
    display: block;
    padding: 7px 0 7px 16px;
    margin-left: -2px;
    border-left: 2px solid transparent;
    font-size: 14px;
    line-height: 1.4;
    color: var(--bt-ink-3);
    text-decoration: none;
    transition:
        color      var(--bt-dur-micro) var(--bt-ease-out),
        border-color var(--bt-dur-micro) var(--bt-ease-out);
}

.ed-toc__list a:hover { color: var(--bt-ink); }

.ed-toc__list a.is-current {
    border-left-color: var(--bt-yellow-deep);
    color: var(--bt-ink);
    font-weight: 650;
}

@media (max-width: 1040px) {
    .ed-toc {
        position: static;
        max-height: none;
        padding: 18px 20px;
        background: var(--bt-white);
        border: 1px solid var(--bt-line);
        border-radius: var(--radius-md);
    }
}

/* --------------------------------------------------------------------------
   8. Prose

   The measure is 68ch and the font size steps up slightly from the site's
   body copy: this is long-form reading, not interface text.
   -------------------------------------------------------------------------- */

.ed-prose {
    max-width: 70ch;
    font-size: 17.5px;
    line-height: 1.72;
    color: var(--bt-ink);
}

/*
 * The reset comes first and the sibling rule second, at equal specificity, so
 * the later one wins for everything after the first child. Resetting on `p`
 * instead — which is what this did at first — outranks `> * + *` on specificity
 * and silently removed the gap between every pair of paragraphs.
 */
.ed-prose > * { margin-block: 0; }
.ed-prose > * + * { margin-top: 1.1em; }

.ed-prose h2 {
    margin-top: 2.1em;
    margin-bottom: 0.5em;
    font-family: var(--bt-display);
    font-size: clamp(24px, 2.3vw, 31px);
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: -0.018em;
    text-wrap: balance;
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.ed-prose h3 {
    margin-top: 1.9em;
    margin-bottom: 0.4em;
    font-family: var(--bt-display);
    font-size: clamp(19px, 1.6vw, 22.5px);
    font-weight: 650;
    line-height: 1.24;
    letter-spacing: -0.012em;
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.ed-prose h4 {
    margin-top: 1.6em;
    margin-bottom: 0.3em;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.005em;
}


.ed-prose a {
    color: var(--bt-blue);
    text-decoration: underline;
    text-underline-offset: 2.5px;
    text-decoration-thickness: 1.5px;
    text-decoration-color: rgba(47, 84, 235, 0.35);
}

.ed-prose a:hover { color: var(--bt-blue-hover); text-decoration-color: currentColor; }

.ed-prose strong { font-weight: 700; }

.ed-prose ul,
.ed-prose ol { margin-left: 0; padding-left: 1.35em; }
.ed-prose li + li { margin-top: 0.5em; }
.ed-prose li::marker { color: var(--bt-ink-3); }
.ed-prose ul li::marker { color: var(--bt-yellow-deep); }

.ed-prose code {
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--bt-cream-2);
    border: 1px solid var(--bt-line);
    font-family: var(--bt-mono);
    font-size: 0.875em;
    color: var(--bt-ink);
}

.ed-prose hr {
    margin-block: 2.4em;
    border: 0;
    border-top: 1px solid var(--bt-line);
}

.ed-prose kbd {
    display: inline-block;
    min-width: 1.9em;
    padding: 3px 7px;
    border: 1px solid var(--bt-line-2);
    border-bottom-width: 2.5px;
    border-radius: 6px;
    background: var(--bt-white);
    box-shadow: 0 1px 0 rgba(16, 17, 20, 0.04);
    font-family: var(--bt-mono);
    font-size: 0.82em;
    font-weight: 500;
    text-align: center;
    color: var(--bt-ink);
}

.ed-prose figure { margin: 0; }

.ed-prose figcaption {
    margin-top: 10px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--bt-ink-3);
}

/* Elements that are allowed to break the measure, because a table or a diagram
   at 70ch is unreadable where the prose at 70ch is not. */
.ed-prose .ed-wide {
    width: min(100%, 860px);
    max-width: none;
}

/* ---- Lede ---- */
.ed-prose .ed-lede {
    font-size: 1.12em;
    line-height: 1.62;
    color: var(--bt-ink-2);
}

/* ---- Callouts ---- */
.ed-note {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    margin-block: 1.7em;
    padding: 18px 20px;
    border: 1px solid var(--bt-line-2);
    border-left-width: 4px;
    border-radius: var(--radius-md);
    background: var(--bt-white);
    font-size: 16px;
    line-height: 1.62;
}

.ed-note > svg { margin-top: 2px; flex: none; }
.ed-note__body > * + * { margin-top: 0.7em; }
.ed-note__body > :first-child { margin-top: 0; }
.ed-note b { display: block; margin-bottom: 3px; font-weight: 700; }

.ed-note--tip     { border-left-color: var(--bt-mint); background: var(--bt-mint-08); }
.ed-note--warn    { border-left-color: var(--bt-amber); background: #FFF8E8; }
.ed-note--danger  { border-left-color: var(--bt-red); background: var(--danger-bg); }
.ed-note--info    { border-left-color: var(--bt-blue); background: #F0F3FE; }
.ed-note--privacy { border-left-color: var(--bt-ink); background: var(--bt-cream-2); }

.ed-note--tip     > svg { color: var(--bt-green); }
.ed-note--warn    > svg { color: #9A5B08; }
.ed-note--danger  > svg { color: var(--bt-red-deep); }
.ed-note--info    > svg { color: var(--bt-blue); }
.ed-note--privacy > svg { color: var(--bt-ink); }

/* ---- Key takeaways ---- */
.ed-takeaways {
    margin-block: 1.8em;
    padding: 22px 24px;
    border: 1px solid var(--bt-line-2);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, var(--bt-yellow-10), transparent 60%),
        var(--bt-white);
}

.ed-takeaways__title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 12px;
    font-family: var(--bt-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bt-ink-2);
}

.ed-takeaways ul { margin: 0; padding-left: 0; list-style: none; }

.ed-takeaways li {
    position: relative;
    padding-left: 28px;
    font-size: 16px;
    line-height: 1.6;
}

.ed-takeaways li + li { margin-top: 10px; }

.ed-takeaways li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.52em;
    width: 14px;
    height: 2.5px;
    border-radius: 2px;
    background: var(--bt-yellow-deep);
}

/* ---- Tables ---- */
.ed-table-wrap {
    margin-block: 1.8em;
    overflow-x: auto;
    border: 1px solid var(--bt-line-2);
    border-radius: var(--radius-md);
    background: var(--bt-white);
    -webkit-overflow-scrolling: touch;
}

.ed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.ed-table caption {
    padding: 14px 18px;
    border-bottom: 1px solid var(--bt-line);
    font-family: var(--bt-mono);
    font-size: 12px;
    text-align: left;
    color: var(--bt-ink-3);
    background: var(--bt-cream-2);
}

.ed-table th,
.ed-table td {
    padding: 12px 16px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--bt-line);
    line-height: 1.5;
}

.ed-table thead th {
    position: sticky;
    top: 0;
    background: var(--bt-cream-2);
    font-family: var(--bt-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--bt-ink-2);
    white-space: nowrap;
}

.ed-table tbody tr:last-child th,
.ed-table tbody tr:last-child td { border-bottom: 0; }
.ed-table tbody tr:nth-child(even) { background: rgba(16, 17, 20, 0.018); }
.ed-table tbody th { font-weight: 650; color: var(--bt-ink); }

.ed-table .is-yes { color: var(--bt-green); font-weight: 650; }
.ed-table .is-no  { color: var(--bt-ink-3); }
.ed-table .is-part{ color: #9A5B08; font-weight: 600; }

/* ---- Steps ---- */
.ed-steps {
    counter-reset: ed-step;
    margin-block: 1.8em;
    padding: 0;
    list-style: none;
}

.ed-steps > li {
    position: relative;
    counter-increment: ed-step;
    padding: 0 0 26px 54px;
}

.ed-steps > li + li { margin-top: 0; }
.ed-steps > li:last-child { padding-bottom: 0; }

.ed-steps > li::before {
    content: counter(ed-step);
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bt-ink);
    color: var(--bt-yellow);
    font-family: var(--bt-mono);
    font-size: 14px;
    font-weight: 500;
}

/* The rail joining one step to the next. Stops at the last step, because a
   line continuing past the final instruction reads as a missing step. */
.ed-steps > li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 16.5px;
    top: 40px;
    bottom: 8px;
    width: 1.5px;
    background: var(--bt-line-2);
}

.ed-steps__title {
    margin: 4px 0 8px;
    font-family: var(--bt-display);
    font-size: 19px;
    font-weight: 650;
    line-height: 1.26;
    letter-spacing: -0.01em;
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.ed-steps__title:first-child { margin-top: 4px; }
.ed-steps > li > * + * { margin-top: 0.85em; }

/* ---- Pull quote ---- */
.ed-pull {
    margin-block: 2em;
    padding: 0 0 0 26px;
    border-left: 3px solid var(--bt-yellow);
    font-family: var(--bt-display);
    font-size: clamp(19px, 1.8vw, 24px);
    font-weight: 500;
    line-height: 1.36;
    letter-spacing: -0.012em;
    color: var(--bt-ink);
}

.ed-pull p { margin: 0; }

/* ---- Code ---- */
.ed-code {
    position: relative;
    margin-block: 1.7em;
    border-radius: var(--radius-md);
    background: var(--bt-night);
    border: 1px solid var(--bt-night-line);
    overflow: hidden;
}

.ed-code__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px 9px 16px;
    border-bottom: 1px solid var(--bt-night-line);
    background: var(--bt-night-2);
}

.ed-code__name {
    font-family: var(--bt-mono);
    font-size: 12px;
    color: var(--bt-fog-2);
}

.ed-code pre {
    margin: 0;
    padding: 16px 18px;
    overflow-x: auto;
    font-family: var(--bt-mono);
    font-size: 14px;
    line-height: 1.65;
    color: var(--bt-fog);
    tab-size: 2;
}

.ed-code code { all: unset; font: inherit; color: inherit; white-space: pre; }

.ed-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid var(--bt-night-line);
    border-radius: var(--radius-sm);
    background: var(--bt-night-3);
    color: var(--bt-fog);
    font-family: var(--bt-mono);
    font-size: 11.5px;
    cursor: pointer;
    transition:
        background var(--bt-dur-micro) var(--bt-ease-out),
        color      var(--bt-dur-micro) var(--bt-ease-out);
}

.ed-copy:hover { background: var(--bt-night-line); color: var(--bt-white); }
.ed-copy.is-done { background: var(--bt-green); border-color: var(--bt-green); color: var(--bt-white); }
.ed-copy:focus-visible { outline: 2px solid var(--bt-focus-invert); outline-offset: 2px; }

/* ---- Inline diagram ---- */
.ed-figure {
    margin-block: 2em;
    padding: 24px;
    border: 1px solid var(--bt-line-2);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle, rgba(16, 17, 20, 0.045) 1.1px, transparent 1.4px) 0 0 / 18px 18px,
        var(--bt-white);
}

.ed-figure svg { display: block; width: 100%; height: auto; }

/* --------------------------------------------------------------------------
   9. Article furniture — share, author, related, CTA
   -------------------------------------------------------------------------- */

.ed-art-foot {
    max-width: 70ch;
    margin-top: clamp(36px, 4vw, 56px);
}

.ed-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-block: 20px;
    border-top: 1px solid var(--bt-line);
    border-bottom: 1px solid var(--bt-line);
}

.ed-share__label {
    margin-right: 2px;
    font-family: var(--bt-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bt-ink-3);
}

.ed-share a,
.ed-share button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid var(--bt-line-2);
    border-radius: var(--radius-pill);
    background: var(--bt-white);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--bt-ink-2);
    text-decoration: none;
    cursor: pointer;
    transition:
        border-color var(--bt-dur-micro) var(--bt-ease-out),
        color        var(--bt-dur-micro) var(--bt-ease-out),
        transform    var(--bt-dur-micro) var(--bt-ease-out);
}

.ed-share a:hover,
.ed-share button:hover { border-color: var(--bt-ink); color: var(--bt-ink); transform: translateY(-1px); }
.ed-share button.is-done { border-color: var(--bt-green); color: var(--bt-green); }

.ed-byline {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
    margin-top: 28px;
    padding: 22px;
    border: 1px solid var(--bt-line);
    border-radius: var(--radius-lg);
    background: var(--bt-cream-2);
}

.ed-byline__mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--bt-white);
    border: 1px solid var(--bt-line-2);
}

.ed-byline h2 {
    margin: 0 0 5px;
    font-family: var(--bt-display);
    font-size: 17px;
    font-weight: 700;
}

.ed-byline p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--bt-ink-2); }

/* ---- Related ---- */
.ed-related__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px 20px;
    margin-bottom: 22px;
}

.ed-related__title {
    margin: 0;
    font-family: var(--bt-display);
    font-size: clamp(22px, 2.1vw, 28px);
    font-weight: 700;
    letter-spacing: -0.016em;
}

.ed-related__all {
    font-size: 14px;
    font-weight: 650;
    color: var(--bt-ink-2);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ed-related__all:hover { color: var(--bt-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---- Prev / next ---- */
.ed-walk {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: clamp(28px, 3vw, 40px);
}

.ed-walk__item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border: 1px solid var(--bt-line);
    border-radius: var(--radius-md);
    background: var(--bt-white);
    text-decoration: none;
    transition:
        border-color var(--bt-dur-short) var(--bt-ease-out),
        transform    var(--bt-dur-short) var(--bt-ease-out);
}

.ed-walk__item:hover { border-color: var(--bt-ink); transform: translateY(-2px); }
.ed-walk__item--next { text-align: right; align-items: flex-end; }

.ed-walk__dir {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--bt-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bt-ink-3);
}

.ed-walk__name {
    font-family: var(--bt-display);
    font-size: 16.5px;
    font-weight: 650;
    line-height: 1.3;
    color: var(--bt-ink);
}

/* ---- Closing CTA ---- */
.ed-cta {
    position: relative;
    overflow: clip;
    background: var(--bt-ink);
    color: var(--bt-white);
}

.ed-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(45% 60% at 85% 20%, var(--bt-yellow-14), transparent 70%),
        var(--bt-dots) 0 0 / 20px 20px;
    pointer-events: none;
}

/*
 * The drifting field paints in --bt-ink-3, which is tuned for the light grounds
 * it was built for and all but disappears on this one. Lifted to fog here, with
 * a little more opacity, so the same decoration reads on the dark band.
 */
.ed-cta .bt-iconfield__item { color: var(--bt-fog-2); opacity: 0.22; }
.ed-cta .bt-iconfield__item--volt { color: var(--bt-yellow); opacity: 0.26; }

.ed-cta__inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(20px, 3vw, 48px);
    padding-block: clamp(34px, 4vw, 56px);
}

.ed-cta__title {
    margin: 0;
    font-family: var(--bt-display);
    font-size: clamp(24px, 2.6vw, 36px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.018em;
    text-wrap: balance;
}

.ed-cta__text {
    margin: 12px 0 0;
    max-width: 58ch;
    font-size: 16px;
    line-height: 1.6;
    color: var(--bt-fog);
}

.ed-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.ed-cta__button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 14px 22px;
    border-radius: var(--radius-pill);
    background: var(--bt-yellow);
    border: 1px solid var(--bt-yellow);
    font-size: 15.5px;
    font-weight: 700;
    color: var(--bt-ink);
    text-decoration: none;
    white-space: nowrap;
    transition:
        transform  var(--bt-dur-short) var(--bt-ease-out),
        box-shadow var(--bt-dur-short) var(--bt-ease-out);
}

.ed-cta__button:hover { transform: translateY(-2px); box-shadow: 0 10px 26px var(--bt-black-38); }

.ed-cta__button--ghost {
    background: transparent;
    border-color: var(--bt-white-24);
    color: var(--bt-white);
}

.ed-cta__button--ghost:hover { border-color: var(--bt-white); }

@media (max-width: 820px) {
    .ed-cta__inner { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   10. Tutorial-specific
   -------------------------------------------------------------------------- */


/* ---- Category group heading ---- */
.ed-group + .ed-group { margin-top: clamp(40px, 4.5vw, 64px); }

/*
 * Two rows, not one.
 *
 * The first version put the icon, the heading, the description and the count in
 * a single centre-aligned row. Because the text column is two lines tall, that
 * centred the icon 22px below the heading it belongs to and left the count
 * sitting level with the description instead of the title — measured, not
 * guessed. Now the icon, heading and count share the top row and the
 * description runs underneath, indented to the heading's left edge.
 */
.ed-group__head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "icon  title count"
        "blank intro intro";
    gap: 6px 16px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--bt-line);
}

.ed-group__head > .ed-group__icon,
.ed-group__head > .ed-group__title,
.ed-group__head > .ed-group__count {
    align-self: center;
}

.ed-group__icon {
    grid-area: icon;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--bt-line-2);
    background: var(--bt-white);
    color: var(--bt-ink);
}

.ed-group__title {
    grid-area: title;
    margin: 0;
    font-family: var(--bt-display);
    font-size: clamp(21px, 2vw, 27px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.016em;
}

.ed-group__link {
    color: inherit;
    text-decoration: none;
}

.ed-group__link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

.ed-group__intro {
    grid-area: intro;
    margin: 0;
    font-size: 14.75px;
    line-height: 1.55;
    color: var(--bt-ink-2);
    max-width: 68ch;
}

.ed-group__count {
    grid-area: count;
    font-family: var(--bt-mono);
    font-size: 12px;
    color: var(--bt-ink-3);
    white-space: nowrap;
}

@media (max-width: 680px) {
    /*
     * The count moves under the heading rather than beside it: at this width a
     * third column squeezes the heading into two or three words per line.
     */
    .ed-group__head {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "icon  title"
            "blank count"
            "blank intro";
        row-gap: 4px;
    }
}

/* ---- Tutorial card extras ---- */
.ed-card__platform {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--bt-white-9);
    border: 1px solid var(--bt-line-2);
    backdrop-filter: blur(6px);
    font-family: var(--bt-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--bt-ink);
}

.ed-level {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--bt-mono);
    font-size: 11.5px;
    color: var(--bt-ink-3);
}

/* Three bars, filled to the level. A word alone ("intermediate") makes a
   reader compare two cards by reading; the bars make it a glance. */
.ed-level__bars { display: inline-flex; gap: 2px; align-items: flex-end; }

.ed-level__bars i {
    width: 3px;
    border-radius: 1px;
    background: var(--bt-line-2);
}

.ed-level__bars i:nth-child(1) { height: 6px; }
.ed-level__bars i:nth-child(2) { height: 9px; }
.ed-level__bars i:nth-child(3) { height: 12px; }

.ed-level--beginner     .ed-level__bars i:nth-child(-n+1),
.ed-level--intermediate .ed-level__bars i:nth-child(-n+2),
.ed-level--advanced     .ed-level__bars i:nth-child(-n+3) { background: var(--bt-ink); }

/* ---- Prerequisites box ---- */
.ed-prereq {
    margin-block: 1.8em;
    padding: 22px 24px;
    border: 1px solid var(--bt-line-2);
    border-radius: var(--radius-lg);
    background: var(--bt-white);
}

.ed-prereq__title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 14px;
    font-family: var(--bt-display);
    font-size: 17px;
    font-weight: 700;
}

.ed-prereq ul { margin: 0; padding: 0; list-style: none; }

.ed-prereq li {
    position: relative;
    padding-left: 30px;
    font-size: 15.5px;
    line-height: 1.55;
    color: var(--bt-ink-2);
}

.ed-prereq li + li { margin-top: 11px; }

.ed-prereq li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.18em;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--bt-line-2);
    background: var(--bt-cream);
}

.ed-prereq li::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 0.42em;
    width: 5px;
    height: 9px;
    border: solid var(--bt-green);
    border-width: 0 2px 2px 0;
    rotate: 45deg;
}

/* ---- Platform tabs inside an article ---- */
.ed-tabs { margin-block: 1.8em; }

.ed-tabs__list {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--bt-line-2);
    border-radius: var(--radius-md);
    background: var(--bt-cream-2);
}

.ed-tabs__tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 650;
    color: var(--bt-ink-3);
    cursor: pointer;
    transition:
        background var(--bt-dur-short) var(--bt-ease-out),
        color      var(--bt-dur-short) var(--bt-ease-out),
        box-shadow var(--bt-dur-short) var(--bt-ease-out);
}

.ed-tabs__tab:hover { color: var(--bt-ink); }

.ed-tabs__tab[aria-selected="true"] {
    background: var(--bt-white);
    color: var(--bt-ink);
    box-shadow: var(--shadow-sm);
}

.ed-tabs__tab:focus-visible { outline: 2px solid var(--bt-focus); outline-offset: -2px; }

.ed-tabs__panel { padding-top: 20px; }
.ed-tabs__panel[hidden] { display: none; }

.js .ed-tabs__panel:not([hidden]) {
    animation: ed-fade var(--bt-dur-short) var(--bt-ease-out) both;
}

@keyframes ed-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/*
 * With no script the tabs cannot switch, so every panel shows and each takes
 * the heading the tab would have been. A reader without JavaScript gets both
 * sets of instructions, clearly labelled, rather than one set and a dead
 * button — which is the whole point of putting the label in the markup.
 */
.ed-tabs__panel-label { display: none; }

html:not(.js) .ed-tabs__list { display: none; }
html:not(.js) .ed-tabs__panel { display: block !important; }
html:not(.js) .ed-tabs__panel-label {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 12px;
    font-family: var(--bt-display);
    font-size: 19px;
    font-weight: 700;
}

/* ---- Tutorial summary strip ---- */
.ed-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 30px;
    margin-block: 1.6em;
    padding: 16px 20px;
    border: 1px solid var(--bt-line);
    border-radius: var(--radius-md);
    background: var(--bt-cream-2);
}

.ed-summary__item { display: flex; align-items: center; gap: 10px; }

.ed-summary__item > svg { flex: none; color: var(--bt-ink-2); }

.ed-summary__item b {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--bt-ink);
    line-height: 1.3;
}

.ed-summary__item span {
    display: block;
    font-family: var(--bt-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bt-ink-3);
}

/* --------------------------------------------------------------------------
   11. Empty state
   -------------------------------------------------------------------------- */

.ed-empty {
    padding: clamp(40px, 6vw, 72px) 24px;
    border: 1px dashed var(--bt-line-2);
    border-radius: var(--radius-lg);
    background: var(--bt-white);
    text-align: center;
}

.ed-empty h2 {
    margin: 0 0 8px;
    font-family: var(--bt-display);
    font-size: 22px;
    font-weight: 700;
}

.ed-empty p { margin: 0 auto; max-width: 48ch; color: var(--bt-ink-2); line-height: 1.6; }
.ed-empty a { color: var(--bt-blue); }

/* --------------------------------------------------------------------------
   12. Reduced motion

   Every animation above stops here, and each one is given the end state it
   would have reached — not its start state. A caret frozen mid-blink is
   invisible; a progress bar frozen at scaleX(0) is a missing bar.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .mo-bar, .mo-line, .mo-cap, .mo-seg, .mo-fan, .mo-slide, .mo-drop,
    .mo-tick, .mo-twinkle, .mo-trace, .mo-ring, .mo-pulse, .mo-caret,
    .mo-press, .mo-bolt, .mo-progress, .mo-sweep, .mo-needle, .mo-spin,
    .mo-play, .mo-orbit, .mo-highlight, .mo-flow, .mo-slash {
        animation: none !important;
        transform: none !important;
        opacity: 1;
        stroke-dashoffset: 0;
        stroke-dasharray: none;
    }

    /* The expanding rings are the one thing whose end state is "gone": they
       exist only as motion, so without it they are removed rather than left
       stacked on top of the shape they radiate from. */
    .mo-ring { display: none; }

    .ed-progress { animation: none; scale: 1 1; }

    .js .ed-reveal,
    .js .ed-reveal.is-in {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .js .ed-tabs__panel:not([hidden]) { animation: none; }

    .ed-card,
    .ed-lead,
    .ed-walk__item,
    .ed-filter,
    .ed-cta__button,
    .ed-share a,
    .ed-share button {
        transition: none;
    }

    .ed-card:hover,
    .ed-lead:hover,
    .ed-walk__item:hover,
    .ed-cta__button:hover,
    .ed-filter:hover,
    .ed-share a:hover,
    .ed-share button:hover {
        transform: none;
    }

    .ed-card:hover .ed-card__arrow svg { transform: none; }
}

/* Nothing animates while the tab is in the background. The motifs are paused
   by default and only a hero runs unattended, but a hero left looping in a
   tab nobody is looking at is still work being done for no one. */
@media (prefers-reduced-motion: no-preference) {
    html[data-page-hidden="true"] .ed-motif--live .mo-art > *,
    html[data-page-hidden="true"] .ed-motif--live .mo-art * {
        animation-play-state: paused !important;
    }
}
