/* =============================================================================
   MakScript — layout.css
   Site header, footer, mobile nav, scroll progress bar
   @author Sebastian Makoye
   ============================================================================= */

/* ---------- Scroll progress bar ----------------------------------------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: var(--scroll-progress-h);
    width: 0%;
    background: linear-gradient(90deg, var(--cyan-500), var(--cyan-300));
    z-index: var(--z-scroll-progress);
    transition: width 80ms linear;
    box-shadow: 0 0 12px rgba(0, 194, 209, .5);
}

/* ---------- Site header -------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--t-base), background var(--t-base), box-shadow var(--t-base);
}

.site-header.is-scrolled {
    border-bottom-color: var(--line);
    background: rgba(255, 255, 255, .95);
    box-shadow: var(--sh-sm);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-6);
    height: var(--header-h);
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 var(--s-6);
}

/* ---------- Brand -------------------------------------------------------- */
.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    color: var(--navy-900);
    text-decoration: none;
    flex-shrink: 0;
}

.brand:hover { color: var(--navy-900); }

.brand__mark {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    transition: transform var(--t-base);
}
.brand:hover .brand__mark {
    transform: rotate(-6deg) scale(1.05);
}
.brand__mark svg { width: 100%; height: 100%; }

.brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand__name {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--navy-900);
}

.brand__tag {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 4px;
}

.brand--footer {
    color: var(--white);
}
.brand--footer .brand__name {
    color: var(--white);
    font-size: 1.4rem;
}

/* ---------- Site nav ----------------------------------------------------- */
.site-nav { display: none; }
@media (min-width: 900px) {
    .site-nav { display: block; }
}

.site-nav__list {
    display: flex;
    align-items: center;
    gap: var(--s-1);
}

.site-nav__link {
    display: inline-block;
    padding: var(--s-2) var(--s-4);
    font-size: 0.94rem;
    font-weight: 500;
    color: var(--ink-2);
    border-radius: var(--r-md);
    transition: color var(--t-fast), background var(--t-fast);
    position: relative;
}
.site-nav__link:hover {
    color: var(--navy-900);
    background: var(--bg);
}
.site-nav__link.is-active {
    color: var(--navy-900);
    font-weight: 600;
}
.site-nav__link.is-active::after {
    content: '';
    position: absolute;
    left: var(--s-4);
    right: var(--s-4);
    bottom: 4px;
    height: 2px;
    background: var(--cyan-500);
    border-radius: var(--r-full);
}

/* ---------- Header actions ---------------------------------------------- */
.site-header__actions {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}

.lang-switch {
    display: none;
    padding: 2px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-full);
}
@media (min-width: 900px) {
    .lang-switch { display: inline-flex; }
}

.lang-switch__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 30px;
    padding: 0 var(--s-3);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--muted);
    border-radius: var(--r-full);
    transition: color var(--t-fast), background var(--t-fast);
}
.lang-switch__link:hover {
    color: var(--navy-900);
    background: var(--white);
}

.lang-switch__short { line-height: 1; }

/* ---------- Mobile toggle ------------------------------------------------ */
.nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: var(--r-md);
    transition: background var(--t-fast);
}
.nav-toggle:hover { background: var(--bg); }
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--navy-900);
    border-radius: var(--r-full);
    margin: 0 auto;
    transition: transform var(--t-base), opacity var(--t-fast);
}
.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);
}

@media (min-width: 900px) {
    .nav-toggle { display: none; }
}

/* ---------- Mobile nav --------------------------------------------------- */
.mobile-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    padding: var(--s-6);
    overflow-y: auto;
    z-index: var(--z-mobile-nav);
    transform: translateY(-8px);
    opacity: 0;
    transition: transform var(--t-base), opacity var(--t-base);
}
.mobile-nav.is-open {
    transform: translateY(0);
    opacity: 1;
}
.mobile-nav[hidden] { display: none; }

.mobile-nav__list {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
}

.mobile-nav__link {
    display: block;
    padding: var(--s-4);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--navy-900);
    border-radius: var(--r-md);
    transition: background var(--t-fast);
}
.mobile-nav__link:hover { background: var(--bg); }
.mobile-nav__link.is-active {
    background: var(--bg);
    color: var(--cyan-600);
    font-weight: 600;
}

.mobile-nav__cta {
    margin-top: var(--s-6);
    padding-top: var(--s-6);
    border-top: 1px solid var(--line);
}

/* ---------- Main / page shell ------------------------------------------- */
.site-main {
    min-height: calc(100vh - var(--header-h) - 400px);
    animation: page-fade-in var(--t-slow) ease-out;
}

/* ---------- Site footer -------------------------------------------------- */
.site-footer {
    background: var(--navy-900);
    color: var(--navy-300);
    padding: var(--s-20) 0 0;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent, var(--cyan-500), transparent);
    opacity: 0.4;
}

.site-footer__inner {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 var(--s-6) var(--s-16);
    display: grid;
    gap: var(--s-12);
    grid-template-columns: 1fr;
}

@media (min-width: 700px) {
    .site-footer__inner {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: var(--s-10);
    }
}

.site-footer__brand { max-width: 340px; }

.site-footer__tagline {
    color: var(--cyan-300);
    font-size: 0.9rem;
    font-weight: 500;
    margin: var(--s-3) 0 var(--s-4);
    letter-spacing: 0.02em;
}

.site-footer__legal {
    color: var(--navy-300);
    font-size: 0.85rem;
    line-height: 1.6;
    opacity: 0.75;
}

.site-footer__col h3 {
    color: var(--white);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: var(--s-4);
}

.site-footer__col ul {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.site-footer__col a {
    color: var(--navy-300);
    font-size: 0.94rem;
    transition: color var(--t-fast);
    position: relative;
}
.site-footer__col a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--cyan-400);
    transition: width var(--t-base);
}
.site-footer__col a:hover {
    color: var(--cyan-300);
}
.site-footer__col a:hover::after {
    width: 100%;
}

.site-footer__base {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: var(--s-6);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    max-width: var(--container-wide);
    margin: 0 auto;
    font-size: 0.85rem;
    color: var(--navy-300);
    opacity: 0.85;
}

.site-footer__credit a {
    color: var(--cyan-400);
    font-weight: 600;
    letter-spacing: 0.02em;
}
.site-footer__credit a:hover { color: var(--cyan-300); }

/* ---------- Responsive tweaks ------------------------------------------- */
@media (max-width: 480px) {
    .brand__text { display: none; }
    .site-header__inner { padding: 0 var(--s-4); }
}