/* =========================================================================
   TheSSS AI — components
   Reusable building blocks. Naming: .block, .block__element, .block--variant.
   Icons come from the sprite: <svg class="icon"><use href="/assets/img/icons.svg#name"/></svg>
   ========================================================================= */

/* --- Icon ------------------------------------------------------------------ */
.icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon--sm {
    width: 1em;
    height: 1em;
}

.icon--fill {
    fill: currentColor;
    stroke: none;
}

.icon-sun {
    display: var(--show-when-dark);
}

.icon-moon {
    display: var(--show-when-light);
}

/* Square tile holding an icon (feature cards, steps) */
.icon-tile {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

.icon-tile .icon {
    width: 22px;
    height: 22px;
}

/* --- Buttons --------------------------------------------------------------- */
.btn {
    --btn-bg: transparent;
    --btn-fg: var(--color-text);
    --btn-border: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 42px;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--btn-border);
    border-radius: var(--radius-pill);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: 0.9375rem;
    font-weight: var(--weight-semibold);
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition:
        transform var(--duration-fast) ease,
        box-shadow var(--duration) ease,
        background-color var(--duration-fast) ease,
        border-color var(--duration-fast) ease,
        color var(--duration-fast) ease;
}

.btn:hover {
    color: var(--btn-fg);
}

.btn:active {
    transform: translateY(1px);
}

.btn .icon {
    width: 1.1em;
    height: 1.1em;
    transition: transform var(--duration) var(--ease-out);
}

.btn:hover .icon-arrow {
    transform: translateX(3px);
}

.btn--primary {
    --btn-fg: #fff;
    background: var(--gradient-brand-deep);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), var(--shadow-sm);
}

.btn--primary:hover {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), var(--shadow-glow);
}

.btn--secondary {
    --btn-bg: var(--color-surface);
    --btn-border: var(--color-border-strong);
}

.btn--secondary:hover {
    --btn-border: var(--color-text-subtle);
}

.btn--ghost {
    --btn-fg: var(--color-text-muted);
}

.btn--ghost:hover {
    --btn-fg: var(--color-text);
    --btn-bg: var(--color-accent-soft);
}

.btn--lg {
    min-height: 52px;
    padding: 0.8rem 1.5rem;
    font-size: var(--text-base);
}

/* Row of buttons inside text or panels */
.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

/* Round icon-only button (theme toggle, menu) */
.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text-muted);
    transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.icon-btn:hover {
    color: var(--color-text);
    border-color: var(--color-border-strong);
}

.icon-btn .icon {
    width: 20px;
    height: 20px;
}

.nav-toggle .icon-close,
.site-header.is-open .nav-toggle .icon-menu {
    display: none;
}

.site-header.is-open .nav-toggle .icon-close {
    display: block;
}

/* Social icon button */
.social-link {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    color: var(--color-text-muted);
    transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.social-link:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.social-link .icon {
    width: 17px;
    height: 17px;
}

/* --- Text bits ---------------------------------------------------------------- */
/* Small mono label above headings */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
}

.eyebrow::before {
    content: "";
    width: 18px;
    height: 1px;
    background: currentColor;
}

/* Pill with a pulsing dot */
.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.35rem 0.85rem 0.35rem 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    box-shadow: var(--shadow-sm);
}

.chip__dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-pink);
}

.chip__dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    animation: ping 2s var(--ease-out) infinite;
}

@keyframes ping {
    75%,
    100% {
        transform: scale(2.6);
        opacity: 0;
    }
}

/* Small rectangular label (domains, categories) */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: var(--weight-medium);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Row of tags (technology stacks) */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: 0;
    list-style: none;
}

.gradient-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Text link with an arrow that nudges on hover */
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: var(--weight-semibold);
    text-decoration: none;
}

.link-arrow .icon {
    width: 1em;
    height: 1em;
    transition: transform var(--duration) var(--ease-out);
}

.link-arrow:hover .icon,
.card--interactive:hover .link-arrow .icon {
    transform: translateX(3px);
}

/* --- Section heading block --------------------------------------------------- */
.section-head {
    display: grid;
    gap: var(--space-4);
    justify-items: start;
    max-width: 44rem;
    margin-bottom: var(--space-7);
}

.section-head--center {
    margin-inline: auto;
    text-align: center;
    justify-items: center;
}

.section-head__lede {
    font-size: var(--text-md);
    color: var(--color-text-muted);
}

/* Heading on the left, link on the right */
.section-head--split {
    max-width: none;
    grid-template-columns: minmax(0, 44rem);
    align-items: end;
    justify-content: space-between;
}

@media (min-width: 1024px) {
    .section-head--split {
        grid-template-columns: minmax(0, 44rem) auto;
    }

    .section-head--split > * {
        grid-column: 1;
    }

    .section-head--split > :last-child {
        grid-column: 2;
        grid-row: 1 / span 3;
        align-self: end;
    }
}

/* --- Card -------------------------------------------------------------------- */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

/* Whole card is clickable through its main link (.card__link) */
.card--interactive {
    transition:
        transform var(--duration) var(--ease-out),
        box-shadow var(--duration) ease,
        border-color var(--duration) ease;
}

.card--interactive:hover {
    transform: translateY(-3px);
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-lg);
}

.card__link {
    color: inherit;
    text-decoration: none;
}

.card__link:hover {
    color: inherit;
}

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

.card__link:focus-visible {
    outline: none;
}

.card__link:focus-visible::after {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
}

/* --- Check list ----------------------------------------------------------------- */
.check-list {
    display: grid;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.check-list li {
    display: flex;
    gap: var(--space-2);
    align-items: flex-start;
}

.check-list .icon {
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.15rem;
    color: var(--color-accent);
    stroke-width: 2.5;
}

@media (min-width: 640px) {
    .check-list--columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--space-6);
    }
}

/* Things to avoid: muted cross instead of a check */
.check-list--avoid .icon {
    color: var(--color-danger);
}

/* --- Click-to-load YouTube embed ------------------------------------------------- */
/* Nothing is requested from YouTube until the visitor presses play. */
.video-embed {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-embed__poster {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: clamp(0.5rem, 2vw, 1rem);
    width: 100%;
    padding: var(--space-4);
    border: 0;
    background:
        radial-gradient(50% 60% at 50% 45%, rgba(155, 59, 234, 0.35), transparent 70%),
        linear-gradient(var(--color-grid-line) 1px, transparent 1px) 0 0 / 32px 32px,
        linear-gradient(90deg, var(--color-grid-line) 1px, transparent 1px) 0 0 / 32px 32px,
        var(--color-surface);
    color: var(--color-text);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
}

.video-embed__play {
    display: grid;
    place-items: center;
    width: clamp(56px, 40px + 3vw, 76px);
    height: clamp(56px, 40px + 3vw, 76px);
    border-radius: 50%;
    background: var(--gradient-brand-deep);
    color: #fff;
    box-shadow: var(--shadow-glow);
    transition: transform var(--duration) var(--ease-out);
}

.video-embed__play .icon {
    width: 28px;
    height: 28px;
    margin-left: 4px;
}

.video-embed__poster:hover .video-embed__play {
    transform: scale(1.08);
}

.video-embed__meta {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-regular);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-subtle);
}

/* --- Cookie consent bar ---------------------------------------------------------- */
.cookie-bar {
    position: fixed;
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
    z-index: var(--z-overlay);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-5);
    max-width: 34rem;
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface-raised);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    animation: rise-in var(--duration-slow) var(--ease-out) both;
}

.cookie-bar p {
    flex: 1 1 16rem;
}

.cookie-bar__actions {
    display: flex;
    gap: var(--space-2);
}

.cookie-bar .btn {
    min-height: 36px;
    padding: 0.4rem 0.9rem;
    font-size: var(--text-sm);
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
}

/* --- Stats strip (big numbers with labels) ----------------------------------- */
.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5) var(--space-4);
    padding-top: var(--space-5);
    border-top: 1px solid var(--color-border);
}

.stat {
    display: grid;
    gap: var(--space-1);
    align-content: start;
}

.stat__value {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
    font-weight: var(--weight-bold);
    line-height: 1;
    letter-spacing: -0.035em;
}

.stat__label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

@media (min-width: 768px) {
    .stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: var(--space-5);
    }

    .stat:not(:first-child) {
        padding-left: var(--space-5);
        border-left: 1px solid var(--color-border);
    }
}

/* --- Project cards (homepage, projects listing, related projects) ---------------- */
.project-grid {
    display: grid;
    gap: var(--space-5);
}

.project-card {
    gap: var(--space-4);
}

.project-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-card :is(h2, h3) {
    font-size: var(--text-xl);
    line-height: 1.2;
}

.project-card__summary {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

.project-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
    margin-top: auto;
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-subtle);
}

.project-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--text-sm);
}

.project-card__foot .link-arrow {
    color: var(--color-accent);
}

/* Sits above the card's stretched link */
.project-card__repo {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-muted);
    text-decoration: none;
}

.project-card__repo:hover {
    color: var(--color-text);
}

@media (min-width: 768px) {
    .project-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* --- Closing call-to-action panel ---------------------------------------------- */
.cta-panel {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    justify-items: center;
    gap: var(--space-5);
    padding: clamp(3rem, 2rem + 5vw, 6rem) var(--space-5);
    border: 1px solid var(--color-border); /* separates it from a dark page */
    border-radius: var(--radius-xl);
    background:
        radial-gradient(55% 90% at 50% 0%, rgba(214, 58, 196, 0.32), transparent 70%),
        radial-gradient(45% 80% at 100% 100%, rgba(99, 102, 241, 0.32), transparent 70%),
        #100d22;
    color: var(--color-text);
    text-align: center;
}

.cta-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(var(--color-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-grid-line) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 40%, #000, transparent 80%);
    mask-image: radial-gradient(ellipse 60% 70% at 50% 40%, #000, transparent 80%);
}

.cta-panel__mark {
    width: 56px;
    height: 56px;
}

.cta-panel h2 {
    max-width: 18ch;
    font-size: var(--text-3xl);
}

.cta-panel p {
    max-width: 34rem;
    font-size: var(--text-md);
    color: var(--color-text-muted);
}

.cta-panel__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-2);
}

.cta-panel__notes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2) var(--space-5);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.cta-panel__notes li {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.cta-panel__notes .icon {
    width: 1rem;
    height: 1rem;
    color: var(--color-success);
    stroke-width: 2.5;
}

/* --- Page hero (top of every inner page) ------------------------------------------ */
.page-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: clamp(2.75rem, 1.75rem + 4vw, 5rem) clamp(2.25rem, 1.5rem + 3vw, 3.75rem);
    border-bottom: 1px solid var(--color-border);
}

/* Blueprint grid, fading out (same motif as the homepage hero) */
.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(var(--color-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-grid-line) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
    -webkit-mask-image: radial-gradient(ellipse 70% 90% at 75% 0%, #000 15%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 90% at 75% 0%, #000 15%, transparent 75%);
}

.page-hero__inner {
    display: grid;
    gap: var(--space-4);
    justify-items: start;
    max-width: 50rem;
}

.page-hero--center .page-hero__inner {
    margin-inline: auto;
    justify-items: center;
    text-align: center;
}

.page-hero h1 {
    font-weight: var(--weight-black);
}

.page-hero__lede {
    max-width: 42rem;
    font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
    color: var(--color-text-muted);
}

.page-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-2);
}

/* Small facts under the title: date, author, reading time */
.page-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.page-hero__meta li {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.page-hero__meta .icon {
    width: 1rem;
    height: 1rem;
    color: var(--color-text-subtle);
}

@media (max-width: 479.98px) {
    .page-hero__actions .btn {
        flex: 1 1 100%;
    }
}

/* --- Breadcrumb ----------------------------------------------------------------- */
/* Unclassed lists inside these components: no markers or indent */
.breadcrumb ol,
.pager ol,
.toc ol {
    padding: 0;
    list-style: none;
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.04em;
    color: var(--color-text-subtle);
}

.breadcrumb li + li::before {
    content: "/";
    margin-right: var(--space-2);
    color: var(--color-border-strong);
}

.breadcrumb a {
    color: var(--color-text-muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--color-accent);
}

.breadcrumb [aria-current] {
    color: var(--color-text-subtle);
}

/* --- Page with a table of contents ------------------------------------------------
   <div class="container toc-layout"><nav class="toc" data-toc>…</nav><div>…</div></div>
   Desktop: sticky sidebar. Below 1024px: a sticky strip of pills under the header
   (nested entries hidden). site.js marks the entry of the section in view. */
.toc-layout {
    display: grid;
    gap: var(--space-6);
    padding-block: var(--space-6) var(--section-space);
}

.toc-layout__main {
    min-width: 0;
}

.toc__title {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-subtle);
}

.toc a {
    display: block;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--duration-fast) ease, background-color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.toc a:hover {
    color: var(--color-text);
}

.toc a[aria-current] {
    color: var(--color-accent);
}

@media (max-width: 1023.98px) {
    .toc {
        position: sticky;
        top: var(--header-h);
        z-index: calc(var(--z-header) - 1);
        margin-inline: calc(-1 * var(--gutter));
        padding: var(--space-2) var(--gutter);
        overflow-x: auto;
        scrollbar-width: none;
        background: var(--color-header-bg);
        -webkit-backdrop-filter: saturate(160%) blur(14px);
        backdrop-filter: saturate(160%) blur(14px);
        border-bottom: 1px solid var(--color-border);
    }

    .toc::-webkit-scrollbar {
        display: none;
    }

    .toc__title {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .toc__list {
        display: flex;
        gap: var(--space-2);
        width: max-content;
    }

    .toc__list ol {
        display: none;
    }

    .toc a {
        padding: 0.4rem 0.85rem;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-pill);
        background: var(--color-surface);
        font-size: var(--text-sm);
        font-weight: var(--weight-medium);
        white-space: nowrap;
    }

    .toc a[aria-current] {
        border-color: transparent;
        background: var(--color-accent-soft);
    }

    /* Anchored headings must clear the header and the strip */
    html:has(.toc) {
        scroll-padding-top: calc(var(--header-h) + 3.5rem + var(--space-4));
    }
}

@media (min-width: 1024px) {
    .toc-layout {
        grid-template-columns: 15rem minmax(0, 1fr);
        gap: var(--space-8);
        padding-top: var(--space-8);
    }

    .toc {
        position: sticky;
        top: calc(var(--header-h) + var(--space-5));
        align-self: start;
        max-height: calc(100vh - var(--header-h) - var(--space-7));
        overflow-y: auto;
        scrollbar-width: thin;
    }

    .toc__title {
        margin-bottom: var(--space-3);
    }

    .toc__list {
        display: grid;
        border-left: 1px solid var(--color-border);
    }

    .toc a {
        margin-left: -1px;
        padding: 0.35rem 0 0.35rem var(--space-4);
        border-left: 2px solid transparent;
        font-size: var(--text-sm);
        line-height: 1.4;
    }

    .toc a[aria-current] {
        border-left-color: var(--color-accent);
        font-weight: var(--weight-medium);
    }

    .toc__list ol a {
        padding-left: var(--space-6);
        font-size: 0.8125rem;
    }
}

/* --- Long-form text: legal pages, docs, tutorial, blog posts -------------------- */
.prose {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--color-text-muted);
}

.prose > * + *,
.prose-card > * + *,
.callout > * + * {
    margin-top: 1em;
}

.prose :is(h2, h3, h4, h5) {
    color: var(--color-text);
    scroll-margin-top: calc(var(--header-h) + var(--space-5));
}

.prose h2 {
    font-size: var(--text-xl);
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.prose > h2 {
    margin-top: 2.4em;
}

.prose h3 {
    font-size: var(--text-lg);
}

.prose > h3 {
    margin-top: 2em;
}

.prose h4 {
    font-size: var(--text-base);
}

.prose > h4 {
    margin-top: 1.6em;
}

.prose h5 {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-subtle);
}

.prose > :is(h2, h3, h4) + * {
    margin-top: 0.75em;
}

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

.prose strong {
    color: var(--color-text);
}

.prose a:not([class]) {
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}

.prose a:not([class]):hover {
    text-decoration-color: currentColor;
}

.prose :is(ul, ol):not([class]) {
    padding-left: 1.4em;
}

.prose :is(ul, ol):not([class]) > li + li {
    margin-top: 0.4em;
}

.prose li::marker {
    color: var(--color-accent);
}

.prose blockquote {
    padding: var(--space-2) 0 var(--space-2) var(--space-5);
    border-left: 3px solid var(--brand-violet);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    line-height: 1.45;
    color: var(--color-text);
}

.prose blockquote footer,
.prose blockquote cite {
    display: block;
    margin-top: var(--space-2);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-style: normal;
    color: var(--color-text-subtle);
}

.prose :not(pre) > code {
    padding: 0.1em 0.35em;
    border-radius: 5px;
    background: var(--color-accent-soft);
    color: var(--color-text);
    font-size: 0.85em;
}

.prose figure img,
.prose > img {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.prose figcaption {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-subtle);
    text-align: center;
}

.prose hr {
    margin-block: 2.5em;
}

/* Tables scroll sideways inside .table-wrap on narrow screens */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    line-height: 1.5;
}

.prose :is(th, td) {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.prose th {
    background: var(--color-bg-subtle);
    font-weight: var(--weight-semibold);
    color: var(--color-text);
}

.prose tr:last-child td {
    border-bottom: 0;
}

.prose td > * + * {
    margin-top: 0.6em;
}

/* Grid of small boxes inside long-form text */
.prose-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: var(--space-4);
}

/* Four boxes read better as 2 × 2 than as 3 + 1 */
@media (min-width: 640px) {
    .prose-grid:has(> :nth-child(4):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.prose-card {
    padding: var(--space-5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    font-size: var(--text-base);
    line-height: 1.6;
}

.prose-card :is(h3, h4, h5) {
    font-family: var(--font-display);
    font-size: var(--text-base);
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--color-text);
}

.prose-card :is(ul, ol):not([class]) {
    padding-left: 1.2em;
}

.prose-card :is(ul, ol):not([class]) > li + li {
    margin-top: 0.25em;
}

/* Numbered marker for step-by-step boxes */
.step-num {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}

/* --- Code block with a copy button (site.js: [data-copy]) ------------------------- */
.code-block {
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--ink-900);
}

.code-block__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ink-400);
}

.code-block__copy {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0.3rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-300);
    font-family: var(--font-body);
    font-size: var(--text-xs);
}

.code-block__copy:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.code-block pre,
.prose pre {
    overflow-x: auto;
    padding: var(--space-4) var(--space-5);
    background: var(--ink-900);
    color: var(--ink-100);
    font-size: 0.8125rem;
    line-height: 1.65;
    tab-size: 4;
}

.prose > pre {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.code-block pre {
    border-radius: 0;
}

/* --- Callout (highlighted note) ---------------------------------------------------- */
.callout {
    --callout-fg: var(--color-accent);
    --callout-bg: var(--color-accent-soft);
    display: block;
    padding: var(--space-4) var(--space-5);
    border-left: 3px solid var(--callout-fg);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: var(--callout-bg);
    color: var(--color-text);
    font-size: var(--text-base);
    line-height: 1.6;
}

.callout--success {
    --callout-fg: var(--color-success);
    --callout-bg: var(--color-success-soft);
}

.callout--warning {
    --callout-fg: var(--color-warning);
    --callout-bg: var(--color-warning-soft);
}

.callout--danger {
    --callout-fg: var(--color-danger);
    --callout-bg: var(--color-danger-soft);
}

.callout :is(h3, h4, h5) {
    font-family: var(--font-display);
    font-size: var(--text-base);
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--color-text);
}

/* --- Forms ------------------------------------------------------------------------- */
.form-grid {
    display: grid;
    gap: var(--space-5) var(--space-4);
}

@media (min-width: 640px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid > .field--full {
        grid-column: 1 / -1;
    }
}

.field {
    display: grid;
    gap: var(--space-2);
    align-content: start;
}

.field label {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-text);
}

.field__req {
    color: var(--color-highlight);
}

.field__hint {
    font-size: var(--text-sm);
    color: var(--color-text-subtle);
}

.input {
    width: 100%;
    min-height: 46px;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--text-base);
    line-height: 1.4;
    transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.input::placeholder {
    color: var(--color-text-subtle);
}

.input:hover {
    border-color: var(--color-text-subtle);
}

.input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

textarea.input {
    min-height: 9rem;
    resize: vertical;
}

/* Input with a leading icon (search boxes) */
.input-icon {
    position: relative;
}

.input-icon > .icon {
    position: absolute;
    top: 50%;
    left: 0.95rem;
    width: 1.1rem;
    height: 1.1rem;
    color: var(--color-text-subtle);
    transform: translateY(-50%);
    pointer-events: none;
}

.input-icon .input {
    padding-left: 2.75rem;
}

/* Hide the native clear button so the field looks the same everywhere */
.input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

/* --- Pagination ---------------------------------------------------------------------- */
.pager ol {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
}

.pager a,
.pager span {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    height: 42px;
    padding-inline: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-weight: var(--weight-semibold);
    text-decoration: none;
}

.pager a:hover {
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.pager [aria-current] {
    border-color: transparent;
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

/* --- Tabs (page JS wires role="tablist"; without JS every panel shows) ------------- */
.tabs__list {
    display: flex;
    gap: var(--space-1);
    overflow-x: auto;
    border-bottom: 1px solid var(--color-border);
    scrollbar-width: none;
}

.tabs__tab {
    flex-shrink: 0;
    margin-bottom: -1px;
    padding: var(--space-3) var(--space-4);
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--color-text-muted);
    font-weight: var(--weight-semibold);
    white-space: nowrap;
    transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.tabs__tab:hover {
    color: var(--color-text);
}

.tabs__tab[aria-selected="true"] {
    border-bottom-color: var(--color-accent);
    color: var(--color-accent);
}

.tabs__panel {
    padding-top: var(--space-6);
}



/* --- Disclosure (<details>) ------------------------------------------------------------ */
.disclosure {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.disclosure + .disclosure {
    margin-top: var(--space-3);
}

.disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    color: var(--color-text);
    font-weight: var(--weight-semibold);
    list-style: none;
    cursor: pointer;
}

.disclosure > summary::-webkit-details-marker {
    display: none;
}

.disclosure > summary:hover {
    color: var(--color-accent);
}

.disclosure__chevron {
    color: var(--color-text-subtle);
    transition: transform var(--duration) var(--ease-out);
}

.disclosure[open] > summary .disclosure__chevron {
    transform: rotate(180deg);
}

.disclosure__body {
    padding: 0 var(--space-5) var(--space-5);
    font-size: var(--text-base);
}

.disclosure__body > * + * {
    margin-top: 1em;
}

.disclosure__body pre {
    border-radius: var(--radius-sm);
}
