/* ==========================================================================
   SYSTEM.CSS — Design-system layer (Antonov v3)
   Editorial grid · proof-mark iconography · component + state library.
   Enqueued AFTER style.css so tokens (:root) are available.
   Goal: a living, documented design system with newsroom rigor.
   All interactive components ship the 8-state contract:
   default / hover / focus-visible / active / disabled / loading / empty / error.
   WCAG AA · respects prefers-reduced-motion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. EDITORIAL GRID
   -------------------------------------------------------------------------- */
.wrap {
    width: 100%;
    max-width: var(--container-max);          /* 1200px */
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}
.measure { max-width: var(--content-width); } /* 832px reading column */

/* Broadsheet split: lead block + ledger (e.g. hero + experience table). */
.grid-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 5vw, 4rem);
    align-items: start;
}
.grid-split--lead { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }

/* Work column grid: image-led cards. */
.grid-work {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.25rem, 3vw, 2.5rem) clamp(1.5rem, 4vw, 3rem);
}
.grid-work--full { grid-template-columns: 1fr; }

@media (max-width: 860px) {
    .grid-split, .grid-split--lead, .grid-work { grid-template-columns: 1fr; }
}

/* Hairline rules — the newsroom register. */
.rule        { border: 0; border-top: 1px solid var(--color-border); margin: 0; }
.rule--strong{ border-top-color: var(--color-text-primary); }
.rule--brand { position: relative; }
.rule--brand::before {
    content: ""; position: absolute; top: -1px; left: 0;
    width: 2.75rem; height: 2px; background: var(--color-brand);
}

/* --------------------------------------------------------------------------
   2. PROOF-MARK ICONOGRAPHY  (editor's marks as UI semantics)
   §=dossier  ¶=nota  ↗=señal  †=corrección  ●◐○=estado
   Decorative glyph is aria-hidden; pair with .sr-only text for AT.
   -------------------------------------------------------------------------- */
.mark {
    font-family: var(--font-mono);
    font-size: 0.95em;
    line-height: 1;
    color: var(--color-text-muted);
    -webkit-font-smoothing: antialiased;
}
.mark--dossier { color: var(--color-text-primary); }   /* § */
.mark--nota    { color: var(--color-text-muted); }     /* ¶ */
.mark--senal   { color: var(--color-accent); }         /* ↗ */
.mark--corr    { color: var(--color-brand); }          /* † */

/* Status dots — ● active · ◐ progress · ○ idle */
.status { font-family: var(--font-mono); font-size: 0.8em; letter-spacing: .02em; color: var(--color-text-muted); }
.status::before { content: "● "; }
.status--live   { color: var(--color-text-primary); }
.status--live::before   { content: "● "; color: var(--color-brand); }
.status--progress::before { content: "◐ "; }
.status--idle    { color: var(--color-text-caption); }
.status--idle::before    { content: "○ "; }

/* Eyebrow / kicker — mono micro-label */
.kicker {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* Chip — compact taxonomy / discipline label */
.chip {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .25rem .55rem;
    border-radius: 999px;
    background: var(--color-bg-secondary);
    color: var(--color-text-muted);
}
.chip--accent { background: var(--color-accent-soft); color: var(--color-accent); }

/* --------------------------------------------------------------------------
   3. STATE PRIMITIVES  (reused by every component)
   -------------------------------------------------------------------------- */

/* Focus-visible — extend the theme's ring to system controls. */
.btn:focus-visible,
.work-card a:focus-visible,
.log-row a:focus-visible,
.field input:focus-visible,
.field textarea:focus-visible,
a.mark:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Loading skeleton — shimmer; frozen under reduced-motion. */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--color-bg-secondary);
    border-radius: 4px;
    color: transparent !important;
    user-select: none;
}
.skeleton::after {
    content: "";
    position: absolute; inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(0,0,0,.045), transparent);
    animation: ds-shimmer 1.3s ease-in-out infinite;
}
[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
@keyframes ds-shimmer { 100% { transform: translateX(100%); } }
.skeleton--line  { height: .85em; margin: .35em 0; }
.skeleton--title { height: 1.6em; width: 70%; }
.skeleton--media { aspect-ratio: 16 / 10; width: 100%; border-radius: 8px; }
[aria-busy="true"] { cursor: progress; }

/* Empty state — quiet, centered notice. */
.empty-state {
    padding: var(--space-10) var(--space-6);
    text-align: center;
    color: var(--color-text-muted);
    border: 1px dashed var(--color-border);
    border-radius: 8px;
}
.empty-state .mark { display: block; font-size: 1.4rem; margin-bottom: var(--space-3); color: var(--color-text-caption); }
.empty-state p { margin: 0; font-size: var(--text-sm); }

/* Error — field + inline message. */
.field { display: block; }
.field > label { display: block; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .04em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: .4rem; }
.field input, .field textarea {
    width: 100%;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
    border: 1px solid var(--color-separator);
    border-radius: 6px;
    padding: .65rem .8rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:hover, .field textarea:hover { border-color: var(--color-text-caption); }
.field input:focus-visible, .field textarea:focus-visible { border-color: var(--color-brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-brand) 18%, transparent); }
.field.has-error input, .field.has-error textarea { border-color: var(--color-accent); }
.field-error { display: block; margin-top: .4rem; font-size: var(--text-sm); color: var(--color-accent); }

/* --------------------------------------------------------------------------
   4. BUTTON — shimmer state machine (idle → pending → done / error)
   The shimmer lives INSIDE the label text (background-clip:text), not a spinner.
   Driven by data-state + JS (_setState). Tokenized to the palette.
   Markup:
     <button class="btn" data-state="idle"
             data-label-idle="…" data-label-pending="Pensando…" data-label-done="Listo">
       <span class="sb-check" aria-hidden="true"></span><span class="sb-label">…</span>
     </button>
   -------------------------------------------------------------------------- */
.btn {
    --sb-fg: var(--color-bg-primary);
    --sb-fg-dim: color-mix(in srgb, var(--sb-fg) 42%, transparent);
    --sb-success: #46c08a;

    appearance: none;
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: var(--font-sans); font-weight: 500; font-size: var(--text-sm); line-height: 1;
    text-decoration: none;
    min-height: 44px; padding: 0 1.2rem;
    border: 1px solid var(--color-text-primary); border-radius: 8px;
    background: var(--color-text-primary); color: var(--sb-fg);
    cursor: pointer;
    transition: background-color .18s ease, transform .06s ease, opacity .18s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: color-mix(in srgb, var(--color-text-primary) 86%, #fff); }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn[data-state="pending"], .btn[data-state="done"] { cursor: default; }

.btn--ghost {
    --sb-fg: var(--color-text-primary);
    --sb-fg-dim: var(--color-text-caption);
    background: transparent; color: var(--color-text-primary); border-color: var(--color-separator);
}
.btn--ghost:hover { background: var(--color-bg-secondary); }

/* Label + shimmer-in-text on pending, with cross-fade on mutation. */
.btn .sb-label { display: inline-block; transition: opacity .25s ease; }
.btn[data-state="pending"] .sb-label {
    background: linear-gradient(100deg, var(--sb-fg-dim) 30%, var(--sb-fg) 50%, var(--sb-fg-dim) 70%);
    background-size: 220% 100%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    animation: sb-shine 2s linear infinite;
}
@keyframes sb-shine { 0% { background-position: 180% 0; } 100% { background-position: -80% 0; } }
.btn.sb-swapping .sb-label { opacity: 0; }

.btn .sb-check { display: inline-flex; }
.btn[data-state="done"] .sb-check { color: var(--sb-success); }

/* Error — graceful: brand ring + retry glyph + one short shake; stays clickable to retry. */
.btn[data-state="error"] { box-shadow: inset 0 0 0 1.5px var(--color-brand); animation: sb-shake .35s ease both; }
.btn[data-state="error"] .sb-check { color: var(--color-brand); }
@keyframes sb-shake { 10%,90% { transform: translateX(-1px); } 30%,70% { transform: translateX(2px); } 50% { transform: translateX(-2px); } }

@media (prefers-reduced-motion: reduce) {
    .btn[data-state="pending"] .sb-label { animation: none; color: var(--sb-fg); -webkit-text-fill-color: currentColor; }
    .btn .sb-label { transition: none; }
    .btn[data-state="error"] { animation: none; }
}

/* --------------------------------------------------------------------------
   5. WORK CARD  (image-led, value caption, mono discipline label)
   -------------------------------------------------------------------------- */
.work-card { display: flex; flex-direction: column; }
.work-card__media {
    display: block; position: relative; overflow: hidden;
    border-radius: 8px; background: var(--color-bg-secondary);
    aspect-ratio: 16 / 10;
    text-decoration: none;   /* card is the link; no underline noise on cover content */
}
.work-card__media:hover { opacity: 1; }
.work-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2,0,.2,1); }
.work-card__media:hover img { transform: scale(1.03); }
/* Typographic cover when no image — never an empty gray box. */
.work-card__cover {
    display: flex; flex-direction: column; justify-content: flex-end;
    height: 100%; padding: 1.2rem 1.3rem;
    background: var(--color-text-primary); color: var(--color-bg-primary);
}
.work-card__cover .kicker { color: color-mix(in srgb, var(--color-brand) 70%, #fff); }
.work-card__cover-title { font-family: var(--font-serif); font-size: var(--text-xl); line-height: 1.05; margin-top: .4rem; }
.work-card__foot { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 1.1rem; }
.work-card__caption { font-family: var(--font-serif); font-size: var(--text-md); line-height: 1.25; color: var(--color-text-primary); text-decoration: none; }
a.work-card__caption:hover { color: var(--color-accent); opacity: 1; }
.work-card__label { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .04em; text-transform: uppercase; color: var(--color-text-caption); white-space: nowrap; flex: none; }
@media (prefers-reduced-motion: reduce) { .work-card__media img { transition: none; } .work-card__media:hover img { transform: none; } }
/* The nowrap mono label can force the card wider than a narrow column — let the
   grid item shrink and stack the foot on small screens (no horizontal scroll). */
.grid-work > * { min-width: 0; }
@media (max-width: 560px) {
    .work-card__foot { flex-direction: column; align-items: flex-start; gap: .35rem; }
    .work-card__label { white-space: normal; }
}

/* --------------------------------------------------------------------------
   6. EXPERIENCE TABLE  (year · org · role — credibility without metrics)
   -------------------------------------------------------------------------- */
/* Borderless, light, compact, one line per entry — air from whitespace (Rachel-Chen). */
.exp-table { width: 100%; }
.exp-row {
    display: grid;
    grid-template-columns: minmax(4.5rem, auto) minmax(0, 1.7fr) minmax(0, 1fr);
    gap: .9rem; align-items: baseline;
    padding: .42rem 0;
}
.exp-row__year { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .01em; color: var(--color-text-caption); white-space: nowrap; }
.exp-row__org  { color: var(--color-text-primary); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-row__role { color: var(--color-text-caption); font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 540px) {
    .exp-row { grid-template-columns: minmax(4rem, auto) 1fr; row-gap: .1rem; }
    .exp-row__role { grid-column: 2; }
}

/* --------------------------------------------------------------------------
   7. METRIC  (DOSSIER-ONLY — evidence inside the case, never on home)
   -------------------------------------------------------------------------- */
.metric-row { display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 4vw, 3rem); }
.metric { display: flex; flex-direction: column; }
.metric__num { font-family: var(--font-sans); font-weight: 600; font-size: var(--text-2xl); line-height: 1; letter-spacing: -.01em; color: var(--color-brand); }
.metric__label { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .05em; text-transform: uppercase; color: var(--color-text-caption); margin-top: .35rem; }

/* --------------------------------------------------------------------------
   8. LOG ROW — bitácora (§ proyecto · ¶ blog · ↗ linkódromo)
   Body carries a fixed "peek" of the featured image (proyecto/blog), or the
   link body + social card (linkódromo). Meta: relative date for blog/linkódromo,
   year/range for proyecto, plus tasteful chips.
   -------------------------------------------------------------------------- */
.log-row {
    display: flex; gap: 1.25rem; align-items: flex-start;
    padding: 1.7rem 0;
    border-top: 1px solid var(--color-separator);
}
.log-row__mark { flex: none; width: 1.4rem; font-size: 1.05rem; line-height: 1.5; }
.log-row__body { flex: 1 1 auto; min-width: 0; }
.log-row__title { font-weight: 500; font-size: var(--text-lg); line-height: 1.25; margin: 0; }
.log-row__title a {
    color: var(--color-text-primary);
    text-decoration: underline; text-decoration-color: var(--color-border);
    text-underline-offset: 3px;
    transition: text-decoration-color .15s ease, color .15s ease;
}
.log-row__title a:hover { color: var(--color-accent); text-decoration-color: currentColor; opacity: 1; }

/* Peek — a fixed glimpse (tab) of the featured image, under the title.
   Not expandable; a subtle vertical pan on hover hints at "more". */
.log-row__peek {
    display: block; margin-top: .95rem; height: 96px; max-width: 520px;
    border-radius: 6px; overflow: hidden; background: var(--color-bg-secondary);
    text-decoration: none;
}
.log-row__peek img { width: 100%; height: 100%; object-fit: cover; object-position: center 26%; display: block; transition: object-position .5s ease; }
.log-row:hover .log-row__peek img { object-position: center 64%; }

/* Linkódromo — link body (commentary) + social card, stacked under the title. */
.log-row__text { margin-top: .65rem; font-size: var(--text-md); line-height: 1.6; color: var(--color-text-secondary); max-width: 60ch; }
.log-card {
    display: inline-flex; gap: .65rem; align-items: center; margin-top: .65rem; max-width: 380px;
    border: 1px solid var(--color-border); border-radius: 8px; padding: .5rem .65rem;
    text-decoration: none; transition: border-color .15s ease, background-color .15s ease;
}
.log-card:hover { border-color: var(--color-text-caption); background: var(--color-bg-secondary); opacity: 1; }
.log-card__thumb { flex: none; width: 46px; height: 46px; object-fit: cover; border-radius: 5px; background: var(--color-bg-secondary); }
.log-card__meta { min-width: 0; }
.log-card__src  { display: block; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-caption); }
.log-card__name { display: block; font-size: var(--text-sm); color: var(--color-text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Meta — relative date / year + tasteful chips (1–2, not saturated). */
.log-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin-top: .95rem; }
.log-row__when { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-caption); }

@media (prefers-reduced-motion: reduce) {
    .log-row__peek img { transition: none; }
    .log-row:hover .log-row__peek img { object-position: center 26%; }
}
@media (max-width: 560px) {
    .log-row__peek { max-width: 100%; }
}

/* --------------------------------------------------------------------------
   9. /SISTEMA gallery layout (scoped to the design-system page)
   -------------------------------------------------------------------------- */
.sistema .lede { font-size: var(--text-md); line-height: 1.55; color: var(--color-text-secondary); max-width: 46ch; margin-top: var(--space-4); }
.ds-section { margin-top: var(--space-12); }
.ds-section > .kicker { margin: .6rem 0 var(--space-5); }
.ds-section .rule--brand { margin-bottom: 0; }

.ds-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-5); }
.ds-swatch { display: flex; flex-direction: column; gap: .25rem; }
.ds-swatch__chip { height: 56px; border-radius: 6px; border: 1px solid var(--color-border); }
.ds-swatch__token { font-size: var(--text-xs); color: var(--color-text-primary); }
.ds-swatch__label { font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-note { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-5); max-width: 60ch; }
.ds-note code { font-family: var(--font-mono); font-size: .85em; background: var(--color-bg-secondary); padding: .05em .35em; border-radius: 3px; }

.ds-type { display: flex; flex-direction: column; gap: var(--space-5); }
.ds-type__row { display: grid; grid-template-columns: 10rem 1fr; gap: var(--space-4); align-items: baseline; }
.ds-type__role { color: var(--color-text-caption); font-size: var(--text-xs); letter-spacing: .06em; text-transform: uppercase; }
@media (max-width: 640px) { .ds-type__row { grid-template-columns: 1fr; gap: .3rem; } }

.ds-marks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-4) var(--space-6); }
.ds-mark-demo { display: flex; align-items: center; gap: .6rem; font-size: var(--text-sm); color: var(--color-text-muted); }
.ds-mark-demo .mark { font-size: 1.2rem; min-width: 1.2rem; }

.ds-states { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }
.ds-states--fields { align-items: start; }
.ds-states--fields .field { flex: 1 1 220px; max-width: 280px; }

/* --------------------------------------------------------------------------
   10. HOME — product-design-lead practice layout
   -------------------------------------------------------------------------- */
.home .wrap { padding-top: clamp(3.5rem, 7vw, 6rem); padding-bottom: clamp(5rem, 10vw, 8rem); }
/* No double separator: the first VISIBLE row (set by the filter JS) drops its
   top border, so the section's brand rule is the only divider under the head.
   (Rows are date-sorted, so the first visible row is rarely the first child.) */
.home-log .log-row.is-first { border-top: 0; padding-top: 0; }

/* Identity + experience — trayectoria bottom-aligned in the shared row. */
.home-hero { align-items: end; gap: clamp(2.5rem, 7vw, 6rem); }
.home-hero__ledger { align-self: end; }
.home-hero__statement {
    font-family: var(--font-serif); font-weight: 400;
    font-size: clamp(2.1rem, 4.8vw, 3.5rem); line-height: 1.12; letter-spacing: -.005em;
    margin: 1.6rem 0 0; max-width: 19ch;
}
.home-hero__statement em { font-style: italic; }
.home-hero__dek { font-size: var(--text-md); line-height: 1.6; color: var(--color-text-secondary); max-width: 46ch; margin: 2rem 0 0; }
.home-hero__role { font-size: var(--text-xs); letter-spacing: .04em; color: var(--color-text-muted); margin-top: 1.8rem; }
.home-hero__ledger { padding-top: .4rem; }
.home-hero__ledger .kicker { margin-bottom: var(--space-5); display: block; }
@media (max-width: 860px) {
    .home-hero__ledger { margin-top: var(--space-10); }
}

/* Section heads — potent Instrument Serif titles, balanced rhythm. */
.home-work, .home-bitacora, .home-contact { margin-top: clamp(3.5rem, 7vw, 6rem); }
.home-section__head { margin-bottom: clamp(1.75rem, 3vw, 2.75rem); }
.home-section__head .rule--brand { margin-bottom: 1rem; }
.home-section__title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.08; letter-spacing: -.005em; margin: 0; }
.home-section__more { margin-top: var(--space-8); display: flex; gap: var(--space-6); flex-wrap: wrap; }

.ds-arrow { font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 500; color: var(--color-accent); text-decoration: none; }
.ds-arrow:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }

/* Contact close */
.home-contact { text-align: left; }
.home-contact .rule--brand { margin-bottom: var(--space-6); }
.home-contact__line { font-family: var(--font-serif); color: var(--color-brand); font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1.15; max-width: 22ch; margin: 0 0 var(--space-6); }

/* --------------------------------------------------------------------------
   11. GARDEN FILTER — center-bottom floating control + stream filtering
   -------------------------------------------------------------------------- */
/* Filter the bitácora in place by the container's data-filter. */
.home-log[data-filter="proyecto"]   .log-row:not([data-type="proyecto"])   { display: none; }
.home-log[data-filter="blog"]       .log-row:not([data-type="blog"])       { display: none; }
.home-log[data-filter="linkodromo"] .log-row:not([data-type="linkodromo"]) { display: none; }
.home-log__empty { font-size: var(--text-sm); color: var(--color-text-muted); padding: var(--space-8) 0; }

/* Floating segmented menu — frosted glass, like the masthead. Revealed in view. */
.garden-filter {
    position: fixed; left: 50%; bottom: clamp(1rem, 3vw, 1.75rem);
    z-index: 60;
    display: flex; gap: .15rem; align-items: center;
    padding: .3rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-bg-primary) 90%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid var(--color-border);
    box-shadow: 0 8px 28px rgba(0,0,0,.12);
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateX(-50%) translateY(10px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.garden-filter.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.garden-filter__btn {
    appearance: none; border: 0; background: transparent; cursor: pointer;
    display: inline-flex; align-items: center; gap: .35rem;
    font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .03em;
    color: var(--color-text-muted);
    padding: .5rem .85rem; min-height: 38px; border-radius: 999px;
    transition: background-color .15s ease, color .15s ease;
}
.garden-filter__btn .mark { color: inherit; font-size: 1em; line-height: 1; }
.garden-filter__btn:hover { color: var(--color-text-primary); }
.garden-filter__btn.is-active { background: var(--color-text-primary); color: var(--color-bg-primary); }
.garden-filter__btn:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .garden-filter { transition: opacity .01ms linear, visibility .01ms linear; transform: translateX(-50%); }
    .garden-filter.is-visible { transform: translateX(-50%); }
}

/* --------------------------------------------------------------------------
   12. DOSSIER (single project) — § head, cover, optional metrics, body.
   Reuses the theme's .project-layout / .entry-content (drop caps, pull-quotes).
   -------------------------------------------------------------------------- */
.dossier .wrap { padding-top: clamp(2rem, 5vw, 3.5rem); padding-bottom: clamp(4rem, 8vw, 6rem); }
.dossier__head { max-width: var(--content-width); margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.dossier__kicker { margin-bottom: 1rem; }
.dossier__kicker .mark { color: var(--color-text-primary); }
.dossier__title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2rem, 4.6vw, 3.3rem); line-height: 1.06; letter-spacing: -.01em; margin: 0; max-width: 20ch; }
.dossier__metaline { margin-top: 1rem; font-size: var(--text-sm); color: var(--color-text-muted); letter-spacing: .01em; }
.dossier__chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem; }
.dossier__cover { margin: clamp(1.5rem, 4vw, 2.5rem) 0 0; border-radius: 10px; overflow: hidden; background: var(--color-bg-secondary); }
.dossier__cover img { display: block; width: 100%; height: auto; }
.dossier__metrics { margin-top: clamp(1.5rem, 4vw, 2.5rem); padding: clamp(1.25rem, 3vw, 1.75rem) 0; border-top: 1px solid var(--color-text-primary); border-bottom: 1px solid var(--color-border); }
.dossier__layout { margin-top: clamp(2rem, 5vw, 3.5rem); }
.dossier__sparse { color: var(--color-text-muted); font-family: var(--font-serif); font-style: italic; font-size: var(--text-lg); }

/* --------------------------------------------------------------------------
   13. MASTHEAD — name + role descriptor (Rachel-Chen style).
   -------------------------------------------------------------------------- */
.header-brand { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.site-role { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .02em; color: var(--color-text-muted); }
.site-role::before { content: "— "; color: var(--color-text-caption); }
@media (max-width: 600px) { .site-role { display: none; } }

/* --------------------------------------------------------------------------
   14. ARCHIVE HEADS — shared by /work and blog.
   -------------------------------------------------------------------------- */
.archive-page .wrap { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(4rem, 8vw, 6.5rem); }
.archive-head { max-width: var(--content-width); margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.archive-head .kicker { margin-bottom: 1rem; }
.archive-head .kicker .mark { color: var(--color-text-primary); }
.archive-title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.02; letter-spacing: -.01em; margin: 0; }
.archive-dek { font-size: var(--text-md); line-height: 1.6; color: var(--color-text-secondary); max-width: 50ch; margin: 1.4rem 0 0; }
.archive-links { display: flex; gap: var(--space-6); margin-top: 1.6rem; flex-wrap: wrap; }
.work-pagination { display: flex; justify-content: space-between; gap: 1rem; margin-top: clamp(2.5rem, 5vw, 4rem); font-family: var(--font-mono); font-size: var(--text-sm); }
.work-pagination a { color: var(--color-text-primary); text-decoration: none; }
.work-pagination a:hover { color: var(--color-accent); opacity: 1; }
.post-kicker { margin-bottom: .8rem; }
.post-kicker .mark { color: var(--color-text-primary); }

/* --------------------------------------------------------------------------
   15. FOOTER — fix pre-existing grid overflow on small screens (no horizontal
   scroll at 390px). Grid items default to min-width:auto and refuse to shrink
   below their content, forcing the 1fr track wider than the container.
   -------------------------------------------------------------------------- */
.footer-inner { min-width: 0; }
.footer-inner > * { min-width: 0; }
.footer-social-grid > * { min-width: 0; }
.social-link { min-width: 0; }
.footer-legal, .footer-trademark, .copyright-text, .footer-links, .social-link .link-text { overflow-wrap: anywhere; }
@media (max-width: 600px) {
    .footer-social-grid { grid-template-columns: 1fr; }
}
