/* TCL — NXTPAPER: una tableta mate que se lee como papel; las páginas pasan y al bajar pasa a modo tinta */

.cv--tcl {
    --cv-bg: #dcdad4;
    --cv-ink: #262626;
    --cv-muted: #5e5a54;
    --cv-accent: #e30613;
    --cv-red: #e30613;
    --cv-font-display: 'Literata', Georgia, serif;
    --cv-font-body: 'Literata', Georgia, serif;
    --cv-cta-bg: #e30613;
    --cv-cta-ink: #fff;
    --cv-cta-radius: 2px;
    --cv-cta-shadow-hover: 0 14px 28px -14px rgba(227, 6, 19, 0.6);
    background: linear-gradient(160deg, #e6e4df 0%, #d3d1ca 100%);
}

/* —— Fondo —— */
.cv-tc-lamp {
    left: -20%;
    top: -40%;
    width: 90vw;
    height: 110vh;
    background: radial-gradient(closest-side, rgba(255, 248, 230, 0.75), transparent 70%);
    animation: cv-tc-lamp 14s ease-in-out infinite alternate;
}

@keyframes cv-tc-lamp {
    to { transform: translate3d(12vw, 8vh, 0); }
}

.cv-tc-glyph {
    left: 2vw;
    bottom: -8vh;
    font-family: 'Literata', serif;
    font-size: 46vh;
    font-style: italic;
    font-weight: 800;
    line-height: 1;
    color: rgba(38, 38, 38, 0.05);
    translate: 0 calc(var(--p) * -10vh);
}

/* —— Tableta —— */
.cv--tcl .cv__art-in {
    --dw: clamp(190px, min(27vw, 46vh), 400px);
}

.cv-tc-device {
    position: relative;
    display: block;
    width: var(--dw);
    height: calc(var(--dw) * 1.34);
    padding: calc(var(--dw) * 0.045);
    border-radius: calc(var(--dw) * 0.07);
    background: linear-gradient(150deg, #3a3a3d, #1d1d1f);
    box-shadow:
        0 50px 80px -40px rgba(30, 25, 15, 0.55),
        inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    rotate: calc(-3deg + var(--p) * 3deg);
    animation: cv-tc-in 1.3s var(--cv-ease) 0.1s both;
}

@keyframes cv-tc-in {
    from {
        opacity: 0;
        transform: translate3d(0, 50px, 0) rotate(4deg);
    }
}

.cv-tc-screen {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: calc(var(--dw) * 0.03);
    background-color: #efede6;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.3' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.38 0 0 0 0 0.33 0 0 0 0.1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    perspective: 900px;
    filter: grayscale(var(--p)) sepia(calc(var(--p) * 0.4)) contrast(calc(1 + var(--p) * 0.08));
}

.cv-tc-page {
    position: absolute;
    inset: 0;
    padding: 10% 10% 0;
}

.cv-tc-pic {
    display: block;
    height: 34%;
    border-radius: 4px;
    background:
        radial-gradient(circle at 70% 38%, #ffd9a0 0 9%, transparent 10%),
        linear-gradient(180deg, transparent 58%, #3f6b52 58%),
        linear-gradient(170deg, transparent 50%, #6b8f6e 50%),
        linear-gradient(180deg, #8fc1e3 0%, #f2c6a0 100%);
}

.cv-tc-text {
    display: block;
    margin-top: 9%;
}

.cv-tc-text b {
    float: left;
    margin: -0.08em 0.12em 0 0;
    font-family: 'Literata', serif;
    font-size: calc(var(--dw) * 0.2);
    font-weight: 800;
    line-height: 0.9;
    color: var(--cv-red);
}

.cv-tc-text i {
    display: block;
    height: calc(var(--dw) * 0.024);
    margin-bottom: calc(var(--dw) * 0.028);
    border-radius: 2px;
    background: #8f8b84;
    opacity: 0.55;
    animation: cv-draw-x 0.8s var(--cv-ease) both;
    animation-delay: calc(0.9s + var(--i) * 0.07s);
    transform-origin: left;
}

.cv-tc-text i:nth-child(3n) { width: 86%; }
.cv-tc-text i:nth-child(4n) { width: 72%; }
.cv-tc-text i:last-child { width: 46%; }

/* Hoja que pasa */
.cv-tc-flip {
    position: absolute;
    inset: 0;
    transform-origin: left center;
    background:
        repeating-linear-gradient(180deg, transparent 0 calc(var(--dw) * 0.052), rgba(143, 139, 132, 0.35) calc(var(--dw) * 0.052) calc(var(--dw) * 0.076)) 10% 52% / 80% 40% no-repeat,
        linear-gradient(90deg, rgba(0, 0, 0, 0.08), transparent 30%),
        #ece9e1;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.16);
    opacity: 0;
    animation: cv-tc-flip 7s ease-in-out 2.4s infinite;
}

@keyframes cv-tc-flip {
    0% { transform: rotateY(0deg); opacity: 0; }
    2% { opacity: 1; }
    16% { transform: rotateY(-178deg); opacity: 1; }
    19%, 100% { transform: rotateY(-178deg); opacity: 0; }
}

.cv-tc-mode {
    position: absolute;
    right: 6%;
    bottom: 5%;
    display: grid;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(38, 38, 38, 0.82);
    font-family: 'Literata', serif;
    font-size: calc(var(--dw) * 0.04);
    font-weight: 500;
    color: #fff;
}

.cv-tc-mode em {
    grid-area: 1 / 1;
    font-style: normal;
    text-align: center;
}

.cv-tc-mode em:first-child { opacity: calc(1 - var(--p) * 2.5); }
.cv-tc-mode em:last-child { opacity: calc(var(--p) * 2.5 - 1); }

/* —— Texto —— */
.cv--tcl .cv__kicker {
    font-weight: 800;
    letter-spacing: 0.42em;
    color: var(--cv-red);
}

.cv--tcl .cv__title {
    font-size: clamp(5rem, min(13vw, 23vh), 11.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 0.88;
}

.cv--tcl .cv-ch {
    animation: cv-tc-ink 1.2s var(--cv-ease) both;
    animation-delay: calc((var(--d) + var(--i) * var(--step)) * 1ms);
}

@keyframes cv-tc-ink {
    from {
        opacity: 0;
        filter: blur(12px);
        transform: scale(0.92);
    }
}

.cv--tcl .cv__lead {
    max-width: 24ch;
    font-size: clamp(1.2rem, 1.8vw, 1.6rem);
    font-style: italic;
    font-weight: 500;
    line-height: 1.28;
}

.cv--tcl .cv__stats {
    font-family: 'Literata', serif;
}

@media (max-width: 900px) {
    .cv--tcl .cv__art-in {
        --dw: clamp(130px, min(40vw, 20vh), 190px);
    }

    .cv--tcl .cv__title {
        font-size: clamp(4rem, 24vw, 6rem);
    }
}
