/* ============================================================================
   QuickRankAI ... service-bay inspection theme.

   Light working surface, dark instrument bar, teal accent. Deliberately not
   AISymantix's dark-navy laboratory look ... same portfolio, different room.

   Token values come from config/design-tokens.json, injected into :root by
   templates/layouts/default.php. Never hardcode a hex here that a token
   already carries.
   ========================================================================= */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    padding-top: var(--header-height);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--color-link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--color-link-hover); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-heading);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 0 0.6em;
}

/* Weight 200-300 only reads as intentional at a size that can carry it, so
   every heading level sets its own size explicitly rather than inheriting a
   browser default that makes the thin weight look broken. */
h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 250; }
h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); font-weight: 250; }
h3 { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; }
h4 { font-size: 1.05rem; font-weight: 600; letter-spacing: 0; }

p { margin: 0 0 1.1rem; }

code, pre, .mono { font-family: var(--font-mono); font-size: 0.92em; }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--color-accent);
    color: #fff;
    padding: 0.6rem 1rem;
    z-index: 200;
}
.skip-link:focus { left: 0; }

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

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

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 0.72rem 1.35rem;
    border-radius: var(--radius-small);
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn--primary { background: var(--color-accent); color: #ffffff; }
.btn--primary:hover { background: var(--color-accent-strong); color: #ffffff; }

.btn--ghost {
    background: transparent;
    color: var(--color-accent-strong);
    border-color: var(--color-border-strong);
}
.btn--ghost:hover { border-color: var(--color-accent); color: var(--color-accent-strong); }

.btn--lg { padding: 0.95rem 1.9rem; font-size: 1.05rem; }
.btn--sm { padding: 0.5rem 0.95rem; font-size: 0.85rem; }

.link-arrow {
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
}
.link-arrow::after { content: " \2192"; }

/* ── Section eyebrow ──────────────────────────────────────────────────────── */

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.9rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-accent-strong);
}
.section-eyebrow::before {
    content: "";
    width: 1.9rem;
    height: 1px;
    background: currentColor;
}
.section-eyebrow--light { color: #6fded4; }

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

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--color-bar);
    color: var(--color-inverse);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.site-header__inner {
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.site-brand { display: flex; flex-direction: column; justify-content: center; }

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-inverse);
    text-decoration: none;
}

.site-logo__mark { display: inline-flex; color: var(--color-accent); }

/* An inline-flex parent blockifies its span children, and a blockified inline
   box trims its own trailing whitespace ... so the space between prefix and
   accent has to be a gap, not a text node. */
.site-logo__wordmark {
    display: inline-flex;
    align-items: baseline;
    gap: 0.28em;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 300;
    letter-spacing: -0.02em;
}
.site-logo__prefix { color: inherit; }
.site-logo__accent { color: var(--color-accent); font-weight: 600; }

.site-logo__tagline {
    font-size: 0.68rem;
    font-style: italic;
    letter-spacing: 0.02em;
    color: rgba(238, 244, 243, 0.72);
    margin-left: 2.05rem;
}

/* ── Navigation ───────────────────────────────────────────────────────────── */

.site-nav { margin-left: auto; }

.site-nav__list {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav__item { position: relative; }

.site-nav__item > a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0;
    color: var(--color-inverse);
    font-size: 0.94rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}
.site-nav__item > a:hover,
.site-nav__item > a.is-active { color: var(--color-accent); }

.site-nav__item--cta > a { color: #ffffff; }
.site-nav__item--cta > a:hover { color: #ffffff; }

.nav-chevron {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 0.65;
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 0.55rem);
    left: -0.9rem;
    min-width: 15rem;
    margin: 0;
    padding: 0.5rem 0;
    list-style: none;
    background: var(--color-bar-soft);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-medium);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
}

.site-nav__item--has-dropdown.is-open > .nav-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-dropdown a {
    display: block;
    padding: 0.55rem 1.1rem;
    color: var(--color-inverse);
    font-size: 0.9rem;
    text-decoration: none;
}
.nav-dropdown a:hover { color: var(--color-accent); background: rgba(255, 255, 255, 0.04); }

.nav-hamburger {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-left: auto;
    padding: 0.4rem;
    background: none;
    border: none;
    color: var(--color-inverse);
    cursor: pointer;
}
.nav-hamburger span:not(.nav-hamburger__label) {
    width: 24px;
    height: 2px;
    background: currentColor;
}
.nav-hamburger__label { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.14em; }

/* ── Page shell ───────────────────────────────────────────────────────────── */

.page-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.page-wrapper--full { max-width: none; padding: 0; }

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20rem;
    gap: 3rem;
    align-items: start;
}
.content-layout--single { grid-template-columns: minmax(0, 1fr); }

.is-home .content-layout { gap: 0; }

.breadcrumbs { margin-bottom: 1.5rem; font-size: 0.85rem; }
.breadcrumbs__list { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.breadcrumbs__item + .breadcrumbs__item::before { content: "/"; margin-right: 0.4rem; color: var(--color-text-faint); }
.breadcrumbs__item.is-current span { color: var(--color-text-muted); }
.breadcrumbs a { color: var(--color-text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--color-accent-strong); }

/* ── Home: hero ───────────────────────────────────────────────────────────── */

.hero {
    background: var(--color-bar);
    color: var(--color-inverse);
    padding: 3.5rem 1.5rem 4rem;
    background-image: radial-gradient(circle at 20% 0%, rgba(23, 171, 161, 0.16), transparent 55%);
}

.hero__inner { max-width: 62rem; margin: 0 auto; }

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 1rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #6fded4;
}
.hero__eyebrow::before { content: ""; width: 1.9rem; height: 1px; background: currentColor; }

.hero__headline {
    margin: 0 0 1rem;
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    font-weight: 200;
    color: #ffffff;
}

.hero__sub {
    max-width: 46rem;
    margin: 0 0 2rem;
    font-size: 1.08rem;
    color: var(--color-inverse-muted);
}

/* ── The inspection bay ───────────────────────────────────────────────────── */

.bay {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-large);
    padding: 1.6rem;
    color: var(--color-text);
}

.bay--hero { box-shadow: var(--shadow-bay); border-color: transparent; }

.bay__label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.bay__row { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.bay__input {
    flex: 1 1 22rem;
    min-width: 0;
    padding: 0.85rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-panel-soft);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-small);
}
.bay__input::placeholder { color: var(--color-text-faint); }
.bay__input:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }

.bay__btn {
    flex: 0 0 auto;
    padding: 0.85rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    background: var(--color-accent);
    border: none;
    border-radius: var(--radius-small);
    cursor: pointer;
    transition: background 0.15s;
}
.bay__btn:hover { background: var(--color-accent-strong); }
.bay__btn:disabled { opacity: 0.6; cursor: progress; }

.bay__note { margin: 0.7rem 0 0; font-size: 0.82rem; color: var(--color-text-faint); }

.bay__status {
    margin-top: 1.1rem;
    padding: 0.8rem 1rem;
    font-size: 0.92rem;
    background: var(--color-accent-soft);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius-small);
}
.bay__status--error {
    background: var(--color-structural-soft);
    border-left-color: var(--color-structural);
    color: var(--color-structural);
}

.bay__result { margin-top: 1.75rem; }

.bay__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.5rem;
    padding-bottom: 1.4rem;
    border-bottom: 1px solid var(--color-border);
}

.bay__scorebox { display: flex; align-items: baseline; gap: 0.3rem; }

.bay__score {
    font-family: var(--font-heading);
    font-size: 3.4rem;
    font-weight: 250;
    line-height: 1;
    letter-spacing: -0.03em;
}
.bay__score--good { color: var(--color-pass); }
.bay__score--mid { color: var(--color-quickfix); }
.bay__score--bad { color: var(--color-structural); }

.bay__scoreunit { font-size: 1rem; color: var(--color-text-faint); }

.bay__headmeta { flex: 1 1 18rem; }

.bay__band {
    margin: 0 0 0.3rem;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--color-heading);
}
.bay__summary { margin: 0 0 0.45rem; color: var(--color-text); }
.bay__inspected {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--color-text-faint);
    overflow-wrap: anywhere;
}

.bay__cats { margin: 1.5rem 0 0.5rem; }

.bay__cat {
    display: grid;
    grid-template-columns: 9.5rem 1fr 3rem;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.55rem;
}
.bay__catlabel { font-size: 0.88rem; color: var(--color-text-muted); }
.bay__catpct { font-family: var(--font-mono); font-size: 0.82rem; text-align: right; color: var(--color-text-muted); }

.bay__bar { height: 8px; background: var(--color-panel); border-radius: 4px; overflow: hidden; }
.bay__barfill { display: block; height: 100%; border-radius: 4px; }
.bay__barfill--good { background: var(--color-pass); }
.bay__barfill--mid { background: var(--color-quickfix); }
.bay__barfill--bad { background: var(--color-structural); }

.bay__group { margin-top: 2rem; }

.bay__grouphead {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.3rem;
    font-size: 1.3rem;
    font-weight: 400;
}
.bay__groupcount {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-small);
    background: var(--color-panel);
    color: var(--color-text-muted);
}

.bay__grouplede { margin: 0 0 1rem; font-size: 0.92rem; color: var(--color-text-muted); }

.bay__findings { list-style: none; margin: 0; padding: 0; }

.bay__finding {
    padding: 1rem 1.1rem;
    margin-bottom: 0.7rem;
    background: var(--color-panel-soft);
    border: 1px solid var(--color-border);
    border-left-width: 3px;
    border-radius: var(--radius-small);
}
.bay__finding--quick_fix { border-left-color: var(--color-quickfix); }
.bay__finding--structural { border-left-color: var(--color-structural); }
.bay__finding--investigate { border-left-color: var(--color-investigate); }
.bay__finding--pass { border-left-color: var(--color-pass); }

.bay__findinghead { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; }

.bay__findingtitle { margin: 0; font-size: 1.02rem; font-weight: 600; letter-spacing: 0; }

/* Status label. The symbol never carries the meaning alone ... the word is
   always rendered beside it, so nothing here depends on color or a glyph. */
.bay__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.12rem 0.5rem;
    border-radius: var(--radius-small);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.bay__chip--quick_fix { background: var(--color-quickfix-soft); color: var(--color-quickfix); }
.bay__chip--structural { background: var(--color-structural-soft); color: var(--color-structural); }
.bay__chip--investigate { background: var(--color-investigate-soft); color: var(--color-investigate); }
.bay__chip--pass { background: var(--color-pass-soft); color: var(--color-pass); }
.bay__chipmark { font-size: 0.85rem; line-height: 1; }

.bay__evidence { margin: 0.55rem 0 0; font-size: 0.94rem; overflow-wrap: anywhere; }
.bay__why { margin: 0.4rem 0 0; font-size: 0.9rem; color: var(--color-text-muted); }
.bay__action { margin: 0.55rem 0 0; font-size: 0.92rem; }
.bay__actionlabel { font-weight: 700; color: var(--color-accent-strong); }

.bay__passes { margin-top: 0.4rem; }
.bay__passsummary {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-accent-strong);
    padding: 0.35rem 0;
}
.bay__passes[open] .bay__passsummary { margin-bottom: 0.7rem; }

.bay__next {
    margin-top: 2.2rem;
    padding: 1.5rem;
    background: var(--color-bar);
    color: var(--color-inverse);
    border-radius: var(--radius-medium);
}
.bay__nexthead {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6fded4;
}
.bay__nextline {
    margin: 0 0 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 300;
    color: #ffffff;
}
.bay__nextbody { margin: 0 0 1.1rem; color: var(--color-inverse-muted); font-size: 0.98rem; }

.bay__limits {
    margin: 1.5rem 0 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
}

/* ── Home: bands ──────────────────────────────────────────────────────────── */

.band { padding: 3.5rem 1.5rem; }
.band--surface { background: var(--color-surface); }
.band--dark { background: var(--color-bar); color: var(--color-inverse); }
.band--dark .band__heading { color: #ffffff; }
.band--dark .band__lede { color: var(--color-inverse-muted); }

.band__inner { max-width: var(--max-width); margin: 0 auto; }
.band__inner--narrow { max-width: 46rem; }

.band__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.band__header .band__heading { margin-bottom: 0; }

.band__heading { margin: 0 0 0.9rem; }
.band__lede { max-width: 46rem; margin: 0 0 2rem; font-size: 1.05rem; color: var(--color-text-muted); }
.band__para { margin: 0 0 1.1rem; }
.band__foot { margin: 1.6rem 0 0; }
.band__source { margin: 1.2rem 0 0; font-size: 0.9rem; color: var(--color-text-muted); }

/* Five categories, and five is an awkward number for auto-fit ... left to its
   own devices it lands four across with one orphan underneath. Explicit
   columns instead: 5, then 3, then 1. */
.checkgrid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.checkgrid__item {
    padding: 1.4rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-accent);
    border-radius: var(--radius-medium);
}
.checkgrid__title { margin: 0 0 0.5rem; font-size: 1.1rem; font-weight: 600; }
.checkgrid__body { margin: 0; font-size: 0.94rem; color: var(--color-text-muted); }

.tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 1.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.tiers__card {
    position: relative;
    padding: 1.6rem;
    background: var(--color-bar-soft);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-medium);
}
.tiers__step {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    margin-bottom: 0.8rem;
    border-radius: var(--radius-small);
    background: rgba(23, 171, 161, 0.18);
    color: #6fded4;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
}
.tiers__title { margin: 0 0 0.35rem; font-size: 1.2rem; font-weight: 600; color: #ffffff; }
.tiers__when {
    margin: 0 0 0.8rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6fded4;
}
.tiers__body { margin: 0 0 1.1rem; font-size: 0.94rem; color: var(--color-inverse-muted); }
.tiers__cta { font-weight: 600; font-size: 0.94rem; color: var(--color-accent); text-decoration: none; }
.tiers__cta::after { content: " \2192"; }
.tiers__cta:hover { color: #6fded4; }

.cardlist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.cardlist__item {
    padding: 1.3rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
}
.cardlist__title { margin: 0 0 0.5rem; font-size: 1.1rem; font-weight: 600; }
.cardlist__title a { text-decoration: none; color: var(--color-heading); }
.cardlist__title a:hover { color: var(--color-accent-strong); }
.cardlist__excerpt { margin: 0; font-size: 0.93rem; color: var(--color-text-muted); }

.termlist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 0.9rem 1.6rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.termlist__item { border-bottom: 1px solid var(--color-border); padding-bottom: 0.7rem; }
.termlist__item a { font-weight: 600; text-decoration: none; }
.termlist__def { display: block; font-size: 0.88rem; color: var(--color-text-muted); }

.closer {
    background: var(--color-accent);
    color: #ffffff;
    padding: 3.5rem 1.5rem;
    text-align: center;
}
.closer__inner { max-width: 46rem; margin: 0 auto; }
.closer__heading { color: #ffffff; font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 250; margin: 0 0 0.8rem; }
.closer__body { margin: 0 0 1.7rem; color: rgba(255, 255, 255, 0.88); }
.closer .btn--primary { background: #ffffff; color: var(--color-accent-strong); }
.closer .btn--primary:hover { background: var(--color-bar); color: #ffffff; }

/* ── Prose / content pages ────────────────────────────────────────────────── */

.prose { max-width: var(--content-width); }
.prose h2 { margin-top: 2.4rem; }
.prose h3 { margin-top: 1.8rem; }
.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.3rem; }
.prose li { margin-bottom: 0.5rem; }
.prose blockquote {
    margin: 1.6rem 0;
    padding: 0.4rem 0 0.4rem 1.2rem;
    border-left: 3px solid var(--color-accent);
    color: var(--color-text-muted);
    font-size: 1.05rem;
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.94rem;
}
.prose th, .prose td {
    text-align: left;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}
.prose th { background: var(--color-surface); font-weight: 600; }
.prose__lede { font-size: 1.18rem; color: var(--color-text-muted); }

.prose .callout {
    margin: 1.8rem 0;
    padding: 1.2rem 1.3rem;
    background: var(--color-accent-soft);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius-small);
}
.prose .callout p:last-child { margin-bottom: 0; }

/* ── Glossary / FAQ / Directory ───────────────────────────────────────────── */

.glossary-index, .faq-index, .directory-root, .directory-category,
.directory-listing, .glossary-term, .faq-item, .case-study, .proof-entry,
.case-study-index, .proof-index { max-width: var(--content-width); }

.glossary-index__letter-group { margin-bottom: 2.2rem; }
.glossary-index__letter-group h2 {
    display: inline-block;
    padding: 0.05rem 0.55rem;
    margin-bottom: 0.9rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-small);
    background: var(--color-panel);
    color: var(--color-text-muted);
}
.glossary-index__list { list-style: none; margin: 0; padding: 0; }
.glossary-index__list > li { padding: 0.7rem 0; border-bottom: 1px solid var(--color-border); }
.glossary-index__list a { font-weight: 600; text-decoration: none; font-size: 1.02rem; }
.glossary-index__short-def { margin: 0.2rem 0 0; font-size: 0.92rem; color: var(--color-text-muted); }

.glossary-term__short-def {
    font-size: 1.2rem;
    line-height: 1.55;
    color: var(--color-text);
    padding-left: 1.1rem;
    border-left: 3px solid var(--color-accent);
}
.glossary-term__meta,
.faq-item__meta,
.directory-listing__meta {
    font-size: 0.85rem;
    color: var(--color-text-faint);
}
.glossary-term__meta span + span { margin-left: 0.4rem; }

.glossary-term__nuance {
    margin-top: 1.6rem;
    padding: 0.2rem 1.3rem 1.1rem;
    background: var(--color-surface);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius-small);
}
.glossary-term__nuance h2 { margin-top: 1.1rem; font-size: 1.15rem; }

.glossary-term__sources ul,
.glossary-term__related ul,
.faq-item__siblings ul,
.directory-listing__siblings ul { list-style: none; padding: 0; }

.glossary-term__related li,
.faq-item__siblings li,
.directory-listing__siblings li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border);
}
.glossary-term__related li a,
.faq-item__siblings li a,
.directory-listing__siblings li a { font-weight: 600; text-decoration: none; }
.glossary-term__related-def,
.directory-listing__sibling-note {
    display: block;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}
.glossary-term__sources li { padding: 0.3rem 0; font-size: 0.94rem; }

.directory-listing__excerpt {
    font-size: 1.15rem;
    line-height: 1.55;
    color: var(--color-text);
    padding-left: 1.1rem;
    border-left: 3px solid var(--color-accent);
}

.glossary-term__cta,
.faq-item__cta,
.directory-listing__cta {
    margin-top: 2.5rem;
    padding: 1.4rem 1.5rem;
    background: var(--color-surface);
    border-radius: var(--radius-medium);
}
.glossary-term__cta h2,
.faq-item__cta h2,
.directory-listing__cta h2 { margin-top: 0; font-size: 1.25rem; }
.glossary-term__cta .link-arrow,
.faq-item__cta .link-arrow,
.directory-listing__cta .link-arrow { margin-left: 0.8rem; }

.faq-index__group { margin-bottom: 2rem; }
.faq-index__list { list-style: none; margin: 0; padding: 0; }
.faq-index__list > li { padding: 0.7rem 0; border-bottom: 1px solid var(--color-border); }
.faq-index__list a { font-weight: 600; text-decoration: none; }
.faq-item__answer { font-size: 1.05rem; }

.directory-root__grid, .directory-listing-grid,
.case-study-index__grid, .proof-index__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.directory-category-card, .directory-listing-card,
.case-study-card, .proof-card {
    display: block;
    padding: 1.3rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.directory-category-card:hover, .directory-listing-card:hover,
.case-study-card:hover, .proof-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-card);
}
.directory-category-card h2, .directory-listing-card h2,
.directory-category-card h3, .directory-listing-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.4rem; }
.directory-category-card p, .directory-listing-card p { margin: 0; font-size: 0.92rem; color: var(--color-text-muted); }

.directory-listing__fields { margin: 1.5rem 0; }
.directory-listing__fields dt { font-weight: 600; font-size: 0.85rem; color: var(--color-text-muted); }
.directory-listing__fields dd { margin: 0 0 0.8rem; }

.directory-category__subcategories, .directory-category__listings { margin-top: 2rem; }

.case-study__section, .proof-entry__section { margin-top: 2rem; }
.case-study__key-takeaway, .proof-entry__outcome {
    margin-top: 1.8rem;
    padding: 1.2rem 1.3rem;
    background: var(--color-accent-soft);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius-small);
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */

.sidebar-block {
    padding: 1.2rem;
    margin-bottom: 1.2rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
}
.sidebar-block__title { margin: 0 0 0.6rem; font-size: 1rem; font-weight: 600; }
.sidebar-block__body { font-size: 0.92rem; color: var(--color-text-muted); }
.sidebar-block__links { list-style: none; margin: 0; padding: 0; font-size: 0.92rem; }
.sidebar-block__links li { margin-bottom: 0.4rem; }
.sidebar-block .cta-btn {
    display: inline-block;
    margin-top: 0.7rem;
    padding: 0.55rem 1rem;
    background: var(--color-accent);
    color: #ffffff;
    border-radius: var(--radius-small);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

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

.article__meta {
    font-size: 0.85rem;
    color: var(--color-text-faint);
    margin-bottom: 1.5rem;
}
.article__excerpt {
    font-size: 1.18rem;
    line-height: 1.6;
    color: var(--color-text-muted);
    padding-left: 1.1rem;
    border-left: 3px solid var(--color-accent);
    margin-bottom: 2rem;
}

/* ── Error page ───────────────────────────────────────────────────────────── */

.error-page { text-align: center; padding: 4rem 0; }
.error-page h1 { font-size: 5rem; font-weight: 200; color: var(--color-text-faint); }

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

.site-footer {
    background: var(--color-bar);
    color: var(--color-inverse-muted);
    padding: 3rem 1.5rem 1.5rem;
    font-size: 0.92rem;
}
.site-footer__inner { max-width: var(--max-width); margin: 0 auto; }

.site-footer__top {
    display: grid;
    grid-template-columns: 1.4fr repeat(4, 1fr);
    gap: 2rem;
    padding-bottom: 2rem;
}

.site-footer__brand-name {
    display: inline-flex;
    align-items: baseline;
    gap: 0.28em;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--color-inverse);
}
.site-footer__tagline { font-style: italic; color: rgba(238, 244, 243, 0.7); margin: 0.35rem 0 1rem; }
.site-footer__cta .btn--ghost { color: #6fded4; border-color: rgba(255, 255, 255, 0.2); }
.site-footer__cta .btn--ghost:hover { border-color: var(--color-accent); color: var(--color-accent); }

.site-footer__col-heading {
    margin-bottom: 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-inverse);
}
.site-footer__links { list-style: none; margin: 0; padding: 0; }
.site-footer__links li { margin-bottom: 0.45rem; }
.site-footer__links a { color: var(--color-inverse-muted); text-decoration: none; }
.site-footer__links a:hover { color: var(--color-accent); }

.site-footer__disclaimer {
    max-width: 58rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.84rem;
    color: rgba(238, 244, 243, 0.55);
}

.site-footer__bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
    color: rgba(238, 244, 243, 0.5);
}
.site-footer__bottom a { color: inherit; text-decoration: none; }
.site-footer__bottom a:hover { color: var(--color-accent); }
.site-footer__protocol { display: inline-flex; flex-wrap: wrap; gap: 1.2rem; }

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .checkgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .content-layout { grid-template-columns: minmax(0, 1fr); }
    .site-footer__top { grid-template-columns: 1fr 1fr 1fr; }
    .site-nav__list { gap: 1.1rem; }
}

@media (max-width: 768px) {
    .checkgrid { grid-template-columns: minmax(0, 1fr); }
    .nav-hamburger { display: flex; }

    /* Fixed overlay panel below the header bar, not an in-header expansion. */
    .site-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
        padding: 1.2rem 1.5rem 3rem;
        background: var(--color-bar);
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }
    .site-nav.is-open { transform: translateX(0); }

    .site-nav__list { flex-direction: column; align-items: stretch; gap: 0.2rem; }
    .site-nav__item > a { padding: 0.7rem 0; font-size: 1.05rem; }
    .site-nav__item--cta { margin-top: 1rem; }
    .nav-chevron { display: none; }

    .nav-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        background: none;
        border: none;
        box-shadow: none;
        padding: 0 0 0.5rem 0.9rem;
    }
    .nav-dropdown a { padding: 0.45rem 0; font-size: 0.95rem; color: var(--color-inverse-muted); }

    .site-logo__tagline { display: none; }

    .hero { padding: 2.5rem 1.1rem 3rem; }
    .band { padding: 2.5rem 1.1rem; }
    .closer { padding: 2.5rem 1.1rem; }
    .page-wrapper { padding: 1.8rem 1.1rem 3rem; }

    .bay { padding: 1.1rem; }
    .bay__row { flex-direction: column; }
    /* flex-basis is the main axis, so the desktop `flex: 1 1 22rem` becomes a
       22rem tall input the moment the row turns into a column. Reset it. */
    .bay__input { flex: 0 0 auto; width: 100%; }
    .bay__btn { width: 100%; }
    .bay__cat { grid-template-columns: 1fr auto; }
    .bay__bar { grid-column: 1 / -1; order: 3; }
    .bay__score { font-size: 2.8rem; }

    /* A footer legible at desktop scale is too small to read or tap on a
       phone, so every string in it roughly doubles here. */
    .site-footer { font-size: 1.15rem; padding: 2.5rem 1.1rem 1.5rem; }
    .site-footer__top { grid-template-columns: 1fr; gap: 2.2rem; }
    .site-footer__brand-name { font-size: 1.9rem; }
    .site-footer__tagline { font-size: 1.15rem; }
    .site-footer__col-heading { font-size: 1.05rem; }
    .site-footer__links { font-size: 1.15rem; }
    .site-footer__links li { margin-bottom: 0.8rem; }
    .site-footer__disclaimer { font-size: 1.02rem; }
    .site-footer__bottom { font-size: 1rem; }
}

/* Index pages: the count and freshness line under the intro. */
.index-meta { font-size: 0.85rem; color: var(--color-text-faint); }
.faq-index__preview { margin: 0.2rem 0 0; font-size: 0.9rem; color: var(--color-text-muted); }
