/* Clarity Canvas — functional, restrained web heritage. */
:root {
    --surface: #fcf9f8;
    --canvas: #ffffff;
    --on-surface: #1b1c1c;
    --muted: #555555;
    --primary: #1b70b7;
    --primary-hover: #155d9d;
    --secondary: #0645ad;
    --border: #dddddd;
    /* DESIGN-2 outline: the palette value that clears 3:1 on this canvas,
       so it is the only colour allowed to draw a control edge. */
    --outline: #717782;
    /* The press inks. Letterpress red paints rules, the motif and small marks;
       it never carries running text. Graphite is the quiet one, for fields. */
    --ink-plate: #a52a2a;
    --rule-ink: #6b6f76;
    /* Generated fields, declared once so a test can hold each to its ceiling.
       A gradient stop needs a concrete colour, so each rgba repeats its token's
       channels; testEveryFieldMatchesItsToken holds the two together. */
    --field-graph: repeating-linear-gradient(0deg, rgba(107, 111, 118, 0.08) 0 1px, transparent 1px 24px),
        repeating-linear-gradient(90deg, rgba(107, 111, 118, 0.08) 0 1px, transparent 1px 24px);
    --field-hatch: repeating-linear-gradient(135deg, rgba(107, 111, 118, 0.07) 0 1px, transparent 1px 6px);
    --field-frieze: repeating-linear-gradient(90deg, rgba(165, 42, 42, 0.45) 0 2px, transparent 2px 30px);
    --field-pinstripe: repeating-linear-gradient(135deg,
        rgba(159, 202, 255, 0.18) 0 1px,
        transparent 1px 3px,
        rgba(159, 202, 255, 0.18) 3px 4px,
        transparent 4px 9px);
    --footer-bg: #303030;
    --header-bg: rgba(255, 255, 255, 0.86);
    --header-line: rgba(27, 28, 28, 0.10);
    --footer-ink: #f3f0ef;
    --footer-accent: #9fcaff;
    --border-soft: #cfe5f6;
    --accent-soft: #eaf4fc;
    --danger: #c2402a;
    --danger-soft: #fbe9e6;
    --radius: 0.75rem;
    --font-body: Arimo, Arial, Helvetica, sans-serif;
    --font-mono: "JetBrains Mono", Menlo, Consolas, monospace;
    /* One column width for the article and the header bar. */
    --content-max: 1016px;
    --content-pad: 1.5rem;
    /* Depth is tinted by this theme's own blue. A neutral grey shadow over a
       warm page reads as dirt, and clarity was the one public theme carrying
       one. */
    --shadow-1: 0 1px 2px rgba(27, 112, 183, 0.06), 0 14px 30px -26px rgba(27, 112, 183, 0.55);
    --shadow-2: 0 2px 4px rgba(27, 112, 183, 0.08), 0 22px 44px -28px rgba(27, 112, 183, 0.6);
}

* { box-sizing: border-box; }

/* The footer is the last band of the page, so the page itself has to be at
   least one screen tall: body is the column, the layout grows, the band closes
   it. Without this a short index left the footer floating mid-screen with the
   page background below it. */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--on-surface);
    background: linear-gradient(180deg, #f8fbfd 0%, var(--canvas) 220px);
    caret-color: var(--primary);
    scrollbar-color: var(--border-soft) var(--surface);
}

a { color: var(--secondary); text-decoration: underline; }
a:hover, a:focus { color: var(--primary); }

::selection {
    background: var(--accent-soft);
    color: var(--on-surface);
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--on-surface);
    color: #ffffff;
    padding: 0.5rem 1rem;
}
.skip-link:focus { left: 0; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--header-line);
}

/* The bar spans the viewport so its blur covers the full width; the row inside it
   shares the article's content column, so the brand starts where the text starts
   and the menu ends where the text ends. */
.header-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0.85rem var(--content-pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.site-title {
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--on-surface);
    text-decoration: none;
}

/* The menu is the right-hand item of the bar: the brand keeps the left edge and
   the nav is pushed to the far right, aligned with the bar's top edge. */
.site-nav {
    margin-left: auto;
    min-width: 0;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem 1.4rem;
}

.site-nav li { position: relative; }

.site-nav a {
    display: inline-block;
    padding: 0.3rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--on-surface);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 140ms ease, border-color 140ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--primary);
    border-bottom-color: currentColor;
}

.site-nav ul ul {
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.35rem 0 0.2rem 0.85rem;
    border-left: 2px solid var(--header-line);
}

/* On a pointer-capable screen a sub-menu is a panel under its parent, not extra
   rows in the bar: an open panel must not stretch the header. Hover opens it for
   a mouse, focus-within for a keyboard, so it stays reachable without a script. */
@media (min-width: 760px) {
    .site-nav ul ul {
        position: absolute;
        top: calc(100% + 0.5rem);
        right: 0;
        min-width: 13rem;
        margin: 0;
        padding: 0.6rem 0.85rem;
        gap: 0.35rem;
        background: var(--canvas);
        border: 1px solid var(--header-line);
        border-left: 1px solid var(--header-line);
        border-radius: 0.5rem;
        box-shadow: var(--shadow-2);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-4px);
        transition: opacity 140ms ease, transform 140ms ease, visibility 140ms;
        z-index: 30;
    }

    .site-nav li:hover > ul,
    .site-nav li:focus-within > ul {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
}

.site-nav ul ul a {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
}

@media (max-width: 759px) {
    .header-inner { padding: 0.7rem var(--content-pad); gap: 0.5rem 1rem; }
    .site-nav { margin-left: 0; width: 100%; }
    .site-nav ul { justify-content: flex-end; gap: 0.2rem 1rem; }
    .site-nav ul ul { align-items: flex-end; border-left: 0; border-right: 2px solid var(--header-line); padding: 0.3rem 0.75rem 0.2rem 0; }
}

.announcement {
    background: var(--accent-soft);
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--primary);
    padding: 0.75rem 1.5rem;
}

.hero { padding: 3rem 1.5rem 1rem; max-width: 1016px; margin: 0 auto; }
.hero h1 { font-size: 2rem; line-height: 1.25; margin: 0 0 0.5rem; }

.layout {
    flex: 1 0 auto;
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 1rem var(--content-pad) 2rem;
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 1.5rem;
}

.sidebar { font-size: 0.95rem; }
.sidebar .block { margin-bottom: 1.5rem; }

.main { min-width: 0; }

/* ── The front page ────────────────────────────────────────────────────────
   Clarity's index is a lead entry and then a quiet stream. The site name
   carries the Display role, the first entry the Title role, and everything
   after it stands back against a hairline, so the lead is the one that
   speaks. Before this, every entry was the same size and the page opened
   with no heading at all. */

/* Ruled stock under the opening: the page's own measure, made visible. The
   field is graphite at 8% because it sits under the lead line as well as the
   title, and a reader must never read past decoration to reach the sentence. */
.index-head {
    padding: 2.25rem 0 1.5rem;
    margin: 0 0 1.5rem;
    background-image: var(--field-graph);
    background-position: 0 0;
}

.index-head__title {
    margin: 0;
    max-width: 22ch;
    font-size: clamp(2.4rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.03;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

/* The rubric: one plate-red rule that opens a change of register, the way a
   printed sheet marks a new division. Not a field — it is a border, and it
   carries no ink under it, so the 8% field ceiling does not apply to it. It is
   drawn on the two lines the sheet names, the index lead and the article facts,
   and exists only where a template emits it (no orphan class). */
.index-head__lead {
    margin: 0.85rem 0 0;
    max-width: 52ch;
    padding-top: 1rem;
    border-top: 2px solid var(--ink-plate);
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--muted);
}

/* Two counts the index can prove about itself. They sit below the heading with
   the other facts, never as a caption above it. */
.index-head__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.75rem;
    margin: 1.1rem 0 0;
}

.index-head__stat { display: flex; align-items: baseline; gap: 0.45rem; }

.index-head__stats dt {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.index-head__stats dd {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--on-surface);
    font-variant-numeric: tabular-nums;
}

.page-stream {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 1rem;
}

/* One column of full-width cards was the flattest composition in the set: on a
   desktop the index read as a list of paragraphs in boxes. Two tracks, with the
   lead across both, is the front page the entries were asking for. */
@media (min-width: 900px) {
    .page-stream { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem; }
    .page-card:first-child { grid-column: 1 / -1; }
}

.page-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.125rem;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

/* The lead entry is the front of the paper: the band the footer already uses
   at its own edge, the Title step, and the only resting shadow in the stream. */
.page-card:first-child {
    border-top: 6px solid var(--primary);
    /* Square across the top so the band is a masthead rule rather than a
       coloured border wrapped around a rounded corner. */
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 1.5rem 1.75rem 1.4rem;
    box-shadow: var(--shadow-1);
    margin-bottom: 0.5rem;
}

.page-card:first-child h2 {
    max-width: 26ch;
    font-size: clamp(1.6rem, 3vw, 2.15rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    /* The lead card carries the register mark in its top-right corner. A long
       single token wraps to the card's full width, so the title must stop short
       of the mark rather than run under it. */
    padding-right: 2.5rem;
}

/* The register mark: drawn on the lead entry only. It sits in the template on
   every card so no card can drift out of the contract by losing a branch, and
   the stylesheet decides where it shows. The base rule is the size; the hiding
   is scoped to the card so the article's watermark can size itself separately. */
.register-mark {
    display: block;
    width: 22px;
    height: 22px;
    color: var(--ink-plate);
    pointer-events: none;
}

.page-card .register-mark { display: none; }

.page-card:first-child .register-mark {
    display: block;
    position: absolute;
    top: 1rem;
    right: 1.1rem;
}

/* The date is right-aligned straight into the mark's corner, so the lead card's
   date row stops short of it. Caught by looking at the page: the mark sat on
   top of "AUG 2026" and read as a red bracket instead of a mark. */
.page-card:first-child .page-card__top { padding-right: 2.2rem; }

.page-card:first-child p { font-size: 1.0625rem; }

/* Depth is a state, not a surface: the card answers a hover or a focused link. */
.page-card:hover,
.page-card:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
}

/* The entry's own facts: when it was published, and whether it is the pick.
   A date is not a label for the heading, it belongs beside it. */
/* The date and badge strip is meta, so it carries the hatch rather than a fill:
   a texture that says "this is not the entry" without adding a surface. */
.page-card__top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    padding: 0.15rem 0.2rem;
    margin-left: -0.2rem;
    background-image: var(--field-hatch);
}

.page-card__date {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.page-card h2 {
    margin: 0 0 0.45rem;
    font-size: 1.25rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.page-card h2 a { color: var(--on-surface); text-decoration: none; }

/* The title link covers the card, so an entry is one tab stop and the whole
   surface is the target. The ring is drawn on the overlay, which cannot
   reshape the card it sits on. */
.page-card h2 a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
}
.page-card h2 a:focus-visible { outline: none; }
.page-card h2 a:focus-visible::after {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.page-card p {
    margin: 0;
    max-width: 66ch;
    line-height: 1.55;
    color: var(--muted);
}

.page-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.page-card__tag {
    padding: 0.1rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* margin-top: auto keeps the affordance on the bottom edge whether or not the
   entry carries a summary and tags, so the cards in a row line up. */
.page-card__more {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: auto;
    padding-top: 0.9rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--primary);
}
.page-card__more .icon { width: 1em; height: 1em; }

.page-card:hover .page-card__more,
.page-card:focus-within .page-card__more { text-decoration: underline; text-underline-offset: 0.18em; }

.badge {
    display: inline-block;
    background: var(--accent-soft);
    color: #124e7c;
    border-radius: 9999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.empty-state {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    padding: 1.25rem 1.375rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 0.9375rem;
}
.empty-state p { margin: 0; }
.empty-state__icon { width: 1.35rem; height: 1.35rem; color: var(--primary); flex: none; }

@media (prefers-reduced-motion: reduce) {
    .page-card { transition: none; }
    .page-card:hover,
    .page-card:focus-within { transform: none; }
}

@media (max-width: 759px) {
    .index-head { padding-top: 1.75rem; }
    .page-card:first-child { padding: 1.25rem 1.125rem 1.15rem; }
}

.page-content { max-width: 720px; }

.article-head { margin: 0 0 1.75rem; position: relative; }
.article-head h1 { margin: 0; }

/* The article's watermark: the same mark, large and quiet, behind the heading.
   It is the one place the motif is drawn at page scale, so it stays at 6% —
   a reader must reach the first sentence without noticing the stock. */
.article-head .register-mark {
    display: block;
    position: absolute;
    /* Anchored to the head's own top so the mark cannot reach past the block
       into the first paragraph. It is drawn from the top-right corner inward. */
    top: 0;
    right: 0;
    /* 96px, not 140: a one-line article head measures about 100px, so a 140px
       mark overhangs the block at every offset. Sized to fit by construction
       rather than cropped by an overflow rule. */
    width: 96px;
    height: 96px;
    color: var(--rule-ink);
    opacity: 0.06;
    pointer-events: none;
}

/* The positioned watermark would paint over a static heading, so the heading is
   lifted rather than the watermark sunk behind the page with a negative index. */
.article-head h1 { position: relative; z-index: 1; }

/* Below 1024 a one-line article head is shorter than the 140px mark, which then
   overhangs the head and paints into the first paragraph. The motif is decoration;
   a decoration that spills past the block it belongs to is a layout fault. */
@media (max-width: 1023px) {
    .article-head .register-mark { display: none; }
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.75rem 0 0;
    padding-top: 0.6rem;
    border-top: 2px solid var(--ink-plate);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--muted);
}
.article-meta .icon { width: 1em; height: 1em; }

.page-content h1 {
    margin: 0 0 1.25rem;
    max-width: 24ch;
    font-size: clamp(2.05rem, 4vw, 2.9rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.03em;
    text-wrap: balance;
}
/* The 404 body is not wrapped in .page-content, so its heading used to fall
   back to the browser's 2em. It takes the Headline role without the measure. */
.main > h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.05rem, 4vw, 2.9rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.03em;
}
.page-content pre, .page-content code { font-family: var(--font-mono); }
.page-content img { max-width: 100%; height: auto; }

/* The publication date under an article: quieter than the body, and never below
   AA. --muted is 4.47:1 on scholar's canvas, so the ink token carries this. */
.page-meta {
    margin: 2rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-soft);
    font-size: 0.8125rem;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: var(--on-surface);
    opacity: 0.72;
}


.button {
    display: inline-block;
    background: var(--primary);
    color: #ffffff;
    border-radius: 8px;
    padding: 0.625rem 1.125rem;
    text-decoration: none;
}
.button:hover { background: var(--primary-hover); color: #ffffff; }

.challenge { max-width: 420px; }
.challenge input[type="password"] { width: 100%; padding: 0.5rem; }



@media (min-width: 760px) {
    /* Only reserve sidebar tracks when a sidebar element is actually rendered. */
    .layout:has(.sidebar--left) { grid-template-columns: 260px 1fr; }
    .layout:has(.sidebar--right) { grid-template-columns: 220px 1fr 260px; }
}

@media (max-width: 759px) {
    /* Stacked: the article comes first, supplementary columns follow. */
    .main { order: 1; }
    .sidebar--left { order: 2; }
    .sidebar--right { order: 3; }
}


.block--address, .block--copyright { white-space: pre-line; }
.block__figure { margin: 0 0 0.75rem; }
.block__figure img { border-radius: 0.375rem; }

.challenge__error {
    color: #8c2f2a;
    border-left: 3px solid currentColor;
    padding-left: 0.75rem;
    margin: 0 0 1rem;
}

/* ── Block library ─────────────────────────────────────────────────────────
   One visual contract for all ten block types. Copied verbatim into every
   theme so the blocks look native in each; only tokens differ. Never add a
   second wrapper: each renderer already emits .block.block--<type>. */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.block { min-width: 0; }

.block > h2 {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 0 0 0.5rem;
}

.block ul { list-style: none; margin: 0; padding: 0; }
.block li + li { margin-top: 0.35rem; }
.block a { color: var(--primary); }

/* The sprite is inline <svg>: without a size it claims 300x150 or 0x0. */
.icon {
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.18em;
    fill: currentColor;
    flex: none;
}

.block--menu ul ul { padding-left: 0.9rem; }
.block--menu a { text-decoration: none; }
.block--menu a:hover,
.block--menu a:focus-visible { text-decoration: underline; }

.block--social ul { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.block--social li + li { margin-top: 0; }
.block--social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--on-surface);
}
.block--social a:hover,
.block--social a:focus-visible { border-color: var(--primary); color: var(--primary); }

@media (pointer: coarse) {
    .block--social a { min-width: 2.75rem; min-height: 2.75rem; }
}

.rss-chicklet {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    text-decoration: none;
    color: var(--on-surface);
}
.rss-chicklet:hover,
.rss-chicklet:focus-visible { border-color: var(--primary); color: var(--primary); }
.rss-chicklet .icon { color: var(--primary); }

.block--facts ul { list-style: none; }
.block--facts li { position: relative; padding-left: calc(1.15rem + 0.35rem); }
.block--facts li::before {
    content: "•";
    position: absolute;
    left: 0;
    width: 1.15rem;
    overflow: hidden;
    white-space: nowrap;
    color: var(--primary);
}
.block--facts li[data-bullet]::before { content: attr(data-bullet); }

.block--images {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}
.block--images img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0.25rem;
}

.block--blurb figure { margin: 0 0 0.6rem; }
.block--blurb figure img {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}
.block--blurb p { margin: 0; line-height: 1.55; }

.block--address { font-style: normal; line-height: 1.5; white-space: pre-line; }
.block--copyright { font-size: 0.8125rem; color: var(--muted); }
.block--custom { line-height: 1.55; }
.block--custom a { text-decoration: underline; }
.block--links a { text-decoration: none; }
.block--links a:hover,
.block--links a:focus-visible { text-decoration: underline; }

.block--rss {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* The images renderer emits <h2> and <img> as siblings, so the heading is a
   grid item and would take the first image cell. Span it across the row. */
.block--images > h2 { grid-column: 1 / -1; }

/* A long unbroken fact or URL must not widen the page at 375. */
.block { overflow-wrap: anywhere; }

/* Blocks keep the theme's own hover colour: a blanket .block a rule has the
   same specificity as a:hover and would win on source order. */
.block a:hover,
.block a:focus-visible { color: var(--secondary); }

/* ── Site footer: the closing band ─────────────────────────────────────────
   DESIGN-1 puts the footer on the primary anchor, DESIGN-2 and DESIGN-3 on the
   inverse surface; all three close the page with a heavy accent rule, a
   four-up column split (DESIGN-3 §8: "4-column balanced grid or horizontal
   split"), bolder headings and a separated colophon line. */
.site-footer {
    margin-top: 4.5rem;
    /* The band spans the viewport; its content starts and ends on the same
       column as the header and the article, so the page has one frame. */
    padding: 3rem max(var(--content-pad), calc((100% - var(--content-max)) / 2 + var(--content-pad))) 2rem;
    background: var(--footer-bg);
    /* The band carries a pinstripe on the diagonal: a pair of hairlines every 9px
       at 18%, which is what reads as woven cloth rather than as a ruled grid.
       A printed sheet's band is woven, not spotted — and on a dark ground a
       stripe reads as texture where a dot only reads as grain.
       Measured: the line composites to #444c55, 1.52:1 on the band — visible,
       still under the ceiling. Set after the shorthand, which would clear it.
       No background-size: a diagonal forced to a square tile restarts every
       6px and seams into a chevron. */
    background-image: var(--field-pinstripe);
    color: var(--footer-ink);
    border-top: 6px solid var(--footer-accent);
}
.site-footer .block {
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.65;
}
.site-footer .block > h2 {
    color: var(--footer-ink);
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    opacity: 0.82;
    margin: 0 0 0.75rem;
}
.site-footer a {
    color: var(--footer-accent);
    font-weight: 600;
    text-decoration: none;
}
.site-footer a:hover,
.site-footer a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}
.site-footer :focus-visible { outline: 2px solid var(--footer-accent); outline-offset: 2px; }

.site-footer__blocks {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem 2.5rem;
    align-items: flex-start;
    text-align: start;
    max-width: 72rem;
    margin: 0 auto;
}
.site-footer__blocks > .block {
    flex: 1 1 12rem;
    min-width: 0;
    margin-bottom: 0;
}
/* The site tagline, directly above the colophon line. It shares the colophon's
   width and rhythm, and takes the footer ink token, so the contrast pair the
   footer test already measures holds here too. */
.site-footer__tagline {
    max-width: 72rem;
    margin: 2rem auto 0;
    font-size: 0.875rem;
    line-height: 1.6;
    letter-spacing: 0.01em;
    color: var(--footer-ink);
}

.site-footer__copyright {
    max-width: 72rem;
    margin: 2rem auto 0;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
@media (max-width: 759px) {
    .site-footer { padding: 2.25rem var(--content-pad) 1.5rem; margin-top: 3rem; }
    .site-footer__blocks { flex-direction: column; gap: 1.5rem; }
    /* flex-basis applies to the block axis in a column: reset it or every
       block becomes 12rem tall regardless of its content. */
    .site-footer__blocks > .block { flex: 0 0 auto; width: 100%; }
}

/* ── Contact form ──────────────────────────────────────────────────────────
   The form is one shared partial (themes/shared/contact-form.php), so it is
   styled here in every theme against the theme's own tokens. No colour is
   hard-coded: the card is the canvas, fields sit on the warm surface, and the
   submit button is the theme's primary action. Message text always uses the
   body ink so the tinted backgrounds cannot fall below AA (clarity's
   #c2402a on #fbe9e6 measures 4.41:1, so the danger colour is the rule only). */
.contact-form {
    max-width: 40rem;
    margin-top: 2.5rem;
    padding: 2rem;
    background: var(--canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.contact-form > h2 { margin: 0 0 0.35rem; font-size: 1.5rem; }
.contact-form__intro { margin: 0 0 1.5rem; font-size: 0.875rem; color: var(--muted); }
.contact-form__form { margin: 0; }

.contact-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.contact-form__field { margin: 0; min-width: 0; }
.contact-form__field--full,
.contact-form__actions { grid-column: 1 / -1; }
.contact-form__actions { margin: 0.25rem 0 0; }

.contact-form label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--on-surface);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font: inherit;
    font-size: 0.9375rem;
    color: var(--on-surface);
    background: var(--surface);
    /* --border measures 1.2-1.4:1 on the card: an edge nobody can see.
       --outline is the palette step that clears the 3:1 non-text minimum. */
    border: 1px solid var(--outline);
    border-radius: 0.375rem;
    transition: border-color 140ms ease, background 140ms ease;
}

.contact-form textarea {
    min-height: 9rem;
    resize: vertical;
    line-height: 1.6;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    border-color: var(--primary);
    background: var(--canvas);
    outline: none;
}

.contact-form input[type="text"]:focus-visible,
.contact-form input[type="email"]:focus-visible,
.contact-form textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

/* The honeypot is a real field so it stays in the DOM for bots, but no person
   should see it or tab to it. */
.contact-form__honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.contact-form button {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--canvas);
    background: var(--primary);
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 140ms ease;
}

.contact-form button:hover,
.contact-form button:focus-visible { background: var(--primary-hover); }

.contact-form__saved,
.contact-form__error {
    margin: 0 0 1.25rem;
    padding: 0.7rem 1rem;
    color: var(--on-surface);
    border-left: 3px solid currentColor;
    border-radius: 0.25rem;
    font-size: 0.9375rem;
}
.contact-form__saved { background: var(--accent-soft); border-left-color: var(--primary); }
.contact-form__error { background: var(--danger-soft); border-left-color: var(--danger); }

@media (max-width: 640px) {
    .contact-form { padding: 1.25rem; }
    .contact-form__grid { grid-template-columns: 1fr; gap: 0.85rem; }
}

/* ── Long-token guard ──────────────────────────────────────────────────────
   A title, summary, tag or article heading can arrive as one unbroken token.
   Without this that single word widens its own grid track and the page scrolls
   sideways on a phone (measured at 390: 121-660px of horizontal overflow). */
.page-card,
.page-card h2,
.page-card p,
.page-card__title,
.page-card__summary,
.page-card__tag,
.index-head__title,
.index-head__lead,
.page-content h1 {
    overflow-wrap: anywhere;
}

/* The frieze: a graphic relative of the register mark — short rules off a long
   rule — under the index head. Not the motif itself, because a <symbol> cannot
   repeat; this is the same gesture drawn a second way. It fades toward the
   right so it reads as stock running out, not as a rule with an end. */
.index-head::after {
    content: "";
    display: block;
    height: 18px;
    margin-top: 1.5rem;
    background-image: var(--field-frieze);
    -webkit-mask-image: linear-gradient(90deg, currentColor 0%, transparent 100%);
    mask-image: linear-gradient(90deg, currentColor 0%, transparent 100%);
    pointer-events: none;
}
