/* Mexzungu site shell v1: the one header and footer every Mexzungu site wears.
   Served from /shell/v1/ on mexzungu.com, olc.mexzungu.com and aistudio.mexzungu.com;
   misfit.mexzungu.com carries a copy that the stamp script keeps in sync.
   Markup is stamped into each page by scripts/stamp_shell.py; never hand-edit it in a page.
   Spec: janis-brain life/areas/mexzungu/brand-guidelines.md, Website Shell.
   Everything is scoped under .mzs-head and .mzs-foot, and resets the bare nav and
   footer rules the host stylesheets carry, so the shell looks the same on every site. */

/* The shell declares its own brand font faces so the header and footer render in RocknRoll One, Space Grotesk
   and Rock Salt whatever the page loads. They point at each site's own /fonts/ files (the same URLs /fonts.css uses,
   on every Mexzungu site including misfit), so a page that also loads /fonts.css downloads each file once. */
@font-face { font-family: "MZS RocknRoll One"; font-weight: 400; font-display: swap; src: url("/fonts/rocknroll-one-latin.woff2") format("woff2"); }
@font-face { font-family: "MZS Space Grotesk"; font-weight: 300 700; font-display: swap; src: url("/fonts/space-grotesk-latin.woff2") format("woff2"); }
@font-face { font-family: "MZS Rock Salt"; font-weight: 400; font-display: swap; src: url("/fonts/rock-salt-latin.woff2") format("woff2"); }

.mzs-head, .mzs-foot {
    --mzs-black: #0D0D0D;
    --mzs-raised: #14141C;
    --mzs-line: #24242E;
    --mzs-white: #FAFAFA;
    --mzs-mist: #9A8F88;
    --mzs-soft: #E8E3DF;
    --mzs-pink: #E14B87;
    --mzs-pink-light: #E86FA0;
    --mzs-pink-dark: #B83A6B;
    --mzs-gold: #D4A039;
    --mzs-unit: var(--mzs-pink-light);
    --mzs-display: "MZS RocknRoll One", "RocknRoll One", "Arial Black", system-ui, sans-serif;
    --mzs-sans: "MZS Space Grotesk", "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mzs-hand: "MZS Rock Salt", "Rock Salt", "Comic Sans MS", cursive;
    --mzs-ease: cubic-bezier(0.23, 1, 0.32, 1);
    --mzs-fam-h: 32px;
    --mzs-bar-h: 68px;
    --mzs-leo-h: 14px;
    font-family: var(--mzs-sans);
    color: var(--mzs-white);
    -webkit-font-smoothing: antialiased;
    text-align: left;
    box-sizing: border-box;
}
.mzs-head *, .mzs-foot *,
.mzs-head *::before, .mzs-foot *::before,
.mzs-head *::after, .mzs-foot *::after { box-sizing: border-box; }
.mzs-head[data-unit="outlaw-studio"], .mzs-foot[data-unit="outlaw-studio"] { --mzs-unit: var(--mzs-gold); }
.mzs-head[data-unit="ai-studio"], .mzs-foot[data-unit="ai-studio"] { --mzs-unit: var(--mzs-pink-light); }
.mzs-head[data-unit="misfit-lab"], .mzs-foot[data-unit="misfit-lab"] { --mzs-unit: var(--mzs-gold); }

.mzs-in {
    max-width: 1240px;
    margin: 0 auto;
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
}
/* Host sites style bare links (misfit.mexzungu.com underlines every a with a border); reset them here. */
.mzs-head a, .mzs-foot a { text-decoration: none; border-bottom: 0; padding-bottom: 0; background-image: none; }
.mzs-head ul, .mzs-foot ul { list-style: none; margin: 0; padding: 0; }
.mzs-head a:focus-visible, .mzs-foot a:focus-visible, .mzs-head button:focus-visible {
    outline: 2px solid var(--mzs-gold);
    outline-offset: 3px;
    border-radius: 4px;
}

/* In-page anchors land below the stuck bar. */
html { scroll-padding-top: 96px; }

/* ---------- Header ---------- */
/* Sticky with a negative top: the family bar scrolls away, the main bar stays. */
header.mzs-head {
    position: sticky;
    top: calc(-1 * var(--mzs-fam-h));
    z-index: 1000;
    width: 100%;
    margin: 0;
    padding: 0;
    background: var(--mzs-black);
    border: 0;
}
.mzs-fam {
    height: var(--mzs-fam-h);
    background: var(--mzs-black);
    border-bottom: 1px solid var(--mzs-line);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.mzs-fam .mzs-in {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 18px;
    padding-top: 4px;
    padding-bottom: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    white-space: nowrap;
}
.mzs-fam .mzs-in::-webkit-scrollbar { display: none; }
.mzs-fam-k { color: var(--mzs-white); font-weight: 700; }
.mzs-head .mzs-fam a {
    color: var(--mzs-mist);
    padding-block: 3px;
    border-bottom: 2px solid transparent;
}
.mzs-head .mzs-fam a[aria-current] { color: var(--mzs-white); border-bottom-color: var(--mzs-unit); }
.mzs-fam-side { margin-left: auto; display: flex; gap: 18px; }
/* Live link: the Chronicles clock. The dot pulses with transform and opacity only. */
.mzs-head .mzs-fam a.mzs-live { display: inline-flex; align-items: center; gap: 8px; color: var(--mzs-white); }
.mzs-next { color: var(--mzs-mist); font-variant-numeric: tabular-nums; }
.mzs-dot { position: relative; width: 6px; height: 6px; border-radius: 50%; background: var(--mzs-pink-light); flex: none; }
.mzs-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--mzs-pink-light); animation: mzs-pulse 2.4s var(--mzs-ease) infinite; }
@keyframes mzs-pulse { from { transform: scale(1); opacity: 0.7; } to { transform: scale(3.2); opacity: 0; } }

/* AI Studio only: a faint dot grid behind the main bar, the AI unit's texture. */
.mzs-head[data-unit="ai-studio"] .mzs-bar {
    background-image: radial-gradient(rgba(250, 250, 250, 0.13) 1px, transparent 1.2px);
    background-size: 14px 14px;
    background-position: 7px 7px;
}
@media (max-width: 640px) {
    .mzs-fam-side { display: none; }
    .mzs-fam .mzs-in { gap: 14px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
}
@media (hover: hover) { .mzs-head .mzs-fam a:hover { color: var(--mzs-white); } }

.mzs-bar { background: var(--mzs-black); }
.mzs-bar .mzs-in {
    height: var(--mzs-bar-h);
    display: flex;
    align-items: center;
    gap: 28px;
}
.mzs-brand { display: flex; align-items: center; gap: 12px; flex: none; color: var(--mzs-white); }
.mzs-brand img { width: 38px; height: 38px; display: block; }
.mzs-word {
    font-family: var(--mzs-display);
    font-weight: 400;
    font-size: 19px;
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--mzs-white);
}
.mzs-word small {
    display: block;
    margin-top: 5px;
    font-family: var(--mzs-sans);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--mzs-unit);
}

/* Reset the host sites' bare nav rules (mexzungu.com sets nav { position: fixed }). */
.mzs-head nav.mzs-nav {
    position: static;
    width: auto;
    padding: 0;
    background: none;
    backdrop-filter: none;
    border: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 28px;
}
.mzs-nav ul { display: flex; align-items: center; gap: 26px; }
.mzs-nav ul a {
    position: relative;
    display: inline-block;
    padding-block: 6px;
    font-family: var(--mzs-sans);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mzs-soft);
}
/* Underline draws in from the left on hover and marks the current page. */
.mzs-nav ul a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--mzs-pink);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 200ms var(--mzs-ease);
}
.mzs-nav ul a[aria-current] { color: var(--mzs-white); }
.mzs-nav ul a[aria-current]::after { transform: scaleX(1); }
@media (hover: hover) {
    .mzs-nav ul a:hover { color: var(--mzs-white); }
    .mzs-nav ul a:hover::after { transform: scaleX(1); }
}

.mzs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 20px;
    border-radius: 6px;
    border: 0;
    background: var(--mzs-pink-dark);
    color: #FFFFFF;
    font-family: var(--mzs-sans);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    transition: transform 160ms var(--mzs-ease);
}
.mzs-head a.mzs-btn, .mzs-foot a.mzs-btn { color: #FFFFFF; }
.mzs-btn:active { transform: scale(0.97); }
@media (hover: hover) {
    .mzs-btn:hover { box-shadow: 0 0 0 1px var(--mzs-gold), 0 0 22px rgba(225, 75, 135, 0.55); }
}

.mzs-lang { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; color: var(--mzs-mist); }
.mzs-head a.mzs-lang { color: var(--mzs-mist); }
@media (hover: hover) { .mzs-head a.mzs-lang:hover { color: var(--mzs-white); } }

.mzs-leo {
    height: var(--mzs-leo-h);
    background-color: var(--mzs-pink);
    background-image: url("img/leopard-band.svg"); /* relative to this file, so it also loads on misfit.mexzungu.com */
    background-repeat: repeat-x;
    background-size: auto 100%;
}

/* Menu button, phones only */
.mzs-burger {
    display: none;
    margin-left: auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--mzs-line);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    position: relative;
}
.mzs-burger:active { transform: scale(0.97); }
.mzs-burger { transition: transform 160ms var(--mzs-ease); }
.mzs-burger span {
    position: absolute;
    left: 12px; right: 12px;
    height: 2px;
    background: var(--mzs-white);
    transition: transform 220ms var(--mzs-ease), opacity 160ms var(--mzs-ease);
}
.mzs-burger span:nth-child(1) { top: 16px; }
.mzs-burger span:nth-child(2) { top: 25px; }
.mzs-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.mzs-burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4.5px) rotate(-45deg); }

@media (max-width: 900px) {
    .mzs-bar .mzs-in { gap: 12px; }
    .mzs-burger { display: block; }
    .mzs-head nav.mzs-nav {
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        margin: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        padding: 20px max(20px, env(safe-area-inset-right, 0px)) 28px max(20px, env(safe-area-inset-left, 0px));
        background: var(--mzs-black);
        border-bottom: 1px solid var(--mzs-line);
        visibility: hidden;
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity 200ms var(--mzs-ease), transform 220ms var(--mzs-ease), visibility 0s linear 220ms;
        max-height: calc(100svh - var(--mzs-bar-h) - var(--mzs-leo-h));
        overflow-y: auto;
    }
    .mzs-head.mzs-open nav.mzs-nav {
        visibility: visible;
        opacity: 1;
        transform: none;
        transition: opacity 200ms var(--mzs-ease), transform 220ms var(--mzs-ease);
    }
    .mzs-nav ul { flex-direction: column; align-items: flex-start; gap: 6px; }
    .mzs-nav ul a { font-size: 15px; padding-block: 8px; }
    .mzs-nav .mzs-btn { align-self: flex-start; }
    .mzs-bar { position: relative; }
}
/* Without scripts the phone menu stays open and the header scrolls with the page, so every link is reachable and nothing is covered.
   shell.js sets html.mzs-js before first paint (it loads in the head), so phones with scripts never see this state. */
@media (max-width: 900px) {
    html:not(.mzs-js) header.mzs-head { position: relative; top: 0; }
    html:not(.mzs-js) .mzs-burger { display: none; }
    html:not(.mzs-js) .mzs-head nav.mzs-nav { position: static; visibility: visible; opacity: 1; transform: none; max-height: none; padding-inline: 0; border: 0; }
    html:not(.mzs-js) .mzs-bar .mzs-in { height: auto; flex-wrap: wrap; padding-block: 12px; }
}

/* ---------- Footer ---------- */
footer.mzs-foot {
    display: block;
    margin: 0;
    padding: 0;
    background: var(--mzs-black);
    color: var(--mzs-soft);
    font-size: 15px;
    line-height: 1.6;
    text-align: left;
    border: 0;
}
.mzs-foot-top {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
    gap: 32px;
    padding-block: 56px 36px;
}
.mzs-badges { display: flex; gap: 12px; flex-wrap: wrap; }
.mzs-badges a { display: block; border-radius: 50%; transition: transform 200ms var(--mzs-ease); }
.mzs-badges img { width: 64px; height: 64px; display: block; }
.mzs-badges a[aria-current] { outline: 2px solid var(--mzs-gold); outline-offset: 3px; }
@media (hover: hover) { .mzs-badges a:hover { transform: translateY(-3px) rotate(-6deg); } }
.mzs-slogan {
    margin: 20px 0 0;
    font-family: var(--mzs-hand);
    font-size: 17px;
    line-height: 1.7;
    color: var(--mzs-gold);
    min-height: 3.4em;
    transition: opacity 140ms ease, transform 200ms var(--mzs-ease);
}
@media (max-width: 360px) { .mzs-slogan { min-height: 5.1em; } }
.mzs-slogan.mzs-swap { opacity: 0; transform: translateY(4px); }
@media (prefers-reduced-motion: reduce) { .mzs-slogan { transition: none; } .mzs-slogan.mzs-swap { transform: none; } }
.mzs-foot .mzs-h {
    margin: 0 0 12px;
    font-family: var(--mzs-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mzs-pink-light);
}
.mzs-foot ul { display: grid; gap: 0; }
.mzs-foot ul a { display: inline-block; padding-block: 10px; line-height: 1.3; color: var(--mzs-soft); }
@media (hover: hover) { .mzs-foot ul a:hover { color: var(--mzs-white); } }
.mzs-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0 18px;
    align-items: center;
    padding-top: 6px;
    padding-bottom: 6px;
    border-top: 1px solid var(--mzs-line);
    font-size: 13px;
    color: var(--mzs-mist);
}
.mzs-legal a { display: inline-block; padding-block: 10px; color: var(--mzs-mist); }
@media (hover: hover) { .mzs-legal a:hover { color: var(--mzs-white); } }
.mzs-foot p.mzs-disclaimer { box-sizing: border-box; width: 100%; max-width: 1240px; margin: 0 auto; padding-top: 0; padding-bottom: 24px; font-size: 12px; color: var(--mzs-mist); }

@media (max-width: 900px) {
    .mzs-foot-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; padding-block: 40px 28px; }
    .mzs-foot-brand { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
    .mzs-head *, .mzs-head *::after, .mzs-foot * { transition: none !important; }
    .mzs-dot::after { animation: none; }
}
@media print {
    .mzs-fam, .mzs-burger, .mzs-leo { display: none; }
    header.mzs-head { position: static; }
}

/* Tactile buttons (janis-brain issue 900, Pepe 2026-11-01: "add this to all our buttons").
   One treatment for every button on every Mexzungu site, kept here so each site gets it with the shell
   and no page carries its own copy. Four rest layers: top-edge light, bottom-edge shade, a contact shadow
   and a glow in the button's own colour. Pressing reverses it into an inset dip.
   It only owns depth (box-shadow) and the press (transform). Colour, radius and type stay with each site.
   Primary: .mz-tactile, plus the existing primary classes listed below so live pages need no markup change.
   Quiet (outline and ghost buttons): .mz-tactile-quiet, plus the existing secondary classes.
   Disabled ([disabled], aria-disabled) goes flat, loading (aria-busy) keeps its depth but stops pressing.
   Keyboard: shell.js adds .mz-pressed while Enter (or Space on a real button, never on a link) is held, so the press shows without a pointer.
   The shadow swaps instantly; only transform animates (motion house rules), and not at all with reduced motion.
   html in front of each selector keeps these rules above the per-page hover and active rules they replace. */
:root {
    --mz-tb-glow: rgba(225, 75, 135, 0.55);
    --mz-tb-ease: cubic-bezier(0.23, 1, 0.32, 1);
}
html :is(.mz-tactile, .mzs-btn, .hero-cta, .ais-btn:not(.ais-btn-ghost), .olc-btn:not(.olc-btn-ghost), .apply-btn) {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.4),
        0 8px 24px -6px var(--mz-tb-glow);
    transition: transform 160ms var(--mz-tb-ease), background-color 160ms ease, color 160ms ease, border-color 160ms ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
html :is(.mzs-btn, .apply-btn) { --mz-tb-glow: rgba(184, 58, 107, 0.6); }
@media (hover: hover) {
    html :is(.mz-tactile, .mzs-btn, .hero-cta, .ais-btn:not(.ais-btn-ghost), .olc-btn:not(.olc-btn-ghost), .apply-btn):not(:disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
        transform: translateY(-1px);
        box-shadow:
            0 0 0 1px #D4A039,
            inset 0 1px 0 rgba(255, 255, 255, 0.4),
            inset 0 -2px 0 rgba(0, 0, 0, 0.2),
            0 1px 2px rgba(0, 0, 0, 0.4),
            0 10px 28px -6px var(--mz-tb-glow);
    }
}
html :is(.mz-tactile, .mzs-btn, .hero-cta, .ais-btn:not(.ais-btn-ghost), .olc-btn:not(.olc-btn-ghost), .apply-btn):not(:disabled, [aria-disabled="true"], [aria-busy="true"]):is(:active, .mz-pressed) {
    transform: translateY(1px) scale(0.98);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.35),
        inset 0 0 0 1px rgba(0, 0, 0, 0.08),
        0 1px 1px rgba(0, 0, 0, 0.3);
}

html :is(.mz-tactile-quiet, .hero-cta-secondary, .ais-btn-ghost, .olc-btn-ghost) {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 -2px 0 rgba(0, 0, 0, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.18);
    transition: transform 160ms var(--mz-tb-ease), background-color 160ms ease, color 160ms ease, border-color 160ms ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
@media (hover: hover) {
    html :is(.mz-tactile-quiet, .hero-cta-secondary, .ais-btn-ghost, .olc-btn-ghost):not(:disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
        transform: translateY(-1px);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.18),
            inset 0 -2px 0 rgba(0, 0, 0, 0.08),
            0 2px 4px rgba(0, 0, 0, 0.2),
            0 8px 20px -8px var(--mz-tb-glow);
    }
}
html :is(.mz-tactile-quiet, .hero-cta-secondary, .ais-btn-ghost, .olc-btn-ghost):not(:disabled, [aria-disabled="true"], [aria-busy="true"]):is(:active, .mz-pressed) {
    transform: translateY(1px) scale(0.98);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.22);
}

/* Focus stays visible on every ground: pink ring (4.9:1 on Black, 3.6:1 on White). Pages with their own ring keep it. */
:where(.mz-tactile, .mz-tactile-quiet, .mzs-btn, .hero-cta, .hero-cta-secondary, .ais-btn, .olc-btn, .apply-btn):focus-visible {
    outline: 2px solid #E14B87;
    outline-offset: 3px;
}

/* Disabled looks disabled: flat, dimmed, no press. Loading keeps depth but does not press. */
html :is(.mz-tactile, .mz-tactile-quiet, .mzs-btn, .hero-cta, .hero-cta-secondary, .ais-btn, .olc-btn, .apply-btn):is(:disabled, [aria-disabled="true"]) {
    box-shadow: none;
    transform: none;
    opacity: 0.5;
    cursor: not-allowed;
    filter: saturate(0.4);
}
html :is(.mz-tactile, .mz-tactile-quiet, .mzs-btn, .hero-cta, .hero-cta-secondary, .ais-btn, .olc-btn, .apply-btn)[aria-busy="true"] {
    transform: none;
    cursor: progress;
    opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
    html :is(.mz-tactile, .mz-tactile-quiet, .mzs-btn, .hero-cta, .hero-cta-secondary, .ais-btn, .olc-btn, .apply-btn) { transition: none; }
    /* Same selector shape as the primary hover and press rules (html, the :is list, the :not guard, the state), so
       this matches their specificity and wins by coming later. A plain :is(:hover) override loses to the :not guard. */
    html :is(.mz-tactile, .mz-tactile-quiet, .mzs-btn, .hero-cta, .hero-cta-secondary, .ais-btn:not(.ais-btn-ghost), .ais-btn-ghost, .olc-btn:not(.olc-btn-ghost), .olc-btn-ghost, .apply-btn):not(:disabled, [aria-disabled="true"], [aria-busy="true"]):is(:hover, :active, .mz-pressed) { transform: none; }
}
