/* ========================= RESET ========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========================= VARIABLES ========================= */
:root {
    --brand: #283b69;
    --brand-dark: #1f2f55;

    /* жовтий не використовуємо */
    --gold: transparent;

    --overlay: rgba(244, 246, 251, 0.72);

    --glass: rgba(255, 255, 255, 0.42);
    --glass-strong: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.55);

    --title: #1f2f55;
    --text: #222;
    --muted: #4b5563;

    --shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 20px 44px rgba(0, 0, 0, 0.18);
}

/* ========================= BODY + FULL BG ========================= */
body {
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background-color: #f4f6fb;
}

body.home {
    background-image: url("../assets/photo1.webp");
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    background-attachment: fixed;
    position: relative;
}

body.home::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 0;
    pointer-events: none;
}

/* Content above overlay */
.site-header,
main,
.site-footer {
    position: relative;
    z-index: 1;
}

@media (max-width: 900px) {
    body.home {
        background-attachment: scroll;
    }

    body.home::before {
        background: rgba(244, 246, 251, 0.80);
    }
}

/* ========================= CONTAINER ========================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 22px 16px 40px;
}

/* ========================= HEADER ========================= */
.site-header {
    background: rgba(40, 59, 105, 0.94);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 9999;
    transition: box-shadow .18s ease, background .18s ease;
}

/* Premium: shadow appears on scroll */
.site-header.is-scrolled {
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    background: rgba(40, 59, 105, 0.97);
}

/* thin divider */
.site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: rgba(255, 255, 255, 0.10);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

/* ========================= BRAND (icon + text) ========================= */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    font-weight: 900;
}

.brand-icon {
    height: 40px;
    width: 40px;
    /* робимо квадрат */
    border-radius: 12px;
    /* ← закруглення кутів */
    object-fit: cover;
    /* щоб не сплющувало */
    display: block;
}


.brand-text {
    font-size: 18px;
    letter-spacing: .2px;
}
@media (max-width: 768px) {
    .brand-icon {
        height: 32px;
    }

    .brand-text {
        font-size: 18px;
    }
}

/* ========================= HEADER TOOLS ========================= */
.header-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* social icons small */
.social-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-icons img {
    width: 14px;
    height: 14px;
    display: block;
    opacity: .95;
    transition: transform .15s ease, opacity .15s ease;
}

.social-icons a:hover img {
    transform: translateY(-1px) scale(1.10);
    opacity: 1;
}

/* language */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.30);
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 900;
    opacity: .92;
    transition: transform .15s ease, opacity .15s ease, background .15s ease;
}

.lang-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.lang-btn.is-active {
    background: rgba(255, 255, 255, 0.15);
    opacity: 1;
}

/* ========================= NAV ========================= */
.main-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 16px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 9999;
}

/* Burger */
.nav-toggle {
    display: none;
    width: 44px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    position: relative;
}

.nav-toggle-lines {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 2px;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 2px;
}

.nav-toggle-lines::before,
.nav-toggle-lines::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

.nav-toggle-lines::before {
    top: -6px;
}

.nav-toggle-lines::after {
    top: 6px;
}

/* Panel desktop */
.nav-panel {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.main-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.main-menu>li {
    position: relative;
}

/* ========================= MENU STYLE (VARIANT 2: PILL TABS) ========================= */
.main-menu>li>a {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 8px 14px;
    border-radius: 999px;

    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .2px;

    opacity: 1;
    transition: transform .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease;
}

/* прибираємо будь-які underline/псевдо-ефекти з інших варіантів */
.main-menu>li>a::before,
.main-menu>li>a::after {
    content: none !important;
}

/* hover */
.main-menu>li>a:hover {
    
    color: #fff;
    transform: translateY(-1px);
}

/* active */
.main-menu>li>a.is-active {
    
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Search */
.nav-search {
    width: 240px;
    max-width: 240px;
}

.nav-search input {
    width: 100%;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    padding: 0 10px;
    font-size: 13px;
    outline: none;
}

.nav-search input::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

.nav-search input:focus {
    border-color: rgba(255, 255, 255, 0.42);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.10);
}

/* ========================= DROPDOWN (desktop hover) ========================= */
.submenu {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 8px;

    min-width: 260px;
    background: rgba(40, 59, 105, 0.97);
    border-radius: 14px;
    padding: 6px 0;
    list-style: none;

    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 10000;
}

/* hover мостик (щоб не “пропадало”) */
.main-menu>li.has-submenu::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 12px;
}

.main-menu>li.has-submenu:hover .submenu,
.main-menu>li.has-submenu:focus-within .submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ПІДМЕНЮ: ідеальний баланс */
.submenu li a {
    display: block;
    padding: 8px 16px;

    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;

    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.25px;
    line-height: 1.35;

    opacity: 1;
    transition: background .15s ease, padding-left .15s ease, color .15s ease;
}

.submenu li a:hover {
    background: rgba(255, 255, 255, 0.12);
    padding-left: 20px;
    color: #fff;
}

/* ========================= TITLES ========================= */
.tools-title,
.section-subtitle {
    display: table;
    margin: 14px auto;
    padding: 10px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(40, 59, 105, 0.10);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
    color: var(--title);
    font-weight: 900;
}

.tools-title {
    font-size: 22px;
}

.section-subtitle {
    font-size: 18px;
}

/* ========================= GRID + CARDS ========================= */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 12px;
    margin-bottom: 24px;
}

.hub-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
}

.hub-card.glass {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
}

.hub-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.hub-card-top {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.hub-card h3 {
    font-size: 16px;
    color: var(--title);
}

.hub-card p {
    font-size: 14px;
    color: var(--muted);
}

/* Pills */
.hub-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(40, 59, 105, 0.15);
    color: var(--brand);
    font-size: 12px;
    font-weight: 900;
    width: max-content;
}

.hub-pill--sport {
    background: rgba(16, 185, 129, 0.12);
    color: #0f766e;
}

/* Button */
.btn {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    text-decoration: none;
    font-weight: 900;
    transition: transform .15s ease, background-color .15s ease;
}

.btn:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
}

/* Empty */
.hub-empty {
    text-align: center;
    padding: 10px 0;
    color: rgba(34, 34, 34, 0.8);
}

/* Divider */
.divider {
    border: none;
    border-top: 2px dashed rgba(40, 59, 105, 0.55);
    height: 0;
    max-width: 960px;
    margin: 26px auto;
}

/* SEO block */
.seo-block {
    max-width: 1000px;
    margin: 18px auto 0;
    padding: 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(40, 59, 105, 0.10);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
}

.seo-block h2 {
    color: var(--brand);
    font-size: 18px;
    margin-bottom: 8px;
}

.seo-block p {
    color: #444;
    font-size: 14px;
    margin-top: 10px;
}

.seo-note {
    opacity: .9;
}

/* ========================= PREMIUM FOOTER ========================= */
.site-footer {
    margin-top: 42px;
    padding: 18px 0;
    background: rgba(40, 59, 105, 0.92);
    backdrop-filter: blur(10px);
    position: relative;
}

.site-footer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.10);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 14px;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-brand {
    color: #fff;
    font-weight: 900;
    font-size: 14px;
    letter-spacing: .2px;
    opacity: .95;
}

.footer-text {
    color: #fff;
    font-size: 13px;
    opacity: .86;
}

.footer-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-weight: 900;
    font-size: 13px;
    opacity: .9;
    transition: opacity .15s ease, transform .15s ease, color .15s ease;
}

.footer-links a:hover {
    opacity: 1;
    color: #fff;
    transform: translateY(-1px);
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
}

.footer-social img {
    width: 18px !important;
    height: 18px !important;
    display: block;
    object-fit: contain;
    opacity: .92;
    transition: transform .15s ease, opacity .15s ease;
}

.footer-social a:hover img {
    transform: translateY(-1px) scale(1.08);
    opacity: 1;
}

/* ========================= RESPONSIVE ========================= */
@media (max-width: 520px) {
    .hub-grid {
        grid-template-columns: 1fr;
    }

    /* НЕ ховаємо назву, а робимо компактною */
    .brand {
        min-width: 0;
    }

    .brand-text {
        display: inline;
        font-size: 14px;
        letter-spacing: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
        /* можна 100-160 під свій хедер */
    }
}
@media (max-width: 768px) {
    .brand-icon {
        width: 32px;
        height: 32px;
    }
}
@media (max-width: 900px) {

    /* Burger visible */
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Panel becomes dropdown block */
    .nav-panel {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-top: 10px;
    }

    .site-header.nav-open .nav-panel {
        display: flex;
    }

    .main-nav {
        flex-wrap: wrap;
        gap: 10px;
    }

    .main-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    /* на мобайлі робимо компактні “таблетки”, але прямокутніші */
    .main-menu>li>a {
        padding: 10px 12px;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.10);
        transform: none !important;
        box-shadow: none !important;
    }

    .main-menu>li>a:hover {
        background: rgba(255, 255, 255, 0.12);
    }

    .nav-search {
        width: 100%;
        max-width: 100%;
    }

    .nav-search input {
        height: 38px;
    }

    /* Dropdown in mobile: static list under item */
    .submenu {
        position: static;
        margin-top: 8px;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        display: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.10);
    }

    .main-menu>li.has-submenu::after {
        display: none;
    }

    .has-submenu.submenu-open .submenu {
        display: block;
    }

    .submenu li a {
        padding: 10px 12px 10px 18px;
    }

    /* Footer stacks */
    .footer-inner {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 12px;
    }

    .footer-social {
        justify-content: center;
    }
}

@supports not (background-image: url("test.webp")) {
    body.home {
        background-image: url("../assets/photo1.png");
    }
}
/* FIX: show CalcCore on phones */
@media (max-width: 520px) {
    .brand {
        min-width: 0;
        flex: 1 1 auto;
    }

    .brand-text {
        display: inline !important;
        font-size: 14px;
        letter-spacing: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }

    /* to make room */
    .social-icons img {
        width: 12px;
        height: 12px;
    }

    .header-inner {
        gap: 10px;
    }

    .header-tools {
        gap: 8px;
    }
}