/* ==========================================================================
   KROTAR — Services, Advantages & About sections
   ========================================================================== */

/* ---------------------------------------------------------------------- */
/* Areas — portada selector. Two horizontal, fully-clickable cards         */
/* (Delivery / Marketing Digital), equal weight, living inside the hero's  */
/* own first-viewport stack on desktop (see .krotar-hero-stack, hero.css)  */
/* — contained to ~74% of the row so they read as doors into KROTAR's two */
/* areas, not as a section competing with KROTAR itself for dominance.    */
/* Horizontal internal layout (image beside text, not stacked) keeps each */
/* card short enough to fit the viewport; tablet/mobile revert to a       */
/* taller stacked card, which reads better at narrow widths anyway.       */
/* ---------------------------------------------------------------------- */
.areas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
    width: 100%;
    max-width: 1469px;
    margin: 0 auto;
    /* The hero (id="inicio") is exactly one viewport tall by design (KROTAR
       + descriptor + these cards are meant to be seen together, with no
       scroll). Anchoring straight to these cards with the default
       scroll-margin-top:0 lands mid-hero, cutting the cards under the
       fixed header while simultaneously revealing the start of the next
       section (#servicios) below — a split-screen landing. Since the hero
       never exceeds one viewport, any scroll-margin-top >= 100vh forces
       the browser to clamp the scroll position back to the hero's own top
       instead — the only position from which the cards are visible without
       either the header covering them or the next section bleeding in. */
    scroll-margin-top: 100vh;
}

.portal-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    text-decoration: none;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 145, 255, 0.42);
    background:
        radial-gradient(ellipse 120% 90% at 15% -10%, rgba(0, 145, 255, 0.12) 0%, transparent 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.015) 100%),
        var(--color-surface-heavy);
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.12),
        inset 0 0 0 1px rgba(0, 174, 239, 0.07),
        0 2px 8px rgba(0, 0, 0, 0.35),
        0 22px 48px rgba(0, 0, 0, 0.5);
    transition: border-color var(--duration-fast) ease, box-shadow 0.3s var(--ease-premium), transform 0.3s var(--ease-premium);
}

.portal-card:hover,
.portal-card:focus-visible {
    border-color: rgba(0, 174, 239, 0.7);
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2),
        inset 0 0 0 1px rgba(0, 174, 239, 0.16),
        0 6px 16px rgba(0, 0, 0, 0.45),
        0 30px 60px rgba(0, 0, 0, 0.55),
        0 0 42px rgba(0, 145, 255, 0.22);
    transform: translateY(-6px) scale(1.015);
}

@media (prefers-reduced-motion: reduce) {
    .portal-card:hover,
    .portal-card:focus-visible {
        transform: none;
    }
}

/* Image area: the SAME photograph, twice. ::before is a cover-fit copy of
   the exact image, scaled just enough to fill every corner of the box with
   real photographic content (no separate blurred "filler" color/glow) —
   the crisp, complete contain-fit <img> sits on top of it. Since the two
   crops of one photo won't align pixel-for-pixel at the seam, a minimal
   blur is applied to the extension layer only (never the main photo) so
   that seam reads as depth/soft focus falloff, not a visible splice. */
.portal-card-visual {
    position: relative;
    flex: 0 0 40%;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(0, 61, 150, 0.16) 0%, rgba(2, 3, 8, 0.4) 100%);
}

.portal-card-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    filter: blur(4px) brightness(0.72) saturate(1.05);
    transform: scale(1.04);
    transition: filter 0.3s var(--ease-premium);
}

.portal-card-visual-delivery::before {
    background-image: url('../img/delivery-hero.jpg');
}

.portal-card-visual-marketing::before {
    background-image: url('../img/marketing-digital-hero.jpg');
}

.portal-card-visual svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.portal-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    object-fit: contain;
    object-position: center center;
    /* Soft edge feather on the main photo itself so its own contain-fit
       boundary fuses into the extension layer beneath instead of reading
       as a hard-edged rectangle. */
    -webkit-mask-image: radial-gradient(ellipse 94% 94% at center, black 68%, transparent 100%);
    mask-image: radial-gradient(ellipse 94% 94% at center, black 68%, transparent 100%);
    transition: filter 0.3s var(--ease-premium);
}

.portal-card:hover .portal-card-img,
.portal-card:focus-visible .portal-card-img {
    filter: brightness(1.1);
}

.portal-card:hover .portal-card-visual::before,
.portal-card:focus-visible .portal-card-visual::before {
    filter: blur(4px) brightness(0.8) saturate(1.1);
}

/* Fuse the photographic area into the content column with a progressive
   fade — sits above both photo layers so it reads as the composition
   dissolving into the card's surface, not a divider drawn over the photo. */
.portal-card-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(90deg, transparent 62%, rgba(4, 5, 12, 0.5) 82%, rgba(4, 5, 12, 0.96) 100%);
    pointer-events: none;
}

@media (max-width: 1023px) {
    .areas-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        gap: var(--space-4);
    }

    .portal-card {
        flex-direction: column;
    }

    .portal-card-visual {
        flex: none;
        height: clamp(200px, 42vw, 280px);
    }

    .portal-card-visual::after {
        background: linear-gradient(180deg, transparent 62%, rgba(4, 5, 12, 0.5) 82%, rgba(4, 5, 12, 0.96) 100%);
    }

    /* More room per card at this width (stacked, one per row / two per
       row on tablet) — restore the larger, easier-to-read scale. */
    .portal-card-body {
        padding: var(--space-6) var(--space-5) var(--space-5);
        gap: var(--space-2);
    }

    .portal-card-title {
        font-size: clamp(1.5rem, 3.4vw, 1.9rem);
    }

    .portal-card-desc {
        font-size: 0.98rem;
        line-height: 1.55;
    }

    .portal-card-cta {
        margin-top: var(--space-4);
        padding: 0.7rem 1.15rem;
        font-size: 0.82rem;
    }

}

@media (min-width: 561px) and (max-width: 1023px) {
    .areas-grid {
        max-width: 560px;
    }
}

.portal-card-body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    flex: 1;
    padding: 1.6rem 2.2rem;
    gap: 0.625rem;
}

.portal-card-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(2.03rem, 2.8vw, 2.5rem);
    letter-spacing: -0.01em;
    color: var(--color-text);
}

.portal-card-desc {
    font-weight: 400;
    font-size: 1.375rem;
    line-height: 1.45;
    color: var(--color-text-body);
    max-width: 30ch;
}

.portal-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 0.94rem;
    padding: 0.8rem 1.4rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--color-text);
    background:
        linear-gradient(180deg, rgba(0, 145, 255, 0.18) 0%, rgba(0, 61, 150, 0.24) 100%),
        rgba(4, 12, 28, 0.8);
    border: 1px solid rgba(0, 174, 239, 0.55);
    border-radius: var(--radius-pill);
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.16),
        inset 0 -1px 2px 0 rgba(0, 0, 0, 0.35),
        0 6px 16px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(0, 145, 255, 0.22);
    transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease, box-shadow var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.portal-card:hover .portal-card-cta,
.portal-card:focus-visible .portal-card-cta {
    border-color: rgba(0, 217, 255, 0.85);
    background:
        linear-gradient(180deg, rgba(0, 174, 239, 0.28) 0%, rgba(0, 91, 255, 0.3) 100%),
        rgba(4, 12, 28, 0.8);
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 2px 0 rgba(0, 0, 0, 0.35),
        0 8px 20px rgba(0, 0, 0, 0.45),
        0 0 32px rgba(0, 174, 239, 0.4);
    transform: translateY(-2px);
}

.portal-card-cta svg {
    transition: transform var(--duration-base) var(--ease-premium);
    color: var(--color-cyan);
}

.portal-card:hover .portal-card-cta svg {
    transform: translateX(4px);
}

/* ---------------------------------------------------------------------- */
/* Services                                                                */
/* ---------------------------------------------------------------------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
}

.service-card {
    padding: var(--space-6) var(--space-5);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
}

.service-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: var(--space-2);
    font-family: var(--font-heading);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--color-cyan);
    text-decoration: none;
}

.service-link svg {
    transition: transform var(--duration-base) var(--ease-premium);
}

.service-card:hover .service-link svg {
    transform: translateX(4px);
}

.service-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border-light);
    color: var(--color-cyan);
    margin-bottom: var(--space-2);
}

.service-card:nth-child(3n+2) .service-icon {
    color: var(--color-blue);
}

.service-card:nth-child(3n+3) .service-icon {
    color: var(--color-blue-violet);
}

/* Discreet lit top edge + per-card accent hue — same technique across all
   cards, rotating hue so the grid doesn't feel identical. */
.service-card::before,
.advantage-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 14%;
    right: 14%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 174, 239, 0.55), transparent);
    opacity: 0.55;
    transition: opacity var(--duration-base) ease;
}

.service-card:hover::before,
.advantage-card:hover::before {
    opacity: 1;
}

.service-card:nth-child(3n+2)::before {
    background: linear-gradient(90deg, transparent, rgba(0, 102, 255, 0.6), transparent);
}

.service-card:nth-child(3n+3)::before {
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.55), transparent);
}

.service-card:nth-child(3n+2):hover {
    border-color: rgba(0, 102, 255, 0.35);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.12), 0 18px 42px rgba(0, 0, 0, 0.48), 0 0 32px rgba(0, 102, 255, 0.12);
}

.service-card:nth-child(3n+3):hover {
    border-color: rgba(99, 102, 241, 0.32);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.12), 0 18px 42px rgba(0, 0, 0, 0.48), 0 0 32px rgba(99, 102, 241, 0.12);
}

.service-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(1.2rem, 1.7vw, 1.5rem);
    line-height: 1.25;
    letter-spacing: -0.005em;
    text-transform: uppercase;
    color: var(--color-text);
}

.service-desc {
    font-weight: 400;
    font-size: 0.94rem;
    line-height: 1.6;
    color: var(--color-text-body);
}

/* Services section heading — "PRESENCIA DIGITAL" (h2.section-title, written
   in caps directly since .section-title itself is shared across every
   other section and must not pick up an uppercase transform) followed by
   this smaller "CRECIMIENTO · CONTROL" subtitle line. */
.services-subtitle {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-cyan);
    text-align: center;
}

.services-glow-a {
    top: -40px;
    left: -60px;
    width: 460px;
    height: 460px;
}

.services-glow-b {
    bottom: -60px;
    right: -70px;
    width: 520px;
    height: 520px;
}

/* ---------------------------------------------------------------------- */
/* Advantages                                                              */
/* ---------------------------------------------------------------------- */
.advantages-section {
    background:
        linear-gradient(180deg, transparent 0%, rgba(37, 99, 235, 0.05) 50%, transparent 100%),
        var(--color-bg);
    /* Scoped to this section only — the shared .section padding elsewhere
       stays untouched. Extra top/bottom room keeps ESTRATEGIA DE
       CRECIMIENTO from crowding into the same viewport. */
    padding-top: 2.5rem;
    padding-bottom: 5.5rem;
}

/* Wider than the shared .section-heading (640px) so the four-word titular
   has room to sit on one line at desktop widths instead of wrapping. */
#metodo .section-heading {
    max-width: 1100px;
    margin-bottom: 3.7rem;
}

#metodo .section-title {
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

@media (max-width: 1023px) {
    #metodo .section-title {
        white-space: normal;
    }
}

.ventajas-glow-a {
    top: -60px;
    left: -80px;
    width: 480px;
    height: 480px;
}

.ventajas-glow-b {
    top: -60px;
    right: -80px;
    width: 480px;
    height: 480px;
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
}

.advantage-card {
    padding: var(--space-5);
    text-align: left;
}

.advantage-card:nth-child(4n+2)::before {
    background: linear-gradient(90deg, transparent, rgba(0, 102, 255, 0.6), transparent);
}

.advantage-card:nth-child(4n+3)::before {
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.55), transparent);
}

.advantage-card:nth-child(4n+4)::before {
    background: linear-gradient(90deg, transparent, rgba(10, 61, 255, 0.6), transparent);
}

/* The question opens each card directly — no phase label/numbering above
   it — so it's the first and most dominant element read. */
.advantage-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(1.15rem, 1.7vw, 1.4rem);
    line-height: 1.28;
    letter-spacing: -0.005em;
    text-transform: uppercase;
    margin-bottom: var(--space-2);
    color: var(--color-text);
}

.advantage-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-text-body);
}

/* ---------------------------------------------------------------------- */
/* About                                                                   */
/* ---------------------------------------------------------------------- */
/* Compacted ~20-25% vertically vs. the rest of the landing's sections —
   tighter bottom padding plus the shorter .about-visual aspect-ratio below
   (cover-cropped, never stretched) bring this section's height down
   without touching copy or the image's own proportions. */
#nosotros {
    padding-top: 0;
    padding-bottom: 3.2rem;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 0.85fr;
    gap: var(--space-8);
    align-items: center;
}

.about-copy .section-title,
.about-copy .eyebrow {
    text-align: left;
}

.about-text {
    text-align: left;
}

.about-paragraph {
    max-width: 54ch;
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--color-text-body);
    margin-bottom: var(--space-6);
}

/* "TU MARCA · TUS CLIENTES · TU CONTROL" — one continuous blue plaque
   (not three separate chips) so it reads as a single visual signature;
   the three <li> stay structurally separate, joined by a "·" divider. */
.about-pillars {
    display: flex;
    flex-wrap: wrap;
    width: fit-content;
    max-width: 100%;
    list-style: none;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.85) 0%, rgba(0, 61, 150, 0.92) 100%);
    border: 1px solid rgba(0, 174, 239, 0.6);
    border-radius: var(--radius-pill);
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.22),
        0 8px 24px rgba(0, 20, 80, 0.4),
        0 0 30px rgba(0, 145, 255, 0.22);
}

.about-pillars li {
    position: relative;
    padding: 0 0.9rem;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffffff;
}

.about-pillars li:first-child {
    padding-left: 0;
}

.about-pillars li:last-child {
    padding-right: 0;
}

.about-pillars li:not(:last-child)::after {
    content: '·';
    position: absolute;
    right: -0.5rem;
    color: rgba(255, 255, 255, 0.65);
}

/* Holds the cover image (imagenes/krotar-chessnano.webp) — overflow:hidden +
   border-radius here are what actually clip/round the image itself. */
.about-visual {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(59, 130, 246, 0.16);
    background:
        radial-gradient(1px 1px at 18% 24%, rgba(255, 255, 255, 0.55) 50%, transparent 52%),
        radial-gradient(1px 1px at 74% 18%, rgba(255, 255, 255, 0.4) 50%, transparent 52%),
        radial-gradient(1.5px 1.5px at 62% 68%, rgba(255, 255, 255, 0.45) 50%, transparent 52%),
        radial-gradient(1px 1px at 30% 78%, rgba(255, 255, 255, 0.35) 50%, transparent 52%),
        radial-gradient(1px 1px at 85% 55%, rgba(255, 255, 255, 0.3) 50%, transparent 52%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0px, rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 32px),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0px, rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 32px),
        linear-gradient(165deg, rgba(255, 255, 255, 0.035) 0%, rgba(4, 5, 11, 0.6) 60%);
    aspect-ratio: 1 / 1;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06), 0 20px 50px rgba(0, 0, 0, 0.5);
}

.about-visual .ambient-glow-blue {
    top: -8%;
    left: -10%;
    width: 80%;
    height: 60%;
}

.about-visual .ambient-glow-cyan {
    bottom: -10%;
    right: -8%;
    width: 70%;
    height: 55%;
}

.about-visual-accent {
    position: absolute;
    top: 35%;
    right: 8%;
    width: 46%;
    height: 34%;
    border-radius: 50%;
    filter: blur(65px);
    background: radial-gradient(circle, rgba(10, 61, 255, 0.32) 0%, transparent 75%);
    mix-blend-mode: screen;
    pointer-events: none;
}

.about-visual-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
    border-radius: var(--radius-xl);
}

/* ---------------------------------------------------------------------- */
/* Responsive                                                              */
/* ---------------------------------------------------------------------- */
@media (max-width: 980px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .about-visual {
        aspect-ratio: 16 / 9;
        max-width: 480px;
        margin: 0 auto;
    }

    .about-text,
    .about-copy .section-title,
    .about-copy .eyebrow {
        text-align: center;
    }

    .about-paragraph {
        margin-left: auto;
        margin-right: auto;
    }

    .about-pillars {
        margin: 0 auto;
    }
}

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

    .advantages-grid {
        grid-template-columns: 1fr;
    }
}
