/* Niche-specific motion for SEO service pages. Colors come from inline variables. */

.seo-service-page .ssp-hero::before {
    background:
        radial-gradient(circle at 20% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(249, 115, 22, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(34, 211, 238, 0.08) 0%, transparent 40%);
}

.seo-service-page .ssp-hero-orb.o1 { background: var(--ssp-primary); }
.seo-service-page .ssp-hero-orb.o2 { background: var(--ssp-accent); }
.seo-service-page .ssp-hero-orb.o3 { background: var(--ssp-primary-light); }

.seo-service-page .ssp-trust-badge {
    background: color-mix(in srgb, var(--ssp-primary) 18%, transparent);
    border-color: color-mix(in srgb, var(--ssp-accent) 45%, transparent);
}

.seo-service-page .ssp-btn-primary {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.35);
}

.seo-service-page .ssp-btn-primary:hover {
    box-shadow: 0 14px 36px color-mix(in srgb, var(--ssp-accent) 45%, transparent);
}

.seo-service-page .ssp-benefits-bar {
    background: linear-gradient(90deg, #0891b2 0%, #0d9488 52%, #0e7490 100%);
}

.ssp-niche-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 1rem;
    padding: 0.35rem 0.8rem 0.35rem 0.35rem;
    border-radius: 999px;
    color: #fff;
    background: color-mix(in srgb, var(--ssp-primary) 22%, transparent);
    border: 1px solid color-mix(in srgb, var(--ssp-primary) 55%, transparent);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.ssp-niche-pill-icon {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ssp-primary);
    color: #fff;
    animation: sspNicheBob 2.8s ease-in-out infinite;
}

.ssp-hero-grid:not(:has(.ssp-hero-aside)) {
    grid-template-columns: 1fr;
}

.ssp-hero-aside {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.ssp-niche-stage {
    --ssp-accent: var(--ssp-primary);
    --ssp-accent-light: var(--ssp-primary-light);
    position: relative;
    z-index: 2;
    width: min(100%, 380px);
    height: 360px;
    margin: 0 auto;
    pointer-events: none;
}

.ssp-niche-stage-grid,
.ssp-niche-sweep,
.ssp-niche-rays,
.ssp-niche-bars,
.ssp-niche-streaks,
.ssp-niche-orbit,
.ssp-niche-ecg,
.ssp-niche-scales,
.ssp-niche-book,
.ssp-niche-codeframe {
    display: none;
}

.ssp-niche-mark {
    position: absolute;
    left: 50%;
    top: 46%;
    width: 84px;
    height: 84px;
    margin: -42px 0 0 -42px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a0f1a;
    background: var(--ssp-accent);
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--ssp-accent) 18%, transparent);
    font-size: 1.7rem;
    z-index: 2;
    animation: sspNicheBob 3.4s ease-in-out infinite;
}

.ssp-niche-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.2rem;
    text-align: center;
    color: #e2e8f0;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    z-index: 2;
}

.ssp-niche-stage[data-motif="orbit"] .ssp-niche-orbit,
.ssp-niche-stage[data-motif="legal"] .ssp-niche-scales,
.ssp-niche-stage[data-motif="clinical"] .ssp-niche-ecg,
.ssp-niche-stage[data-motif="trade"] .ssp-niche-stage-grid,
.ssp-niche-stage[data-motif="trade"] .ssp-niche-sweep,
.ssp-niche-stage[data-motif="motion"] .ssp-niche-streaks,
.ssp-niche-stage[data-motif="bloom"] .ssp-niche-orbit,
.ssp-niche-stage[data-motif="solar"] .ssp-niche-rays,
.ssp-niche-stage[data-motif="code"] .ssp-niche-codeframe,
.ssp-niche-stage[data-motif="learn"] .ssp-niche-book {
    display: block;
}

.ssp-niche-orbit {
    position: absolute;
    inset: 18px;
    border: 1px dashed color-mix(in srgb, var(--ssp-accent) 70%, transparent);
    border-radius: 50%;
    animation: sspNicheSpin 14s linear infinite;
}

.ssp-niche-orbit i {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ssp-accent);
    top: -6px;
    left: 50%;
}

.ssp-niche-orbit i:nth-child(2) { top: 50%; left: -6px; }
.ssp-niche-orbit i:nth-child(3) { top: auto; bottom: -6px; left: 62%; }

.ssp-niche-stage[data-motif="property"] .ssp-niche-bars,
.ssp-niche-stage[data-motif="signal"] .ssp-niche-bars {
    display: flex;
}

.ssp-niche-stage[data-motif="bloom"] .ssp-niche-orbit {
    animation: sspNicheBloom 4.5s ease-in-out infinite;
    border-style: solid;
    border-color: color-mix(in srgb, var(--ssp-accent) 55%, transparent);
}

.ssp-niche-stage[data-motif="bloom"] .ssp-niche-orbit i { display: none; }

.ssp-niche-scales {
    position: absolute;
    left: 24px;
    right: 24px;
    top: 58px;
    height: 70px;
}

.ssp-niche-scales .beam {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 8px;
    height: 4px;
    border-radius: 4px;
    background: var(--ssp-accent);
    transform-origin: center;
    animation: sspNicheTilt 3.6s ease-in-out infinite;
}

.ssp-niche-scales .pan {
    position: absolute;
    top: 18px;
    width: 36px;
    height: 14px;
    border-radius: 0 0 12px 12px;
    background: color-mix(in srgb, var(--ssp-accent) 80%, white);
}

.ssp-niche-scales .pan.left { left: 8px; animation: sspNichePan 3.6s ease-in-out infinite; }
.ssp-niche-scales .pan.right { right: 8px; animation: sspNichePan 3.6s ease-in-out infinite reverse; }

.ssp-niche-ecg {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 48px;
}

.ssp-niche-ecg polyline {
    fill: none;
    stroke: var(--ssp-accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 180;
    animation: sspNicheDraw 2.8s ease-in-out infinite;
}

.ssp-niche-stage-grid {
    position: absolute;
    inset: 10px 10px 46px;
    background-image:
        linear-gradient(color-mix(in srgb, var(--ssp-accent) 35%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--ssp-accent) 35%, transparent) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(circle at 50% 45%, #000 40%, transparent 78%);
}

.ssp-niche-sweep {
    position: absolute;
    left: 16px;
    right: 16px;
    height: 2px;
    top: 30px;
    background: var(--ssp-accent);
    box-shadow: 0 0 16px var(--ssp-accent);
    animation: sspNicheSweep 3.2s ease-in-out infinite;
}

.ssp-niche-bars {
    position: absolute;
    left: 36px;
    right: 36px;
    bottom: 58px;
    height: 110px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.ssp-niche-bars span {
    flex: 1;
    height: 30%;
    border-radius: 8px 8px 2px 2px;
    background: linear-gradient(180deg, var(--ssp-accent), color-mix(in srgb, var(--ssp-primary) 70%, black));
    transform-origin: bottom;
    animation: sspNicheRise 2.6s ease-in-out infinite;
}

.ssp-niche-bars span:nth-child(2) { animation-delay: 0.2s; height: 55%; }
.ssp-niche-bars span:nth-child(3) { animation-delay: 0.35s; height: 80%; }
.ssp-niche-bars span:nth-child(4) { animation-delay: 0.5s; height: 45%; }

.ssp-niche-stage[data-motif="property"] .ssp-niche-bars span {
    border-radius: 2px 2px 0 0;
}

.ssp-niche-streaks {
    position: absolute;
    inset: 24px 0 70px;
    overflow: hidden;
}

.ssp-niche-streaks span {
    position: absolute;
    height: 2px;
    width: 90px;
    background: linear-gradient(90deg, transparent, var(--ssp-accent));
    animation: sspNicheStreak 1.8s linear infinite;
}

.ssp-niche-streaks span:nth-child(1) { top: 20px; }
.ssp-niche-streaks span:nth-child(2) { top: 58px; animation-delay: 0.4s; width: 120px; }
.ssp-niche-streaks span:nth-child(3) { top: 96px; animation-delay: 0.8s; }

.ssp-niche-rays {
    position: absolute;
    left: 50%;
    top: 42%;
    width: 180px;
    height: 180px;
    margin: -90px 0 0 -90px;
    background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--ssp-accent) 70%, transparent) 0 8deg, transparent 8deg 24deg);
    border-radius: 50%;
    mask-image: radial-gradient(circle, transparent 0 28%, #000 29% 70%, transparent 71%);
    animation: sspNicheSpin 18s linear infinite;
}

.ssp-niche-codeframe {
    position: absolute;
    inset: 28px 34px 64px;
    border: 2px solid color-mix(in srgb, var(--ssp-accent) 75%, transparent);
    border-radius: 16px;
}

.ssp-niche-codeframe span {
    position: absolute;
    left: 8px;
    right: 8px;
    height: 2px;
    background: var(--ssp-accent);
    animation: sspNicheSweep 2.6s ease-in-out infinite;
}

.ssp-niche-book {
    position: absolute;
    left: 70px;
    top: 48px;
    width: 140px;
    height: 96px;
    perspective: 500px;
}

.ssp-niche-book i {
    position: absolute;
    inset: 0;
    border-radius: 4px 12px 12px 4px;
    background: color-mix(in srgb, var(--ssp-accent) 80%, white);
    transform-origin: left center;
    animation: sspNichePage 3s ease-in-out infinite;
}

.ssp-niche-book i:last-child {
    background: var(--ssp-primary-light);
    animation-delay: 0.35s;
}

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

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

@keyframes sspNicheTilt {
    0%, 100% { transform: rotate(-8deg); }
    50% { transform: rotate(8deg); }
}

@keyframes sspNichePan {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

@keyframes sspNicheDraw {
    0% { stroke-dashoffset: 180; }
    55%, 100% { stroke-dashoffset: 0; }
}

@keyframes sspNicheSweep {
    0% { top: 18px; opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { top: 150px; opacity: 0; }
}

@keyframes sspNicheRise {
    0%, 100% { transform: scaleY(0.45); }
    50% { transform: scaleY(1); }
}

@keyframes sspNicheStreak {
    from { transform: translateX(-120px); opacity: 0; }
    20% { opacity: 1; }
    to { transform: translateX(240px); opacity: 0; }
}

@keyframes sspNicheBloom {
    0%, 100% { transform: scale(0.82); opacity: 0.45; }
    50% { transform: scale(1.08); opacity: 1; }
}

@keyframes sspNichePage {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(-46deg); }
}

@media (max-width: 640px) {
    .ssp-niche-stage { height: 190px; }
}

.ssp-hero-aside { min-height: 0; align-items: center; }
.ssp-rank {
    width: 100%;
    padding: 0;
    background: none;
    box-shadow: none;
    border: 0;
}
.ssp-rank-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.45rem 0.65rem; margin-bottom: 0.85rem; text-align: center; }
.ssp-rank-mark {
    width: 36px; height: 36px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: none; color: #22d3ee; font-size: 1.15rem;
    box-shadow: none;
}
.ssp-rank-head strong { color: #fff; font-size: 1.35rem; letter-spacing: -0.02em; text-transform: none; }
.ssp-rank-head em { flex-basis: 100%; font-style: normal; color: #a5f3fc; font-size: 0.9rem; }
.ssp-rank-table {
    display: grid;
    grid-template-columns: minmax(7.5rem, 1.45fr) repeat(7, minmax(0, 0.7fr));
    gap: 0.45rem 0.35rem;
    align-items: center;
}
.ssp-rank-table .hd { color: #67e8f9; font-size: 0.78rem; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; text-align: center; }
.ssp-rank-table .hd.kw { text-align: left; }
.ssp-rank-table .name {
    color: #fff; font-size: 0.92rem; font-weight: 700; line-height: 1.25;
    text-transform: capitalize;
}
.ssp-rank-cell {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 46px; border-radius: 0; font-size: 1rem; font-weight: 750; color: #e2e8f0;
    background: none; box-shadow: inset 0 -1px 0 rgba(34, 211, 238, 0.28); opacity: 0;
}
.ssp-rank-cell small { font-size: 0.72rem; line-height: 1.1; font-weight: 750; color: #67e8f9; }
.ssp-rank-cell.up { color: #ecfeff; background: none; }
.ssp-rank-hooks { position: relative; height: 2.4rem; margin-top: 1rem; }
.ssp-rank-hook {
    position: absolute; left: 0; right: 0; top: 0; margin: 0;
    text-align: center; color: #e0f2fe; font-size: 1rem; line-height: 1.35; opacity: 0;
}
.ssp-rank-hook.h1 { animation: sspHook1 16s linear infinite; }
.ssp-rank-hook.h2 { animation: sspHook2 16s linear infinite; }
.ssp-rank-hook.h3 { animation: sspHook3 16s linear infinite; }
.ssp-rank-hook.h4 { animation: sspHook4 16s linear infinite; }
@keyframes sspHook1 { 0%, 20% { opacity: 1; } 24%, 96% { opacity: 0; } 100% { opacity: 1; } }
@keyframes sspHook2 { 0%, 20% { opacity: 0; } 24%, 44% { opacity: 1; } 48%, 100% { opacity: 0; } }
@keyframes sspHook3 { 0%, 44% { opacity: 0; } 48%, 68% { opacity: 1; } 72%, 100% { opacity: 0; } }
@keyframes sspHook4 { 0%, 68% { opacity: 0; } 72%, 94% { opacity: 1; } 98%, 100% { opacity: 0; } }
.ssp-rank-table .m1 { animation: sspRk1 16s linear infinite; }
.ssp-rank-table .m2 { animation: sspRk2 16s linear infinite; }
.ssp-rank-table .m3 { animation: sspRk3 16s linear infinite; }
.ssp-rank-table .m4 { animation: sspRk4 16s linear infinite; }
.ssp-rank-table .m5 { animation: sspRk5 16s linear infinite; }
.ssp-rank-table .m6 { animation: sspRk6 16s linear infinite; }
.ssp-rank-table .m7 { animation: sspRk7 16s linear infinite; }
@keyframes sspRk1 { 0%, 4% { opacity: 0; } 8%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sspRk2 { 0%, 14% { opacity: 0; } 18%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sspRk3 { 0%, 26% { opacity: 0; } 30%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sspRk4 { 0%, 38% { opacity: 0; } 42%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sspRk5 { 0%, 50% { opacity: 0; } 54%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sspRk6 { 0%, 62% { opacity: 0; } 66%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sspRk7 { 0%, 74% { opacity: 0; } 78%, 94% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 640px) {
    .ssp-rank-head strong { font-size: 1.05rem; }
    .ssp-rank-table { grid-template-columns: minmax(4.5rem, 1.1fr) repeat(7, minmax(0, 0.55fr)); gap: 0.3rem 0.15rem; }
    .ssp-rank-table .name, .ssp-rank-table .hd { font-size: 0.62rem; }
    .ssp-rank-cell { min-height: 34px; font-size: 0.68rem; }
    .ssp-rank-hook { font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
    .ssp-niche-stage *,
    .ssp-niche-pill-icon,
    .ssp-niche-mark,
    .ssp-niche-orbit,
    .ssp-niche-rays,
    .ssp-niche-sweep,
    .ssp-niche-codeframe span,
    .ssp-niche-bars span,
    .ssp-niche-streaks span,
    .ssp-niche-scales .beam,
    .ssp-niche-scales .pan,
    .ssp-niche-book i,
    .ssp-niche-ecg polyline,
    .ssp-rank-cell,
    .ssp-rank-table .hd,
    .ssp-rank-hook {
        animation: none !important;
        opacity: 1 !important;
    }
    .ssp-rank-hook { opacity: 0 !important; }
    .ssp-rank-hook.h1 { opacity: 1 !important; }
}
