/* ============================================
   ECPSOLUTIONS INC - Home Page Styles
   (resets, background, particles live in shared/base.css)
   ============================================ */

/* ============================================
   Main Content
   ============================================ */
main {
    position: relative;
    z-index: 1;
    padding-top: 80px;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 6rem 4rem;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* ---- Layered watermark behind everything ---- */
.hero-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Outfit', sans-serif;
    font-size: clamp(10rem, 24vw, 22rem);
    font-weight: 900;
    letter-spacing: -0.06em;
    line-height: 0.85;
    background: linear-gradient(180deg,
        rgba(168, 85, 247, 0.07) 0%,
        rgba(99, 102, 241, 0.04) 50%,
        rgba(255, 255, 255, 0.0) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
    z-index: 0;
    white-space: nowrap;
    text-align: center;
    animation: watermarkBreathe 14s ease-in-out infinite;
    -webkit-font-smoothing: antialiased;
}

@keyframes watermarkBreathe {
    0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 0.65; transform: translate(-50%, -50%) scale(1.04); }
}

.hero-content {
    max-width: 700px;
    position: relative;
    z-index: 1;
}

/* ============================================
   Hero Title — kinetic value statement
   ============================================ */
.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.5rem, 5.4vw, 5.25rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.025em;
    color: #ffffff;
    margin-bottom: 1.75rem;
}

.title-line {
    display: block;
}

/* "Engineering the" line uses a soft white-to-lavender wash for elegance */
.title-line:first-child {
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.14;
    padding-bottom: 0.06em;
    margin-bottom: 0.18em;
}

/* Second line holds the cycling word + "enterprise." */
.title-line-cycle {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.28em;
}

/* Cycling word slot — uses inline-grid so all words stack in
   one cell, sized to the widest word (no layout shift). */
.title-cycle {
    display: inline-grid;
    grid-template-areas: 'cycle';
    overflow: hidden;
    line-height: 1.04;
    padding-bottom: 0.12em;   /* room for descender of "g" / "y" */
    margin-bottom: -0.12em;
    position: relative;
}

.title-cycle-word {
    grid-area: cycle;
    background: linear-gradient(135deg, #c4b5fd 0%, #a855f7 35%, #6366f1 70%, #3b82f6 100%);
    background-size: 220% 220%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    will-change: transform, opacity, filter;
    transform: translateY(112%);
    opacity: 0;
    filter: blur(6px);
    transition:
        transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
        opacity   0.55s ease,
        filter    0.55s ease;
    animation: titleGradient 6s ease infinite;
}

.title-cycle-word.is-active {
    transform: translateY(0);
    opacity: 1;
    filter: blur(0);
}

.title-cycle-word.is-leaving {
    transform: translateY(-112%);
    opacity: 0;
    filter: blur(6px);
}

@keyframes titleGradient {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* Subtle glow line under the cycle word */
.title-cycle::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.04em;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(168, 85, 247, 0.6) 50%,
        transparent 100%);
    border-radius: 2px;
    opacity: 0.7;
    filter: blur(0.5px);
    transform: scaleX(0.85);
    transform-origin: center;
    animation: cycleUnderline 6s ease-in-out infinite;
}

@keyframes cycleUnderline {
    0%, 100% { opacity: 0.4; transform: scaleX(0.7); }
    50%      { opacity: 0.85; transform: scaleX(1); }
}

.title-tail {
    color: #ffffff;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Brand line — wordmark + tagline
   ============================================ */
.hero-brand-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    font-family: 'Outfit', sans-serif;
}

.hero-brand-line .brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-brand-line .brand-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1;
    background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-brand-line .brand-inc {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #c4b5fd;
    padding: 0.22rem 0.5rem;
    border: 1px solid rgba(168, 85, 247, 0.45);
    border-radius: 4px;
    background: rgba(168, 85, 247, 0.1);
    line-height: 1;
}

.brand-divider {
    width: 1px;
    height: 18px;
    background: linear-gradient(180deg, transparent, rgba(168, 85, 247, 0.5), transparent);
}

.brand-tagline {
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0;
}

/* ============================================
   Hero Description
   ============================================ */
.hero-description {
    font-size: 1.1rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.78);
    max-width: 540px;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* ============================================
   Service chips — micro shortcuts
   ============================================ */
.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0.5rem 0.8rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition:
        background 0.3s ease,
        border-color 0.3s ease,
        transform 0.3s ease,
        color 0.3s ease,
        box-shadow 0.3s ease;
}

.hero-chip:hover {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.4);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.18);
}

/* Keyboard focus parity for the service-shortcut chips */
.hero-chip:focus-visible {
    outline: none;
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.55);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.18), 0 0 0 3px rgba(168, 85, 247, 0.45);
}
.hero-chip:focus-visible svg,
.hero-chip:focus-visible i { color: #ffffff; }

.hero-chip svg,
.hero-chip i {
    width: 14px;
    height: 14px;
    color: #c4b5fd;
}

.hero-chip:hover svg,
.hero-chip:hover i {
    color: #ffffff;
}

/* ============================================
   Hero Visual - 3D Rotating Cubes
   ============================================ */
.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    perspective: 1600px;
    perspective-origin: 50% 30%;
}

.cubes-container {
    position: relative;
    width: 480px;
    height: 600px;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

/* ============================================
   Cube wrapper - position + float bob
   Per-cube color expressed as CSS variables.
   ============================================ */
.cube-wrapper {
    position: absolute;
    width: 180px;
    height: 180px;
    z-index: 2;
    --cube-color: 168, 85, 247;
    transform-style: preserve-3d;
    will-change: transform;
}

.cube-wrapper-1 {
    top: 0;
    left: 50%;
    margin-left: -90px;
    --cube-color: 168, 85, 247; /* purple — AI Implementing */
    animation: cubeFloat 6s ease-in-out infinite;
}

.cube-wrapper-2 {
    top: 300px;
    left: 0;
    --cube-color: 99, 102, 241; /* indigo — Cloud Computing */
    animation: cubeFloat 6.8s ease-in-out infinite;
    animation-delay: -1.7s;
}

.cube-wrapper-3 {
    top: 300px;
    right: 0;
    --cube-color: 16, 185, 129; /* green — security infrastructure */
    animation: cubeFloat 7.4s ease-in-out infinite;
    animation-delay: -3.4s;
}

@keyframes cubeFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-14px); }
}

/* ============================================
   Layered shadow + halo
   ============================================ */
/* Background halo (big soft color glow behind cube) */
.cube-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 280px;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle, rgba(var(--cube-color), 0.65) 0%, transparent 70%);
    animation: cubeGlowPulse 5s ease-in-out infinite;
}

@keyframes cubeGlowPulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 0.75; transform: translate(-50%, -50%) scale(1.08); }
}

/* Cast shadow on virtual ground — sells the "floating above surface" feel */
.cube-wrapper::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 170px;
    height: 26px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.15) 50%, transparent 75%);
    filter: blur(10px);
    z-index: -1;
    pointer-events: none;
    animation: castShadow 6s ease-in-out infinite;
}

.cube-wrapper-2::after { animation-duration: 6.8s; animation-delay: -1.7s; }
.cube-wrapper-3::after { animation-duration: 7.4s; animation-delay: -3.4s; }
@keyframes castShadow {
    0%, 100% { width: 170px; opacity: 0.55; filter: blur(10px); }
    50%      { width: 130px; opacity: 0.3;  filter: blur(14px); }
}

/* ============================================
   3D Cube — single-axis continuous rotation
   ============================================ */
.cube {
    width: 180px;
    height: 180px;
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
}

.cube-1 { animation: cubeSpin1 28s linear infinite; }
.cube-2 { animation: cubeSpin2 32s linear infinite; }
.cube-3 { animation: cubeSpin3 30s linear infinite; }

/* Smooth continuous spin — single axis vector per cube,
   gives each one a distinct "personality" without the
   keyframe-stuttering of the old multi-stop animation. */
@keyframes cubeSpin1 {
    from { transform: rotate3d(1, 0.6, 0.3, 0deg); }
    to   { transform: rotate3d(1, 0.6, 0.3, 360deg); }
}
@keyframes cubeSpin2 {
    from { transform: rotate3d(0.5, 1, -0.4, 0deg); }
    to   { transform: rotate3d(0.5, 1, -0.4, 360deg); }
}
@keyframes cubeSpin3 {
    from { transform: rotate3d(-0.4, 0.8, 0.6, 0deg); }
    to   { transform: rotate3d(-0.4, 0.8, 0.6, 360deg); }
}

/* ============================================
   Cube Faces
   The artwork (cube-1.webp … cube-18.webp) is the hero —
   border + glow are just framing. Pseudo-overlays and
   mix-blend-mode have been removed because they cause
   z-fighting / flicker during 3D rotation.
   ============================================ */
.cube-face {
    position: absolute;
    width: 180px;
    height: 180px;
    border: 1px solid rgba(var(--cube-color), 0.5);
    border-radius: 14px;
    overflow: hidden;
    /* Hidden backface = each face only renders when it's
       facing the viewer. Eliminates flicker from overlapping
       front/back surfaces during rotation. */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: flat;
    /* (was will-change:transform — removed; it pinned 18 permanent GPU layers.
       Transforms auto-promote to a layer only while actually animating.) */
    background: #0c0716;
    box-shadow:
        inset 0 0 22px rgba(var(--cube-color), 0.22),
        0 0 18px rgba(var(--cube-color), 0.18);
}

/* <picture> defaults to display: inline which would shrink the
   img inside it. Force it to fill the face. */
.cube-face picture {
    display: block;
    width: 100%;
    height: 100%;
}

.cube-face img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Hint to the renderer that this img is composited */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Face positions — translateZ = half the new cube size (90px) */
.cube-front  { transform: translateZ(90px); }
.cube-back   { transform: rotateY(180deg) translateZ(90px); }
.cube-right  { transform: rotateY(90deg)  translateZ(90px); }
.cube-left   { transform: rotateY(-90deg) translateZ(90px); }
.cube-top    { transform: rotateX(90deg)  translateZ(90px); }
.cube-bottom { transform: rotateX(-90deg) translateZ(90px); }

/* Hover pause */
.cube-wrapper:hover .cube,
.cube-wrapper:hover {
    animation-play-state: paused;
}

/* Reduced motion: hold position */
@media (prefers-reduced-motion: reduce) {
    .cube-wrapper, .cube, .cube-glow,
    .cube-wrapper::after { animation: none !important; }
}

/* ============================================
   Services Overview Section
   ============================================ */
/* ============================================================
   Services Overview — "Transformative Technology Services"
   MERGED: Editorial numbered-index base (equal-height grid +
   single-source --ca accent + strong focus ring) grafted with
   the floating icon medallion + halo, the growing top accent
   bar, the icon sheen-wipe, and the accent-tinted CTA pill.
   Per-card accent set inline: style="--ca: R, G, B".
   Drop-in: replaces the existing .services-overview block.
   ============================================================ */

.services-overview {
    padding: 8rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ---- Header: title fits ONE line on desktop ---- */
/* nowrap ignores max-width for wrapping; max-width only constrains the
   description. The widened value keeps the centered block roomy. */
.section-header {
    text-align: center;
    max-width: 780px;
    margin: 0 auto 4.5rem;
}

.section-tag {
    display: inline-block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #a855f7;
    padding: 0.5rem 1rem;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 100px;
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    /* clamp shrinks the font on narrow desktops so nowrap never clips */
    font-size: clamp(2.25rem, 3.4vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    white-space: nowrap;            /* one line on desktop */
    background: linear-gradient(135deg, #ffffff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.7;
    max-width: 580px;
    margin: 0 auto;
}

/* ---- Grid: 4 portrait cards, one row, equal height ----
   1400 - 8rem(128px) padding = 1272 content;
   - 3 * 1.5rem(72px) gaps = 1200 / 4 = 300px per card. */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    align-items: stretch;           /* equal-height columns */
}

/* ---- The card: internal grid so CTA pins to bottom on ALL cards ---- */
.service-card {
    --ca: 168, 85, 247;             /* fallback; each card overrides inline */
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-rows: auto auto 1fr auto;  /* head / divider / features / cta */
    gap: 1.35rem;
    min-width: 0;                   /* prevent grid blowout from long words */
    padding: 2.25rem 1.75rem 2rem;
    min-height: 480px;              /* tuned floor; raise if a card wraps further */
    background:
        linear-gradient(180deg,
            rgba(var(--ca), 0.05),
            rgba(255, 255, 255, 0.02) 36%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 1px 1px rgba(0, 0, 0, 0.4);
    transition:
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Top accent bar — grows from the left on hover/focus (grafted from C3) */
.card-accent-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 3;
    background: linear-gradient(90deg,
        rgba(var(--ca), 0),
        rgba(var(--ca), 0.95) 50%,
        rgba(var(--ca), 0));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Top hairline glow (the site's existing language, re-expressed in --ca) */
.card-glow {
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    z-index: 3;
    background: linear-gradient(90deg,
        transparent,
        rgba(var(--ca), 0.7),
        transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Accent glow that blooms from the top (grafted from C3) */
.card-bloom {
    position: absolute;
    top: -38%;
    left: 50%;
    width: 130%;
    height: 78%;
    z-index: 0;
    transform: translateX(-50%);
    background: radial-gradient(60% 60% at 50% 0%,
        rgba(var(--ca), 0.26),
        rgba(var(--ca), 0.05) 45%,
        transparent 70%);
    opacity: 0.16;
    filter: blur(6px);
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* ---- Editorial index numeral (motif, from the base concept) ---- */
.card-index {
    position: absolute;
    top: 0.5rem;
    right: 1.1rem;
    z-index: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 6.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(var(--ca), 0.16);
    pointer-events: none;
    user-select: none;
    transition:
        transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        -webkit-text-stroke-color 0.55s ease;
}

/* keep real content above the decorative layers */
.card-head,
.card-divider,
.card-features,
.card-link {
    position: relative;
    z-index: 2;
}

/* ---- Head block (medallion + title + desc) ---- */
.card-head {
    display: flex;
    flex-direction: column;
}

/* Floating icon medallion: halo + tile (grafted from C3, sheen from C2) */
.card-medallion {
    position: relative;
    width: 64px;
    height: 64px;
    margin-bottom: 1.4rem;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.medallion-halo {
    position: absolute;
    inset: -10px;
    border-radius: 22px;
    background: radial-gradient(circle at 50% 35%,
        rgba(var(--ca), 0.45),
        transparent 68%);
    opacity: 0.4;
    filter: blur(8px);
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.card-icon {
    position: relative;
    z-index: 1;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;               /* clips the sheen wipe */
    border-radius: 16px;
    background:
        linear-gradient(160deg,
            rgba(var(--ca), 0.24),
            rgba(var(--ca), 0.06) 65%),
        rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(var(--ca), 0.28);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 8px 20px rgba(0, 0, 0, 0.45);
    transition:
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.5s ease,
        border-color 0.5s ease;
}

/* Sheen wipe across the tile on hover (grafted from C2) */
.card-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg,
        transparent 30%,
        rgba(255, 255, 255, 0.22) 48%,
        transparent 62%);
    transform: translateX(-130%);
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-icon i {
    position: relative;
    width: 28px;
    height: 28px;
    color: rgb(var(--ca));
    filter: drop-shadow(0 0 8px rgba(var(--ca), 0.4));
}

.service-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0 0 0.6rem;
    color: #ffffff;
}

.service-card p {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin: 0;
}

/* ---- Hairline gradient divider with hover shimmer (from base) ---- */
.card-divider {
    display: block;
    height: 1px;
    width: 100%;
    border: 0;
    background: linear-gradient(90deg,
        rgba(var(--ca), 0.45),
        rgba(var(--ca), 0.12) 45%,
        transparent);
    background-size: 200% 100%;
    background-position: 100% 0;
    transition: background-position 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Feature list fills the 1fr row → CTA pins to the bottom ---- */
.card-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    align-content: start;
}

.card-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.85rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.74);
}

.tick {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 0.05rem;
    border-radius: 6px;
    position: relative;
    background: rgba(var(--ca), 0.14);
    border: 1px solid rgba(var(--ca), 0.3);
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* CSS-masked check glyph (mask + fallback border-tick if mask unsupported) */
.tick::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgb(var(--ca));
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px 11px no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px 11px no-repeat;
}

/* ---- CTA pill pinned to the bottom (grafted from C3) ---- */
.card-link {
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgb(var(--ca));
    background: rgba(var(--ca), 0.07);
    border: 1px solid rgba(var(--ca), 0.18);
    transition:
        background 0.4s ease,
        border-color 0.4s ease,
        color 0.4s ease,
        box-shadow 0.4s ease;
}

.card-link i {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   Hover + Focus  (keyboard gets full parity with hover)
   ============================================================ */
.service-card:hover,
.service-card:focus-visible {
    transform: translateY(-8px);
    border-color: rgba(var(--ca), 0.4);
    background:
        linear-gradient(180deg,
            rgba(var(--ca), 0.1),
            rgba(255, 255, 255, 0.03) 40%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 24px 48px -16px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(var(--ca), 0.12),
        0 18px 60px -22px rgba(var(--ca), 0.45);
}

.service-card:hover .card-glow,
.service-card:focus-visible .card-glow { opacity: 1; }

.service-card:hover .card-accent-bar,
.service-card:focus-visible .card-accent-bar { transform: scaleX(1); }

.service-card:hover .card-bloom,
.service-card:focus-visible .card-bloom { opacity: 0.55; }

.service-card:hover .card-index,
.service-card:focus-visible .card-index {
    transform: translateY(-6px);
    -webkit-text-stroke-color: rgba(var(--ca), 0.38);
}

.service-card:hover .card-medallion,
.service-card:focus-visible .card-medallion { transform: translateY(-4px); }

.service-card:hover .medallion-halo,
.service-card:focus-visible .medallion-halo {
    opacity: 0.85;
    transform: scale(1.08);
}

.service-card:hover .card-icon,
.service-card:focus-visible .card-icon {
    transform: scale(1.06);
    border-color: rgba(var(--ca), 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 10px 26px rgba(0, 0, 0, 0.5),
        0 0 32px rgba(var(--ca), 0.4);
}

.service-card:hover .card-icon::after,
.service-card:focus-visible .card-icon::after { transform: translateX(130%); }

.service-card:hover .card-divider,
.service-card:focus-visible .card-divider { background-position: 0 0; }

.service-card:hover .tick,
.service-card:focus-visible .tick {
    background: rgba(var(--ca), 0.24);
    border-color: rgba(var(--ca), 0.5);
    box-shadow: 0 0 12px rgba(var(--ca), 0.28);
}

.service-card:hover .card-link,
.service-card:focus-visible .card-link {
    background: rgba(var(--ca), 0.16);
    border-color: rgba(var(--ca), 0.4);
    color: #ffffff;
    box-shadow: 0 0 24px rgba(var(--ca), 0.2);
}

.service-card:hover .card-link i,
.service-card:focus-visible .card-link i { transform: translate(3px, -3px); }

/* Real, accent-aware focus ring on the whole clickable card.
   #000 spacer ring guarantees contrast on any of the 4 accents. */
.service-card:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px #000,
        0 0 0 4px rgba(var(--ca), 0.9),
        0 24px 48px -16px rgba(0, 0, 0, 0.7),
        0 18px 60px -22px rgba(var(--ca), 0.45);
}

/* ============================================================
   Responsive: 4-up  →  2-up (<=1100px)  →  1-up (<=640px)
   ============================================================ */
@media (max-width: 1100px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    .section-title { white-space: normal; }   /* allow wrap once it can't fit */
}

@media (max-width: 900px) {
    .services-overview { padding: 6rem 2rem; }
}

@media (max-width: 640px) {
    .services-overview { padding: 4rem 1.25rem; }
    .section-header { margin-bottom: 3rem; }
    .section-title {
        font-size: clamp(1.85rem, 8vw, 2.25rem);
        white-space: normal;
    }
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .service-card { min-height: 0; }           /* height follows content */
    .card-index { font-size: 5.5rem; }
}

/* ============================================================
   Reduced motion: keep the recolor + lit states, drop movement
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .service-card,
    .service-card::before,
    .card-index,
    .card-glow,
    .card-bloom,
    .card-accent-bar,
    .card-medallion,
    .medallion-halo,
    .card-icon,
    .card-icon::after,
    .card-divider,
    .tick,
    .card-link,
    .card-link i {
        transition: none;
    }
    .service-card:hover,
    .service-card:focus-visible { transform: none; }
    .service-card:hover .card-index,
    .service-card:focus-visible .card-index,
    .service-card:hover .card-medallion,
    .service-card:focus-visible .card-medallion,
    .service-card:hover .medallion-halo,
    .service-card:focus-visible .medallion-halo,
    .service-card:hover .card-icon,
    .service-card:focus-visible .card-icon,
    .service-card:hover .card-link i,
    .service-card:focus-visible .card-link i { transform: none; }
    /* Show the lit states statically so nothing looks broken */
    .card-accent-bar { transform: scaleX(1); opacity: 0.6; }
    .service-card:hover .card-icon::after,
    .service-card:focus-visible .card-icon::after { transform: translateX(-130%); }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1200px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 4rem 2rem;
        min-height: auto;  /* drop the forced 100vh once the cube visual is hidden */
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-description {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-brand-line,
    .title-line-cycle,
    .hero-chips {
        justify-content: center;
    }

    .hero-visual {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-watermark {
        font-size: clamp(7rem, 30vw, 14rem);
    }

    .hero-brand-line {
        gap: 0.5rem;
    }

    .brand-divider {
        display: none;
    }

    .brand-tagline {
        flex-basis: 100%;
        font-size: 0.85rem;
    }
}
