/* ========================================
   Hero Section — Asymmetric blob + geometric ring composition
   On wide screens the blob is contained and a set of
   concentric rings + satellite dots fill the right side.
   ======================================== */
.hero-section {
    background: var(--color-bg-white); /* bright tier (page rhythm: bright → soft → dark) */
    padding: calc(var(--navbar-h) + var(--section-py)) 0 var(--section-py);
    position: relative;
    overflow: hidden;
}

/* Subtle dot-grid texture */
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(99, 155, 241, 0.035) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

/* Quarter-circle ring system — bottom-left corner.
   Center is placed at the corner so overflow:hidden
   clips it to show only the top-right quadrant. */
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -220px;
    left: -220px;
    width: 440px;
    height: 440px;
    border: 2px solid rgba(99, 155, 241, 0.14);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    box-shadow:
        0 0 0 40px rgba(99, 155, 241, 0.05),
        0 0 0 80px rgba(99, 155, 241, 0.03),
        0 0 0 130px rgba(99, 155, 241, 0.015);
    animation: heroCornerSpin 60s linear infinite;
}

@keyframes heroCornerSpin {
    to { transform: rotate(360deg); }
}

/* ----------------------------------------
   Main organic blob — tighter, does NOT
   bleed to the viewport right edge.
   On wide screens it leaves room for
   the geometric ring composition.
   ---------------------------------------- */
.hero-bg-decor {
    position: absolute;
    top: -18%;
    right: 2%;
    width: 56%;
    height: 130%;
    background:
        linear-gradient(
            145deg,
            rgba(232, 240, 254, 0.92) 0%,
            rgba(223, 230, 255, 0.85) 30%,
            rgba(237, 233, 254, 0.78) 60%,
            rgba(224, 234, 255, 0.7) 100%
        );
    background-size: 200% 200%;
    border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
    pointer-events: none;
    z-index: 0;
    animation:
        heroBlob 25s ease-in-out infinite,
        heroShimmer 10s ease-in-out infinite;
}

@keyframes heroBlob {
    0%, 100% {
        border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
        transform: rotate(-6deg) translate(0, 0);
    }
    25% {
        border-radius: 55% 45% 48% 52% / 42% 58% 45% 55%;
        transform: rotate(-3deg) translate(6px, -5px);
    }
    50% {
        border-radius: 48% 52% 60% 40% / 55% 45% 50% 50%;
        transform: rotate(-8deg) translate(-3px, 6px);
    }
    75% {
        border-radius: 52% 48% 42% 58% / 45% 55% 55% 45%;
        transform: rotate(-5deg) translate(5px, -3px);
    }
}

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

/* ----------------------------------------
   Concentric rings — geometric anchor on
   the far right. Uses box-shadow to create
   three rings from a single element.
   ---------------------------------------- */
.hero-bg-decor::before {
    content: '';
    position: absolute;
    top: 12%;
    right: -38%;
    width: 420px;
    height: 420px;
    border: 1.5px solid rgba(99, 155, 241, 0.1);
    border-radius: 50%;
    box-shadow:
        0 0 0 50px rgba(99, 155, 241, 0.035),
        0 0 0 100px rgba(139, 92, 246, 0.02),
        0 0 0 170px rgba(99, 155, 241, 0.012);
    pointer-events: none;
    animation: heroRingsRotate 50s linear infinite;
}

@keyframes heroRingsRotate {
    to { transform: rotate(360deg); }
}

/* ----------------------------------------
   Satellite dots — small colored circles
   scattered on the right side.
   Uses box-shadow on a tiny seed element
   to produce multiple dots from one el.
   ---------------------------------------- */
.hero-bg-decor::after {
    content: '';
    position: absolute;
    top: 22%;
    right: -12%;
    width: 12px;
    height: 12px;
    background: var(--color-primary);
    border-radius: 50%;
    opacity: 0.35;
    box-shadow:
        -40px 220px 0 4px rgba(212, 175, 122, 0.4),
        80px 310px 0 8px rgba(139, 92, 246, 0.2),
        -120px 400px 0 6px rgba(99, 155, 241, 0.3),
        180px 100px 0 3px rgba(212, 175, 122, 0.25),
        -200px 140px 0 10px rgba(99, 155, 241, 0.12);
    pointer-events: none;
    animation: heroSatellites 18s ease-in-out infinite;
}

@keyframes heroSatellites {
    0%, 100% { transform: translate(0, 0); opacity: 0.35; }
    33%      { transform: translate(-6px, 8px); opacity: 0.45; }
    66%      { transform: translate(4px, -5px); opacity: 0.3; }
}

/* ========================================
   Wide-screen overrides (≥1440px)
   Tighten the blob, enlarge rings.
   ======================================== */
@media (min-width: 1440px) {
    .hero-bg-decor {
        width: 50%;
        right: 8%;
    }

    .hero-bg-decor::before {
        width: 500px;
        height: 500px;
        right: -44%;
        box-shadow:
            0 0 0 60px rgba(99, 155, 241, 0.04),
            0 0 0 130px rgba(139, 92, 246, 0.02),
            0 0 0 210px rgba(99, 155, 241, 0.012);
    }
}

/* Ultra-wide (≥1920px) — even tighter blob, bigger ring system */
@media (min-width: 1920px) {
    .hero-bg-decor {
        width: 44%;
        right: 12%;
    }

    .hero-bg-decor::before {
        width: 580px;
        height: 580px;
        right: -52%;
        top: 5%;
        box-shadow:
            0 0 0 70px rgba(99, 155, 241, 0.04),
            0 0 0 150px rgba(139, 92, 246, 0.025),
            0 0 0 240px rgba(99, 155, 241, 0.015),
            0 0 0 340px rgba(139, 92, 246, 0.008);
    }

    .hero-bg-decor::after {
        right: -18%;
        box-shadow:
            -40px 220px 0 5px rgba(212, 175, 122, 0.4),
            80px 310px 0 10px rgba(139, 92, 246, 0.2),
            -120px 400px 0 7px rgba(99, 155, 241, 0.3),
            180px 100px 0 4px rgba(212, 175, 122, 0.25),
            -200px 140px 0 12px rgba(99, 155, 241, 0.12),
            260px 260px 0 6px rgba(139, 92, 246, 0.15),
            -50px 520px 0 5px rgba(212, 175, 122, 0.18);
    }
}

/* ----------------------------------------
   Content sits above all decorations
   ---------------------------------------- */
.hero-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--container-px);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-text-dark);
    line-height: 1.12;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.hero-text-gradient {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--color-text-light);
    line-height: 1.7;
    margin-bottom: 40px;
    max-width: 520px;
}

.hero-metrics {
    display: flex;
    gap: 48px;
}

.hero-metric {
    display: flex;
    flex-direction: column;
}

.hero-metric-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-dark);
    line-height: 1.2;
}

.hero-metric-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Portal Panel — glass card */
.hero-portal-panel {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
}

.portal-panel-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-dark);
    margin-bottom: 6px;
}

.portal-panel-desc {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-bottom: 28px;
}

.portal-entry-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    font-family: var(--font-body);
}

.portal-entry-btn + .portal-entry-btn {
    margin-top: 12px;
}

.portal-entry-btn:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 16px rgba(99, 155, 241, 0.12);
    transform: translateY(-2px);
}

.portal-entry-btn.lawyer-entry:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 16px rgba(212, 175, 122, 0.15);
}

.portal-entry-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.portal-entry-icon.client-icon {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}

.portal-entry-icon.lawyer-icon {
    background: linear-gradient(135deg, var(--color-accent), #c9a06e);
}

.portal-entry-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.portal-entry-text strong {
    font-size: 1rem;
    color: var(--color-text-dark);
}

.portal-entry-text span {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.portal-entry-arrow {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    transition: all var(--transition);
}

.portal-entry-btn:hover .portal-entry-arrow {
    transform: translateX(4px);
    color: var(--color-primary);
}

.portal-entry-btn.lawyer-entry:hover .portal-entry-arrow {
    color: var(--color-accent);
}

/* ----------------------------------------
   Feature Cards Strip — grid of glass cards
   linking to individual feature pages.
   Desktop: 5 columns (2 rows for 10 items).
   Tablet: 4 columns. Mobile: 2–3 columns.
   ---------------------------------------- */
.hero-features-strip {
    max-width: var(--max-width);
    margin: 64px auto 0;
    padding: 0 var(--container-px);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    position: relative;
    z-index: 1;
}

.hero-fcard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 12px 20px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.3s ease;
    animation: fcardFloat 5s ease-in-out infinite;
    animation-delay: calc(var(--fc-i, 0) * 0.5s);
}

/* Colored accent bar on top edge */
.hero-fcard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 3px;
    background: var(--fc-accent);
    border-radius: 0 0 3px 3px;
    transition: left 0.35s ease, right 0.35s ease;
}

/* Soft colored glow behind the icon area */
.hero-fcard::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    background: var(--fc-accent);
    opacity: 0.07;
    border-radius: 50%;
    filter: blur(14px);
    transition: opacity 0.35s ease, width 0.35s ease, height 0.35s ease;
    pointer-events: none;
}

/* Hover — lift, accent bar spans full width, glow intensifies */
.hero-fcard:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.07);
    border-color: color-mix(in srgb, var(--fc-accent) 30%, transparent);
}

.hero-fcard:hover::before {
    left: 0;
    right: 0;
}

.hero-fcard:hover::after {
    opacity: 0.14;
    width: 80px;
    height: 80px;
}

.hero-fcard-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--fc-accent);
    position: relative;
    z-index: 1;
}

.hero-fcard-name {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-text-dark);
    text-align: center;
    line-height: 1.2;
}

.hero-fcard-tag {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    font-weight: 500;
    text-align: center;
}

/* Staggered floating animation */
@keyframes fcardFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

/* ========================================
   Responsive — smaller screens
   ======================================== */
@media (max-width: 1024px) {
    .hero-container {
        gap: 40px;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .hero-bg-decor {
        width: 64%;
        right: -4%;
    }

    .hero-features-strip {
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .hero-section::before {
        background-size: 24px 24px;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-title {
        font-size: 2.4rem;
    }

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

    .hero-metrics {
        gap: 32px;
    }

    .hero-portal-panel {
        padding: 28px 24px;
    }

    .hero-features-strip {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        margin-top: 48px;
    }

    .hero-fcard {
        padding: 18px 10px 16px;
    }

    .hero-fcard-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .hero-fcard-name {
        font-size: 0.8rem;
    }

    .hero-fcard-tag {
        font-size: 0.65rem;
    }

    .hero-bg-decor {
        top: -12%;
        right: -15%;
        width: 100%;
        height: 65%;
        opacity: 0.65;
    }

    /* Hide complex ring/dot decorations on mobile */
    .hero-bg-decor::before,
    .hero-bg-decor::after {
        display: none;
    }
}

@media (max-width: 600px) {
    .hero-features-strip {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-metrics {
        gap: 24px;
        flex-wrap: wrap;
    }

    .hero-metric-value {
        font-size: 1.6rem;
    }

    .hero-features-strip {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-top: 36px;
    }

    .hero-fcard {
        padding: 16px 8px 14px;
        animation: none;
    }

    .hero-bg-decor {
        width: 110%;
        height: 55%;
        opacity: 0.5;
    }

    .hero-section::after {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-bg-decor,
    .hero-bg-decor::before,
    .hero-bg-decor::after,
    .hero-section::after {
        animation: none;
    }
}
