/* ==========================================================================
   SmartPlus IPTV UK - 3D effects and UK layout additions
   Loaded after styles.css. Effects switch on only when enhance.js adds
   .fx to <html>, so the site stays fully readable without JavaScript.
   ========================================================================== */

/* ---------- Top banner link ---------- */
.top-banner a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 3D hero stage ---------- */
.hero-3d-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3.2;
    border-radius: 28px;
    overflow: visible;
}
.hero-3d-stage .hero-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.8s ease;
}
.hero-3d-stage canvas {
    position: absolute;
    inset: -6% -8%;
    width: 116% !important;
    height: 112% !important;
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
    /* fade the outer screens out softly instead of a hard cut at the canvas edge */
    mask-image: radial-gradient(ellipse 58% 62% at 50% 50%, #000 62%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 58% 62% at 50% 50%, #000 62%, transparent 100%);
}
.hero-3d-stage.is-3d canvas { opacity: 1; }
.hero-3d-stage.is-3d .hero-preview-img { opacity: 0; }
.hero-3d-stage .floating-badge { z-index: 3; }

/* ---------- Scroll reveal (3D) ---------- */
.fx .reveal {
    opacity: 0;
    translate: 0 48px;
    rotate: x 14deg;
    transition:
        opacity 0.7s cubic-bezier(.2,.7,.2,1) var(--d, 0s),
        translate 0.8s cubic-bezier(.2,.7,.2,1) var(--d, 0s),
        rotate 0.9s cubic-bezier(.2,.7,.2,1) var(--d, 0s);
    transform-origin: 50% 100%;
}
.fx .reveal.is-visible { opacity: 1; translate: 0 0; rotate: x 0deg; }

/* ---------- 3D tilt cards ---------- */
.fx .tilt {
    transform-style: preserve-3d;
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
    transition: transform 0.45s cubic-bezier(.2,.7,.2,1), background var(--transition-normal),
                border-color var(--transition-normal), box-shadow var(--transition-normal);
    position: relative;
}
.fx .tilt.is-tilting { transition: transform 0.08s linear, background var(--transition-normal),
                border-color var(--transition-normal), box-shadow var(--transition-normal); }
.fx .tilt::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,0.16), transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.fx .tilt.is-tilting::after { opacity: 1; }
.fx .pricing-card.popular-plan.tilt { transform: scale(1.03) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }

/* ---------- Sub-page hero with animated 3D grid floor ---------- */
.mini-hero {
    position: relative;
    overflow: hidden;
    padding: 110px 0 80px;
    text-align: center;
    color: #fff;
    border-bottom: 1px solid var(--border-color);
    background-size: cover;
    background-position: center;
}
.mini-hero .container { position: relative; z-index: 2; }
.mini-hero .hero-title { font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: 1rem; color: #fff; text-shadow: 0 4px 18px rgba(0,0,0,.5); }
.mini-hero .hero-subtitle { max-width: 680px; margin: 0 auto; color: rgba(255,255,255,.88); font-size: 1.12rem; }
.grid-3d {
    position: absolute;
    left: -50%;
    right: -50%;
    bottom: -10%;
    height: 70%;
    z-index: 1;
    perspective: 420px;
    pointer-events: none;
    mask-image: linear-gradient(to top, #000 10%, transparent 85%);
    -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%);
}
/* The floor is a static tiled plane; only its transform animates, which the
   GPU handles without repainting (animating background-position caused lag). */
.grid-3d::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 200%;
    transform-origin: 50% 100%;
    transform: rotateX(68deg) translate3d(0, 0, 0);
    background-image:
        linear-gradient(rgba(139,92,246,.55) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6,182,212,.45) 1px, transparent 1px);
    background-size: 56px 56px;
    will-change: transform;
    animation: grid-move 3.2s linear infinite;
}
@keyframes grid-move { to { transform: rotateX(68deg) translate3d(0, 56px, 0); } }

/* ---------- Performance: no live blur behind cards, no repainting banner ---------- */
.glass-panel,
body.light-theme .glass-panel {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.glass-panel { background: rgba(20, 24, 46, 0.88); }
body.light-theme .glass-panel { background: rgba(255, 255, 255, 0.96); }
.top-banner { animation: none; background-size: 100% 100%; }

/* ---------- Moving rows (marquee) ---------- */
.marquee {
    --speed: 50s;
    overflow: hidden;
    width: 100%;
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee-track {
    display: flex;
    width: max-content;
    will-change: transform;
    animation: marquee var(--speed) linear infinite;
}
.marquee-reverse .marquee-track { animation-direction: reverse; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; gap: 1rem; padding-right: 1rem; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }

/* Live events strip under the hero */
.events-strip { padding: 1.1rem 0; background: linear-gradient(90deg, rgba(139,92,246,.12), rgba(6,182,212,.12)); border-block: 1px solid var(--border-color); }
.event-chip {
    display: inline-flex; align-items: center; gap: .55rem; white-space: nowrap;
    padding: .55rem 1.1rem; border-radius: 99px; font-weight: 600; font-size: .92rem;
    color: var(--text-inverse); background: var(--bg-card); border: 1px solid var(--border-color);
}
.event-chip i { color: var(--secondary); }
.event-chip .live-dot { width: 8px; height: 8px; }

/* Poster rows */
.library-section { overflow: hidden; }
.row-title { font-size: 1.15rem; margin: 2.2rem auto 1rem; color: var(--text-inverse); display: flex; align-items: center; gap: .6rem; }
.poster-row .marquee-group { gap: 1.25rem; padding: .5rem 1.25rem .5rem 0; }
.poster {
    position: relative; flex: 0 0 auto; width: 190px; aspect-ratio: 2 / 3; border-radius: 18px; overflow: hidden;
    display: flex; flex-direction: column; justify-content: flex-end; padding: 1.1rem;
    background:
        radial-gradient(circle at 70% 18%, color-mix(in srgb, var(--c1) 70%, transparent), transparent 60%),
        linear-gradient(160deg, var(--c2), #05060d 85%);
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 14px 30px rgba(0,0,0,.35);
    transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease;
}
.poster > i {
    position: absolute; top: 28%; left: 50%; transform: translate(-50%, -50%);
    font-size: 3.4rem; color: rgba(255,255,255,.88); text-shadow: 0 8px 24px var(--c1);
}
.poster-badge {
    position: absolute; top: .8rem; right: .8rem; font-size: .7rem; font-weight: 800; letter-spacing: .05em;
    padding: .2rem .5rem; border-radius: 6px; background: rgba(0,0,0,.45); color: #fff; border: 1px solid rgba(255,255,255,.2);
}
.poster-text h3 { font-size: 1.05rem; line-height: 1.25; color: #fff; margin-bottom: .2rem; }
.poster-text p { font-size: .82rem; color: rgba(255,255,255,.72); }
.poster:hover { transform: translateY(-8px) rotateX(6deg) scale(1.04); box-shadow: 0 22px 40px rgba(0,0,0,.5), 0 0 0 1px var(--c1); }
.poster-row { perspective: 900px; }

/* Photos on posters: image fills the card, a colour-tinted fade keeps text readable */
.poster-img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
    transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.poster::after {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
        linear-gradient(180deg, rgba(5,6,13,.15) 0%, rgba(5,6,13,.05) 35%, rgba(5,6,13,.92) 100%),
        linear-gradient(160deg, color-mix(in srgb, var(--c1) 35%, transparent), transparent 55%);
}
.poster:hover .poster-img { transform: scale(1.08); }
.poster-badge, .poster-text, .poster > .poster-icon { position: relative; z-index: 2; }
.poster-badge { position: absolute; }
.poster > i.poster-icon {
    position: absolute; top: .8rem; left: .8rem; transform: none;
    width: 34px; height: 34px; display: grid; place-items: center;
    font-size: .95rem; color: #fff; text-shadow: none;
    background: color-mix(in srgb, var(--c1) 75%, transparent); border-radius: 10px;
}

/* Football cards with a photo banner */
.info-card.photo-card { padding: 0 0 1.6rem; overflow: hidden; }
.photo-card img { width: 100%; height: 150px; object-fit: cover; display: block; }
.photo-card .card-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; margin: -23px 0 0 1.6rem; position: relative;
    font-size: 1.2rem; border-radius: 14px; background: var(--bg-dark); border: 1px solid var(--border-color); }
.photo-card h3, .photo-card p { padding: 0 1.6rem; }

/* ---------- Trust strip ---------- */
.trust-strip { padding: 1.6rem 0; border-block: 1px solid var(--border-color); background: var(--bg-card); }
.trust-strip ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem 2.2rem; margin: 0; padding: 0; color: var(--text-muted); font-weight: 600; font-size: .95rem; }
.trust-strip i { color: var(--secondary); margin-right: .45rem; }

/* ---------- Generic card grids ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.info-card { padding: 2rem; border-radius: 22px; }
.info-card h3 { font-size: 1.2rem; margin: .9rem 0 .5rem; color: var(--text-inverse); }
.info-card p { color: var(--text-muted); font-size: .97rem; line-height: 1.65; }
.info-card .card-icon { font-size: 2.2rem; }
a.info-card { display: block; text-decoration: none; }
a.info-card .more { display: inline-block; margin-top: .9rem; color: var(--secondary); font-weight: 600; font-size: .92rem; }

/* ---------- Steps ---------- */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; counter-reset: step; }
.step-card { padding: 2.2rem 2rem; border-radius: 22px; }
.step-num {
    width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
    font-family: var(--font-heading); font-weight: 800; font-size: 1.4rem; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 10px 25px var(--primary-glow);
}
.step-card h3 { margin: 1.1rem 0 .5rem; font-size: 1.2rem; color: var(--text-inverse); }
.step-card p { color: var(--text-muted); line-height: 1.65; }

/* ---------- Long-form SEO copy ---------- */
.prose { max-width: 820px; margin: 0 auto; }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 1rem; }
.prose h3 { font-size: 1.25rem; margin: 1.8rem 0 .6rem; color: var(--text-inverse); }
.prose p, .prose li { color: var(--text-muted); line-height: 1.8; font-size: 1.03rem; }
.prose p + p { margin-top: 1rem; }
.prose ul { margin: .8rem 0 0 1.2rem; }
.prose a { color: var(--secondary); }

/* ---------- Comparison table ---------- */
.compare-wrap { overflow-x: auto; border-radius: 22px; }
.compare-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.compare-table th, .compare-table td { padding: 1rem 1.25rem; text-align: left; border-bottom: 1px solid var(--border-color); }
.compare-table th { font-family: var(--font-heading); color: var(--text-inverse); font-size: 1rem; }
.compare-table td { color: var(--text-muted); }
.compare-table td.yes { color: var(--success); font-weight: 600; }
.compare-table tr:last-child td { border-bottom: 0; }

/* ---------- VOD cards ---------- */
.vod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 2rem; }
.vod-card { border-radius: 20px; overflow: hidden; padding: 0; }
.vod-card img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; }
.vod-card div { padding: 1.4rem; text-align: center; }
.vod-card h3 { font-size: 1.1rem; margin-bottom: .25rem; color: var(--text-inverse); }
.vod-card p { font-size: .88rem; color: var(--text-muted); }

/* ---------- Contact cards ---------- */
.contact-card { padding: 2.5rem 2rem; border-radius: 22px; text-align: center; }
.contact-card .card-icon { font-size: 3rem; margin-bottom: 1rem; }
.contact-card h3 { margin-bottom: .6rem; color: var(--text-inverse); }
.contact-card p { color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.65; }

.section-cta { margin-top: 2.5rem; text-align: center; }
.text-pink { color: #ec4899; }
.text-amber { color: #f59e0b; }

/* ---------- Mobile ---------- */
/* styles.css ends with an unconditional 4-column .pricing-grid rule that
   overrides its own breakpoints; restore the responsive columns here. */
@media (max-width: 1100px) {
    .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .pricing-grid { grid-template-columns: minmax(0, 1fr); }
    .pricing-card.popular-plan, .fx .pricing-card.popular-plan.tilt { transform: none; }
}
html, body { overflow-x: clip; }
@media (max-width: 900px) {
    .hero-3d-stage { aspect-ratio: 16 / 11; margin-top: 1rem; }
    .mini-hero { padding: 90px 0 60px; }
}

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .fx .reveal { opacity: 1; translate: none; rotate: none; transition: none; }
    .fx .tilt { transform: none !important; }
    .grid-3d::before { animation: none; }
    .marquee-track { animation: none; }
    .marquee { overflow-x: auto; }
}

/* ==========================================================================
   3D TV hero (CSS 3D: real <img> photos, crisp text, GPU-composited motion)
   ========================================================================== */
.hero-3d-stage { container-type: inline-size; }
/* the old hero image gave this box its width; the 3D scene is absolutely positioned, so set it */
.hero-image-container { width: 100%; max-width: 680px; justify-self: center; }
.tv-scene {
    position: absolute; inset: 0; display: grid; place-items: center;
    perspective: 1100px; perspective-origin: 50% 40%;
}
.tv-world {
    position: absolute; left: 50%; top: 50%; width: 600px; height: 440px; margin: -220px 0 0 -300px;
    transform-style: preserve-3d;
    transform: scale(var(--fit, 1)) rotateX(calc(var(--my, 0) * -7deg)) rotateY(calc(var(--mx, 0) * 12deg));
    transition: transform .7s cubic-bezier(.2,.7,.2,1);
}
.tv-wall { position: absolute; inset: 0; transform-style: preserve-3d; }
.wall-tv {
    position: absolute; left: 50%; top: 42%; width: 196px; height: 110px; margin: -55px 0 0 -98px;
    transform: translate3d(var(--x), var(--y), var(--z)) rotateY(var(--a));
    border-radius: 5px; overflow: hidden; background: #0a0b10;
    border: 3px solid #0c0d12;
    box-shadow: 0 0 0 1px rgba(255,255,255,.10), 0 16px 28px rgba(0,0,0,.55);
    animation: tv-float 7s ease-in-out infinite; animation-delay: calc(var(--d) * -1);
}
.wall-tv img { width: 100%; height: 100%; object-fit: cover; display: block; filter: brightness(.78) saturate(1.1); }
.wall-tv::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.85)); }
.wall-tv .tv-live { position: absolute; top: 6px; left: 6px; z-index: 1; font-size: 7px; padding: 2px 5px; }
.tv-cap { position: absolute; left: 8px; bottom: 6px; z-index: 1; color: rgba(255,255,255,.8); font: 500 7.5px/1.25 var(--font-body); }
.tv-cap b { display: block; color: #fff; font: 800 11px/1.1 var(--font-heading); letter-spacing: .02em; text-transform: uppercase; }
@keyframes tv-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }

.tv-main {
    position: absolute; left: 50%; top: 44%; width: 420px; margin: -118px 0 0 -210px;
    transform: translateZ(140px); transform-style: preserve-3d;
    animation: tv-sway 10s ease-in-out infinite;
}
@keyframes tv-sway { 0%, 100% { rotate: y -5deg; } 50% { rotate: y 5deg; } }
.tv-frame {
    position: relative; aspect-ratio: 16 / 9; border-radius: 9px; padding: 6px;
    background: linear-gradient(150deg, #3a3d48 0%, #14151b 18%, #0b0c11 60%, #1d1f27 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 45px 80px rgba(0,0,0,.65), 0 0 70px rgba(34,197,94,.16);
}
.tv-frame > img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; display: block; }
.tv-ui {
    position: absolute; inset: 6px; border-radius: 3px; padding: 12px 14px;
    display: flex; flex-direction: column; justify-content: space-between;
    background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, transparent 30%, transparent 50%, rgba(0,0,0,.85) 100%);
    color: #fff;
}
.tv-pills { display: flex; gap: 6px; }
.tv-live {
    display: inline-flex; align-items: center; gap: 4px; font: 700 10px/1 var(--font-body); letter-spacing: .04em;
    background: #e11d48; color: #fff; padding: 5px 8px; border-radius: 4px;
}
.tv-live::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #fff; animation: liveDotBlink 1.2s infinite; }
.tv-q { font: 800 10px/1 var(--font-body); padding: 4px 7px; border-radius: 4px; border: 1.5px solid rgba(255,255,255,.75); background: rgba(0,0,0,.35); }
.tv-title b { display: block; font: 800 24px/1.05 var(--font-heading); letter-spacing: .01em; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.tv-title span { display: block; font: 500 11px/1.4 var(--font-body); color: rgba(255,255,255,.85); margin-top: 3px; }
.tv-progress { display: block; height: 4px; margin-top: 9px; border-radius: 2px; background: rgba(255,255,255,.25); overflow: hidden; position: relative; }
.tv-progress::after { content: ""; position: absolute; inset: 0; width: 64%; background: var(--c); border-radius: 2px; }
.tv-glare {
    position: absolute; inset: 6px; border-radius: 3px; pointer-events: none;
    background: linear-gradient(118deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.04) 30%, transparent 30.5%);
}
.tv-stand span {
    position: absolute; bottom: -30px; width: 5px; height: 34px; border-radius: 2px;
    background: linear-gradient(90deg, #2a2c35, #111218);
}
.tv-stand span:first-child { left: 20%; transform: rotate(22deg); }
.tv-stand span:last-child { right: 20%; transform: rotate(-22deg); }
.tv-shadow {
    position: absolute; left: 8%; right: 8%; bottom: -44px; height: 24px;
    background: radial-gradient(closest-side, rgba(0,0,0,.6), transparent);
}
.hero-3d-stage .floating-badge { z-index: 5; backdrop-filter: none; }
/* keep badges clear of the TV's on-screen labels */
.hero-3d-stage .fb-1 { top: auto; bottom: 2%; left: -6%; }
.hero-3d-stage .fb-2 { bottom: auto; top: 4%; right: -4%; }

@media (max-width: 600px) {
    .tv-world { --fit: .5; }
    .hero-3d-stage .floating-badge { display: none; }
    .hero-3d-stage { margin-bottom: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
    .wall-tv, .tv-main, .tv-live::before { animation: none; }
    .tv-world { transition: none; }
}
