/* layer2.wiki — isometric technical docs
   Palette:
     --bg        #fafbfc  primary background
     --surface   #f0f3f7  module / code background
     --l1        #6366f1  Layer 1 indigo
     --l2        #06b6d4  Layer 2 cyan
     --apps      #8b5cf6  application purple
     --text      #1e293b  body text
     --border    #e1e5ea  module edges
     --muted     #94a3b8  secondary text
*/

:root {
    --bg: #fafbfc;
    --surface: #f0f3f7;
    --l1: #6366f1;
    --l2: #06b6d4;
    --apps: #8b5cf6;
    --text: #1e293b;
    --border: #e1e5ea;
    --muted: #94a3b8;

    --display: 'Outfit', 'Inter', system-ui, sans-serif;
    --body: 'Inter', system-ui, sans-serif;
    --mono: 'Inconsolata', ui-monospace, 'SF Mono', Menlo, monospace;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 14px;
    --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 30px rgba(15, 23, 42, 0.04);

    --max-w: 1200px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--body);
    color: var(--text);
    background: var(--bg);
    font-size: 0.95rem;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    min-height: 100vh;
}

/* Isometric grid background — repeating-linear-gradient at +30 / -30 */
.iso-grid-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        repeating-linear-gradient( 30deg, rgba(225, 229, 234, 0.55) 0 1px, transparent 1px 64px),
        repeating-linear-gradient(-30deg, rgba(225, 229, 234, 0.55) 0 1px, transparent 1px 64px),
        var(--bg);
    opacity: 0.7;
}

a {
    color: var(--l2);
    text-decoration: none;
    transition: color 160ms ease;
}

a:hover {
    color: var(--l1);
}

code, kbd {
    font-family: var(--mono);
    font-size: 0.85em;
    background: var(--surface);
    padding: 0.1em 0.4em;
    border-radius: 4px;
    border: 1px solid var(--border);
    color: var(--text);
}

/* ============================ Header ============================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(250, 251, 252, 0.85);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
}

.brand-mark {
    width: 32px;
    height: 32px;
}

.brand-name {
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    color: var(--text);
}

.brand-name::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--l2);
    margin-left: 0.4em;
    vertical-align: 0.2em;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.18);
}

.header-nav {
    display: flex;
    gap: 1.5rem;
    justify-self: center;
    font-family: var(--display);
    font-weight: 500;
    font-size: 0.92rem;
}

.header-nav a {
    color: var(--text);
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 160ms ease, color 160ms ease;
}

.header-nav a:hover {
    color: var(--l2);
    border-bottom-color: var(--l2);
}

.header-search {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    color: var(--muted);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.header-search:focus-within {
    border-color: var(--l2);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.12);
}

.search-icon {
    width: 14px;
    height: 14px;
    color: var(--muted);
}

#searchInput {
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-family: var(--body);
    font-size: 0.9rem;
    width: 220px;
}

#searchInput::placeholder {
    color: var(--muted);
}

.header-search kbd {
    font-family: var(--mono);
    font-size: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.05em 0.4em;
    color: var(--muted);
}

/* ====================== Layer Navigator ====================== */
.layer-navigator {
    position: sticky;
    top: 65px;
    z-index: 40;
    background: rgba(250, 251, 252, 0.92);
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    border-bottom: 1px solid var(--border);
}

.layer-nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0;
}

.layer-tab {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    padding: 0.85rem 1.4rem;
    font-family: var(--display);
    font-weight: 500;
    font-size: 0.92rem;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 160ms ease, border-color 160ms ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.005em;
}

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

.layer-tab.active {
    color: var(--l2);
    border-bottom-color: var(--l2);
}

.tab-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--muted);
    display: inline-block;
}

.tab-dot.l1 { background: var(--l1); }
.tab-dot.l2 { background: var(--l2); }
.tab-dot.apps { background: var(--apps); }
.tab-dot.all {
    background: linear-gradient(135deg, var(--l1), var(--l2), var(--apps));
}

.tab-count {
    font-family: var(--mono);
    font-size: 0.72rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.05em 0.55em;
    color: var(--muted);
    min-width: 24px;
    text-align: center;
}

.layer-tab.active .tab-count {
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.3);
    color: var(--l2);
}

.nav-meta {
    margin-left: auto;
    display: flex;
    gap: 0.85rem;
    align-items: center;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.78rem;
}

.nav-meta strong {
    color: var(--text);
    font-weight: 600;
}

.meta-divider {
    width: 1px;
    height: 14px;
    background: var(--border);
    display: inline-block;
}

/* ============================ Hero ============================ */
.hero {
    padding: 4rem 1.5rem 3rem;
}

.hero-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
}

.hero-eyebrow {
    margin: 0 0 1.25rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.eyebrow-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--l2);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.18); }
    50%      { box-shadow: 0 0 0 8px rgba(6, 182, 212, 0.04); }
}

.hero-title {
    margin: 0 0 1rem;
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text);
}

.title-accent {
    color: var(--l2);
    position: relative;
    white-space: nowrap;
}

.title-accent::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.05em;
    height: 0.18em;
    background: rgba(6, 182, 212, 0.18);
    border-radius: 2px;
    z-index: -1;
}

.hero-lede {
    margin: 0 0 1.75rem;
    color: var(--text);
    opacity: 0.78;
    font-size: 1.05rem;
    max-width: 36rem;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: var(--display);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
}

.btn-primary:hover {
    background: var(--l2);
    color: var(--bg);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-ghost:hover {
    border-color: var(--l2);
    color: var(--l2);
    transform: translateY(-1px);
}

.arrow {
    display: inline-block;
    transition: transform 200ms ease;
}

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

.hero-bullets {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.hero-bullets li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text);
}

.bullet-tag {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 0.1em 0.55em;
    border-radius: 999px;
    color: var(--bg);
}

.bullet-tag.l1 { background: var(--l1); }
.bullet-tag.l2 { background: var(--l2); }
.bullet-tag.apps { background: var(--apps); }

/* Hero stack illustration */
.hero-stack {
    margin: 0;
    padding: 1.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.hero-stack::before {
    content: 'fig.01 — isometric stack diagram';
    position: absolute;
    top: 0.85rem;
    left: 1.25rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.iso-svg {
    width: 100%;
    height: auto;
    display: block;
    margin-top: 1.5rem;
}

.iso-label {
    font-family: var(--display);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: -0.01em;
}

.iso-sublabel {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.iso-layer {
    cursor: pointer;
    transition: transform 280ms cubic-bezier(.2,.7,.3,1), filter 200ms ease, opacity 200ms ease;
    transform-origin: center;
    transform-box: fill-box;
}

.iso-layer:hover {
    transform: translateY(-4px);
    filter: drop-shadow(0 6px 12px rgba(15, 23, 42, 0.12));
}

.iso-layer.dim {
    opacity: 0.25;
}

.iso-layer.highlight {
    filter: drop-shadow(0 8px 18px rgba(6, 182, 212, 0.25));
}

.pulse {
    transform-origin: center;
    transform-box: fill-box;
    animation: dotPulse 2.6s ease-in-out infinite;
}

.pulse-2 { animation-delay: 0.4s; }
.pulse-3 { animation-delay: 0.9s; }

@keyframes dotPulse {
    0%, 100% { opacity: 1; r: 3; }
    50%      { opacity: 0.35; r: 5; }
}

.diagram-key {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
}

.key-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.key-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    transform: skewY(-15deg);
}

.key-swatch.l1 { background: var(--l1); opacity: 0.85; }
.key-swatch.l2 { background: var(--l2); opacity: 0.85; }
.key-swatch.apps { background: var(--apps); opacity: 0.85; }

/* ===================== Section heads / shared ===================== */
section {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.section-eyebrow {
    margin: 0 0 0.4rem;
    font-family: var(--mono);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
}

.section-title {
    margin: 0;
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--text);
}

.section-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

/* ===================== Modules grid ===================== */
.filter-row {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.filter-label {
    font-family: var(--mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-right: 0.25rem;
}

.type-filter {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-family: var(--display);
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--muted);
    cursor: pointer;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.type-filter:hover {
    color: var(--text);
    border-color: var(--muted);
}

.type-filter.active {
    color: var(--l2);
    border-color: var(--l2);
    background: rgba(6, 182, 212, 0.08);
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.module {
    position: relative;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
    overflow: hidden;
}

.module::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1.5rem;
    bottom: 1.5rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--border);
    transition: background 200ms ease;
}

.module[data-layer="l1"]::before  { background: var(--l1); }
.module[data-layer="l2"]::before  { background: var(--l2); }
.module[data-layer="apps"]::before{ background: var(--apps); }

.module:hover {
    transform: translateY(-2px);
    border-color: var(--muted);
    box-shadow: var(--shadow-soft);
}

.module.dim {
    opacity: 0.32;
    transform: scale(0.99);
    filter: saturate(0.6);
}

.module-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

/* Pill-shaped type badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 100px;
    padding: 0.2em 0.8em;
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--border);
}

.badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.7;
}

.badge-article  { color: var(--l1);  border-color: rgba(99, 102, 241, 0.3);  background: rgba(99, 102, 241, 0.06); }
.badge-diagram  { color: var(--l2);  border-color: rgba(6, 182, 212, 0.3);   background: rgba(6, 182, 212, 0.06); }
.badge-glossary { color: var(--muted); }
.badge-tutorial { color: var(--apps); border-color: rgba(139, 92, 246, 0.3); background: rgba(139, 92, 246, 0.06); }

.layer-tag {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    padding: 0.15em 0.55em;
    border-radius: 4px;
    color: var(--bg);
    text-transform: uppercase;
}

.layer-tag.l1   { background: var(--l1); }
.layer-tag.l2   { background: var(--l2); }
.layer-tag.apps { background: var(--apps); }

.module-title {
    margin: 0;
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.18rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--text);
}

.module-excerpt {
    margin: 0;
    color: var(--text);
    opacity: 0.78;
    font-size: 0.92rem;
    line-height: 1.7;
}

.module-points,
.module-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.88rem;
}

.module-points li {
    position: relative;
    padding-left: 1.25rem;
    color: var(--text);
    opacity: 0.85;
}

.module-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 8px;
    height: 8px;
    background: var(--l2);
    opacity: 0.6;
    transform: skewY(-20deg);
}

.module-steps {
    counter-reset: step;
}

.module-steps li {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    color: var(--text);
    opacity: 0.85;
}

.step-num {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--apps);
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 4px;
    padding: 0.05em 0.45em;
    letter-spacing: 0.04em;
}

.module-defs {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    font-size: 0.85rem;
}

.module-defs > div {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
}

.module-defs dt {
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin: 0;
}

.module-defs dd {
    margin: 0;
    color: var(--text);
    opacity: 0.85;
}

.module-footer {
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--mono);
    font-size: 0.76rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.module-read {
    color: var(--l2);
    transition: transform 200ms ease;
}

.module:hover .module-read {
    transform: translateX(3px);
}

.module-diagram .mini-iso {
    width: 100%;
    height: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}

.mini-label {
    font-family: var(--display);
    font-weight: 600;
    font-size: 11px;
    fill: var(--text);
}

.mini-tag {
    font-family: var(--mono);
    font-size: 9px;
    fill: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ===================== Protocol table ===================== */
.protocol-table {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg);
}

.protocol-row {
    display: grid;
    grid-template-columns: 1.4fr 0.7fr 1.1fr 1.4fr 0.9fr;
    align-items: center;
    padding: 0.85rem 1.25rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
    transition: background 160ms ease;
}

.protocol-row:last-child {
    border-bottom: 0;
}

.protocol-row:not(.protocol-head):hover {
    background: rgba(6, 182, 212, 0.04);
}

.protocol-head {
    background: var(--surface);
    font-family: var(--mono);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.protocol-row.dim {
    opacity: 0.25;
}

.proto-name {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--display);
    font-weight: 500;
    color: var(--text);
}

.proto-mark {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    transform: skewY(-15deg);
    border: 1px solid currentColor;
}

.proto-mark.l1   { background: rgba(99, 102, 241, 0.25);  color: var(--l1); }
.proto-mark.l2   { background: rgba(6, 182, 212, 0.25);   color: var(--l2); }
.proto-mark.apps { background: rgba(139, 92, 246, 0.25);  color: var(--apps); }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--mono);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.2em 0.7em;
    border-radius: 999px;
    background: rgba(6, 182, 212, 0.08);
    color: var(--l2);
    border: 1px solid rgba(6, 182, 212, 0.25);
}

.status-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--l2);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

/* ===================== Glossary ===================== */
.glossary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.glossary-term {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    color: var(--text);
    transition: border-color 200ms ease, transform 200ms ease;
}

.glossary-term:hover {
    border-color: var(--l2);
    transform: translateY(-1px);
}

.term-letter {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--display);
    font-weight: 600;
    color: var(--l2);
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: var(--radius-sm);
    transform: skewY(-15deg);
}

.term-letter > * {
    transform: skewY(15deg);
}

.glossary-term > div {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.glossary-term strong {
    font-family: var(--display);
    font-weight: 600;
    font-size: 0.92rem;
}

.glossary-term span {
    font-size: 0.78rem;
    color: var(--muted);
}

/* ===================== Contribute ===================== */
.contribute-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 2rem;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.contribute-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient( 30deg, rgba(6, 182, 212, 0.04) 0 1px, transparent 1px 32px),
        repeating-linear-gradient(-30deg, rgba(99, 102, 241, 0.04) 0 1px, transparent 1px 32px);
    pointer-events: none;
}

.contribute-text {
    position: relative;
}

.contribute-title {
    margin: 0 0 0.85rem;
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--text);
}

.contribute-lede {
    margin: 0 0 1.5rem;
    color: var(--text);
    opacity: 0.78;
    font-size: 0.95rem;
    max-width: 36rem;
}

.contribute-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.contribute-stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
}

.stat {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-num {
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.75rem;
    color: var(--l2);
    letter-spacing: -0.015em;
}

.stat-label {
    font-family: var(--mono);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

/* ===================== Footer ===================== */
.site-footer {
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 3rem 1.5rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2.5rem;
}

.footer-brand .brand-name {
    font-size: 1.05rem;
}

.footer-blurb {
    margin: 0.5rem 0 0;
    color: var(--muted);
    font-size: 0.85rem;
    max-width: 22rem;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.footer-cols h4 {
    margin: 0 0 0.75rem;
    font-family: var(--mono);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    font-weight: 500;
}

.footer-cols a {
    display: block;
    color: var(--text);
    font-size: 0.9rem;
    padding: 0.2rem 0;
    border-bottom: 1px solid transparent;
    transition: color 160ms ease, border-color 160ms ease;
    width: fit-content;
}

.footer-cols a:hover {
    color: var(--l2);
    border-bottom-color: var(--l2);
}

.footer-meta {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

/* ===================== Responsive ===================== */
@media (max-width: 980px) {
    .header-inner {
        grid-template-columns: auto 1fr auto;
        gap: 1rem;
    }

    .header-nav {
        display: none;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .glossary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contribute-card {
        grid-template-columns: 1fr;
    }

    .protocol-row {
        grid-template-columns: 1.2fr 0.6fr 1fr 1.2fr 0.8fr;
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 720px) {
    .layer-nav-inner {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .layer-nav-inner::-webkit-scrollbar {
        display: none;
    }

    .layer-tab {
        padding: 0.7rem 1rem;
        flex-shrink: 0;
        font-size: 0.86rem;
    }

    .nav-meta {
        display: none;
    }

    #searchInput {
        width: 120px;
    }

    .hero-bullets {
        grid-template-columns: 1fr;
    }

    .protocol-head {
        display: none;
    }

    .protocol-row:not(.protocol-head) {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: auto;
        gap: 0.4rem 0.85rem;
        align-items: start;
    }

    .protocol-row .proto-name {
        grid-column: 1 / -1;
        font-size: 1rem;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-cols {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-meta {
        flex-direction: column;
        gap: 0.4rem;
    }

    .glossary-grid {
        grid-template-columns: 1fr;
    }

    .contribute-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Hero stack collapses to flat stacked-bar on mobile */
    .hero-stack .iso-svg .iso-arrows,
    .hero-stack .iso-svg .iso-pulses {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2.5rem 1rem 2rem;
    }

    section {
        padding: 2.25rem 1rem;
    }

    .header-inner {
        padding: 0.75rem 1rem;
    }

    .filter-row {
        gap: 0.35rem;
    }

    .type-filter {
        padding: 0.3rem 0.7rem;
        font-size: 0.78rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary,
    .btn-ghost {
        justify-content: center;
    }
}
