/* ═══════════════════════════════════════════════════════════════════
   home-rebuild.css — Phase A of the home rebuild
   ═══════════════════════════════════════════════════════════════════
   Conversion-focused hero (dual CTA + project tile preview), shrunk
   tech strip, video demo slot, trust row. Mobile-first.
   All values reference existing tokens in tokens/variables.css —
   no new colors, no new spacing scale, no new fonts.

   Loaded AFTER home.css so `.hero-rebuild` selectors override the
   pre-rebuild .hero rules.
*/

/* ───────────────────────────────────────────────────────────────────
   HERO BENTO (rebuild variant — Canva mockup)
   Massive H1 + dual CTA on the left, AI orb top-right, 4 tiles below:
   Websites (BIG) · FB Ads · Apps (Bandazo) · CRM (Olynx + Aivoks).
   ─────────────────────────────────────────────────────────────────── */

/* The base .hero rules (min-height: 100vh/svh, particle canvas, etc.)
   come from home.css. The base also vertically centers and uses huge top
   padding — for the bento we anchor near the top so the whole composition
   (headline + orb + 4 tiles) is visible above the fold on first load. */

.hero-rebuild {
    justify-content: center;
    padding-top: var(--space-sm);
    padding-bottom: var(--space-sm);
    padding-left: 0;
    padding-right: 0;
    overflow: visible;
}

.hero-rebuild .hero-content {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--space-xs) clamp(0.5rem, 1vw, 1.25rem);
    position: relative;
    z-index: 2;
}

/* The bento grid: mobile = flat vertical stack.
   Desktop = 2-row grid: top (headline + orb), bottom (4 tiles). */
.hero-bento {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-sm);
    width: 100%;
}

/* ── Top zone: headline + AI orb side-by-side on desktop ── */
.hero-bento-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-sm);
}

.hero-bento-headline {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
}

.hero-rebuild .hero-title {
    font-size: clamp(2.2rem, 5.8vw, 4.6rem);
    font-weight: var(--fw-black);
    line-height: 0.95;
    letter-spacing: var(--ls-tight);
    color: var(--color-text-white);
    margin: 0;
    text-transform: uppercase;
}

.hero-rebuild .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: center;
    margin-top: var(--space-xs);
}

/* ── AI orb (visual placeholder — chatbot launcher) ── */
.hero-ai-orb-card {
    position: relative;
    aspect-ratio: 1 / 1;
    max-width: 280px;
    margin: 0 auto;
    border-radius: var(--radius-2xl);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.hero-ai-pill {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.55);
    color: var(--color-text-white);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: var(--ls-widest, 0.15em);
    font-weight: var(--fw-bold);
    z-index: 2;
}

.hero-ai-orb {
    width: clamp(130px, 14vw, 240px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 30%, rgba(255, 220, 235, 0.95) 0%, rgba(255, 150, 200, 0.85) 18%, rgba(236, 72, 153, 0.85) 45%, rgba(168, 32, 110, 0.85) 75%, rgba(80, 12, 60, 0.9) 100%);
    box-shadow:
        0 0 60px rgba(236, 72, 153, 0.55),
        inset -8px -10px 30px rgba(120, 20, 80, 0.55),
        inset 6px 6px 24px rgba(255, 220, 235, 0.4);
    animation: hero-orb-pulse 4.5s ease-in-out infinite;
}

@keyframes hero-orb-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 60px rgba(236, 72, 153, 0.55), inset -8px -10px 30px rgba(120, 20, 80, 0.55), inset 6px 6px 24px rgba(255, 220, 235, 0.4); }
    50%      { transform: scale(1.04); box-shadow: 0 0 90px rgba(236, 72, 153, 0.75), inset -8px -10px 30px rgba(120, 20, 80, 0.55), inset 6px 6px 24px rgba(255, 220, 235, 0.5); }
}

/* ── Bottom zone: 4 tiles. Default grid stretch — the 9:16 FB Ads/Apps
   tiles set the row height, and Websites + CRM stretch to match so all
   four tiles share the same top + bottom baseline. ── */
.hero-bento-bottom {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    align-items: stretch;
}

.hero-bento-tile {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    text-decoration: none;
    color: inherit;
}

.hero-bento-tile-skeleton {
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--glass-bg) 0%,
        var(--glass-bg-hover) 50%,
        var(--glass-bg) 100%
    );
    background-size: 200% 100%;
    animation: hero-tile-shimmer 1.6s ease-in-out infinite;
}

@keyframes hero-tile-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.hero-bento-tile img,
.hero-bento-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-bento-tile-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: var(--space-md);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 2;
}

.hero-bento-tile-name {
    font-size: var(--fs-body);
    font-weight: var(--fw-bold);
    color: var(--color-text-white);
    line-height: var(--lh-tight);
}

.hero-bento-tile-tag {
    font-size: var(--fs-xs);
    color: var(--color-cyan);
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
    font-weight: var(--fw-bold);
}

/* Websites tile: two layered <img> elements that crossfade. Both fill
   the tile via object-fit:cover; only the .--active one is opaque. */
.hero-websites-stack {
    position: absolute;
    inset: 0;
}
.hero-websites-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 700ms ease;
}
.hero-websites-img--active {
    opacity: 1;
}

/* FB Ads tile: clickable to toggle mute. Inherits .hero-bento-tile but
   needs cursor:pointer and the mute icon overlay. */
.hero-bento-tile--ads {
    cursor: pointer;
}
.hero-ads-mute-indicator {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--color-text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background 0.2s ease;
}
.hero-bento-tile--ads:hover .hero-ads-mute-indicator {
    background: rgba(0, 0, 0, 0.8);
}
.hero-bento-tile--ads:focus-visible {
    outline: 2px solid var(--color-cyan);
    outline-offset: 2px;
}

/* Tile-specific gradient backgrounds for logo-style tiles (CRM only — Apps
   now shows a full-bleed 9:16 app screenshot) */

.hero-bento-tile--crm {
    background:
        radial-gradient(ellipse at 50% 30%, rgba(59, 130, 246, 0.3) 0%, transparent 60%),
        linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(0, 0, 0, 0.45));
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    padding: 14px;
    aspect-ratio: 4 / 3;
}

.hero-bento-tile--crm .hero-crm-sub {
    position: relative;
    border-radius: calc(var(--radius-xl) - 6px);
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    overflow: hidden;
}

.hero-bento-tile--crm .hero-crm-sub img {
    max-height: 60%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.6));
}

.hero-bento-tile--crm .hero-crm-sub-label {
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: var(--fs-xs);
    color: var(--color-text-light);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
}


/* Trust row stays available below the bento on mobile/desktop */
.hero-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md) var(--space-lg);
    justify-content: center;
    align-items: center;
    margin-top: var(--space-md);
}

.hero-trust-item {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
    font-weight: var(--fw-bold);
    white-space: nowrap;
}

/* Tablet — 2 cols for the bottom tiles */
@media (min-width: 640px) {
    .hero-bento-bottom {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop — full bento. Top row: headline (3fr) + AI orb (1fr).
   Bottom row: Websites is the wide flagship; CRM card is the right anchor. */
@media (min-width: 1024px) {
    .hero-rebuild .hero-content {
        padding: var(--space-sm) clamp(0.75rem, 1.25vw, 1.5rem);
    }
    .hero-bento {
        gap: var(--space-md);
    }
    .hero-bento-top {
        grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
        align-items: stretch;
        gap: var(--space-md);
        min-height: 38vh;
    }
    .hero-bento-headline {
        text-align: left;
        gap: var(--space-md);
        justify-content: center;
    }
    .hero-rebuild .hero-actions {
        justify-content: flex-start;
        margin-top: var(--space-sm);
    }
    .hero-trust-row {
        justify-content: flex-start;
        margin-top: var(--space-sm);
    }
    .hero-ai-orb-card {
        max-width: none;
        height: 100%;
        aspect-ratio: auto;
        padding: var(--space-md);
    }
    .hero-bento-bottom {
        grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr);
        gap: var(--space-md);
    }
    /* CRM stretches to fill the row (height set by 9:16 FB Ads/Apps tiles). */
    .hero-bento-tile--crm {
        aspect-ratio: auto;
        min-height: 0;
        height: auto;
        align-self: stretch;
    }
    /* Websites: stretches to fill the row but margin-bottom pulls its
       bottom edge up 208px so it sits flush with the lifted FB Ads/Apps. */
    .hero-bento-tile--websites {
        aspect-ratio: auto;
        min-height: 0;
        height: auto;
        align-self: stretch;
        margin-bottom: 298px;
    }
    /* FB Ads + Apps: portrait 9:16. Their column width × 16/9 sets the
       intrinsic height, which becomes the bottom-row height. */
    .hero-bento-tile--ads,
    .hero-bento-tile--apps {
        aspect-ratio: 9 / 16;
        height: auto;
        min-height: 0;
        max-height: 75vh;
        width: 100%;
        align-self: stretch;
    }
}

/* Ultra-wide — take advantage of large desktops */
@media (min-width: 1600px) {
    .hero-rebuild .hero-title {
        font-size: clamp(3.5rem, 6.5vw, 7rem);
    }
    .hero-bento-top {
        min-height: 40vh;
    }
    /* Ultra-wide: keep stretch behaviour from the 1024px breakpoint —
       no explicit height needed; row is sized by the 9:16 portrait tiles. */
    .hero-rebuild .hero-content {
        padding: var(--space-sm) clamp(1rem, 1.5vw, 2rem);
    }
}

/* Tile hover — only on hover-capable devices */
@media (hover: hover) and (pointer: fine) {
    .hero-bento-tile,
    .hero-ai-orb-card {
        transition: transform 0.4s var(--ease-expo),
                    border-color 0.4s var(--ease-expo),
                    box-shadow 0.4s var(--ease-expo);
    }
    .hero-bento-tile:hover {
        transform: translateY(-4px);
        border-color: rgba(0, 212, 255, 0.4);
        box-shadow: 0 12px 40px rgba(0, 212, 255, 0.18);
    }
    .hero-ai-orb-card:hover {
        border-color: rgba(236, 72, 153, 0.5);
        box-shadow: 0 12px 40px rgba(236, 72, 153, 0.25);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-orb,
    .hero-ai-orb,
    .hero-bento-tile-skeleton { animation: none !important; }
}

/* ── Per-tile manual offsets (experimental — keeps layout flow intact) ── */
.hero-bento-tile--ads {
    transform: translateY(-208px);
}
.hero-bento-tile--apps {
    transform: translateY(-208px);
}
@media (hover: hover) and (pointer: fine) {
    .hero-bento-tile--ads:hover {
        transform: translateY(-212px);
    }
    .hero-bento-tile--apps:hover {
        transform: translateY(-212px);
    }
}

/* Trust row pinned absolutely above the FB Ads + Apps tiles, between
   them and the headline. Positioned relative to .hero-content. */
@media (min-width: 1024px) {
    .hero-trust-row {
        position: absolute;
        z-index: 30;
        top: 215px;
        left: 50%;
        margin-left: 30px;
        margin-top: 0;
        transform: none;
    }
}

/* ───────────────────────────────────────────────────────────────────
   TECH STRIP — replaces the old infinite-marquee TECH TICKER section
   ─────────────────────────────────────────────────────────────────── */

.home-tech-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm) var(--space-md);
    padding: var(--space-md) var(--container-padding);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(0, 0, 0, 0.25);
    text-align: center;
}

.home-tech-strip-label {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
    font-weight: var(--fw-bold);
    color: var(--color-text-dim);
}

.home-tech-strip-stack {
    font-size: var(--fs-small);
    color: var(--color-text-muted);
    font-weight: var(--fw-medium);
}

/* ───────────────────────────────────────────────────────────────────
   VIDEO DEMO SECTION — relocated from the hero (Q4 default location:
   between Process and FAQ)
   ─────────────────────────────────────────────────────────────────── */

.home-video-demo {
    position: relative;
}

.home-video-demo .home-video-demo-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.home-video-demo .home-video-demo-header h2 {
    font-size: var(--fs-h2);
    font-weight: var(--fw-black);
    color: var(--color-text-white);
    margin: 0;
}

.home-video-demo .home-video-demo-header p {
    color: var(--color-text-muted);
    font-size: var(--fs-body);
    margin-top: var(--space-sm);
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

.home-video-demo .home-video-demo-frame {
    max-width: 900px;
    margin: 0 auto;
}

/* ───────────────────────────────────────────────────────────────────
   OUR WORK PREVIEW (Phase B)
   6-tile grid pulled from Firestore web_showings, plus a section CTA
   below routing to /projects. Mobile-first: 1 col → 2 col → 3 col.
   ─────────────────────────────────────────────────────────────────── */

.home-section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.home-section-header h2 {
    font-size: var(--fs-h1);
    font-weight: var(--fw-black);
    color: var(--color-text-white);
    margin: 0;
}

.home-section-subtitle {
    color: var(--color-text-muted);
    font-size: var(--fs-body);
    margin-top: var(--space-sm);
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

.home-section-cta {
    text-align: center;
    margin-top: var(--space-2xl);
}

/* Featured Work grid */
.featured-work-grid {
    display: grid;
    grid-template-columns: 1fr;          /* mobile: stack */
    gap: var(--space-lg);
}

.featured-work-tile {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    text-decoration: none;
    color: inherit;
}

.featured-work-tile-skeleton {
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--glass-bg) 0%,
        var(--glass-bg-hover) 50%,
        var(--glass-bg) 100%
    );
    background-size: 200% 100%;
    animation: hero-tile-shimmer 1.6s ease-in-out infinite;
}

.featured-work-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-work-tile-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: var(--space-md);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.featured-work-tile-name {
    font-size: var(--fs-body);
    font-weight: var(--fw-bold);
    color: var(--color-text-white);
    line-height: var(--lh-tight);
}

.featured-work-tile-tag {
    font-size: var(--fs-xs);
    color: var(--color-cyan);
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
    font-weight: var(--fw-bold);
}

/* Tablet: 2 columns */
@media (min-width: 640px) {
    .featured-work-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 3 columns (so 6 tiles render as 2 rows of 3) */
@media (min-width: 1024px) {
    .featured-work-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Hover lift — hover-capable devices only */
@media (hover: hover) and (pointer: fine) {
    .featured-work-tile {
        transition: transform 0.4s var(--ease-expo),
                    border-color 0.4s var(--ease-expo),
                    box-shadow 0.4s var(--ease-expo);
    }
    .featured-work-tile:hover {
        transform: translateY(-4px);
        border-color: rgba(0, 212, 255, 0.4);
        box-shadow: 0 12px 40px rgba(0, 212, 255, 0.15);
    }
}

/* ───────────────────────────────────────────────────────────────────
   PLANS PREVIEW (Phase C)
   3 website tiers mirrored from /services. Mobile: stack. Desktop:
   3 columns with the middle (Pro) tier slightly raised + accented.
   Cotizar buttons trigger the existing modal (toast-and-modal.js).
   ─────────────────────────────────────────────────────────────────── */

.plan-grid {
    display: grid;
    grid-template-columns: 1fr;            /* mobile: stack */
    gap: var(--space-lg);
    max-width: 480px;
    margin: 0 auto;
    align-items: stretch;
}

.plan-card {
    padding: var(--space-xl);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    position: relative;
}

.plan-card-featured {
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.08);
}

.plan-card-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-cyan);
    color: var(--color-bg-deep);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
    white-space: nowrap;
}

.plan-card-header {
    text-align: center;
}

.plan-price-label {
    display: inline-block;
    font-size: var(--fs-xs);
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
    font-weight: var(--fw-bold);
    margin-bottom: var(--space-xs);
}

.plan-price-amount {
    font-size: var(--fs-h2);
    font-weight: var(--fw-black);
    color: var(--color-text-white);
    line-height: var(--lh-tight);
    margin: 0 0 var(--space-sm);
    letter-spacing: var(--ls-tight);
}

.plan-card .product-card-title {
    font-size: var(--fs-h4);
    font-weight: var(--fw-bold);
    color: var(--color-text-white);
    margin: 0 0 var(--space-sm);
}

.plan-card-desc {
    font-size: var(--fs-small);
    color: var(--color-text-muted);
    line-height: var(--lh-body);
    margin: 0;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    flex: 1;
}

.plan-feature {
    font-size: var(--fs-small);
    color: var(--color-text-light);
    padding-left: calc(var(--space-md) + 4px);
    position: relative;
    line-height: var(--lh-body);
}

.plan-feature::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-emerald);
    font-weight: var(--fw-black);
}

/* Cotizar button at the bottom of each card — full-width within the card */
.plan-card .cotizar-btn {
    width: 100%;
    justify-content: center;
}

/* Footer link below the grid */
.home-plans-talk {
    display: inline-block;
    font-size: var(--fs-body);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--duration-normal) var(--ease-smooth);
}

.home-plans-talk strong {
    color: var(--color-cyan);
    font-weight: var(--fw-bold);
}

.home-plans-talk:hover {
    color: var(--color-text-light);
}

/* Tablet: keep single-column up to 1024 to keep cards readable */
/* Desktop: 3 columns, Pro card slightly scaled up for visual emphasis */
@media (min-width: 1024px) {
    .plan-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1100px;
        align-items: stretch;
    }
    .plan-card-featured {
        transform: scale(1.04);
        z-index: 1;
    }
}

/* Hover lift on non-featured cards (Pro is already visually raised) */
@media (hover: hover) and (pointer: fine) {
    .plan-card {
        transition: transform 0.4s var(--ease-expo),
                    border-color 0.4s var(--ease-expo);
    }
    .plan-card:not(.plan-card-featured):hover {
        transform: translateY(-4px);
        border-color: rgba(0, 212, 255, 0.3);
    }
}
