/* =========================================================
   WEBPLEX SOLUTION — TESTIMONIAL CARDS + STAR RATINGS
   Shared by index.html and Testimonials.html
   (cards are built by assets/testimonials.js)
   ========================================================= */

:root {
    --star-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2.2l2.98 6.04 6.67.97-4.83 4.7 1.14 6.64L12 17.42l-5.96 3.13 1.14-6.64-4.83-4.7 6.67-.97z'/></svg>");
    --star-gradient: linear-gradient(90deg, #f0209e 0%, #8b2cf0 55%, #1f63ea 100%);
}

/* --- Star rating display: --rating can be a decimal (4.8 fills 4.8 stars) --- */

.t-stars {
    --size: 16px;
    --rating: 5;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: calc(var(--size) * 5);
    height: var(--size);
    background: #e4e7ec;
    -webkit-mask: var(--star-mask) 0 0 / var(--size) var(--size) repeat-x;
    mask: var(--star-mask) 0 0 / var(--size) var(--size) repeat-x;
}

.t-stars::before {
    content: "";
    position: absolute;
    inset: 0;
    width: calc(var(--rating) / 5 * 100%);
    background: var(--star-gradient);
}

/* --- Grids --- */

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

/* --- Card --- */

.t-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 26px 26px 22px;
    background: #ffffff;
    border: 1px solid #e5e9f2;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(40, 50, 80, 0.06);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.t-card::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -100px;
    bottom: -100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 44, 240, 0.10), transparent 70%);
    pointer-events: none;
}

.t-card:hover {
    transform: translateY(-6px);
    border-color: #e1c8fb;
    box-shadow: 0 18px 45px rgba(44, 51, 90, 0.10);
}

.t-card--featured {
    border-color: #e9d6fc;
    background: linear-gradient(160deg, #ffffff 55%, #faf5ff 100%);
}

.t-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.t-card__top .t-stars {
    margin-top: 3px;
}

/* One tag per service; several services wrap onto extra lines */
.t-tags {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.t-tag {
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3e9fd;
    color: #6d1fc4;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
}

.t-quote {
    position: absolute;
    top: 52px;
    right: 20px;
    width: 58px;
    height: 58px;
    color: rgba(139, 44, 240, 0.08);
    pointer-events: none;
}

.t-body {
    position: relative;
    flex: 1;
}

.t-title {
    margin-top: 18px;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.t-message {
    margin-top: 10px;
    color: #475467;
    font-size: 14px;
    line-height: 1.75;
    white-space: pre-line;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.t-card.is-expanded .t-message {
    display: block;
}

.t-more {
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: #8b2cf0;
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.t-project {
    margin-top: 14px;
    color: #667085;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.t-project b {
    color: #344054;
    font-weight: 600;
}

/* Linked Our Work project - sits above the card's stretched hover/tilt layers */
.t-project__link {
    position: relative;
    z-index: 4;
    color: #8b2cf0;
    font-weight: 600;
    text-decoration: none;
}

.t-project__link:hover {
    text-decoration: underline;
}

/* --- Author --- */

.t-author {
    position: relative;
    margin-top: 20px;
    padding-top: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #eef0f5;
}

.t-avatar {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #f0209e, #8b2cf0);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 18px rgba(139, 44, 240, 0.22);
}

.t-avatar--2 { background: linear-gradient(135deg, #8b2cf0, #1f63ea); }
.t-avatar--3 { background: linear-gradient(135deg, #1f63ea, #0fb4f7); }
.t-avatar--4 { background: linear-gradient(135deg, #f0209e, #1f63ea); }

.t-author-text {
    min-width: 0;
}

.t-name {
    display: block;
    color: #111827;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.t-company {
    display: block;
    color: #475467;
    font-size: 12.5px;
    line-height: 1.4;
}

.t-place {
    margin-top: 2px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    color: #667085;
    font-size: 12px;
    line-height: 1.4;
}

.t-place svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: #8b2cf0;
}

/* --- Invite card (no reviews yet) --- */

.t-invite {
    grid-column: 1 / -1;
    padding: 40px 30px;
    text-align: center;
    background:
        radial-gradient(circle at 0% 0%, rgba(240, 32, 158, 0.07), transparent 45%),
        radial-gradient(circle at 100% 100%, rgba(31, 99, 234, 0.08), transparent 45%),
        #ffffff;
    border: 1px dashed #d9c2fb;
    border-radius: 20px;
}

.t-invite .t-stars {
    --size: 26px;
    --rating: 5;
}

.t-invite h3 {
    margin-top: 16px;
    color: #111827;
    font-size: 20px;
    letter-spacing: -0.03em;
}

.t-invite p {
    max-width: 480px;
    margin: 8px auto 0;
    color: #667085;
    font-size: 14px;
    line-height: 1.7;
}

/* --- Entrance animation (cards arrive after the page loads) --- */

.t-card--enter {
    animation: tCardIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

@keyframes tCardIn {
    from {
        opacity: 0;
        transform: perspective(1000px) translateY(36px) rotateX(-14deg);
    }
}

/* --- Responsive --- */

@media (max-width: 992px) {
    .t-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Home page: swipe through reviews instead of stacking them */
    .t-grid--scroll {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(300px, 46%);
        overflow-x: auto;
        padding: 6px 4px 18px;
        margin: -6px -4px 0;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .t-grid--scroll::-webkit-scrollbar {
        display: none;
    }

    .t-grid--scroll > .t-card {
        scroll-snap-align: start;
    }
}

@media (max-width: 640px) {
    .t-grid {
        grid-template-columns: 1fr;
    }

    .t-grid--scroll {
        grid-template-columns: none;
        grid-auto-columns: 86%;
    }

    .t-card {
        padding: 22px 20px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .t-card--enter {
        animation: none;
    }
}
