/* =============================================================================
   Layout — header, mega-menu, mobile nav, footer, floating WhatsApp. Depends on tokens.css + base.css.
   ============================================================================= */

/* ---- Header ---- */
.site-header {
    position: sticky; top: 0; z-index: var(--z-header);
    background: rgb(236 243 251 / 0.94);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
    transition: transform 0.35s var(--ease-out), border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.site-header.is-scrolled { box-shadow: var(--shadow-1); }
.site-header.is-hidden { transform: translateY(-100%); }
.site-header__bar { display: flex; align-items: center; gap: var(--space-m); min-height: 4.25rem; }
.site-header__logo { flex: none; display: block; padding-block: 0.25rem; }
.site-header__logo img { width: 144px; height: auto; }
.site-header__actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-2xs); }
.site-header__cta { min-height: 2.75rem; padding: 0.6em 1.1em; font-size: var(--step--1); }
.site-header__burger {
    display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem;
    border: 1px solid var(--border-control); border-radius: var(--radius-s); color: var(--text);
}

.site-nav { display: none; }
.site-nav__list { display: flex; gap: 0.15rem; }
.site-nav__item { position: static; }
.site-nav__link {
    display: inline-flex; align-items: center; gap: 0.4em;
    min-height: 2.75rem; padding: 0.5em 0.8em; border-radius: var(--radius-s);
    color: var(--text); font-size: var(--step--1); font-weight: 550; text-decoration: none;
}
.site-nav__link:hover, .site-nav__link[aria-expanded="true"] { background: color-mix(in srgb, var(--text) 7%, transparent); }
.site-nav__link .chev { transition: transform var(--dur-2) var(--ease-out); }
.site-nav__link[aria-expanded="true"] .chev { transform: rotate(180deg); }

.mega {
    position: absolute; left: 0; right: 0; top: 100%; z-index: var(--z-menu);
    background: var(--bg-raised); color: var(--text);
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-3);
}
.mega__inner {
    width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); gap: var(--space-l);
    padding-block: var(--space-l);
}
.mega__title {
    font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: var(--tracking-label);
    text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-2xs);
    padding-bottom: var(--space-2xs); border-bottom: 1px solid var(--border);
}
.mega ul { display: grid; gap: 0.1rem; }
.mega a {
    display: grid; gap: 0.1rem; padding: 0.5rem 0.6rem; margin-inline: -0.6rem; border-radius: var(--radius-s);
    color: var(--text); text-decoration: none; font-weight: 550; font-size: var(--step--1);
}
.mega a small { color: var(--text-muted); font-weight: 400; font-size: var(--step--2); }
.mega a:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--accent); }

.mobile-nav { border-top: 1px solid var(--border); background: var(--bg-raised); max-height: calc(100vh - 4.25rem); overflow-y: auto; padding-block: var(--space-s) var(--space-l); }
.mobile-nav__link, .mobile-nav__group summary {
    display: flex; align-items: center; justify-content: space-between; min-height: 3rem;
    padding-block: 0.5rem; border-bottom: 1px solid var(--border);
    color: var(--text); font-weight: 600; text-decoration: none; cursor: pointer; list-style: none;
}
.mobile-nav__group summary::-webkit-details-marker { display: none; }
.mobile-nav__group summary::after { content: "+"; font-family: var(--font-mono); color: var(--accent); }
.mobile-nav__group[open] summary::after { content: "–"; }
.mobile-nav__group .mega__title { margin-top: var(--space-s); }
.mobile-nav__group ul { display: grid; padding-bottom: var(--space-s); }
.mobile-nav__group a { display: flex; align-items: center; min-height: 2.75rem; color: var(--text); text-decoration: none; }
.mobile-nav__cta { width: 100%; margin-top: var(--space-m); }

@media (min-width: 64rem) {
    .site-nav { display: block; }
    .site-header__bar { position: relative; }
    .site-header__burger, .mobile-nav { display: none !important; }
}
@media (max-width: 26rem) {
    .site-header__cta { display: none; }
}

/* ---- Footer ---- */
/* navy footer: re-maps tokens like .band-dark */
.site-footer { color-scheme: dark; --text: #ffffff; --text-2: #c9d0e6; --text-muted: #b9c1dd; --accent: var(--sky-text); --border: #3a4468; --focus: var(--sky-text);
    background: var(--navy-deep); color: var(--text); padding-top: var(--space-2xl); font-size: var(--step--1); }
.site-footer a { color: #e3e8f5; }
.site-footer__grid { display: grid; gap: var(--space-l); grid-template-columns: repeat(2, 1fr); }
.site-footer__brand { grid-column: 1 / -1; display: grid; gap: var(--space-s); max-width: 26rem; }
.site-footer__brand img { width: 180px; }
.site-footer__brand p { color: var(--text-2); }
.site-footer address { font-style: normal; color: var(--text-2); line-height: 1.8; }
.site-footer h2 { font-family: var(--font-sans); font-size: var(--step--1); font-weight: 700; letter-spacing: 0.02em; color: #fff; margin-bottom: var(--space-xs); }
.site-footer ul { display: grid; gap: 0.15rem; }
.site-footer__col a { display: inline-flex; min-height: 2rem; align-items: center; color: var(--text); text-decoration: none; }
.site-footer__col a:hover { color: var(--sky-text); text-decoration: underline; }
.site-footer address a { color: #e3e8f5; }
.site-footer__legal {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-xs);
    margin-top: var(--space-xl); padding-block: var(--space-m); border-top: 1px solid var(--border); color: var(--text-muted);
}
.site-footer__legal a { color: var(--text-muted); }
@media (min-width: 48rem) { .site-footer__grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 64rem) {
    .site-footer__grid { grid-template-columns: 1.6fr repeat(4, 1fr); }
    .site-footer__brand { grid-column: auto; }
}

/* ---- Floating WhatsApp ---- */
.wa-float {
    position: fixed; right: var(--gutter); bottom: var(--gutter); z-index: var(--z-sticky-cta);
    display: inline-grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%;
    background: #1d7a4a; color: #fff; box-shadow: var(--shadow-3);
    transition: transform var(--dur-1) var(--ease-out);
}
.wa-float:hover { transform: scale(1.06); }

/* ---- Molecular network background (site.js [data-fx]) ---- */
[data-fx] { position: relative; isolation: isolate; overflow: hidden; }
[data-fx] > .container { position: relative; }
.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.95;
    -webkit-mask-image: linear-gradient(100deg, rgb(0 0 0 / 0.5) 0%, rgb(0 0 0 / 0.7) 35%, #000 65%); mask-image: linear-gradient(100deg, rgb(0 0 0 / 0.5) 0%, rgb(0 0 0 / 0.7) 35%, #000 65%); }
@media (forced-colors: active) { .fx-canvas { display: none; } }
/* Light theme: behind every light section. The section is its own stacking context, so the canvas (z -1) paints
   above the section background but under all content — cards, images and text are never covered. */
.fx-host { position: relative; isolation: isolate; }
.fx-canvas--light { z-index: -1; opacity: 1;
    /* faint logo-navy (#212843) colour wash under the network — capped at ~8% so muted text stays >= 4.5:1 on --cool */
    background: radial-gradient(ellipse 70% 90% at 88% 15%, rgb(33 40 67 / 0.04), transparent 70%);
    -webkit-mask-image: linear-gradient(100deg, rgb(0 0 0 / 0.12) 0%, rgb(0 0 0 / 0.22) 45%, #000 75%); mask-image: linear-gradient(100deg, rgb(0 0 0 / 0.12) 0%, rgb(0 0 0 / 0.22) 45%, #000 75%); }
@media print { .fx-canvas { display: none; } }

/* ---- Consent banner (consent.js) — non-modal, bottom, never covers the whole page ---- */
.consent { position: fixed; left: var(--gutter); right: var(--gutter); bottom: var(--gutter); z-index: var(--z-banner); max-width: 60rem; margin-inline: auto; }
.consent[hidden] { display: none; }
.consent__inner { display: grid; gap: var(--space-s); padding: var(--space-m); background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-l); box-shadow: 0 30px 70px -20px rgb(22 27 51 / 0.45); }
@media (min-width: 48rem) { .consent__inner { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-l); } }
.consent h2 { font-size: var(--step-0); }
.consent p { margin-top: 0.25rem; font-size: var(--step--1); color: var(--text-2); }
.consent__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.linklike { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linklike:hover { color: var(--sky-text); }
@media print { .consent { display: none; } }
/* Secondary header link to the product tour (Phase 12) — wide screens only; the mobile menu lists it under Platform. */
.site-header__tour { display: none; margin-right: 0.9rem; font-size: var(--step--1); font-weight: 600; color: var(--blue); text-decoration: none; }
.site-header__tour:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 80rem) { .site-header__tour { display: inline-block; } }
.site-footer__hours { margin-top: 0.6rem; font-size: 0.82rem; opacity: 0.9; }
