/* ==========================================================================
   Why Choose Us / "Our Qualities" section
   Desktop: central circular badge + orbiting numbered nodes along a curved path.
   Mobile/tablet (<992px): collapses to a plain stacked list — the orbit
   diagram doesn't translate to narrow screens, so it's replaced entirely
   rather than squeezed. Uses the site's existing theme tokens + tp_fade_anim.
   ========================================================================== */

.tp-quality-area {
    background-color: var(--tp-white-color);
    overflow: hidden;
}

.tp-quality-container {
    max-width: 1720px;
    margin: 0 auto;
    padding-left: 60px;
    padding-right: 60px;
}

/* ---- Left column ---- */
.tp-quality-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border: 1px solid rgba(22, 50, 79, 0.15);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tp-orange-color, var(--tp-secoundery-color));
    margin-bottom: 24px;
}

.tp-quality-badge i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tp-orange-color, var(--tp-secoundery-color));
    display: inline-block;
}

.tp-quality-title {
    font-family: "Playfair Display", "Manrope", serif;
    font-size: 46px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--tp-theme-color);
    margin: 0 0 22px;
}

.tp-quality-title span {
    font-style: italic;
    font-weight: 500;
    color: var(--tp-orange-color, var(--tp-secoundery-color));
}

.tp-quality-sub {
    font-size: 15px;
    line-height: 1.75;
    color: var(--tp-body-color);
    max-width: 420px;
    margin: 0 0 32px;
}

.tp-quality-btn {
    background: var(--tp-theme-color);
    color: var(--tp-white-color);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 6px 6px 6px 26px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 50px;
}

.tp-quality-btn .tp-btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--tp-orange-color, var(--tp-secoundery-color));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--tp-theme-color);
    transition: transform 0.35s ease;
}

.tp-quality-btn:hover .tp-btn-icon {
    transform: rotate(45deg);
}

.tp-quality-photo {
    border-radius: 24px 140px 24px 24px;
    overflow: hidden;
}

.tp-quality-photo img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 700 / 520;
}

/* ---- Right column: diagram ----
   A true circular layout: a fixed-aspect-ratio box (900:860) so the
   center circle and every node position can be expressed as percentages
   without distorting into an ellipse. Each node's icon-center position
   is set via --nx/--ny (computed from circle-center + polar coordinates
   around a shared radius) directly on the <li> in the HTML. The SVG
   overlay draws short "spoke" lines from the circle out to each node
   plus one arc threading the nodes together, both with an animated
   flowing-dash effect.

   container-type: inline-size + cqw units on the node icon/text below
   make node sizing scale down WITH the diagram as it shrinks at narrower
   desktop widths — without this, fixed-px icon/font sizes stay full size
   while the percentage-based node positions shrink, and nodes collide
   into each other well before the 991px "switch to mobile list" breakpoint. */
.tp-quality-diagram {
    position: relative;
    width: 100%;
    max-width: 900px;
    aspect-ratio: 900 / 860;
    margin: 0 0 0 auto;
    container-type: inline-size;
}

.tp-quality-center {
    position: absolute;
    left: 18.89%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 37.78%;
    height: 39.53%;
    border-radius: 50%;
    background: var(--tp-white-color);
    box-shadow: 0 30px 70px rgba(22, 50, 79, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.tp-quality-center-inner {
    width: 78%;
    height: 78%;
    border-radius: 50%;
    border: 1px solid var(--tp-orange-color, var(--tp-secoundery-color));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.tp-quality-center-icon {
    color: var(--tp-orange-color, var(--tp-secoundery-color));
    display: inline-flex;
}

.tp-quality-center-text {
    font-family: "Playfair Display", serif;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-align: center;
    color: var(--tp-theme-color);
}

.tp-quality-path {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    fill: none;
    z-index: 1;
}

.tp-quality-arc,
.tp-quality-spoke {
    stroke: var(--tp-orange-color, var(--tp-secoundery-color));
    stroke-dasharray: 5 9;
    stroke-linecap: round;
    animation: tp-quality-flow 1.4s linear infinite;
}

.tp-quality-arc {
    stroke-width: 1.5;
    opacity: 0.5;
}

.tp-quality-spoke {
    stroke-width: 1.5;
    opacity: 0.6;
}

@keyframes tp-quality-flow {
    to {
        stroke-dashoffset: -28;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tp-quality-arc,
    .tp-quality-spoke {
        animation: none;
    }
}

.tp-quality-nodes {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tp-quality-node {
    position: absolute;
    left: calc(var(--nx) - 3.111cqw);
    top: calc(var(--ny) - 3.111cqw);
    display: flex;
    align-items: center;
    gap: 1.778cqw;
    width: max-content;
    max-width: 27.78cqw;
    z-index: 2;
}

.tp-quality-node-icon {
    flex: 0 0 auto;
    width: 6.222cqw;
    height: 6.222cqw;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 28px rgba(22, 50, 79, 0.14);
}

.tp-quality-node-icon svg {
    width: 40%;
    height: 40%;
}

.tp-quality-node-dark .tp-quality-node-icon {
    background: var(--tp-theme-color);
    color: var(--tp-white-color);
}

.tp-quality-node-gold .tp-quality-node-icon {
    background: var(--tp-orange-color, var(--tp-secoundery-color));
    color: var(--tp-theme-color);
}

.tp-quality-node-text {
    padding-top: 0;
}

.tp-quality-node-head {
    display: flex;
    align-items: baseline;
    gap: 1.111cqw;
    margin-bottom: 0.444cqw;
}

.tp-quality-node-num {
    font-family: "Playfair Display", serif;
    font-size: 2.333cqw;
    color: var(--tp-orange-color, var(--tp-secoundery-color));
    line-height: 1;
}

.tp-quality-node-head h3 {
    font-size: 1.778cqw;
    font-weight: 700;
    color: var(--tp-theme-color);
    margin: 0;
    line-height: 1.25;
}

.tp-quality-node-text p {
    font-size: 1.389cqw;
    line-height: 1.5;
    color: var(--tp-body-color);
    margin: 0;
    max-width: 35.56cqw;
}

/* ---- Mobile / tablet: plain stacked list, no diagram ---- */
@media (max-width: 991px) {
    .tp-quality-container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .tp-quality-left {
        margin-bottom: 20px;
    }

    .tp-quality-btn {
        margin-bottom: 30px;
    }

    .tp-quality-title {
        font-size: 34px;
    }

    .tp-quality-photo {
        display: none;
    }

    .tp-quality-diagram {
        max-width: none;
        aspect-ratio: auto;
    }

    .tp-quality-center,
    .tp-quality-path {
        display: none;
    }

    /* Mobile: each quality becomes its own rectangle card (matching the
       Expertise cards' visual language — white bg, rounded corners, soft
       shadow), stacked vertically with a short animated dashed connector +
       dot between consecutive cards, echoing the desktop orbit's "energy
       flowing" spokes. Desktop keeps the circular diagram — untouched,
       this whole block only applies ≤991px. */
    .tp-quality-nodes {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .tp-quality-node {
        position: relative;
        left: auto;
        top: auto;
        max-width: none;
        width: auto;
        gap: 18px;
        background: var(--tp-white-color);
        border: 1px solid rgba(22, 50, 79, 0.08);
        border-radius: 18px;
        padding: 22px 20px;
        box-shadow: 0 14px 30px rgba(22, 50, 79, 0.08);
        margin-bottom: 46px;
    }

    .tp-quality-node:last-child {
        margin-bottom: 40px;
    }

    .tp-quality-node:not(:last-child)::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: -46px;
        width: 2px;
        height: 46px;
        transform: translateX(-50%);
        background-image: linear-gradient(var(--tp-orange-color, var(--tp-secoundery-color)) 50%, transparent 0%);
        background-size: 2px 10px;
        background-repeat: repeat-y;
        opacity: 0.6;
        animation: tp-quality-flow-vertical 0.6s linear infinite;
    }

    .tp-quality-node:not(:last-child)::before {
        content: "";
        position: absolute;
        left: 50%;
        bottom: -46px;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--tp-orange-color, var(--tp-secoundery-color));
        transform: translate(-50%, 50%);
        z-index: 1;
    }

    .tp-quality-node-icon {
        width: 52px;
        height: 52px;
    }

    /* The base rules size these in `cqw` (container-query-width), tuned for
       the desktop orbit diagram's container shrinking from 900px down to
       ~496px at the 992px breakpoint. On mobile that same container is only
       ~300-350px wide, so `cqw` scaling made the text unreadably tiny
       (measured: title ~6px, description ~4.6px). Fixed sizes here instead. */
    .tp-quality-node-num {
        font-size: 20px;
    }

    .tp-quality-node-head h3 {
        font-size: 18px;
    }

    .tp-quality-node-text p {
        font-size: 14px;
        line-height: 1.55;
        max-width: none;
    }
}

@keyframes tp-quality-flow-vertical {
    to {
        background-position-y: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tp-quality-node::after {
        animation: none;
    }
}

@media (max-width: 575px) {
    .tp-quality-title {
        font-size: 28px;
    }

    .tp-quality-node {
        gap: 14px;
    }

    .tp-quality-node-head {
        flex-wrap: wrap;
        gap: 8px;
    }
}
