/* ─────────────────────────────────────────────────────────────────
   Layout — top nav, footer, page grid wrappers.
   ───────────────────────────────────────────────────────────────── */

/* ── Top navigation ────────────────────────────────────────────── */
.nav {
    position: sticky;
    top: 0;
    z-index: var(--z-nav);
    width: 100%;
    background: transparent;
    transition: background-color var(--t-base), border-color var(--t-base), backdrop-filter var(--t-base);
    border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
    background: var(--bg-overlay);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border-subtle);
}
.nav__inner {
    height: var(--nav-height);
    display: flex;
    align-items: center;
    gap: var(--s-5);
    width: 100%;
    max-width: var(--container-wide);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.nav__brand {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-weight: 700;
    font-size: var(--fz-md);
    color: var(--text-strong);
    letter-spacing: var(--tracking-tight);
}
.nav__brand:hover { color: var(--text-strong); }
.nav__brand-mark {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--r-sm);
    background: var(--gradient-brand);
    box-shadow: var(--shadow-glow);
}
.nav__brand-mark svg { width: 18px; height: 18px; color: #fff; }

.nav__links {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    margin-left: var(--s-4);
}
.nav__link {
    color: var(--text-secondary);
    font-size: var(--fz-sm);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    transition: background-color var(--t-fast), color var(--t-fast);
}
.nav__link:hover {
    color: var(--text-strong);
    background: var(--bg-card-hover);
}
.nav__link.is-active {
    color: var(--text-strong);
}

.nav__spacer { flex: 1; }

.nav__actions {
    display: flex;
    align-items: center;
    gap: var(--s-2);
}

.nav__burger {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-primary);
    align-items: center;
    justify-content: center;
}
.nav__burger svg { width: 20px; height: 20px; }

@media (max-width: 880px) {
    .nav__links { display: none; }
    .nav__burger { display: inline-flex; }
    .nav__cta-text { display: none; }
}

/* Mobile drawer */
.nav__drawer {
    position: fixed;
    inset: var(--nav-height) 0 0 0;
    background: var(--bg-canvas);
    border-top: 1px solid var(--border-subtle);
    padding: var(--s-5) var(--gutter);
    display: none;
    z-index: var(--z-nav);
}
.nav__drawer.is-open { display: block; }
.nav__drawer .nav__link {
    display: block;
    padding: var(--s-3) 0;
    font-size: var(--fz-md);
    border-bottom: 1px solid var(--border-subtle);
}

/* ── Footer ────────────────────────────────────────────────────── */
.footer {
    background: var(--bg-canvas);
    border-top: 1px solid var(--border-subtle);
    padding-block: var(--s-8) var(--s-6);
    margin-top: var(--s-9);
}
.footer__grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: var(--s-7);
    margin-bottom: var(--s-7);
}
@media (max-width: 720px) {
    .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--s-5); }
}
@media (max-width: 480px) {
    .footer__grid { grid-template-columns: 1fr; }
}
.footer__brand-block {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    max-width: 320px;
}
.footer__tagline {
    color: var(--text-muted);
    font-size: var(--fz-sm);
    line-height: var(--lh-loose);
}
.footer__col h4 {
    font-size: var(--fz-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-extra);
    color: var(--text-muted);
    margin-bottom: var(--s-3);
    font-weight: 700;
}
.footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.footer__col a {
    color: var(--text-secondary);
    font-size: var(--fz-sm);
}
.footer__col a:hover { color: var(--text-strong); }

.footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s-3);
    padding-top: var(--s-5);
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: var(--fz-xs);
}

/* ── Page-level grids ──────────────────────────────────────────── */
.grid {
    display: grid;
    gap: var(--s-5);
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--auto-lg { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

@media (max-width: 960px) {
    .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-7);
    align-items: center;
}
.split--media-end { direction: rtl; }
.split--media-end > * { direction: ltr; }
@media (max-width: 880px) {
    .split { grid-template-columns: 1fr; gap: var(--s-5); }
    .split--media-end { direction: ltr; }
}

.stack { display: grid; gap: var(--s-3); }
.stack--lg { gap: var(--s-5); }
.stack--xl { gap: var(--s-7); }

.cluster {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    align-items: center;
}
