/* ════════════════════════════════════════════════════════════
   HOME.CSS — homepage only (direction C, "Lab")
   Load after pages.css in templates/index.html.
   Relies on tokens from styles.css (after patch-sober.sh).
   ════════════════════════════════════════════════════════════ */

   :root {
    --home-max: 80rem;           /* 1280px */
    --home-ink: #111214;
    --home-ink-2: #3A3D43;       /* rules on dark lab band */
    --home-on-ink: #E8E9EB;
    --home-on-ink-2: #A3A7AE;
    --home-cv-rule: #C9CDD2;
    --chip-all: var(--home-ink-stroke, var(--home-ink)); /* “All” chip — ink pill (light) */
    /* --home-rule / --home-panel → styles.css :root */

    /* Type tokens → styles.css :root */
}

[data-theme="dark"] {
    --chip-all: var(--home-ink-stroke, var(--c-text-primary));
    --home-cv-rule: var(--c-border);
}

/* Hero shell → styles.css; --home-max for index-only bands below */

/* Band sections: vertical rhythm only; horizontal gutter on <section> */
.home-band {
    margin-inline: 0;
    padding-inline: 0;
}

/* .home-eyebrow / .home-h2 base → styles.css */

.home-link {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--c-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.home-link:hover { color: var(--c-text-primary); }


/* ────────────────────────────────────────
   HERO — homepage specimen (layout → styles.css)
   ──────────────────────────────────────── */

.home-spec {
  flex: 5 1 18rem;
  margin: 0;
  max-width: 28rem;
}

.home-spec-stage {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 1.75rem 1.75rem 4.25rem;
    background: color-mix(in srgb, var(--home-panel) 28%, var(--c-background));
    border: 1px solid color-mix(in srgb, var(--c-border) 20%, transparent);
    backdrop-filter: blur(14px) saturate(1.12);
    -webkit-backdrop-filter: blur(14px) saturate(1.12);
}

.home-spec-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(
        155deg,
        color-mix(in srgb, var(--c-background) 55%, transparent) 0%,
        transparent 42%,
        color-mix(in srgb, var(--home-panel) 18%, transparent) 100%
    );
}

.home-spec-stage > * {
    position: relative;
    z-index: 1;
}

:root[data-theme="light"] .home-spec-stage {
    background: color-mix(in srgb, var(--home-panel) 18%, var(--c-background));
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--c-background) 80%, transparent);
}

[data-theme="dark"] .home-spec-stage {
    background: color-mix(in srgb, var(--home-panel) 42%, var(--c-background));
}

/* Pipeline hero (ip_pipeline_hero.js) */
.home-spec-stage--pipeline {
    padding: 1rem;
    overflow: visible;
}

.home-spec-stage--pipeline .ipx-wrap {
    max-height: none;
    overflow: visible;
}

.home-spec-page {
    background: #fff;
    border: 1px solid var(--home-rule);
    padding: 1.15rem 1.35rem 1.5rem;
}

.home-spec-meta {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--c-text-secondary);
}

.home-spec-lines {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.home-spec-line {
    height: 7px;
    width: var(--w, 90%);
    background: #C9CDD2;
}

.home-spec-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.home-spec-row .home-spec-line:last-child { flex: 1; }

.home-spec-hit {
    position: relative;
    height: 16px;
    width: var(--w, 30%);
    border: 1.5px solid var(--tag, var(--home-ink));
    box-sizing: border-box;
}

.home-spec-hit::before {
    content: attr(data-tag);
    position: absolute;
    top: -17px;
    left: -1.5px;
    padding: 1px 4px;
    font-family: var(--font-mono);
    font-size: 9px;
    line-height: 1.3;
    color: #fff;
    background: var(--tag, var(--home-ink));
}

.home-spec-hit--accent { --tag: var(--c-accent); }

.home-spec-out {
    position: absolute;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 62%;
    background: var(--home-ink);
    color: var(--home-on-ink);
    padding: 1rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.9;
}

.home-spec-out-label {
    font-size: 0.625rem;
    letter-spacing: 0.08em;
    color: var(--home-on-ink-2);
}

.home-spec-out mark { background: none; color: #F0B9BD; }

.home-spec figcaption {
    margin-top: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--c-text-secondary);
}


/* ────────────────────────────────────────
   NOTES / REGISTER
   ──────────────────────────────────────── */

.home-notes {
    background: var(--home-band);
    border-top: 0;
    padding: clamp(3rem, 6vw, 4.5rem) 0 clamp(3.5rem, 6vw, 5rem);
}

.home-notes-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

.home-chips {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.home-chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 0.9rem;
    font-family: inherit;
    font-size: 0.8125rem;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--c-border);
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.home-chip:not(.is-active) {
    background: color-mix(in srgb, var(--chip-thread, var(--c-border)) 11%, var(--c-background));
    color: color-mix(in srgb, var(--chip-thread, var(--c-text-secondary)) var(--hatch-mix-text, 62%), var(--c-text-primary));
    border-color: color-mix(in srgb, var(--chip-thread, var(--c-border)) var(--hatch-mix-border, 52%), var(--c-border));
}

.home-chip:hover:not(.is-active) {
    background: color-mix(in srgb, var(--chip-thread, var(--c-border)) 16%, var(--c-background));
    border-color: color-mix(in srgb, var(--chip-thread, var(--c-border)) 68%, var(--c-border));
    color: color-mix(in srgb, var(--chip-thread, var(--c-text-primary)) 58%, var(--c-text-primary));
}

.home-chip.is-active {
    background: var(--chip-thread, var(--home-ink-stroke, var(--home-ink)));
    border-color: var(--chip-thread, var(--home-ink-stroke, var(--home-ink)));
    color: #fff;
}

[data-theme="dark"] .home-chip.is-active {
    background: var(--chip-thread, var(--chip-all));
    border-color: var(--chip-thread, var(--chip-all));
    color: var(--c-background);
}

.home-notes-foot {
    margin-top: 1.75rem;
    display: flex;
    justify-content: center;
}

.home-register {
    margin-top: 1.25rem;
    overflow-x: auto;
}

.home-register table {
    width: 100%;
    min-width: 38rem;
    border-collapse: collapse;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.home-register thead tr { border-bottom: 1px solid var(--home-ink-stroke, var(--home-ink)); }

.home-register th {
    padding: 0.6rem 1rem 0.6rem 0;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--c-text-secondary);
}

.home-register tbody tr {
    border-bottom: 1px solid var(--home-rule);
    vertical-align: top;
    transition: background-color 0.15s ease;
}

.home-register tbody tr:hover { background: var(--home-panel); }

.home-register td { padding: 1rem 1rem 1rem 0; }
.home-register td:last-child { padding-right: 0; }

.home-register .col-no { width: 4rem; }
.home-register .col-section { width: 8rem; }
.home-register .col-status { width: 7rem; }

.home-register .cell-mono {
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.home-register .cell-no { color: var(--c-text-secondary); }

.home-register .home-thread-link {
    color: color-mix(in srgb, var(--row-thread, var(--c-text-secondary)) var(--hatch-mix-text, 62%), var(--c-text-secondary));
    text-decoration: none;
    font-weight: 500;
    text-transform: uppercase;
}

.home-register .home-thread-link:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.home-register .cell-title a {
    font-weight: 500;
    color: var(--c-text-primary);
    text-decoration: none;
}

.home-register .cell-title a:hover { color: var(--c-accent); }

.home-register .cell-summary {
    margin-top: 0.2rem;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--c-text-secondary);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}


/* ────────────────────────────────────────
   LAB — dark band
   ──────────────────────────────────────── */

.home-lab {
    background: var(--home-ink);
    color: var(--home-on-ink);
    padding-block: clamp(3.5rem, 7vw, 5rem);
}

.home-lab-inner {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Same header row pattern as .home-notes-head */
.home-lab-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem 2rem;
}

.home-lab .home-eyebrow {
    color: var(--home-on-ink-2);
}

.home-lab .home-h2 {
    color: #fff;
    max-width: 40rem;
}

.home-lab-intro {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--home-on-ink-2);
    max-width: 28rem;
}

.home-lab-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    border-top: 1px solid var(--home-ink-2);
}

.home-lab-cell {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.35rem 1.25rem;
    border-right: 1px solid var(--home-ink-2);
    color: var(--home-on-ink);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.home-lab-cell:first-child { padding-left: 0; }
.home-lab-cell:last-child { padding-right: 0; border-right: 0; }
.home-lab-cell:hover { color: var(--home-on-ink); background: #1B1C1F; }

.home-lab-num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--home-on-ink-2);
}

.home-lab-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
}

.home-lab-note {
    flex: 1 1 auto;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--home-on-ink-2);
}

.home-lab-link {
    margin-top: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--c-accent);
}

.home-lab-cell:hover .home-lab-link {
    color: #fff;
}


/* ────────────────────────────────────────
   BACKGROUND
   ──────────────────────────────────────── */

.home-bg {
    background: var(--home-panel);
    padding-block: clamp(3.5rem, 7vw, 5rem);
}

.home-bg-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem 5rem;
}

.home-bg-copy { flex: 6 1 28rem; }

.home-bg-quote,
#arc-heading {
    margin: 0.75rem 0 0;
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: var(--home-t-lead);
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--c-text-primary);
}

.home-bg-text {
    margin: 2rem 0 1.25rem;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--c-text-body);
    max-width: 37.5rem;
}

.home-cv {
    flex: 4 1 18rem;
    align-self: flex-end;
    margin: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    font-size: 0.9375rem;
    line-height: 1.45;
    border-top: 1px solid var(--home-ink-stroke, var(--home-ink));
}

.home-cv dt,
.home-cv dd {
    margin: 0;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--home-cv-rule);
}

.home-cv dt {
    padding-right: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--c-text-secondary);
}


/* ────────────────────────────────────────
   LOGOS — static grid, no carousel
   ──────────────────────────────────────── */

.home-logos {
    padding-block: clamp(1.25rem, 3vw, 2rem) clamp(1.75rem, 4vw, 2.5rem);
}

.home-logos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    border-left: 1px solid var(--home-rule);
    border-top: 1px solid var(--home-rule);
}

.home-logo {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: none;
    border-right: 1px solid var(--home-rule);
    border-bottom: 1px solid var(--home-rule);
}

.home-logo img {
    max-height: 80px;
    width: auto;
    object-fit: contain;
    filter: none;
    opacity: 1;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

[data-theme="dark"] .home-logo img {
    filter: invert(1);
    opacity: 0.88;
}


/* ── Endorsements marquee: styles.css (.endorse-*); home section shell only ── */

.home-endorse {
    overflow-x: clip;
    border-top: 0;
    padding-block: clamp(2.5rem, 5vw, 3.5rem);
}

/* Contact CTA → styles.css (.home-contact-*) */

/* ────────────────────────────────────────
   RESPONSIVE — index-only bands
   ──────────────────────────────────────── */

@media (max-width: 760px) {
    .home-hero > .home-wrap {
        flex-direction: column;
        align-items: center;
        gap: 2.5rem;
        text-align: center;
    }

    .home-hero-copy {
        flex: 1 1 auto;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .home-hero-cta {
        justify-content: center;
        width: 100%;
    }

    .home-hero .home-spec {
        flex: 1 1 auto;
        width: 100%;
        max-width: min(28rem, 100%);
        margin-inline: auto;
    }

    .home-lab-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-lab-grid {
        flex-direction: column;
        border-top: 0;
    }

    .home-lab-cell,
    .home-lab-cell:first-child,
    .home-lab-cell:last-child {
        flex: 1 1 auto;
        padding: 1.35rem 0;
        border-right: 0;
        border-bottom: 1px solid var(--home-ink-2);
    }

    .home-lab-cell:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 480px) {
    .home-spec-stage { padding: 1.5rem 1.5rem 1rem; }

    .home-spec-out {
        position: static;
        width: auto;
        margin-top: 1rem;
    }
}