/* ==========================================================================
   RavenBlog — Ghost theme on the Alacrity design system
   Tokens mirror new.alacrity.education/src/app/(frontend)/globals.css.
   ========================================================================== */

/* ── Fonts (self-hosted, OFL — see assets/fonts/OFL.txt) ─────────────────── */

@font-face {
    font-family: "Lexend";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/lexend-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Lexend";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/lexend-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: "Lexend Deca";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/lexend-deca-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Lexend Deca";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/lexend-deca-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: "JetBrains Mono";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/jetbrains-mono-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/jetbrains-mono-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: "JetBrains Mono";
    font-style: italic;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/jetbrains-mono-italic-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;
}

/* ── Tokens ──────────────────────────────────────────────────────────────── */

:root {
    --rb-paper: #FBFBFD;
    --rb-paper-2: #F2F2F6;
    --rb-rule: #E4E4EC;
    --rb-ink: #16141F;
    --rb-ink-muted: #55525F;

    --rb-brand-900: #241C42;
    --rb-brand-700: #3F3170;
    --rb-brand-500: #6550A3;
    --rb-brand-400: #8467C9; /* bottom of the hero fade */
    --rb-brand-200: #D8D2EA;
    --rb-brand-100: #EEEBF6;

    /* Ghost's own font picker (Design → Brand) wins when set. */
    --rb-font-display: var(--gh-font-heading, "Lexend Deca", ui-sans-serif, system-ui, sans-serif);
    --rb-font-body: var(--gh-font-body, "Lexend", ui-sans-serif, system-ui, sans-serif);
    --rb-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --rb-radius-box: 1rem;
    --rb-radius-field: 0.25rem;

    --rb-shadow-sm: 0 1px 2px rgb(36 28 66 / 0.08), 0 2px 6px rgb(36 28 66 / 0.08);
    --rb-shadow-lg: 0 4px 10px rgb(36 28 66 / 0.08), 0 14px 32px rgb(36 28 66 / 0.14);

    /* Side margin, the same 24px on phones and desktop. */
    --rb-gutter: 1.5rem;
    --rb-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --rb-ease-ui: cubic-bezier(0.4, 0, 0.2, 1);
    /* daisyUI's hover: the fill mixed 7% towards black. */
    --rb-brand-700-hover: color-mix(in oklab, #3F3170, #000 7%);
    --rb-rule-hover: color-mix(in oklab, #E4E4EC, #000 7%);
    /* Tailwind shadow-lg, as on the site's buttons. */
    --rb-shadow-btn: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --rb-max: 82rem;
    --rb-measure: 42rem;
}


/* ── Base ────────────────────────────────────────────────────────────────── */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 6rem;
}

body {
    margin: 0;
    font-family: var(--rb-font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--rb-ink);
    background: var(--rb-paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: var(--rb-font-display);
    color: var(--rb-brand-700);
    text-wrap: balance;
}
/* Lexend ships loose; tracking tightens as size grows. */
h1 { letter-spacing: -0.045em; line-height: 0.98; font-weight: 500; }
h2 { letter-spacing: -0.035em; line-height: 1.05; font-weight: 600; }
h3 { letter-spacing: -0.02em;  line-height: 1.25; font-weight: 600; }
h4 { letter-spacing: -0.01em;  line-height: 1.3;  font-weight: 600; }

p { margin: 0; }
a { color: inherit; text-decoration: none; }

:focus-visible {
    outline: 2px solid var(--rb-brand-700);
    outline-offset: 2px;
}

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

.rb-visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.rb-skip {
    position: absolute;
    left: 1rem; top: -4rem;
    z-index: 100;
    padding: 0.5rem 1rem;
    background: var(--rb-brand-700);
    color: #fff;
    border-radius: var(--rb-radius-field);
}
.rb-skip:focus { top: 1rem; }

/* ── Layout ──────────────────────────────────────────────────────────────── */

.rb-site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.rb-main { flex: 1; }

.rb-container {
    width: 100%;
    max-width: calc(var(--rb-max) + 2 * var(--rb-gutter));
    margin-inline: auto;
    padding-inline: var(--rb-gutter);
}

/* ── Primitives ──────────────────────────────────────────────────────────── */

/* Buttons — measured from alacrity.education (its cva buttonVariants on
   daisyUI's .btn): 40px tall, 1rem side padding, 6px corners, 18px Lexend at
   500, 0.15s colour/shadow transitions and no movement. */
.rb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 2.5rem;
    padding: 0 1rem;
    font-family: var(--rb-font-body);
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.75rem;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s var(--rb-ease-ui), background-color 0.15s var(--rb-ease-ui), border-color 0.15s var(--rb-ease-ui), box-shadow 0.15s var(--rb-ease-ui);
}
.rb-btn--sm { height: 2rem; padding: 0 0.75rem; font-size: 0.875rem; }

/* variant "primary": btn-primary + shadow-lg */
.rb-btn--primary,
.rb-btn--solid {
    background: var(--rb-brand-700);
    border-color: var(--rb-brand-700);
    color: #fff;
    box-shadow: var(--rb-shadow-btn);
}
.rb-btn--primary:hover,
.rb-btn--solid:hover {
    background: var(--rb-brand-700-hover);
    border-color: var(--rb-brand-700-hover);
}

/* variant "secondary": quiet grey fill, near-black text, shadow-lg */
.rb-btn--outline {
    background: var(--rb-rule);
    border-color: var(--rb-paper);
    color: var(--rb-ink);
    box-shadow: var(--rb-shadow-btn);
}
.rb-btn--outline:hover { background: var(--rb-rule-hover); border-color: var(--rb-rule-hover); }

/* variant "default": paper fill, violet text, grey on hover */
.rb-btn--white {
    background: var(--rb-paper);
    border-color: transparent;
    color: var(--rb-brand-700);
    box-shadow: var(--rb-shadow-btn);
    min-width: 12rem;
}
.rb-btn--white:hover { background: var(--rb-rule); }

.rb-link {
    color: var(--rb-brand-700);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--rb-brand-200);
    text-underline-offset: 0.2em;
}
.rb-link:hover { text-decoration-color: currentColor; }

.rb-arrow {
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    vertical-align: -0.05em;
    flex: none;
}

/* A link whose ::after covers the nearest positioned ancestor — the whole
   card is clickable without wrapping block content in an <a>. */
.rb-stretched::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.rb-eyebrow {
    display: inline-block;
    font-family: var(--rb-font-display);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rb-brand-500);
}

.rb-raven {
    display: block;
    width: 3rem;
    color: var(--rb-brand-700);
}
.rb-raven svg { width: 100%; height: auto; }
.rb-raven--sm { width: 2rem; }

.rb-wordmark {
    font-family: var(--rb-font-display);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    color: var(--rb-brand-700);
}
.rb-wordmark b { font-weight: 700; }
.rb-wordmark--sm { font-size: 1.125rem; }

/* ── Header ──────────────────────────────────────────────────────────────── */

.rb-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--rb-paper);
}
/* The site's progressive blur under the bar: content fades out as it
   scrolls beneath, instead of meeting a hard edge. */
.rb-header::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 2rem;
    pointer-events: none;
    background: linear-gradient(to bottom, var(--rb-paper), rgb(251 251 253 / 0));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    mask: linear-gradient(to bottom, #000, transparent);
    -webkit-mask: linear-gradient(to bottom, #000, transparent);
}

.rb-header__inner {
    display: grid;
    /* Equal outer tracks, so the links sit at the true centre of the page
       whatever the logo and button widths are. */
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    min-height: 4rem;
    padding: 0.5rem 1rem;
}

.rb-header__logo { display: flex; justify-self: start; }

.rb-header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-self: end;
}

.rb-nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* The drawer's own parts; hidden in the desktop bar. */
.rb-nav__head,
.rb-nav__cta,
.rb-nav__backdrop { display: none; }

/* The site's menu button: btn btn-primary rounded-md with a 20px icon. */
.rb-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
    padding: 0 1rem;
    color: #fff;
    background: var(--rb-brand-700);
    border: 1px solid var(--rb-brand-700);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s var(--rb-ease-ui), border-color 0.15s var(--rb-ease-ui);
}
.rb-burger:hover { background: var(--rb-brand-700-hover); border-color: var(--rb-brand-700-hover); }
.rb-burger svg { width: 1.25rem; height: 1.25rem; }

/* Desktop (lg, like the site): links centred in the bar. */
@media (min-width: 64rem) {
    .rb-header__inner { padding-inline: 2rem; }
    .rb-nav { justify-self: center; }
    .rb-nav__list { justify-content: center; flex-wrap: nowrap; gap: 0.75rem; }
    .rb-header .rb-burger { display: none; }
}

/* Below lg: logo and menu button only; the links live in a drawer that
   slides in from the left — the site's modal-start drawer, frosted
   base-200 at 80%, full width on phones and 20rem from sm. */
@media (max-width: 63.99rem) {
    .rb-header__inner { grid-template-columns: auto 1fr; }
    .rb-header__cta { display: none; }

    .rb-nav {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 60;
        display: flex;
        flex-direction: column;
        width: 100vw;
        height: 100dvh;
        overflow-y: auto;
        background: rgb(242 242 246 / 0.8);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform 0.3s var(--rb-ease-ui), visibility 0s linear 0.3s;
    }
    .rb-nav.is-open {
        transform: none;
        visibility: visible;
        transition: transform 0.3s var(--rb-ease-ui), visibility 0s;
    }
    @media (min-width: 40rem) {
        .rb-nav { width: 20rem; box-shadow: 0 0 40px rgb(36 28 66 / 0.18); }
    }

    .rb-nav__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.25rem;
    }
    .rb-nav__title {
        font-family: var(--rb-font-body);
        font-size: 1.5rem;
        line-height: 2rem;
        color: var(--rb-brand-700);
    }
    .rb-nav__close {
        display: inline-flex;
        padding: 0;
        color: var(--rb-brand-700);
        background: none;
        border: 0;
        cursor: pointer;
    }
    .rb-nav__close svg { width: 1.875rem; height: 1.875rem; }

    .rb-nav__cta { display: block; padding: 0.5rem 1rem 1rem; }
    .rb-nav__cta:empty { display: none; }
    .rb-btn--block { display: flex; width: 100%; }

    .rb-nav .rb-nav__list {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0;
        padding: 0 1rem 1.5rem;
    }
    .rb-nav .rb-navlink {
        justify-content: flex-start;
        width: 100%;
        padding: 0 0.75rem;
        font-weight: 400;
        color: var(--rb-ink);
        background: transparent;
    }
    .rb-nav .rb-navlink:hover { background: rgb(22 20 31 / 0.08); }

    .rb-nav__backdrop:not([hidden]) {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 55;
        background: rgb(22 20 31 / 0.25);
    }
    .rb-lock, .rb-lock body { overflow: hidden; }

    /* Without JS the drawer cannot open: show the links under the bar. */
    .no-js .rb-nav {
        position: static;
        grid-column: 1 / -1;
        width: auto;
        height: auto;
        transform: none;
        visibility: visible;
        background: none;
        backdrop-filter: none;
    }
    .no-js .rb-nav__head { display: none; }
    .no-js .rb-burger { display: none; }
}

/* ── Masthead ────────────────────────────────────────────────────────────── */

.rb-masthead {
    margin: clamp(1rem, 3vw, 2rem) 0 clamp(1.25rem, 3vw, 2rem);
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    line-height: 1;
    letter-spacing: 0;
}
.rb-masthead .rb-wordmark { letter-spacing: -0.035em; }

@media (min-width: 64rem) {
    /* Inset like the design: the wordmark starts in from the hero's edge. */
    .rb-masthead { padding-left: 2.5rem; }
}

/* ── Lead: hero + side column ────────────────────────────────────────────── */

.rb-lead {
    display: grid;
    gap: 2.5rem;
}

@media (min-width: 64rem) {
    .rb-lead {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        gap: 4rem;
        align-items: start;
    }
}

.rb-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* overflow:clip (not hidden) lets it grow past the ratio when the copy
       needs it, so a long title is never cut off. */
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: clip;
    border-radius: var(--rb-radius-box);
    background: var(--rb-brand-900);
    box-shadow: var(--rb-shadow-lg);
    isolation: isolate;
}
@media (min-width: 40rem) {
    .rb-hero { aspect-ratio: 4 / 3; }
}

.rb-hero__img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

/* A light wash over the whole image, then the copy block carries its own
   fade to solid violet. Tying the fade to the copy (not to a percentage of
   the card) keeps white text readable on any image — including the pale
   diagrams and screenshots many posts lead with — at every card height. */
.rb-hero__shade {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to bottom, rgb(36 28 66 / 0.08) 0%, rgb(36 28 66 / 0) 30%, rgb(36 28 66 / 0.35) 100%);
}

.rb-hero__body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 5rem 1.25rem 1.5rem;
    color: #fff;
    background: linear-gradient(
        to bottom,
        rgb(36 28 66 / 0) 0,
        rgb(46 36 86 / 0.85) 3.5rem,
        var(--rb-brand-700) 6.5rem,
        var(--rb-brand-900) 100%
    );
}
@media (min-width: 40rem) {
    .rb-hero__body { padding: 6rem 2.5rem 2.25rem; }
}

.rb-hero__title {
    color: #fff;
    font-size: clamp(2rem, 5.5vw, 3.75rem);
    font-weight: 600;
    line-height: 1;
    overflow-wrap: break-word;
}
.rb-hero__excerpt {
    max-width: 36rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: rgb(255 255 255 / 0.92);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rb-hero__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-top: 0.75rem;
}
@media (max-width: 39.99rem) {
    .rb-hero__foot .rb-btn { width: 100%; }
}

.rb-lead__side {
    display: grid;
    gap: 2.5rem;
    align-content: start;
}
@media (min-width: 40rem) and (max-width: 63.99rem) {
    .rb-lead__side { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
}
@media (min-width: 64rem) {
    .rb-lead__side { gap: 3.5rem; padding-top: 0.25rem; }
}

/* ── Byline ──────────────────────────────────────────────────────────────── */

.rb-byline {
    position: relative;
    z-index: 2; /* above a card's stretched link, so author links work */
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.25;
}
.rb-avatar {
    flex: none;
    width: 2.5rem;
    height: 2.5rem;
    overflow: hidden;
    border-radius: 50%;
    background: var(--rb-brand-900);
}
.rb-avatar img,
.rb-avatar__blank { display: block; width: 100%; height: 100%; object-fit: cover; }
.rb-avatar--lg { width: 6rem; height: 6rem; }

.rb-byline__text { display: flex; flex-direction: column; min-width: 0; }
.rb-byline__name {
    font-family: var(--rb-font-display);
    font-weight: 500;
    color: var(--rb-brand-700);
}
.rb-byline__name a:hover { text-decoration: underline; }
.rb-byline__date { font-size: 0.75rem; color: var(--rb-ink-muted); }

.rb-byline--inverse .rb-avatar { background: var(--rb-brand-900); box-shadow: 0 0 0 2px rgb(255 255 255 / 0.25); }
.rb-byline--inverse .rb-byline__name { color: #fff; }
.rb-byline--inverse .rb-byline__date { color: rgb(255 255 255 / 0.78); }

/* ── Row (beside the hero) ───────────────────────────────────────────────── */

.rb-row {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.rb-row__title { font-size: 1.25rem; }
.rb-row__title a:hover,
.rb-card__title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.rb-row__excerpt {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--rb-ink);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rb-row .rb-byline { margin-top: 0.75rem; }

/* ── Sections and grid ───────────────────────────────────────────────────── */

.rb-section { padding-block: clamp(3.5rem, 8vw, 6rem) 0; }
.rb-section--tight { padding-top: 1rem; }

.rb-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}
.rb-section__title {
    margin-bottom: 1.75rem;
    font-size: clamp(2rem, 4vw, 2.75rem);
}
.rb-section__more { font-size: 0.875rem; white-space: nowrap; }

.rb-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3rem;
}
@media (min-width: 40rem) {
    .rb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem 2rem; }
}
@media (min-width: 64rem) {
    .rb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4rem 5rem; }
}

/* ── Card ────────────────────────────────────────────────────────────────── */

.rb-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.rb-card__media {
    margin: 0;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: var(--rb-radius-box);
    background: var(--rb-brand-100);
    box-shadow: var(--rb-shadow-lg);
}
.rb-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.rb-card__media--empty {
    display: grid;
    place-items: center;
}
.rb-card__media--empty .rb-raven { width: 22%; color: var(--rb-brand-200); --rb-paper: var(--rb-brand-100); }

.rb-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}
.rb-card__title { font-size: 1.25rem; overflow-wrap: anywhere; }
.rb-card__excerpt {
    font-size: 0.875rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rb-card .rb-byline { margin-top: auto; padding-top: 1rem; }

/* ── Pagination ──────────────────────────────────────────────────────────── */

.rb-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin-top: 4rem;
}
.rb-pagination [rel="next"] { justify-self: end; }
.rb-pagination__count { font-size: 0.875rem; color: var(--rb-ink-muted); }

/* ── Archive headers (tag, author, error) ────────────────────────────────── */

.rb-archive-head { padding-block: 1rem 1.5rem; }
.rb-archive-head__title {
    margin-top: 0.75rem;
    font-size: clamp(2.5rem, 6vw, 4rem);
}
.rb-archive-head__desc {
    max-width: var(--rb-measure);
    margin-top: 1rem;
    font-size: 1.125rem;
    color: var(--rb-ink-muted);
}
.rb-archive-head--author {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}

.rb-error {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    padding-block: 3rem 6rem;
}
.rb-error__details { font-size: 0.875rem; color: var(--rb-ink-muted); }

/* ── Article ─────────────────────────────────────────────────────────────── */

.rb-article__head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    max-width: calc(52rem + 2 * var(--rb-gutter));
    padding-block: clamp(1.5rem, 5vw, 3.5rem) 2rem;
}
.rb-article__title {
    font-size: clamp(2.25rem, 6vw, 4rem);
    overflow-wrap: break-word;
}
.rb-article__lede {
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
    line-height: 1.5;
    color: var(--rb-ink-muted);
}
.rb-article__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.5rem;
}
.rb-article__reading { font-size: 0.8125rem; color: var(--rb-ink-muted); }

.rb-article__image { margin-block: 0 clamp(2rem, 5vw, 3.5rem); }
.rb-article__image img {
    width: 100%;
    max-height: 80vh;
    object-fit: cover;
    border-radius: var(--rb-radius-box);
    box-shadow: var(--rb-shadow-lg);
}
.rb-article__image figcaption,
.rb-content figcaption {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    text-align: center;
    color: var(--rb-ink-muted);
}

.rb-article__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 3rem;
}
.rb-comments { margin-top: 4rem; }

/* ── Post content + Koenig cards ─────────────────────────────────────────── */

/* Three tracks: reading measure, wide (kg-width-wide), full bleed. */
.rb-content {
    display: grid;
    grid-template-columns:
        [full-start] minmax(var(--rb-gutter), 1fr)
        [wide-start] minmax(0, 8rem)
        [main-start] min(var(--rb-measure), calc(100% - 2 * var(--rb-gutter)))
        [main-end] minmax(0, 8rem)
        [wide-end] minmax(var(--rb-gutter), 1fr) [full-end];
}
.rb-content > * { grid-column: main; }
.rb-content > .kg-width-wide { grid-column: wide; }
.rb-content > .kg-width-full { grid-column: full; }
.rb-content > .kg-width-full img { border-radius: 0; }

.gh-content {
    font-size: 1.0625rem;
    line-height: 1.75;
    /* Raw URLs in reference lists are one unbreakable word otherwise. */
    overflow-wrap: anywhere;
}
/* Display maths (KaTeX, MathJax) wider than a phone scrolls in its own box
   instead of pushing the page sideways. */
.gh-content :is(.katex-display, mjx-container[display="true"], .MathJax_Display) {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-block: 0.25rem;
}
.gh-content > * + * { margin-top: 1.5em; }
.gh-content > :is(h2, h3, h4) + * { margin-top: 0.75em; }
.gh-content > h2 { margin-top: 2.25em; font-size: clamp(1.625rem, 3vw, 2rem); }
.gh-content > h3 { margin-top: 2em; font-size: 1.375rem; }
.gh-content > h4 { margin-top: 1.75em; font-size: 1.125rem; }

.gh-content a {
    color: var(--rb-brand-700);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--rb-brand-200);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.2em;
}
.gh-content a:hover { text-decoration-color: currentColor; }
.gh-content strong { font-weight: 600; }
.gh-content :is(ul, ol) { padding-left: 1.4em; }
.gh-content li + li { margin-top: 0.4em; }
.gh-content li::marker { color: var(--rb-brand-500); }

.gh-content blockquote:not([class]) {
    margin-inline: 0;
    padding-left: 1.25rem;
    border-left: 3px solid var(--rb-brand-500);
    font-family: var(--rb-font-display);
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--rb-brand-700);
}
.gh-content blockquote.kg-blockquote-alt {
    margin-inline: 0;
    font-family: var(--rb-font-display);
    font-size: clamp(1.375rem, 3vw, 1.75rem);
    line-height: 1.35;
    text-align: center;
    color: var(--rb-brand-700);
}

.gh-content hr {
    width: 100%;
    height: 1px;
    margin-block: 3em;
    border: 0;
    background: var(--rb-rule);
}

.gh-content :not(pre) > code {
    padding: 0.15em 0.4em;
    font-family: var(--rb-font-mono);
    font-size: 0.875em;
    font-weight: 500;
    background: var(--rb-brand-100);
    color: var(--rb-brand-900);
    border-radius: var(--rb-radius-field);
}

/* ── Code blocks: Nord ───────────────────────────────────────────────────────
   Dark Polar Night ground, Aurora (and Frost) for the tokens Prism marks up.
   Prism itself still comes from the site's Code injection; this replaces the
   theme that was pasted there. Selectors start at body so they outrank any
   injected Prism theme still in place, whatever order it loads in. */

:root {
    --nord0: #2E3440;  --nord1: #3B4252;  --nord2: #434C5E;  --nord3: #4C566A;
    --nord4: #D8DEE9;  --nord5: #E5E9F0;  --nord6: #ECEFF4;
    --nord7: #8FBCBB;  --nord8: #88C0D0;  --nord9: #81A1C1;  --nord10: #5E81AC;
    --nord11: #BF616A; --nord12: #D08770; --nord13: #EBCB8B; --nord14: #A3BE8C; --nord15: #B48EAD;
    --nord-comment: #7B88A1;
}

body .gh-content pre,
body .gh-content pre[class*="language-"] {
    margin-block: 1.75em 0;
    overflow-x: auto;
    padding: 1.25rem 1.5rem;
    background: var(--nord0);
    color: var(--nord6);
    border: 1px solid var(--nord1);
    border-radius: var(--rb-radius-box);
    box-shadow: var(--rb-shadow-lg);
    text-shadow: none;
    font-family: var(--rb-font-mono);
    font-size: 0.9375rem;
    line-height: 1.7;
    tab-size: 4;
}
body .gh-content pre code,
body .gh-content code[class*="language-"] {
    font-family: var(--rb-font-mono);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.7;
    font-variant-ligatures: contextual;
    color: var(--nord6);
    background: none;
    text-shadow: none;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}
@media (max-width: 39.99rem) {
    body .gh-content pre,
    body .gh-content pre[class*="language-"] { padding: 1rem 1.125rem; }
    body .gh-content pre code,
    body .gh-content code[class*="language-"] { font-size: 0.8125rem; }
}
body .gh-content pre ::selection,
body .gh-content pre::selection { background: var(--nord2); color: var(--nord6); }

body .gh-content .token:is(.comment, .prolog, .doctype, .cdata) { color: var(--nord-comment); font-style: italic; font-weight: 400; }
body .gh-content .token.punctuation { color: var(--nord4); }
body .gh-content .token.namespace { opacity: 0.8; }
body .gh-content .token:is(.keyword, .rule, .atrule, .important, .selector .class) { color: var(--nord15); font-weight: 600; }
body .gh-content .token:is(.string, .char, .attr-value, .inserted, .template-string) { color: var(--nord14); }
body .gh-content .token:is(.number, .boolean, .constant, .symbol, .unit) { color: var(--nord12); }
body .gh-content .token:is(.function, .function-name, .method) { color: var(--nord13); }
body .gh-content .token:is(.class-name, .builtin, .maybe-class-name) { color: var(--nord7); }
body .gh-content .token:is(.operator, .entity, .url) { color: var(--nord9); background: none; }
body .gh-content .token:is(.tag, .property, .attr-name, .selector) { color: var(--nord8); }
body .gh-content .token:is(.variable, .parameter) { color: var(--nord5); }
body .gh-content .token:is(.regex, .deleted) { color: var(--nord11); }
body .gh-content .token:is(.macro, .directive, .directive-hash, .preprocessor) { color: var(--nord11); }
body .gh-content .token:is(.shebang) { color: var(--nord-comment); }
body .gh-content .token.bold { font-weight: 700; }
body .gh-content .token.italic { font-style: italic; }
/* Bash: commands frost, flags aurora orange. */
body .gh-content .language-bash .token:is(.function) { color: var(--nord8); }
body .gh-content .language-bash .token:is(.parameter) { color: var(--nord12); }

.gh-content table:not(.gist table) {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.9375rem;
}
.gh-content :is(th, td) { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--rb-rule); text-align: left; }
.gh-content th { font-family: var(--rb-font-display); color: var(--rb-brand-700); }

.gh-content figure { margin-inline: 0; }
.gh-content .kg-image,
.gh-content .kg-gallery-image img { border-radius: var(--rb-radius-box); }
.gh-content .kg-image-card img { margin-inline: auto; }

/* Koenig cards pick up the brand. */
.gh-content .kg-callout-card { border-radius: var(--rb-radius-box); }
.gh-content .kg-callout-card-accent { background: var(--rb-brand-700); }
.gh-content .kg-btn-accent,
.gh-content .kg-header-card-button,
.gh-content .kg-product-card-btn-accent,
.gh-content .kg-cta-button {
    font-family: var(--rb-font-display);
    border-radius: var(--rb-radius-field);
}
.gh-content .kg-bookmark-container { border-radius: var(--rb-radius-box); }
.gh-content .kg-bookmark-title { font-family: var(--rb-font-display); color: var(--rb-brand-700); }
.gh-content .kg-toggle-heading-text { font-family: var(--rb-font-display); color: var(--rb-brand-700); }

/* Ghost's accent colour feeds the cards; default it to the brand. */
:root { --ghost-accent-color: var(--rb-brand-700); }

/* ── Footer ──────────────────────────────────────────────────────────────── */

.rb-footer {
    margin-top: clamp(5rem, 10vw, 8rem);
    border-top: 1px solid var(--rb-rule);
    background: var(--rb-paper-2);
}
.rb-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem 2rem;
    padding-block: 2.5rem;
}
.rb-footer__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    --rb-paper: var(--rb-paper-2);
}
.rb-footer__nav .rb-nav__list { gap: 0.5rem 1.5rem; }
.rb-footer__nav .rb-link { font-size: 0.875rem; }
.rb-footer__meta { font-size: 0.8125rem; color: var(--rb-ink-muted); }

/* Members / portal-free Ghost still prints these on some pages. */
.rb-content .kg-signup-card,
.rb-content .kg-cta-card { border-radius: var(--rb-radius-box); }

/* ── Website lockup and navigation (measured from alacrity.education) ───── */

/* Logo: raven, daisyUI divider-horizontal divider-primary, two lines. */
.rb-logo {
    display: inline-flex;
    align-items: stretch;
    gap: 0.25rem;
    color: var(--rb-brand-700);
}
.rb-logo__mark {
    width: auto;
    height: 2.5rem;
    transition: transform 0.45s var(--rb-ease);
    transform-origin: 60% 70%;
}
.rb-logo__rule {
    width: 2px;
    margin-inline: 0.4375rem;
    background: var(--rb-brand-700);
}
.rb-logo__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: var(--rb-font-body);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25rem;
    letter-spacing: 0;
}
.rb-logo__text span:first-child { margin-bottom: -0.25rem; }
@media (min-width: 40rem) {
    .rb-logo__mark { height: 3rem; }
    .rb-logo__text { font-size: 1rem; line-height: 1.5rem; }
}
a:hover > .rb-logo .rb-logo__mark { transform: rotate(-8deg) translateY(-1px); }

.rb-footer__brand .rb-logo__mark { height: 2.5rem; }

/* Nav items: the site's "default" button — paper fill, violet 18px/500,
   light grey on hover. No underline, no movement. */
.rb-navlink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
    padding: 0 1rem;
    font-family: var(--rb-font-body);
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.75rem;
    white-space: nowrap;
    color: var(--rb-brand-700);
    background: var(--rb-paper);
    border-radius: 0.375rem;
    transition: color 0.15s var(--rb-ease-ui), background-color 0.15s var(--rb-ease-ui), box-shadow 0.15s var(--rb-ease-ui);
}
.rb-navlink:hover { background: var(--rb-rule); }

@media (max-width: 39.99rem) {
    .rb-header__actions .rb-btn--primary { font-size: 1rem; padding-inline: 0.875rem; }
}

/* ── Hover motion ────────────────────────────────────────────────────────── */


/* Arrows travel up and to the right, the way they point. */
.rb-arrow { transition: transform 0.3s var(--rb-ease); }
.rb-card:hover .rb-arrow,
.rb-row:hover .rb-arrow,
.rb-hero:hover .rb-arrow,
.rb-section__more:hover .rb-arrow { transform: translate(3px, -3px); }

/* Cards lift; the image zooms inside its frame and its shadow deepens. */
.rb-card { transition: transform 0.35s var(--rb-ease); }
.rb-card:hover { transform: translateY(-4px); }
.rb-card__media { transition: box-shadow 0.35s var(--rb-ease); }
.rb-card:hover .rb-card__media { box-shadow: 0 8px 18px rgb(36 28 66 / 0.12), 0 24px 48px rgb(36 28 66 / 0.2); }
.rb-card__media img { transition: transform 0.6s var(--rb-ease); }
.rb-card:hover .rb-card__media img { transform: scale(1.05); }

/* Titles get an underline that draws in from the left. */
:is(.rb-card__title, .rb-row__title) a {
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
    transition: background-size 0.35s var(--rb-ease);
    padding-bottom: 1px;
}
:is(.rb-card, .rb-row):hover :is(.rb-card__title, .rb-row__title) a { background-size: 100% 2px; }
.rb-row__title a:hover,
.rb-card__title a:hover { text-decoration: none; }

/* Side rows slide a touch to the right. */
.rb-row { transition: transform 0.35s var(--rb-ease); }
.rb-row:hover { transform: translateX(4px); }

/* The hero: slow zoom, button lifts with the card. */
.rb-hero { transition: box-shadow 0.4s var(--rb-ease), transform 0.4s var(--rb-ease); }
.rb-hero:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgb(36 28 66 / 0.14), 0 30px 60px rgb(36 28 66 / 0.22); }
.rb-hero__img { transition: transform 1.2s var(--rb-ease); }
.rb-hero:hover .rb-hero__img { transform: scale(1.04); }
.rb-hero:hover .rb-btn--white { background: var(--rb-rule); }

/* Touch screens have no hover; don't leave cards stuck lifted after a tap. */
@media (hover: none) {
    .rb-card:hover, .rb-row:hover, .rb-hero:hover { transform: none; }
}
