/* ===========================================================================
   Testimonials — two separate page-turning panels (js/reviews-book.js).
   The section holds the screen while you scroll; each step of scroll turns
   the top page of each panel away to the left, like a notebook.
   =========================================================================== */

.tstory {
    position: relative;
    height: 100vh;
    min-height: 620px;
    overflow: hidden;
    background:
        radial-gradient(55% 45% at 10% 5%, rgba(255, 77, 148, .07), transparent 70%),
        radial-gradient(45% 45% at 92% 95%, rgba(249, 157, 78, .08), transparent 70%),
        #faf8f5;
}

.tstory__inner {
    height: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 112px 24px 30px;     /* top: clear of the header */
    display: flex;
    flex-direction: column;
}

.tstory__head { text-align: center; margin-bottom: 26px; }
.tstory__kicker {
    margin: 0 0 10px;
    font: 700 12px/1 'Outfit', sans-serif;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #e93b6e;
}
.tstory__title {
    margin: 0;
    font: 800 clamp(28px, 3.4vw, 48px)/1.05 'Outfit', sans-serif;
    letter-spacing: -1.2px;
    color: #0d0d14;
}

/* two panels, clearly apart */
.tstory__grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(28px, 4.5vw, 72px);
}

.tpanel { display: flex; flex-direction: column; min-height: 0; }
.tpanel__label {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 12px 4px;
    font: 700 12.5px/1 'Outfit', sans-serif;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: #6b6a73;
}
.tpanel__label i { color: #e93b6e; font-size: 13px; }

/* the stack of pages; the edges of the pages beneath peek out */
.tpanel__stack {
    position: relative;
    flex: 1;
    min-height: 0;
    perspective: 2200px;
}
.tpanel__stack::before,
.tpanel__stack::after {
    content: '';
    position: absolute;
    border-radius: 20px;
    z-index: 0;
}
.tpanel__stack::before { inset: 8px -7px -8px 7px;   background: #ece6db; box-shadow: 0 20px 40px -18px rgba(13, 13, 20, .25); }
.tpanel__stack::after  { inset: 15px -13px -15px 13px; background: #e2dbcd; z-index: -1; }
.tpanel--video .tpanel__stack::before { background: #1b1726; }
.tpanel--video .tpanel__stack::after  { background: #241f31; }

/* one page: front face + back face, turning on its left edge */
.tleaf {
    position: absolute;
    inset: 0;
    transform-origin: 0% 50%;
    transform-style: preserve-3d;
    will-change: transform;
}
.tleaf__front,
.tleaf__back {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.tleaf__front { box-shadow: 0 18px 38px -16px rgba(13, 13, 20, .28), 0 0 0 1px rgba(13, 13, 20, .05); }
.tleaf__back { transform: rotateY(180deg); }
.tleaf__back--paper {
    background:
        repeating-linear-gradient(180deg, transparent 0 33px, rgba(13, 13, 20, .04) 33px 34px),
        linear-gradient(270deg, #f6f1e7, #ece5d7);
}
.tleaf__back--screen { background: linear-gradient(270deg, #1d1828, #131019); }
/* light across the bending page */
.tleaf__shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, .32), rgba(0, 0, 0, 0) 65%);
}

/* ---- page content ---- */
.tpage {
    display: flex;
    flex-direction: column;
    padding: clamp(26px, 3vw, 44px) clamp(26px, 3.2vw, 48px) clamp(22px, 2.6vw, 36px);
    font-family: 'Outfit', sans-serif;
}

.tpage--paper {
    color: #1b1b26;
    background:
        repeating-linear-gradient(180deg, transparent 0 33px, rgba(13, 13, 20, .035) 33px 34px),
        linear-gradient(90deg, #fffdf9 0%, #fffaf2 100%);
}
.tpage__quote {
    font: 800 clamp(70px, 7vw, 110px)/0.7 'Outfit', sans-serif;
    background: linear-gradient(135deg, #ff4d94, #f99d4e);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}
.tpage__stars { display: flex; gap: 4px; margin-bottom: 14px; color: #f5a623; font-size: 14px; }
.tpage__stars .is-off { color: #e3e0da; }
.tpage__text {
    flex: 1;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    font-size: clamp(16px, 1.55vw, 21px);
    font-weight: 500;
    line-height: 1.55;
    letter-spacing: -0.2px;
}
.tpage__who { display: flex; align-items: center; gap: 13px; margin-top: 16px; }
.tpage__who b { display: block; font-size: 16px; font-weight: 700; color: #0d0d14; }
.tpage__who small { display: block; margin-top: 2px; font-size: 13px; color: #77767f; }
.tpage__avatar { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; object-fit: cover; }
.tpage__avatar--initials {
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    background: linear-gradient(135deg, #ff4d94, #f99d4e);
}
.tpage__num {
    position: absolute;
    bottom: 16px;
    right: 22px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    color: rgba(13, 13, 20, .3);
}

.tpage--screen {
    color: #fff;
    background:
        radial-gradient(80% 60% at 70% 20%, rgba(168, 85, 247, .18), transparent 70%),
        radial-gradient(70% 60% at 20% 90%, rgba(255, 77, 148, .16), transparent 70%),
        #0e0e16;
}
.tpage--screen .tpage__num { color: rgba(255, 255, 255, .3); }
.tpage__frame,
.tpage__video {
    position: relative;
    flex: 1;
    min-height: 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .1);
    background:
        radial-gradient(60% 70% at 50% 35%, rgba(255, 77, 148, .35), transparent 70%),
        linear-gradient(160deg, #1d1530, #0b0b12);
}
.tpage__frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 22px 26px;
    text-align: center;
}
.tpage__face {
    display: grid;
    place-items: center;
    width: clamp(64px, 6vw, 88px);
    height: clamp(64px, 6vw, 88px);
    border-radius: 50%;
    font-size: clamp(22px, 2vw, 28px);
    font-weight: 700;
    background: linear-gradient(135deg, #ff4d94, #f99d4e);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, .06), 0 16px 40px rgba(255, 77, 148, .45);
}
.tpage__clip {
    margin: 0;
    max-width: 34ch;
    font-size: clamp(14px, 1.2vw, 16px);
    font-style: italic;
    line-height: 1.55;
    color: rgba(255, 255, 255, .82);
}
.tpage__video video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.tpage__who--light { justify-content: space-between; }
.tpage__who--light b { color: #fff; }
.tpage__who--light small { color: rgba(255, 255, 255, .55); }
.tpage__tag {
    flex: 0 0 auto;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .4px;
    color: #ffb3cf;
    background: rgba(255, 77, 148, .14);
    border: 1px solid rgba(255, 77, 148, .3);
}

/* ---- progress ---- */
.tstory__progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 26px;
    font-family: 'Outfit', sans-serif;
}
.tstory__count { font-size: 14px; font-weight: 600; color: #77767f; letter-spacing: 1px; }
.tstory__count b { color: #0d0d14; }
.tstory__bar {
    position: relative;
    width: min(260px, 30vw);
    height: 4px;
    border-radius: 4px;
    background: rgba(13, 13, 20, .1);
    overflow: hidden;
}
.tstory__bar i {
    position: absolute;
    inset: 0;
    transform-origin: 0 50%;
    transform: scaleX(0);
    background: linear-gradient(90deg, #ff4d94, #f99d4e);
    border-radius: inherit;
}
.tstory__hint { font-size: 12.5px; color: #9a99a2; letter-spacing: .3px; }

/* short screens: tighter */
@media (max-height: 760px) and (min-width: 768px) {
    .tstory__inner { padding-top: 96px; }
    .tstory__head { margin-bottom: 16px; }
    .tstory__progress { margin-top: 16px; }
    .tpage__quote { font-size: 64px; }
}

/* ---- phones: the panels stack ---- */
@media (max-width: 767px) {
    .tstory { min-height: 560px; }
    .tstory__inner { padding: 92px 18px 18px; }
    .tstory__head { margin-bottom: 12px; }
    .tstory__kicker { margin-bottom: 6px; font-size: 10.5px; }
    .tstory__title { font-size: 24px; }
    .tstory__grid { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; gap: 22px; }
    .tpanel__label { margin-bottom: 7px; font-size: 11px; }
    .tpage { padding: 18px 20px 16px; }
    .tpage__quote { font-size: 54px; }
    .tpage__stars { margin-bottom: 8px; font-size: 12px; }
    .tpage__text { font-size: 14.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; }
    .tpage__who { margin-top: 10px; }
    .tpage__avatar { width: 38px; height: 38px; flex-basis: 38px; }
    .tpage__frame { gap: 8px; padding: 12px; }
    .tpage__face { width: 52px; height: 52px; font-size: 18px; }
    .tpage__clip { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
    .tstory__progress { margin-top: 12px; }
    .tstory__hint { display: none; }
}

/* ---- the bending page (js/reviews-book.js): a chain of hinged strips ---- */
.tleaf--bending > .tleaf__front,
.tleaf--bending > .tleaf__back { visibility: hidden; }
.tbend {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    pointer-events: none;
}
.tbend__seg {
    position: absolute;
    top: 0;
    height: 100%;
    transform-style: preserve-3d;
}
.tbend__face,
.tbend__back {
    position: absolute;
    inset: 0;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.tbend__back { transform: rotateY(180deg); border-radius: 0 !important; box-shadow: none !important; }
.tbend__face { border-radius: 0; }
.tbend__copy {
    position: absolute !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.tbend__copy .tleaf__shade { display: none; }
.tbend__shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: #000;
    opacity: 0;
}
