/*
  This affects all templates.
  Only update this css file if intending to apply universal styling to all templates.
*/

:root {
    --font-main: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
    --shell-width: min(calc(100vw - 92px), 1940px);
    --nav-height: 58px;
    --transition-fast: 180ms ease;
    --bg: #232323;
    --surface: #333533;
    --text: #f5f2ea;
    --text-soft: #a7acb2;
    --border: rgba(133, 158, 183, 0.42);
    --accent: #1f6feb;
    --footer-button: #5b7384;
    --nav-strip: #353735;
    --footer-copy: #c6c0b9;
    --footer-note: #7d8188;
}

body.theme-light {
    --bg: #f3f1ef;
    --surface: #ddd9d6;
    --text: #2f3237;
    --text-soft: #8d9198;
    --border: rgba(96, 123, 147, 0.5);
    --accent: #5aa4d8;
    --footer-button: #485f6c;
    --nav-strip: #e2e0dd;
    --footer-copy: #696e76;
    --footer-note: #8a8f96;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

main {
    flex: 1;
}

a {
    color: inherit;
}

.container-shell {
    width: var(--shell-width);
    margin: 0 auto;
}

.custom-navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    padding-top: 10px;
    background: transparent;
}

.nav-inner {
    width: 100%;
    min-height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 22px;
    background: var(--nav-strip);
    border-radius: 0;
}

.logo {
    text-decoration: none;
    color: var(--text);
    font-size: 1.2rem;
    line-height: 1;
    font-weight: 700;
}

.nav-desktop {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 42px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 400;
    transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--text);
}

.theme-bar {
    width: 100%;
    padding: 8px 0 0;
}

.theme-bar-inner {
    display: flex;
    justify-content: flex-end;
    padding-right: 6px;
}

.dark-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    border-radius: 999px;
    background-color: #cdd3d9;
    transition: background-color var(--transition-fast);
}

.slider::before {
    position: absolute;
    content: "";
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background-color: #ffffff;
    transition: transform var(--transition-fast);
}

.switch input:checked + .slider {
    background-color: var(--accent);
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
}

.menu-toggle {
    display: none;
    width: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    margin: 3px 0;
    border-radius: 999px;
    background: var(--text);
}

.mobile-menu {
    display: none;
}

.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 38;
    background: rgba(0, 0, 0, 0.34);
}

.site-footer {
    padding: 36px 0 28px;
}

.footer-card {
    background: var(--surface);
    border-radius: 24px;
    padding: 46px 70px;
    display: flex;
    justify-content: space-between;
    gap: 48px;
}

.footer-quote,
.footer-cta {
    flex: 1;
}

.footer-quote {
    max-width: 500px;
}

.footer-quote p,
.footer-cta p {
    margin: 0;
}

.footer-quote p {
    font-size: clamp(1.12rem, 1.5vw, 1.5rem);
    line-height: 1.45;
    color: var(--text);
}

.footer-quote small {
    display: inline-block;
    margin-top: 10px;
    color: var(--footer-note);
    font-size: 1.05rem;
}

.footer-cta {
    max-width: 430px;
    margin-left: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.footer-cta p {
    margin-bottom: 18px;
    color: var(--footer-copy);
    font-size: 1.05rem;
    line-height: 1.55;
}

.footer-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    padding: 0 28px;
    border-radius: 6px;
    background: var(--footer-button);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: filter var(--transition-fast);
}

.footer-button:hover,
.footer-button:focus-visible {
    filter: brightness(1.08);
}

@media (max-width: 900px) {
    :root {
        --shell-width: min(calc(100vw - 36px), 1940px);
    }

    .nav-links {
        gap: 20px;
    }

    .footer-card {
        padding: 34px 28px;
        flex-direction: column;
        gap: 28px;
    }

    .footer-cta {
        max-width: none;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    :root {
        --shell-width: 100vw;
        --nav-height: 46px;
    }

    .custom-navbar {
        padding-top: 16px;
    }

    .nav-inner {
        padding: 0 8px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .nav-desktop {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .theme-bar {
        padding: 20px 12px 0 0;
    }

    .theme-bar-inner {
        padding-right: 0;
    }

    .dark-toggle {
        font-size: 0.95rem;
        gap: 12px;
    }

    .switch {
        width: 58px;
        height: 30px;
    }

    .slider::before {
        width: 22px;
        height: 22px;
        left: 4px;
        top: 4px;
    }

    .switch input:checked + .slider::before {
        transform: translateX(28px);
    }

    .mobile-menu {
        display: block;
        position: fixed;
        top: calc(var(--nav-height) + 16px);
        left: 0;
        right: 0;
        z-index: 40;
        background: var(--bg);
        transform: translateY(-110%);
        opacity: 0;
        pointer-events: none;
        transition: transform 220ms ease, opacity 220ms ease;
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
    }

    .mobile-menu.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-menu-inner {
        width: min(100vw - 12px, 1240px);
        margin: 0 auto;
        padding: 22px 0 34px;
    }

    .mobile-links {
        display: flex;
        flex-direction: column;
        gap: 28px;
        padding-left: 58px;
    }

    .mobile-links a {
        text-decoration: none;
        font-size: 1.08rem;
        color: var(--text);
    }

    .site-footer {
        padding: 20px 0 18px;
    }

    .footer-card {
        border-radius: 18px;
        padding: 26px 20px;
    }

    .footer-quote p {
        font-size: 1rem;
    }

    .footer-quote small,
    .footer-cta p {
        font-size: 0.95rem;
    }

    .footer-button {
        width: 100%;
        min-height: 56px;
        font-size: 1rem;
        text-align: center;
    }
}
