/* ============================================================
   Ancordi — shared chrome (header, footer, base)
   Prefixed custom properties (--a-*) so per-page stylesheets
   can declare their own design tokens without collisions.
   ============================================================ */

:root {
    --a-accent: #01ddd2;
    --a-accent-dark: #00d0c5;
    --a-heading: #07070a;
    --a-text: #626262;
    --a-text-soft: #8a8a8a;
    --a-dark: #180d5b;
    --a-navy: #00032a;
    --a-line: #e6e6e6;
    --a-bg-soft: #f7f8fa;

    /* footer: pale cyan band with the wave decoration sitting on top */
    --a-footer-bg: #cbf3f0;
    --a-footer-text: #4f6564;
    --a-footer-accent: #00877f;

    --a-font-head: 'Poppins', 'Montserrat', system-ui, sans-serif;
    --a-font-body: 'Montserrat', system-ui, sans-serif;

    --a-header-h: 90px;
    --a-header-h-sm: 68px;
    --a-max: 1220px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--a-font-body);
    font-size: 15px;
    line-height: 1.75;
    color: var(--a-text);
    background: #fff;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 2000;
    background: var(--a-navy); color: #fff; padding: 12px 20px; font-size: 14px;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--a-accent); outline-offset: 3px; }

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
    position: fixed; inset: 0 0 auto 0; z-index: 1000;
    background: #fff;
    border-bottom: 1px solid var(--a-line);
    transition: height .3s ease, box-shadow .3s ease;
    height: var(--a-header-h);
    font-family: var(--a-font-body);
}
.site-header.is-stuck { height: var(--a-header-h-sm); box-shadow: 0 4px 24px rgba(0, 0, 0, .07); }

.site-header__inner {
    max-width: var(--a-max);
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex; align-items: center; gap: 32px;
}

.site-logo {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 11px;
    text-decoration: none; color: var(--a-navy);
}
.site-logo__mark { width: 34px; height: 34px; flex-shrink: 0; transition: width .3s ease, height .3s ease; }
.site-logo__text {
    font-family: var(--a-font-head);
    display: flex; flex-direction: column; gap: 3px;
    text-transform: uppercase;
}
.site-logo__line1 {
    font-size: 16px; font-weight: 700; letter-spacing: .17em; line-height: 1;
    transition: font-size .3s ease;
}
.site-logo__line2 {
    font-size: 8.5px; font-weight: 500; letter-spacing: .155em; line-height: 1;
    color: var(--a-text-soft);
    transition: font-size .3s ease;
}
.site-header.is-stuck .site-logo__mark { width: 29px; height: 29px; }
.site-header.is-stuck .site-logo__line1 { font-size: 14px; }
.site-header.is-stuck .site-logo__line2 { font-size: 7.6px; }

.site-nav { margin-left: auto; }
.site-nav__list { list-style: none; display: flex; align-items: center; gap: 4px; }
.site-nav__list > li { position: relative; }

.site-nav__list > li > a {
    display: block;
    padding: 12px 16px;
    font-family: var(--a-font-head);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--a-heading);
    text-decoration: none;
    transition: color .2s ease;
}
.site-nav__list > li > a:hover,
.site-nav__list > li.is-active > a { color: var(--a-accent); }

.site-nav__list > li.is-active > a::after {
    content: ''; display: block; height: 2px; margin-top: 6px;
    background: var(--a-accent);
}

/* dropdown */
.site-nav__sub {
    list-style: none;
    position: absolute; top: 100%; left: 0;
    min-width: 262px;
    background: #fff;
    border: 1px solid var(--a-line);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .1);
    padding: 8px 0;
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
}
.site-nav__list > li.has-children:hover > .site-nav__sub,
.site-nav__list > li.has-children:focus-within > .site-nav__sub {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.site-nav__sub a {
    display: block; padding: 11px 22px;
    font-family: var(--a-font-head);
    font-size: 13px; font-weight: 400;
    color: var(--a-text); text-decoration: none;
    transition: background .2s ease, color .2s ease, padding-left .2s ease;
}
.site-nav__sub a:hover { background: var(--a-bg-soft); color: var(--a-accent); padding-left: 28px; }

.submenu-toggle { display: none; }

.nav-toggle {
    display: none;
    margin-left: auto;
    width: 42px; height: 42px;
    background: none; border: 1px solid var(--a-line); cursor: pointer;
    flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--a-heading); transition: transform .25s ease, opacity .25s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

main { padding-top: var(--a-header-h); }

/* keep in-page anchor jumps clear of the fixed header */
[id] { scroll-margin-top: calc(var(--a-header-h) + 16px); }

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    position: relative;
    background: var(--a-footer-bg);
    color: var(--a-footer-text);
    font-family: var(--a-font-body);
    font-size: 14px;
}

/* Rising wave that overlaps whatever section sits above, light or dark. */
.site-footer::before {
    content: '';
    position: absolute; left: 0; right: 0; bottom: 100%;
    height: clamp(46px, 6.5vw, 108px);
    background: url('../img/footer-wave.svg') no-repeat center bottom;
    background-size: 100% 100%;
    pointer-events: none;
}

.site-footer__top { max-width: var(--a-max); margin: 0 auto; padding: 66px 24px 50px; }

.site-footer__grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 48px;
}

.site-footer__wordmark {
    display: inline-flex; align-items: center; gap: 11px;
    color: var(--a-navy); margin-bottom: 18px;
}
.site-footer__wordmark .site-logo__mark { width: 32px; height: 32px; }
.site-footer__wordmark .site-logo__line1 { font-size: 16px; color: var(--a-navy); }
.site-footer__wordmark .site-logo__line2 { font-size: 8.5px; color: var(--a-footer-text); }
.site-footer__tagline { font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--a-footer-accent); font-weight: 600; }
.site-footer__blurb { margin-top: 16px; font-size: 13.5px; line-height: 1.9; color: var(--a-footer-text); max-width: 380px; }

.site-footer__col h4 {
    font-family: var(--a-font-head);
    font-size: 15px; font-weight: 600; color: var(--a-heading);
    margin-bottom: 20px;
}
.site-footer__col ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.site-footer__col li { font-size: 13.5px; line-height: 1.7; }
.site-footer__col a { text-decoration: none; transition: color .2s ease; }
.site-footer__col a:hover { color: var(--a-footer-accent); }

.site-footer__bottom {
    border-top: 1px solid rgba(0, 3, 42, .1);
    max-width: var(--a-max);
    margin: 0 auto;
    padding: 22px 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--a-footer-text);
}
.site-footer__links { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer__links a { text-decoration: none; transition: color .2s ease; }
.site-footer__links a:hover { color: var(--a-footer-accent); }

/* ============================================================
   BACK TO TOP
   ============================================================ */

#backToTop {
    position: fixed; right: 26px; bottom: 26px; z-index: 900;
    width: 44px; height: 44px;
    border: none; cursor: pointer;
    background: var(--a-navy); color: #fff;
    font-size: 16px; line-height: 1;
    display: grid; place-items: center;
    opacity: 0; pointer-events: none;
    transition: opacity .3s ease, background .3s ease, transform .3s ease;
}
#backToTop.is-visible { opacity: 1; pointer-events: auto; }
#backToTop:hover { background: var(--a-accent); transform: translateY(-3px); }

/* ============================================================
   RESPONSIVE CHROME
   ============================================================ */

@media (max-width: 1024px) {
    .nav-toggle { display: flex; }

    .site-nav {
        position: fixed;
        top: var(--a-header-h); left: 0; right: 0;
        max-height: calc(100vh - var(--a-header-h));
        overflow-y: auto;
        background: #fff;
        border-top: 1px solid var(--a-line);
        box-shadow: 0 20px 40px rgba(0, 0, 0, .1);
        margin-left: 0;
        display: none;
    }
    .site-nav.is-open { display: block; }
    .site-header.is-stuck .site-nav { top: var(--a-header-h-sm); }

    .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0; }
    .site-nav__list > li { border-bottom: 1px solid var(--a-line); }
    .site-nav__list > li:last-child { border-bottom: none; }
    .site-nav__list > li > a { padding: 15px 24px; }
    .site-nav__list > li.is-active > a::after { display: none; }

    .site-nav__sub {
        position: static; opacity: 1; visibility: visible; transform: none;
        border: none; box-shadow: none; min-width: 0;
        background: var(--a-bg-soft);
        padding: 0; display: none;
    }
    .site-nav__list > li.is-expanded > .site-nav__sub { display: block; }
    .site-nav__sub a { padding: 13px 38px; }
    .site-nav__sub a:hover { padding-left: 42px; }

    .submenu-toggle {
        display: block;
        position: absolute; top: 6px; right: 16px;
        width: 40px; height: 40px;
        background: none; border: none; cursor: pointer;
    }
    .submenu-toggle::before,
    .submenu-toggle::after {
        content: ''; position: absolute; top: 50%; left: 50%;
        width: 11px; height: 2px; background: var(--a-heading);
        transform: translate(-50%, -50%);
        transition: transform .25s ease;
    }
    .submenu-toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
    .site-nav__list > li.is-expanded .submenu-toggle::after { transform: translate(-50%, -50%) rotate(0deg); }

    .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}

@media (max-width: 640px) {
    :root { --a-header-h: 68px; }
    .site-footer__grid { grid-template-columns: 1fr; gap: 34px; }
    .site-footer__top { padding: 54px 22px 40px; }
    .site-footer__bottom { flex-direction: column; align-items: flex-start; }
}
