/* =========================================================
   QIYALI ULTRA — FRONTEND CSS
   Version: 1.2.0 (Cleaned & Refactored)
   ========================================================= */

/* -------------------------
   1. RESET & BASE
------------------------- */

@font-face {
    font-family: "Qiyali Inter";
    src: url("../fonts/InterVariable.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

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

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

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--q-bg);
    color: var(--q-text);
    font-family: "Qiyali Inter", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
}

img,
svg,
video {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

/* -------------------------
   2. VARIABLES & THEMES
------------------------- */

:root {
    /* Brand Colors */
    --q-primary: #111111;
    --q-secondary: #666666;
    --q-muted: #888888;
    --q-accent: #b6ff00;

    /* Theme Tokens */
    --q-text: #171717;
    --q-text-muted: var(--q-secondary);
    --q-bg: #ffffff;
    --q-bg-soft: #f7f7f5;
    --q-bg-dark: #111111;
    --q-surface: #ffffff;
    --q-surface-muted: #f7f7f5;
    --q-surface-alt: #f0f0f0;
    --q-border: #e7e7e7;
    --q-border-strong: #cccccc;

    /* Layout Spacing & Sizing */
    --q-container: 1240px;
    --container-width: 1200px;
    --q-radius: 10px;
    --q-radius-sm: 6px;

    --q-space-1: 8px;
    --q-space-2: 16px;
    --q-space-3: 24px;
    --q-space-4: 32px;
    --q-space-5: 48px;
    --q-space-6: 64px;
    --q-space-7: 96px;

    --q-transition: 180ms ease;
}

html[data-theme="dark"] {
    --q-primary: #f5f5f5;
    --q-secondary: #aaaaaa;
    --q-muted: #777777;
    --q-text: #f5f5f5;
    --q-text-muted: #aaaaaa;

    --q-bg: #111111;
    --q-bg-soft: #181818;
    --q-bg-dark: #050505;
    --q-surface: #151515;
    --q-surface-muted: #181818;
    --q-surface-alt: #222222;
    --q-border: #292929;
    --q-border-strong: #444444;
}

/* -------------------------
   3. TYPOGRAPHY
------------------------- */

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    color: inherit;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.025em;
}

h1 { font-size: clamp(40px, 7vw, 88px); }
h2 { font-size: clamp(32px, 5vw, 56px); }
h3 { font-size: clamp(24px, 3vw, 34px); }

p {
    margin: 0 0 1rem;
}

.lead {
    font-size: clamp(18px, 2vw, 22px);
    line-height: 1.5;
    color: var(--q-secondary);
}

.text-muted {
    color: var(--q-muted);
}

/* -------------------------
   4. LAYOUT & GLOBALS
------------------------- */

::selection {
    background: var(--q-primary);
    color: #ffffff;
}

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

.container {
    width: min(1200px, calc(100% - 48px));
    max-width: 1200px;
    margin-inline: auto;
    box-sizing: border-box;
}

.site-main {
    flex: 1 0 auto;
    min-height: 60vh;
    overflow-x: hidden;
    width: 100%;
}

.section {
    padding-block: var(--q-space-7);
}

.section--soft { background: var(--q-bg-soft); }
.section--dark { background: var(--q-bg-dark); color: #ffffff; }

.section__header,
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--q-space-4);
    margin-bottom: var(--q-space-5);
}

.section-heading__eyebrow {
    margin: 0 0 10px;
    color: var(--q-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-heading h2 { margin: 0; }

.section-heading__link {
    color: var(--q-text);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.section-heading__link:hover { color: var(--q-accent); }

.section__title {
    margin: 0;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.section__description {
    max-width: 620px;
    margin: 12px 0 0;
    color: var(--q-secondary);
}

/* -------------------------
   5. HEADER & NAVIGATION
------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 999;
    width: 100%;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--q-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: visible;
}

html[data-theme="dark"] .site-header {
    background: rgba(17, 17, 17, 0.94);
}

/* Ограничение ширины шапки единым контейнером */
.site-header__inner {
    position: relative;
    width: min(calc(100% - 40px), var(--q-container));
    margin-inline: auto;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--q-space-3);
    box-sizing: border-box;
}

.site-branding {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-logo {
    display: block;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.site-logo img {
    width: auto;
    max-height: 38px;
}

.custom-logo-link {
    display: block;
    line-height: 0;
}

.custom-logo {
    width: auto;
    max-height: 38px;
}

.primary-navigation ul {
    display: flex;
    align-items: center;
    gap: 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.primary-navigation {
    align-self: stretch;
    display: flex;
    align-items: center;
}

.primary-navigation > ul {
    height: 100%;
}

.primary-navigation > ul > li {
    position: relative;
    display: flex;
    align-items: center;
}

.primary-navigation a {
    position: relative;
    display: inline-block;
    padding: 30px 0;
    color: #333333;
    font-size: 14px;
    font-weight: 500;
}

.primary-navigation .menu-item-has-children > a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.primary-navigation .menu-item-has-children > a::before {
    content: "";
    width: 5px;
    height: 5px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    opacity: 0.6;
}

html[data-theme="dark"] .primary-navigation a { color: #dddddd; }

.primary-navigation a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: 17px;
    height: 1px;
    background: var(--q-primary);
    transition: right var(--q-transition);
}

.primary-navigation a:hover::after,
.primary-navigation .current-menu-item > a::after,
.primary-navigation .current_page_item > a::after {
    right: 0;
}

.primary-navigation > ul > .menu-item-has-children > .sub-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    width: min(1180px, calc(100vw - 40px));
    margin: 0;
    padding: 28px;
    border: 1px solid var(--q-border);
    background: var(--q-bg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
    visibility: hidden;
}

.primary-navigation > ul > .menu-item-has-children:hover > .sub-menu,
.primary-navigation > ul > .menu-item-has-children:focus-within > .sub-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
    visibility: visible;
}

.primary-navigation .sub-menu li {
    min-width: 0;
}

.primary-navigation .sub-menu > li {
    padding: 0 22px;
    border-left: 1px solid var(--q-border);
}

.primary-navigation .sub-menu > li:first-child {
    border-left: 0;
}

.primary-navigation .sub-menu a {
    display: block;
    padding: 8px 0;
    color: var(--q-text);
    font-size: 14px;
    font-weight: 600;
}

.primary-navigation .sub-menu a::after,
.primary-navigation .sub-menu a::before {
    display: none;
}

.primary-navigation .sub-menu .sub-menu {
    display: block;
    margin: 6px 0 0;
    padding: 0;
}

.primary-navigation .sub-menu .sub-menu a {
    padding: 5px 0;
    color: var(--q-text-muted);
    font-size: 12px;
    font-weight: 500;
}

.primary-navigation .sub-menu a:hover {
    color: var(--q-accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.header-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--q-primary);
}

.header-action:hover { background: var(--q-bg-soft); }

.theme-icon--moon { display: none; }
html[data-theme="dark"] .theme-icon--sun { display: none; }
html[data-theme="dark"] .theme-icon--moon { display: block; }
.site-search {
    display: none;
    border-top: 1px solid var(--q-border);
    border-bottom: 1px solid var(--q-border);
    background: var(--q-bg);
}

.site-search.is-open { display: block; }

.search-form {
    display: flex;
    gap: 10px;
    padding-block: 16px;
}

.search-form__input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--q-border);
    border-radius: var(--q-radius-sm);
    background: var(--q-bg);
    color: var(--q-primary);
    outline: none;
}

.search-form__input:focus { border-color: var(--q-primary); }

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--q-border);
    border-radius: 50%;
    background: transparent;
}

.menu-toggle__lines,
.menu-toggle__lines::before,
.menu-toggle__lines::after {
    display: block;
    width: 18px;
    height: 1px;
    margin: auto;
    background: currentColor;
}

.menu-toggle__lines { position: relative; }
.menu-toggle__lines::before,
.menu-toggle__lines::after {
    content: "";
    position: absolute;
    left: 0;
}

.menu-toggle__lines::before { top: -6px; }
.menu-toggle__lines::after { top: 6px; }

/* -------------------------
   6. BUTTONS & UI
------------------------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border: 1px solid var(--q-primary);
    border-radius: var(--q-radius-sm);
    background: var(--q-primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    transition: transform var(--q-transition), background var(--q-transition), color var(--q-transition), border-color var(--q-transition);
}

.button:hover { transform: translateY(-1px); }

.button--light {
    background: #ffffff;
    color: #111111;
    border-color: #ffffff;
}

.button--outline {
    background: transparent;
    color: var(--q-primary);
}

.button--accent {
    background: var(--q-accent);
    border-color: var(--q-accent);
    color: #111111;
}

.button--secondary {
    background: transparent;
    color: var(--q-primary);
    border-color: var(--q-primary);
}

.button--secondary:hover {
    background: var(--q-primary);
    color: #ffffff;
}

.form-group { margin-bottom: var(--q-space-3); }

.form-label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--q-border);
    border-radius: var(--q-radius-sm);
    background: var(--q-surface);
    color: var(--q-primary);
    outline: none;
    transition: border-color var(--q-transition);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.form-control:focus { border-color: var(--q-primary); }

/* -------------------------
   7. GRID & CARDS
------------------------- */

.grid {
    display: grid;
    gap: var(--q-space-4);
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
    overflow: hidden;
    border: 1px solid var(--q-border);
    border-radius: var(--q-radius);
    background: var(--q-surface);
}

.card__image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--q-bg-soft);
}

.card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease;
}

.card:hover .card__image img { transform: scale(1.025); }
.card__content { padding: var(--q-space-3); }

.card__meta {
    margin-bottom: 8px;
    color: var(--q-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.card__title { margin-bottom: 8px; font-size: 22px; }
.card__excerpt { color: var(--q-secondary); font-size: 15px; }

/* -------------------------
   8. HERO SECTION
------------------------- */

.hero {
    padding-block: clamp(80px, 12vw, 160px);
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--q-space-3);
    color: var(--q-secondary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero__eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--q-accent);
}

.hero__title {
    max-width: 1000px;
    margin: 0;
}

.hero__description {
    max-width: 700px;
    margin-top: var(--q-space-4);
    color: var(--q-secondary);
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.6;
}

.hero__description > p { 
    margin: 0; 
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: var(--q-space-5);
}

/* HOME HERO (60% / 40%) */
.home-hero {
    width: 100%;
    padding: 80px 0 120px;
    overflow: hidden; /* Ekrandan chiqib ketuvchi elementlarni cheklash */
}

.home-hero__container {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px; /* Ichki kontent va rasm orasidagi aniq masofa */
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

.home-hero__content {
    flex: 0 0 calc(60% - 20px); /* Gapdagi masofani inobatga olgan holda aniq 60% */
    max-width: calc(60% - 20px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* Toshishni oldini olish */
    padding: 0; /* Ekrandan surilishga sabab bo'lgan padding-right olib tashlandi */
}

.home-hero .hero__eyebrow { 
    margin-bottom: 20px; 
    color: var(--q-accent);
}

.home-hero .hero__title {
    max-width: 100%;
    color: var(--q-text);
    font-size: clamp(36px, 5vw, 84px);
    font-weight: 600;
    line-height: 0.98;
    letter-spacing: -0.055em;
    word-break: break-word; /* Uzoq so'zlar bo'lsa ekrandan chiqarmaslik */
}

.home-hero .hero__description {
    max-width: 620px;
    margin-top: 36px;
    margin-bottom: 0;
}

.home-hero .hero__description > p {
    color: var(--q-text-muted);
    font-size: 18px;
    line-height: 1.7;
}

.home-hero .hero__actions { 
    margin-top: 40px; 
}

.home-hero__visual { 
    flex: 0 0 calc(40% - 20px); /* Gapdagi masofani inobatga olgan holda aniq 40% */
    max-width: calc(40% - 20px);
    min-width: 0;
}

.home-hero__image {
    width: 100%;
    height: auto;
    display: block;
    overflow: hidden; /* Hover effekti paytida rasmni qutidan chiqarmaslik */
}

.home-hero__image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    transition: transform 600ms ease, filter 600ms ease;
}

.home-hero__image:hover img {
    transform: scale(1.025);
}

.home-hero__signal {
    position: absolute;
    right: -24px;
    bottom: 24px;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 178px;
    padding: 16px 18px;
    background: var(--q-accent);
    color: #111111;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.home-hero__signal-index {
    font-size: 10px;
    letter-spacing: 0.08em;
}

.home-capabilities {
    border-top: 1px solid var(--q-border);
    border-bottom: 1px solid var(--q-border);
    background: var(--q-surface);
}

.home-capabilities__grid {
    display: grid;
    grid-template-columns: 1.25fr repeat(4, 1fr);
    align-items: center;
    min-height: 82px;
}

.home-capabilities__grid > span {
    min-height: 82px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-left: 1px solid var(--q-border);
    color: var(--q-text-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.home-capabilities__grid > span:last-child {
    border-right: 1px solid var(--q-border);
}

.home-capabilities__label {
    color: var(--q-text) !important;
    font-size: 11px !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-capabilities__grid > span:not(.home-capabilities__label):hover {
    background: var(--q-bg-soft);
    color: var(--q-text);
}

/* -------------------------
   MOBIL MOSLASHUVCHANLIK (RESPONSIVE)
------------------------- */
@media (max-width: 991px) {
    .home-hero {
        padding: 40px 0 60px;
    }

    .home-hero__container {
        flex-direction: column;
        gap: 40px;
    }

    .home-hero__content,
    .home-hero__visual {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }

    .home-hero__signal {
        right: 20px;
    }

    .home-capabilities__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-capabilities__label {
        grid-column: 1 / -1;
        border-right: 1px solid var(--q-border);
    }
}

/* -------------------------
   9. HOME SECTIONS (PARTNERS, ABOUT, PORTFOLIO)
------------------------- */

/* PARTNERS Grid */
.home-partners { border-bottom: 1px solid var(--q-border); }

.partners-grid {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    border-top: 1px solid var(--q-border);
    border-left: 1px solid var(--q-border);
}

.partner-cell {
    position: relative;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border-right: 1px solid var(--q-border);
    border-bottom: 1px solid var(--q-border);
    background: var(--q-surface);
}

.partner-cell:hover { background: var(--q-bg-soft); }

.partner-cell__number {
    position: absolute;
    top: 10px;
    left: 12px;
    color: var(--q-muted);
    font-size: 9px;
    line-height: 1;
}

.partner-cell__name {
    color: var(--q-text);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    letter-spacing: -0.01em;
}

/* HOME ABOUT */
.home-about { border-bottom: 1px solid var(--q-border); }

.home-about__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 80px;
    align-items: start;
}

.home-about__grid h2 { max-width: 600px; margin: 0; }

.home-about__text {
    max-width: 620px;
    font-size: 17px;
    line-height: 1.8;
    color: var(--q-text-muted);
}

.home-about__text p { margin-bottom: 24px; }

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--q-text);
    font-size: 14px;
    font-weight: 600;
}

.text-link:hover { color: var(--q-accent); }

/* HOME PORTFOLIO */
.home-portfolio { border-bottom: 1px solid var(--q-border); }

.portfolio-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 1px;
    background: var(--q-border);
    border: 1px solid var(--q-border);
}

.portfolio-card {
    min-height: 330px;
    background: var(--q-surface);
}

.portfolio-card--large {
    grid-row: span 2;
    min-height: 661px;
}

.portfolio-card__link {
    position: relative;
    height: 100%;
    min-height: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 32px;
    transition: background-color var(--q-transition), color var(--q-transition);
}

.portfolio-card__link:hover {
    background: var(--q-text);
    color: var(--q-bg);
}

.portfolio-card__number {
    color: var(--q-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.portfolio-card__content { max-width: 580px; }

.portfolio-card__category {
    margin-bottom: 12px;
    color: var(--q-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portfolio-card__content h3 {
    margin: 0 0 14px;
    font-size: clamp(24px, 3vw, 36px);
}

.portfolio-card__content p:last-child {
    max-width: 520px;
    margin: 0;
    color: var(--q-text-muted);
    font-size: 15px;
    line-height: 1.65;
}

.portfolio-card__link:hover .portfolio-card__content p:last-child {
    color: #aaaaaa;
}

.portfolio-card__arrow {
    align-self: flex-end;
    font-size: 28px;
    line-height: 1;
}

.portfolio-grid--dynamic .portfolio-card__link,
.portfolio-grid--fallback .portfolio-card__link {
    min-height: inherit;
}

.portfolio-grid--dynamic .portfolio-card {
    min-height: 330px;
}

.portfolio-grid--dynamic .portfolio-card--large {
    min-height: 661px;
}

.home-cta {
    background: var(--q-bg-dark);
    color: #ffffff;
}

.home-cta__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    align-items: end;
    gap: 64px;
}

.home-cta h2 {
    max-width: 680px;
    margin: 0;
    color: #ffffff;
    font-size: clamp(42px, 6vw, 76px);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.home-cta__action {
    max-width: 420px;
}

.home-cta__action p {
    margin: 0 0 28px;
    color: #aaaaaa;
    font-size: 16px;
    line-height: 1.7;
}



/* CATEGORY CHILDREN */
.category-children {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
    margin-top: 32px;
}

.category-child {
    min-height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 1px solid var(--q-border);
    border-radius: 14px;
    background: var(--q-surface);
    color: var(--q-text);
    text-align: center;
    transition: transform var(--q-transition), border-color var(--q-transition), background-color var(--q-transition), color var(--q-transition), box-shadow var(--q-transition);
}

.category-child__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    color: var(--q-accent);
    font-size: 36px;
    line-height: 1;
    transition: color var(--q-transition), transform var(--q-transition);
}

.category-child__name {
    display: block;
    color: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    text-transform: uppercase;
}

.category-child:hover {
    transform: translateY(-4px);
    border-color: var(--q-accent);
    background: var(--q-accent);
    color: #111111;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.category-child:hover .category-child__icon,
.category-child:hover .category-child__name {
    color: #111111;
}

/* -------------------------
   10. BLOG, ARCHIVE & CARDS
------------------------- */

.archive-page {
    padding-top: 64px;
    padding-bottom: 96px;
}

.archive-header {
    max-width: 760px;
    margin-bottom: 48px;
}

.archive-header h1 { margin: 0; }

.archive-description {
    margin-top: 16px;
    max-width: 680px;
    color: var(--q-text-muted);
    line-height: 1.7;
}

.home-blog { border-bottom: 1px solid var(--q-border); }

.articles-grid,
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.article-card,
.blog-card {
    min-width: 0;
    overflow: hidden;
    background: var(--q-surface);
    border: 1px solid var(--q-border);
    border-radius: 16px;
    transition: transform var(--q-transition), border-color var(--q-transition), box-shadow var(--q-transition);
}

.article-card:hover,
.blog-card:hover {
    transform: translateY(-3px);
    border-color: var(--q-border-strong);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.07);
}

html[data-theme="dark"] .article-card:hover,
html[data-theme="dark"] .blog-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.article-card__image,
.blog-card__image {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--q-surface-muted);
}

.article-card__image img,
.blog-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease;
}

.article-card:hover .article-card__image img,
.blog-card:hover .blog-card__image img {
    transform: scale(1.025);
}

.article-card__body,
.blog-card__content {
    display: flex;
    flex-direction: column;
    min-height: 250px;
    padding: 22px;
}

.article-card__meta,
.blog-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--q-text-muted);
}

.blog-card__category {
    padding-left: 8px;
    border-left: 1px solid var(--q-border-strong);
}

.article-card__title,
.blog-card__title {
    margin: 0 0 12px;
    font-size: 20px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.article-card__title a,
.blog-card__title a {
    color: var(--q-text);
}

.article-card__title a:hover,
.blog-card__title a:hover {
    color: var(--q-accent);
}

.article-card__excerpt,
.blog-card__excerpt {
    margin-bottom: 20px;
    color: var(--q-text-muted);
    font-size: 14px;
    line-height: 1.65;
}

.article-card__link,
.blog-card__link {
    margin-top: auto;
    color: var(--q-text);
    font-size: 14px;
    font-weight: 600;
}

.article-card__link:hover,
.blog-card__link:hover {
    color: var(--q-accent);
}

/* Post Lists Layouts */
.post-list {
    display: grid;
    gap: var(--q-space-5);
}

.post-card {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--q-space-4);
    padding-bottom: var(--q-space-5);
    border-bottom: 1px solid var(--q-border);
}

.post-card__image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: var(--q-radius);
    background: var(--q-bg-soft);
}

.post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card__meta {
    margin-bottom: 10px;
    color: var(--q-muted);
    font-size: 13px;
}

.post-card__title {
    margin-bottom: 12px;
    font-size: clamp(24px, 3vw, 36px);
}

/* -------------------------
   11. SINGLE POST
------------------------- */

.single-hero {
    position: relative;
    width: 100%;
    min-height: min(680px, 72vh);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: var(--q-text);
    color: #ffffff;
}

.single-hero__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.single-hero__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.single-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.62) 42%, rgba(0, 0, 0, 0.10) 100%);
}

.single-hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--container-width);
    margin-inline: auto;
    padding-top: 180px;
    padding-bottom: 64px;
}

.single-hero__category {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    font-weight: 600;
}

.single-hero__title {
    width: 100%;
    max-width: 900px;
    margin: 0 0 20px;
    color: #ffffff;
    font-size: clamp(36px, 5vw, 68px);
    line-height: 1.04;
    letter-spacing: -0.04em;
    overflow-wrap: break-word;
}

.single-hero__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
}

.single-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 72px;
    padding-top: 72px;
    padding-bottom: 80px;
}

.single-article { min-width: 0; }

.single-article__content {
    max-width: 820px;
    font-size: 17px;
    line-height: 1.85;
}

.single-article__content > * {
    margin-top: 0;
    margin-bottom: 1.4em;
}

.single-article__content h2 { margin-top: 2em; font-size: 32px; line-height: 1.2; }
.single-article__content h3 { margin-top: 1.8em; font-size: 24px; line-height: 1.3; }
.single-article__content h4 { margin-top: 1.6em; font-size: 20px; line-height: 1.35; }

.single-article__content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.single-article__content figure { margin: 32px 0; }
.single-article__content figcaption {
    margin-top: 8px;
    color: var(--q-text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.single-article__content blockquote {
    margin: 32px 0;
    padding: 8px 0 8px 24px;
    border-left: 3px solid var(--q-accent);
    font-size: 21px;
    line-height: 1.6;
}

.single-article__content pre {
    overflow-x: auto;
    padding: 20px;
    border-radius: 12px;
    background: var(--q-surface-muted);
}

.single-article__content code { font-size: 0.9em; }
.single-article__content pre code { font-size: 14px; }

.single-article__content table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

.single-article__content figure,
.single-article__content table {
    max-width: 100%;
}

.single-article__content table {
    display: block;
    overflow-x: auto;
}

.single-article__content th,
.single-article__content td {
    padding: 10px 12px;
    border: 1px solid var(--q-border);
    text-align: left;
}

/* Taxonomy & Share */
.single-taxonomy {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 52px;
    padding-top: 28px;
    border-top: 1px solid var(--q-border);
}

.taxonomy-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.taxonomy-item__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 110px;
    color: var(--q-text-muted);
    font-size: 13px;
    font-weight: 600;
}

.taxonomy-item__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.taxonomy-item__links a {
    display: inline-flex;
    padding: 6px 10px;
    border: 1px solid var(--q-border);
    border-radius: 999px;
    color: var(--q-text);
    font-size: 13px;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.taxonomy-item__links a:hover {
    border-color: var(--q-accent);
    color: var(--q-accent);
}

.single-share {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 32px;
    padding: 24px 0;
    border-top: 1px solid var(--q-border);
    border-bottom: 1px solid var(--q-border);
}

.single-share__label {
    font-size: 14px;
    font-weight: 600;
}

.single-share__links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--q-border);
    border-radius: 50%;
    background: transparent;
    color: var(--q-text);
    font-size: 12px;
    font-weight: 700;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.share-link:hover {
    border-color: var(--q-accent);
    color: var(--q-accent);
}

/* Post Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 40px;
    border-top: 1px solid var(--q-border);
    border-bottom: 1px solid var(--q-border);
}

.post-navigation__item {
    min-width: 0;
    padding: 26px 0;
}

.post-navigation__item--next {
    padding-left: 28px;
    border-left: 1px solid var(--q-border);
    text-align: right;
}

.post-navigation__label {
    display: block;
    margin-bottom: 8px;
    color: var(--q-text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-navigation a {
    display: block;
    color: var(--q-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: break-word;
}

.post-navigation a:hover { color: var(--q-accent); }

/* -------------------------
   12. SIDEBAR & CAROUSEL
------------------------- */

.single-sidebar { min-width: 0; }
.sidebar-block { margin-bottom: 42px; }
.sidebar-block:last-child { margin-bottom: 0; }
.sidebar-block__title { margin: 0 0 18px; font-size: 18px; line-height: 1.3; }

.sidebar-list { margin: 0; padding: 0; list-style: none; }
.sidebar-list li { border-bottom: 1px solid var(--q-border); }
.sidebar-list li:first-child { border-top: 1px solid var(--q-border); }

.sidebar-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 0;
    color: var(--q-text);
    font-size: 14px;
    transition: color 0.2s ease;
}

.sidebar-list a:hover { color: var(--q-accent); }
.sidebar-list small { color: var(--q-text-muted); }

.sidebar-posts { display: flex; flex-direction: column; }

.sidebar-post {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--q-border);
}

.sidebar-post:first-child { border-top: 1px solid var(--q-border); }

.sidebar-post__image {
    display: block;
    width: 76px;
    height: 60px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--q-surface-muted);
}

.sidebar-post__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-post__content time {
    display: block;
    margin-bottom: 5px;
    color: var(--q-text-muted);
    font-size: 11px;
}

.sidebar-post__content h3 { margin: 0; font-size: 14px; line-height: 1.35; }
.sidebar-post__content h3 a { color: var(--q-text); }
.sidebar-post__content h3 a:hover { color: var(--q-accent); }

.sidebar-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.sidebar-tags a {
    display: inline-flex;
    padding: 7px 10px;
    border: 1px solid var(--q-border);
    border-radius: 999px;
    color: var(--q-text-muted);
    font-size: 12px;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.sidebar-tags a:hover {
    border-color: var(--q-accent);
    color: var(--q-accent);
}

/* Similar Posts Carousel */
.similar-posts {
    overflow: hidden;
    padding-top: 72px;
    padding-bottom: 90px;
    border-top: 1px solid var(--q-border);
}

.similar-posts__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 28px;
}

.similar-posts__header h2 { margin: 0; }
.similar-posts__controls { display: flex; gap: 8px; }

.similar-posts__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--q-border);
    border-radius: 50%;
    background: var(--q-surface);
    color: var(--q-text);
    transition: border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.similar-posts__button:hover:not(:disabled) {
    border-color: var(--q-accent);
    color: var(--q-accent);
}

.similar-posts__button:disabled {
    opacity: 0.35;
    cursor: default;
}

.similar-carousel { width: 100%; overflow: hidden; }

.similar-carousel__track {
    display: flex;
    gap: 24px;
    transition: transform 350ms ease;
    will-change: transform;
}

.similar-card {
    flex: 0 0 calc((100% - 48px) / 3);
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--q-border);
    border-radius: 14px;
    background: var(--q-surface);
}

.similar-card__image {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--q-surface-muted);
}

.similar-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease;
}

.similar-card:hover .similar-card__image img { transform: scale(1.025); }
.similar-card__body { padding: 18px; }

.similar-card__body time {
    display: block;
    margin-bottom: 8px;
    color: var(--q-text-muted);
    font-size: 12px;
}

.similar-card__body h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.similar-card__body h3 a { color: var(--q-text); }
.similar-card__body h3 a:hover { color: var(--q-accent); }

/* -------------------------
   13. PAGES (STATIC, SEARCH, INDEX)
------------------------- */

.site-main > .page { padding: 80px 0 100px; }
.page-content { max-width: 900px; margin: 0 auto; }
.page-content__header { margin-bottom: 48px; }

.page-content__title {
    margin: 0;
    color: var(--q-text);
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.page-content__image {
    width: 100%;
    margin-bottom: 48px;
    overflow: hidden;
    border-radius: 8px;
}

.page-content__body {
    color: var(--q-text);
    font-size: 17px;
    line-height: 1.8;
}

.page-content__body h2 { margin: 56px 0 20px; font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -0.025em; }
.page-content__body h3 { margin: 40px 0 16px; font-size: 24px; font-weight: 600; line-height: 1.3; }
.page-content__body h4 { margin: 32px 0 14px; font-size: 20px; font-weight: 600; }
.page-content__body p { margin: 0 0 24px; }
.page-content__body a { color: var(--q-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.page-content__body ul, .page-content__body ol { margin: 0 0 28px; padding-left: 28px; }
.page-content__body li { margin-bottom: 10px; }
.page-content__body img { max-width: 100%; height: auto; border-radius: 6px; }

.page-content__body blockquote {
    margin: 40px 0;
    padding: 20px 24px;
    border-left: 3px solid var(--q-accent);
    color: var(--q-text-muted);
    font-size: 20px;
    line-height: 1.6;
}

.page-content__body table { width: 100%; margin: 32px 0; border-collapse: collapse; }
.page-content__body th, .page-content__body td { padding: 12px 14px; border-bottom: 1px solid var(--q-border); text-align: left; }

.page-content__body pre {
    overflow-x: auto;
    margin: 32px 0;
    padding: 20px;
    border-radius: 6px;
    background: var(--q-bg-soft);
    font-size: 14px;
    line-height: 1.6;
}

.page-content__body code { font-size: 0.9em; }

/* Search & Fallback Index */
.search-page, .site-index { padding: 80px 0 100px; }
.search-page__header, .site-index__header { margin-bottom: 48px; }

.search-page__eyebrow, .site-index__eyebrow {
    margin: 0 0 10px;
    color: var(--q-accent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.search-page__title, .site-index__title {
    max-width: 900px;
    margin: 0;
    color: var(--q-text);
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.search-page__count { margin: 14px 0 0; color: var(--q-text-muted); font-size: 14px; }
.search-page__empty, .site-index__empty { max-width: 620px; margin: 80px auto; text-align: center; }

/* -------------------------
   14. 404 ERROR PAGE
------------------------- */

.error-page {
    position: relative;
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.error-page__inner {
    position: relative;
    width: 100%;
    max-width: var(--container-width);
    margin-inline: auto;
    padding-block: 100px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: 80px;
}

.error-page__visual {
    position: relative;
    width: 100%;
    min-height: 430px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-page__number {
    position: relative;
    z-index: 1;
    font-size: clamp(150px, 20vw, 280px);
    line-height: 0.8;
    font-weight: 800;
    letter-spacing: -0.09em;
    color: var(--q-surface-muted);
    user-select: none;
}

.puzzle {
    position: absolute;
    width: 92px;
    height: 92px;
    border: 2px solid var(--q-border);
    background: var(--q-surface);
    z-index: 3;
    transition: transform 0.4s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.puzzle::before, .puzzle::after,
.puzzle span::before, .puzzle span::after {
    content: "";
    position: absolute;
    width: 25px;
    height: 25px;
    border: 2px solid var(--q-border);
    border-radius: 50%;
    background: var(--q-surface);
}

.puzzle::before { top: -14px; left: 31px; border-bottom: 0; }
.puzzle::after { top: 31px; right: -14px; border-left: 0; }
.puzzle span::before { bottom: -14px; left: 31px; border-top: 0; }
.puzzle span::after { top: 31px; left: -14px; border-right: 0; }

.puzzle--one { top: 70px; left: 18%; transform: rotate(-8deg); animation: puzzleFloatOne 5s ease-in-out infinite; }
.puzzle--two { top: 165px; right: 16%; transform: rotate(7deg); animation: puzzleFloatTwo 6s ease-in-out infinite; }
.puzzle--three { bottom: 48px; left: 27%; transform: rotate(4deg); animation: puzzleFloatThree 5.5s ease-in-out infinite; }
.puzzle--four { bottom: 85px; right: 25%; transform: rotate(-6deg); animation: puzzleFloatFour 6.5s ease-in-out infinite; }

.puzzle--floating {
    width: 58px;
    height: 58px;
    top: 30px;
    right: 34%;
    opacity: 0.65;
    transform: rotate(20deg) scale(0.8);
    animation: puzzleFloatFive 4.5s ease-in-out infinite;
}

.error-page__content { max-width: 560px; }
.error-page__eyebrow { margin: 0 0 14px; color: var(--q-accent); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.error-page__title { margin: 0 0 22px; font-size: clamp(38px, 5vw, 64px); line-height: 1.04; letter-spacing: -0.045em; }
.error-page__description { margin: 0 0 32px; color: var(--q-text-muted); font-size: 17px; line-height: 1.7; }

.error-page__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.error-page__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border: 1px solid var(--q-border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.error-page__button:hover { transform: translateY(-2px); }
.error-page__button--primary { border-color: var(--q-text); background: var(--q-text); color: var(--q-bg); }
.error-page__button--primary:hover { background: var(--q-accent); border-color: var(--q-accent); color: #111111; }
.error-page__button--secondary { background: transparent; color: var(--q-text); }
.error-page__button--secondary:hover { border-color: var(--q-accent); color: var(--q-accent); }

/* Puzzle Keyframe Animations */
@keyframes puzzleFloatOne {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-8deg); }
    50% { transform: translate3d(-5px, -10px, 0) rotate(-3deg); }
}
@keyframes puzzleFloatTwo {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(7deg); }
    50% { transform: translate3d(7px, -12px, 0) rotate(12deg); }
}
@keyframes puzzleFloatThree {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(4deg); }
    50% { transform: translate3d(-8px, 7px, 0) rotate(9deg); }
}
@keyframes puzzleFloatFour {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-6deg); }
    50% { transform: translate3d(8px, -7px, 0) rotate(-12deg); }
}
@keyframes puzzleFloatFive {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(20deg) scale(0.8); }
    50% { transform: translate3d(10px, -14px, 0) rotate(32deg) scale(0.8); }
}

/* -------------------------
   15. FOOTER
------------------------- */

.site-footer {
    width: 100%;
    background: var(--q-surface);
    color: var(--q-text);
    border-top: 1px solid var(--q-border);
    flex-shrink: 0;
}

/* Синхронизация ширины футера с контейнером сайта */
.site-footer__inner {
    width: min(calc(100% - 40px), var(--q-container));
    min-height: 64px;
    margin-inline: auto;
    padding: 16px 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    box-sizing: border-box;
}

.site-footer__copyright {
    color: var(--q-text-muted);
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
}

.site-footer__links,
.site-footer__social {
    display: flex;
    align-items: center;
}

.site-footer__links {
    justify-content: flex-end;
    gap: 20px;
}

.site-footer__social {
    justify-content: center;
    gap: 8px;
}

.site-footer__links a,
.site-footer__social a {
    color: var(--q-text-muted);
    font-size: 12px;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.site-footer__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--q-border);
    border-radius: 50%;
    transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.site-footer__social svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.site-footer__social a:hover,
.site-footer__social a:focus-visible {
    border-color: var(--q-accent);
    background: var(--q-accent);
    color: #111111;
    transform: translateY(-2px);
}

.site-footer__links a:hover,
.site-footer__links a:hover {
    color: var(--q-accent);
}

.site-footer__center {
    max-width: 600px;
    margin-inline: auto;
    text-align: center;
}

.footer-site-name {
    display: inline-block;
    margin-bottom: 12px;
    color: #ffffff;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.footer-tagline { color: #aaaaaa; font-size: 15px; }
.footer-site-info { margin-top: 18px; color: #777777; font-size: 13px; line-height: 1.8; }
.footer-social { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 24px; }

/* -------------------------
   16. PAGINATION & WORDPRESS UTILS
------------------------- */

.pagination, .archive-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: var(--q-space-6);
}

.pagination .page-numbers,
.archive-pagination a,
.archive-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding-inline: 12px;
    border: 1px solid var(--q-border);
    border-radius: var(--q-radius-sm);
    color: var(--q-text);
    background: var(--q-surface);
    font-size: 14px;
}

.pagination .current,
.archive-pagination .current {
    background: var(--q-text);
    border-color: var(--q-text);
    color: var(--q-bg);
}

.alignwide { width: min(calc(100% - 40px), 1400px); margin-inline: auto; }
.alignfull { width: 100%; max-width: none; }
.wp-block-image img, .wp-caption { max-width: 100%; }

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* -------------------------
   17. MEDIA QUERIES & RESPONSIVE
------------------------- */

/* Desktop / Tablet Large (Max 1100px) */
@media (max-width: 1100px) {
    .partners-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .home-about__grid { gap: 48px; }
}

/* Tablet Large (Max 1024px) */
@media (max-width: 1024px) {
    .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .single-layout { grid-template-columns: 1fr; gap: 56px; }
    .single-sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
    .sidebar-block { margin-bottom: 0; }
}

/* Tablet Medium (Max 900px) */
@media (max-width: 900px) {
    .home-hero { padding: 64px 0 90px; }
    .home-hero__container { min-height: 520px; }
    .home-hero__content { padding: 48px 48px 48px 0; }
    .home-hero .hero__title { font-size: clamp(44px, 6vw, 64px); }
    .home-hero .hero__description > p { font-size: 16px; }
    .home-hero__image { min-height: 520px; }

    .partners-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .blog-grid, .articles-grid, .search-page .articles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
    .home-about__grid { grid-template-columns: 1fr; gap: 32px; }
    
    .portfolio-grid { grid-template-columns: 1fr; }
    .portfolio-card--large { grid-row: auto; min-height: 420px; }
    .portfolio-card { min-height: 300px; }

    .portfolio-grid--dynamic .portfolio-card--large {
        min-height: 420px;
    }

    .home-cta__inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .category-children { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
    .category-child { min-height: 115px; padding: 20px 14px; }
    .category-child__icon { width: 42px; height: 42px; font-size: 30px; margin-bottom: 12px; }

    .error-page__inner { grid-template-columns: 1fr; gap: 20px; padding-block: 70px; }
    .error-page__visual { min-height: 330px; }
    .error-page__number { font-size: clamp(150px, 30vw, 230px); }
    .error-page__content { max-width: 680px; }
}

/* Mobile Standard (Max 768px) */
@media (max-width: 768px) {
    .container { width: min(calc(100% - 32px), var(--q-container)); }
    .section { padding-block: var(--q-space-6); }
    .site-header__inner { min-height: 64px; flex-wrap: nowrap; }

    .menu-toggle { display: flex; }
    .primary-navigation {
        position: absolute;
        top: 100%;
        right: 16px;
        left: 16px;
        display: none;
        padding: 12px 16px 20px;
        border: 1px solid var(--q-border);
        border-radius: var(--q-radius);
        background: var(--q-bg);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);}
    .primary-navigation.is-open { display: block; }
    .primary-navigation ul { display: block; }
    .primary-navigation > ul > li { display: block; }
    .primary-navigation li { border-bottom: 1px solid var(--q-border); }
    .primary-navigation a { display: block; padding: 13px 4px; }
    .primary-navigation a::after { display: none; }

    .primary-navigation .menu-item-has-children > a {
        justify-content: space-between;
    }

    .primary-navigation .menu-item-has-children > a::before {
        display: none;
    }

    .primary-navigation > ul > .menu-item-has-children > .sub-menu {
        position: static;
        display: none;
        width: auto;
        margin: 0 0 8px;
        padding: 6px 0 6px 14px;
        border: 0;
        border-left: 1px solid var(--q-border);
        box-shadow: none;
        opacity: 1;
        pointer-events: auto;
        transform: none;
        visibility: visible;
    }

    .primary-navigation > ul > .menu-item-has-children.is-submenu-open > .sub-menu {
        display: block;
    }

    .primary-navigation .sub-menu > li {
        padding: 0;
        border: 0;
    }

    .primary-navigation .sub-menu a,
    .primary-navigation .sub-menu .sub-menu a {
        padding: 8px 4px;
        font-size: 13px;
    }

    .submenu-toggle {
        position: absolute;
        top: 7px;
        right: 0;
        width: 38px;
        height: 38px;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--q-text-muted);
    }

    .submenu-toggle::before {
        content: "";
        display: block;
        width: 7px;
        height: 7px;
        margin: auto;
        border-right: 1px solid currentColor;
        border-bottom: 1px solid currentColor;
        transform: rotate(45deg) translate(-2px, -2px);
        transition: transform 180ms ease;
    }

    .menu-item-has-children.is-submenu-open > .submenu-toggle::before {
        transform: rotate(225deg) translate(-1px, -1px);
    }

    .grid--2, .grid--3, .grid--4, .post-card { grid-template-columns: 1fr; }
    .post-card__image { max-height: 320px; }

    .single-hero { min-height: 560px; }
    .single-hero__content { padding-top: 140px; padding-bottom: 40px; }
    .single-hero__title { font-size: clamp(32px, 9vw, 48px); }
    .single-sidebar { grid-template-columns: 1fr; }

    .single-layout {
        gap: 40px;
        padding-top: 48px;
        padding-bottom: 56px;
    }

    .single-article__content {
        font-size: 16px;
        line-height: 1.75;
    }

    .single-article__content blockquote {
        padding-left: 18px;
        font-size: 19px;
    }
    
    .taxonomy-item { flex-direction: column; gap: 10px; }
    .single-share { align-items: flex-start; gap: 18px; flex-direction: column; }
    
    .post-navigation { grid-template-columns: 1fr; }
    .post-navigation__item--next { padding-left: 0; border-top: 1px solid var(--q-border); border-left: 0; text-align: left; }

    .similar-posts__header { align-items: flex-start; gap: 20px; flex-direction: column; }
    .similar-card { flex-basis: calc((100% - 18px) / 2); }

    .site-footer__inner {
        min-height: 58px;
        padding: 18px 20px;
        grid-template-columns: 1fr;
        gap: 16px;
        justify-items: center;
        text-align: center;
    }

    .site-footer__copyright { white-space: normal; }
    .site-footer__links { justify-content: center; flex-wrap: wrap; gap: 12px 18px; }
    .site-footer__social { gap: 10px; }
}

/* Mobile Small (Max 700px) */
@media (max-width: 700px) {
    .home-hero { padding: 48px 0 72px; }
    .home-hero__container { display: flex; flex-direction: column; min-height: auto; }
    .home-hero__content { display: block; padding: 0 0 48px; }
    .home-hero .hero__eyebrow { margin-bottom: 16px; }
    .home-hero .hero__title { font-size: clamp(46px, 13vw, 68px); line-height: 0.98; }
    .home-hero .hero__description { margin-top: 28px; }
    .home-hero .hero__description > p { font-size: 16px; line-height: 1.65; }
    .home-hero .hero__actions { margin-top: 32px; }
    .home-hero__visual { width: 100%; }
    .home-hero__image { width: 100%; min-height: 420px; aspect-ratio: 4 / 5; }

    .home-hero__signal {
        right: 12px;
        bottom: 12px;
        min-width: 158px;
        padding: 13px 14px;
        font-size: 10px;
    }

    .home-capabilities__grid {
        grid-template-columns: 1fr;
    }

    .home-capabilities__grid > span,
    .home-capabilities__label {
        min-height: 54px;
        border-right: 1px solid var(--q-border);
    }

   }

/* Mobile Extra Small (Max 600px) */
@media (max-width: 600px) {
    .section-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
    .archive-page, .search-page, .site-main > .page, .site-index { padding-block: 48px 64px; }
    .archive-header, .search-page__header, .page-content__header { margin-bottom: 32px; }

    .partners-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .partner-cell { min-height: 90px; }

    .blog-grid, .articles-grid, .search-page .articles-grid { grid-template-columns: 1fr; gap: 18px; }
    .blog-card__content { min-height: 220px; }

    .portfolio-card, .portfolio-card--large { min-height: 320px; }
    .portfolio-card__link { padding: 24px; }

    .category-children { grid-template-columns: 1fr; gap: 12px; }
    .category-child { min-height: 100px; padding: 20px; }
    .category-child__icon { width: 36px; height: 36px; font-size: 28px; margin-bottom: 10px; }

    .single-hero { min-height: 500px; }
    .similar-card { flex-basis: 100%; }

    .error-page__inner { gap: 0; padding-block: 50px 60px; }
    .error-page__visual { min-height: 250px; }
    .error-page__number { font-size: 145px; }
    .error-page__actions { width: 100%; }
    .error-page__button { flex: 1; }

    .puzzle { width: 62px; height: 62px; }
    .puzzle::before, .puzzle::after, .puzzle span::before, .puzzle span::after { width: 18px; height: 18px; }
}

@media (max-width: 480px) {
    .hero { padding-block: 70px; }
    .hero__title { font-size: 42px; }
    .section__header { display: block; }
    .portfolio-card { min-height: 320px; }
    .site-footer__inner { justify-content: center; }
    .site-footer__social { gap: 10px; }
    .site-footer__social a { font-size: 11px; }
}

@media (max-width: 420px) {
    .home-hero { padding-top: 40px; }
    .home-hero .hero__title { font-size: 44px; }
    .home-hero .hero__actions { flex-direction: column; align-items: stretch; }
    .home-hero .hero__actions .button { width: 100%; }
    .home-hero__image { min-height: 360px; }
}

/* -------------------------
   18. ACCESSIBILITY (REDUCED MOTION)
------------------------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .puzzle,
    .home-hero__image img {
        animation: none !important;
        transition: none !important;
    }
}

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

.qiyali-backtop {
    --progress: 0;

    position: fixed;
    right: 28px;
    bottom: 28px;

    width: 52px;
    height: 52px;

    padding: 0;
    border: 0;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.92);

    color: #111;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    z-index: 9999;

    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease,
        background 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease;
}

.qiyali-backtop.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


/* -----------------------------------------
   CIRCLE
----------------------------------------- */

.qiyali-backtop__progress {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    transform: rotate(-90deg);

    pointer-events: none;
}


/* Background ring */

.qiyali-backtop__track {
    fill: none;

    stroke: rgba(0, 0, 0, 0.10);

    stroke-width: 2;
}


/* Progress ring */

.qiyali-backtop__fill {
    fill: none;

    stroke: #111;

    stroke-width: 2.5;

    stroke-linecap: round;

    /*
     * 2π × 21 ≈ 132
     */
    stroke-dasharray: 132;

    stroke-dashoffset: calc(
        132 - (132 * var(--progress))
    );

    transition: stroke-dashoffset 0.08s linear;
}


/* -----------------------------------------
   ARROW
----------------------------------------- */

.qiyali-backtop__arrow {
    position: relative;

    z-index: 2;

    font-size: 21px;
    line-height: 1;

    font-weight: 400;

    transform: translateY(-1px);

    transition:
        transform 0.2s ease;
}


/* Hover */

.qiyali-backtop:hover {
    background: #111;
    color: #fff;

    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.16);
}

.qiyali-backtop:hover .qiyali-backtop__arrow {
    transform: translateY(-4px);
}


/* Active */

.qiyali-backtop:active {
    transform: scale(0.94);
}


/* Focus */

.qiyali-backtop:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}


/* -----------------------------------------
   MOBILE
----------------------------------------- */

@media (max-width: 768px) {

    .qiyali-backtop {
        right: 18px;
        bottom: 18px;

        width: 46px;
        height: 46px;
    }

    .qiyali-backtop__arrow {
        font-size: 19px;
    }
}

/* =====================================================
   PROJECT SINGLE
===================================================== */

.project-hero {
    position: relative;
    min-height: min(620px, 72vh);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: var(--q-text);
    color: #ffffff;
}

.project-hero__image,
.project-hero__image img,
.project-hero__overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.project-hero__image img {
    display: block;
    object-fit: cover;
}

.project-hero__overlay {
    background: linear-gradient(110deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.18));
}

.project-hero__content {
    position: relative;
    z-index: 1;
    padding-top: 160px;
    padding-bottom: 64px;
}

.project-hero__eyebrow {
    margin: 0 0 18px;
    color: var(--q-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.project-hero__title {
    max-width: 900px;
    margin: 0 0 24px;
    color: #ffffff;
    font-size: clamp(42px, 6vw, 78px);
    line-height: 1;
    letter-spacing: -0.05em;
}

.project-hero__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-hero__categories a {
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.84);
    font-size: 12px;
}

.project-layout__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 72px;
    align-items: start;
}

.project-content {
    max-width: 820px;
    min-width: 0;
}

.project-content__lead {
    margin: 0 0 40px;
    color: var(--q-text);
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.25;
    letter-spacing: -0.03em;
}

.project-content__body {
    color: var(--q-text);
    font-size: 17px;
    line-height: 1.85;
}

.project-content__body > * {
    margin-top: 0;
    margin-bottom: 1.4em;
}

.project-content__body img {
    max-width: 100%;
    height: auto;
}

.project-details {
    position: sticky;
    top: 104px;
    padding: 28px;
    border: 1px solid var(--q-border);
    background: var(--q-surface);
}

.project-details__heading h2 {
    margin: 0;
    font-size: 28px;
}

.project-details__list {
    margin: 28px 0 0;
}

.project-details__list > div {
    padding: 15px 0;
    border-top: 1px solid var(--q-border);
}

.project-details__list dt {
    margin-bottom: 6px;
    color: var(--q-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-details__list dd {
    margin: 0;
    color: var(--q-text);
    font-size: 14px;
    line-height: 1.5;
}

.project-details__list dd a {
    display: block;
    color: var(--q-text);
}

.project-details__list dd a:hover {
    color: var(--q-accent);
}

.project-details__link {
    width: 100%;
    margin-top: 20px;
}

@media (max-width: 900px) {
    .project-layout__grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .project-details {
        position: static;
    }
}

@media (max-width: 600px) {
    .project-hero {
        min-height: 500px;
    }

    .project-hero__content {
        padding-top: 120px;
        padding-bottom: 40px;
    }

    .project-layout__grid {
        gap: 36px;
    }

    .project-details {
        padding: 22px;
    }
}