/* =============================================
   SITE CHROME — navbar + footer styles
   Markup and behaviour live in site-chrome.js.
   Relies on the page's design tokens (--nav-h, --border, --brand, …)
   and, for <site-footer cta>, its .wrap, .rev, .hu, .btn-primary and
   .sol-corner styles.

   Layout follows the page's fixed content frame when the page defines one:
     --frame        content frame width per tier (1200 / 960 / 680px, 100% on phones)
     --fw           width that frame-scaled type is based on
     --footer-side  side padding of the footer CTA block
     --footer-card  footer card width on tablet
   Every value falls back to the older viewport-based layout, so a page
   without these variables renders exactly as before.
============================================= */

site-nav, site-footer { display: contents; }

/* =============================================
   NAVIGATION
============================================= */
.nav {
    position: fixed; top: 0; left: 0;
    width: 100%; height: var(--nav-h);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    transition: background .4s ease, border-color .4s ease, transform .32s ease;
    border-bottom: 1px solid var(--border);
    will-change: transform;
}
.nav.solid {
    background: rgba(6,5,15,0.94);
    backdrop-filter: blur(14px) saturate(160%);
    border-bottom-color: var(--border);
}
.nav.hide { transform: translateY(-100%); }
@media (max-width: 640px) { .nav.hide { transform: none; } }

.nav-inner {
    display: flex; justify-content: space-between; align-items: center;
    width: var(--frame, 100%);
    max-width: 100%;
}
.nav-inner > nav { flex-shrink: 0; margin-left: 12px; display: flex; align-items: center; gap: 28px; }

.logo {
    display: flex; align-items: center; gap: 10px;
    color: var(--text);
    min-width: 0; overflow: hidden;
}
.logo img { height: 28px; width: auto; }
.logo-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.3px;
    color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav-link {
    font-family: var(--body);
    font-size: 0.7rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--muted);
    padding: 0 0 5px;
    border: none;
    background: none;
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 1.5px;
    transition: color .2s, background-size .25s ease;
}
.nav-link:hover { color: var(--text); background-size: 100% 1.5px; }
.nav-link.active { color: var(--text); font-weight: 700; background-size: 100% 1.5px; }

.nav-cta {
    font-family: var(--body);
    font-size: 0.66rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: #fff;
    background: var(--brand);
    padding: 10px 16px;
    white-space: nowrap;
    text-decoration: none;
    transition: background .2s, transform .15s;
}
.nav-cta:hover { background: #c8304f; }
.nav-cta:active { transform: scale(0.97); }

/* Tighten on narrow phones so the wordmark stays whole */
@media (max-width: 480px) {
    .nav-inner > nav { gap: 16px; }
    .nav-link { letter-spacing: 0.8px; }
    .nav-cta { padding: 8px 11px; font-size: 0.6rem; letter-spacing: 0.8px; }
}

/* =============================================
   FOOTER
============================================= */
.footer {
    padding: 0;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    position: relative;
}

/* CTA block (<site-footer cta>) */
.footer-inner {
    position: relative;
    overflow: hidden;
    display: flex; flex-direction: column; align-items: center;
    text-align: center;
    padding: 160px var(--footer-side, 0) 160px;
}
#cta-dither {
    position: absolute;
    inset: 0; width: 100%; height: 100%;
    pointer-events: none;
    opacity: 0.4;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    z-index: 0;
}
.footer-inner > * {
    position: relative; z-index: 10;
}
.footer-frame {
    width: calc(var(--frame, calc(100vw * 2 / 3)) * 0.625);
    padding: 64px 60px 64px;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    text-align: center;
}
.footer-headline {
    font-family: var(--head);
    font-size: clamp(2.4rem, calc(var(--fw, calc(100vw * 2 / 3)) * 4.4 * 0.015), 3.8rem);
    font-weight: 600;
    line-height: 1.08; letter-spacing: -1.4px;
    margin-bottom: 20px;
}
.footer-sub {
    font-size: 1.05rem; color: var(--muted);
    max-width: 540px; margin: 0 auto 40px;
    line-height: 1.65;
}
.footer-cta { display: inline-block; align-self: center; text-decoration: none; }

/* Bottom bar */
.footer-bottom-wrap {
    position: relative; z-index: 10;
    background: var(--bg);
    border-top: 1px solid var(--border);
}
/* Without the CTA, .footer's own border-top already draws the line. */
.footer--compact .footer-bottom-wrap { border-top: none; }
.footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    /* Content lines up with the frame edges (old pages: 1/6 of the width) */
    padding: 28px calc((100% - var(--frame, calc(100% * 2 / 3))) / 2 + 24px);
    color: var(--muted);
}
.footer-brand-group {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 8px;
}
.footer-brand {
    font-family: var(--head); font-weight: 500;
    font-size: 0.95rem;
    color: var(--text); opacity: .85;
}
.footer-links {
    display: inline-flex; align-items: center; gap: 22px;
}
.footer-links a {
    font-family: var(--body); font-size: 0.82rem;
    color: var(--muted); text-decoration: none;
    opacity: .7;
    transition: color .2s, opacity .2s;
}
.footer-links a:hover { color: var(--brand); opacity: 1; }
.footer-right {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 8px;
}
.footer-email {
    font-family: var(--body); font-size: 0.82rem;
    color: var(--muted); text-decoration: underline;
    text-underline-offset: 4px; opacity: .7;
    transition: color .2s, opacity .2s;
}
.footer-email:hover { color: var(--brand); opacity: 1; }
.footer-email-group { display: inline-flex; align-items: center; gap: 6px; }
.footer-copy-btn {
    background: none; border: none; padding: 0; cursor: pointer;
    color: var(--muted); opacity: 0.7;
    transition: color .2s, opacity .2s;
    display: inline-flex; align-items: center; line-height: 1;
    position: relative;
}
.footer-copy-btn:hover { color: var(--brand); opacity: 1; }
.footer-copy-btn .icon-check { display: none; }
.footer-copy-btn.copied .icon-copy { display: none; }
.footer-copy-btn.copied .icon-check { display: inline; }
.footer-copy-btn.copied { color: var(--brand); opacity: 1; }
.footer-copy-btn::after {
    content: 'Copied!'; position: absolute;
    bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    background: var(--brand); color: #fff;
    font-size: 0.72rem; padding: 3px 8px; border-radius: 4px;
    white-space: nowrap; pointer-events: none;
    opacity: 0; transition: opacity .15s;
}
.footer-copy-btn.copied::after { opacity: 1; }
.footer-copy {
    font-family: var(--body); font-size: 0.72rem;
    opacity: .35;
}

@media (max-width: 1099px) { .footer-frame { width: var(--footer-card, calc(100vw * 5 / 12)); } }
@media (max-width: 900px) { .footer-frame { width: var(--footer-card, 90%); padding: 48px 32px 56px; } }
@media (max-width: 768px) {
    .footer-inner { padding: 80px var(--footer-side, 0) 60px; }
    .footer-bottom { padding: 28px 28px; }
}
@media (max-width: 600px) {
    .footer-inner { padding-left: 28px; padding-right: 28px; }
    .footer-frame { width: 100%; padding: 40px 24px 48px; }
    .footer-bottom { flex-direction: column; gap: 20px; text-align: center; padding: 24px var(--footer-side, 20px); }
    .footer-brand-group { align-items: center; }
    .footer-right { align-items: center; }
    .footer-links { flex-wrap: wrap; justify-content: center; }
}
