:root {
    --kk-blue: #2b2588;
    --kk-blue-strong: #1559c5;
    --kk-green: #00963a;
    --kk-green-strong: #008f36;
    --kk-text: #263142;
    --kk-muted: #657184;
    --kk-page: #f7f9fc;
    --kk-white: #ffffff;
    --stage-shadow: 0 26px 95px rgba(22, 39, 65, 0.14);
    --focus-ring: 0 0 0 4px rgba(0, 150, 58, 0.18), 0 0 0 8px rgba(21, 89, 197, 0.16);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--kk-page);
}

body {
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
    color: var(--kk-text);
    font-family: Tahoma, Verdana, Arial, sans-serif;
    background:
        radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.96), transparent 18%),
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.95), transparent 20%),
        linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
}

body::before,
body::after {
    position: fixed;
    inset: 0;
    z-index: -2;
    content: "";
    pointer-events: none;
}

body::before {
    background:
        linear-gradient(145deg, rgba(255,255,255,0.92), rgba(247,249,252,0.85)),
        radial-gradient(circle at 26% 48%, rgba(0, 150, 58, 0.12), transparent 24%),
        radial-gradient(circle at 72% 48%, rgba(21, 89, 197, 0.10), transparent 26%);
}

body::after {
    opacity: 0.48;
    background-image:
        linear-gradient(28deg, transparent 0 24%, rgba(255,255,255,0.75) 24.1% 24.4%, transparent 24.5% 100%),
        radial-gradient(circle at 8% 24%, rgba(255,255,255,0.9) 0 6px, transparent 7px),
        radial-gradient(circle at 94% 28%, rgba(255,255,255,0.9) 0 8px, transparent 9px),
        radial-gradient(circle at 86% 64%, rgba(255,255,255,0.8) 0 7px, transparent 8px),
        radial-gradient(circle at 13% 69%, rgba(255,255,255,0.7) 0 6px, transparent 7px);
}

a {
    color: inherit;
}

img,
svg {
    display: block;
    max-width: 100%;
}

.portal-page {
    display: grid;
    min-height: 100dvh;
    padding: clamp(16px, 2.2vw, 34px);
    place-items: center;
}

.portal-stage {
    width: min(1500px, 100%);
    min-height: min(930px, calc(100dvh - clamp(32px, 4.4vw, 68px)));
    display: grid;
    grid-template-rows: auto minmax(300px, 1fr) auto auto;
    gap: clamp(16px, 2vw, 28px);
    align-content: center;
    position: relative;
    overflow: hidden;
    padding: clamp(24px, 3.6vw, 52px) clamp(18px, 4.8vw, 72px) clamp(18px, 2.3vw, 32px);
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: clamp(28px, 3vw, 48px);
    background:
        linear-gradient(145deg, rgba(255,255,255,0.89), rgba(255,255,255,0.72)),
        radial-gradient(circle at 50% 35%, rgba(255,255,255,0.92), rgba(255,255,255,0.16));
    box-shadow: var(--stage-shadow);
    isolation: isolate;
}

.portal-stage::before,
.portal-stage::after {
    position: absolute;
    z-index: -1;
    content: "";
    border-radius: 999px;
    filter: blur(48px);
    opacity: 0.5;
}

.portal-stage::before {
    width: 430px;
    height: 430px;
    left: 15%;
    top: 36%;
    background: rgba(0, 150, 58, 0.10);
}

.portal-stage::after {
    width: 500px;
    height: 500px;
    right: 10%;
    top: 30%;
    background: rgba(21, 89, 197, 0.10);
}

.portal-header {
    text-align: center;
}

.portal-logo {
    width: clamp(300px, 32vw, 540px);
    height: auto;
    margin: 0 auto clamp(12px, 1.6vw, 22px);
    object-fit: contain;
}

.portal-header h1 {
    margin: 0;
    font-size: clamp(2.6rem, 5.2vw, 5.6rem);
    line-height: 0.96;
    color: var(--kk-blue);
    letter-spacing: 0.01em;
    text-wrap: balance;
}

.portal-header h1 span {
    color: var(--kk-green);
}

.portal-header p {
    max-width: 860px;
    margin: clamp(10px, 1.3vw, 17px) auto 0;
    color: var(--kk-muted);
    font-size: clamp(1rem, 1.24vw, 1.28rem);
    line-height: 1.55;
}

.portal-visual {
    display: grid;
    align-items: center;
    width: 100%;
    min-height: 330px;
}

.connection-map {
    width: min(1220px, 100%);
    height: auto;
    margin: 0 auto;
    overflow: visible;
}

.dot-field {
    opacity: 0.85;
    mask-image: radial-gradient(circle at center, #000 0 28%, transparent 72%);
}

.map-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.base-line {
    stroke-width: 2.1;
    opacity: 0.72;
    vector-effect: non-scaling-stroke;
}

.line-layer-green .base-line {
    stroke: rgba(0, 150, 58, 0.65);
}

.line-layer-blue .base-line {
    stroke: rgba(21, 89, 197, 0.68);
}

.flow-line {
    stroke-width: 4.8;
    opacity: 0.88;
    stroke-dasharray: 62 265;
    vector-effect: non-scaling-stroke;
    animation: line-flow 2.9s linear infinite;
    filter: drop-shadow(0 0 8px currentColor);
}

.flow-green {
    color: rgba(26, 226, 88, 0.65);
    stroke: currentColor;
}

.flow-blue {
    color: rgba(75, 169, 255, 0.70);
    stroke: currentColor;
    animation-direction: reverse;
}

.delay-1 { animation-delay: -0.5s; }
.delay-2 { animation-delay: -1.05s; }
.delay-3 { animation-delay: -1.65s; }
.delay-4 { animation-delay: -2.15s; }

@keyframes line-flow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -327; }
}

.icon-card rect:first-child {
    fill: rgba(255, 255, 255, 0.88);
    stroke: rgba(0, 150, 58, 0.24);
}

.icon-card path,
.icon-card rect:not(:first-child),
.icon-card circle {
    fill: none;
    stroke: var(--kk-green);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-card rect:not(:first-child),
.icon-card circle {
    fill: var(--kk-green);
    stroke: none;
}

.service-card rect:first-child {
    stroke: rgba(21, 89, 197, 0.24);
}

.service-card path,
.service-card rect:not(:first-child),
.service-card circle {
    stroke: var(--kk-blue-strong);
}

.service-card rect:not(:first-child),
.service-card circle {
    fill: var(--kk-blue-strong);
    stroke: none;
}

.hub {
    filter: drop-shadow(0 22px 45px rgba(17, 46, 74, 0.15));
}

.hub-halo {
    fill: none;
    stroke: url(#hub-ring);
    opacity: 0.18;
    transform-origin: center;
    animation: hub-pulse 3.6s ease-in-out infinite;
}

.hub-halo-inner {
    stroke-width: 16;
}

.hub-halo-outer {
    stroke-width: 7;
    animation-delay: -1.6s;
}

.hub-core {
    fill: url(#hub-fill);
}

.hub-ring {
    fill: none;
    stroke: url(#hub-ring);
    stroke-width: 8;
}

.hub-dot {
    fill: #ffffff;
    filter: drop-shadow(0 0 9px rgba(255, 255, 255, 0.9));
    animation: hub-dot-pulse 2.6s ease-in-out infinite;
}

.dot-2,
.dot-5 { animation-delay: -0.8s; }
.dot-3 { animation-delay: -1.5s; }
.dot-4 { animation-delay: -2.1s; }

.hub-title,
.hub-subtitle {
    font-family: Tahoma, Verdana, Arial, sans-serif;
    font-weight: 700;
}

.hub-title {
    fill: var(--kk-green);
    font-size: 38px;
}

.hub-subtitle {
    fill: var(--kk-text);
    font-size: 30px;
    font-weight: 600;
}

@keyframes hub-pulse {
    0%, 100% { transform: scale(0.98); opacity: 0.14; }
    50% { transform: scale(1.08); opacity: 0.35; }
}

@keyframes hub-dot-pulse {
    0%, 100% { opacity: 0.5; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.15); }
}

.particles circle {
    opacity: 0.95;
    transform-box: fill-box;
    transform-origin: center;
}

.portal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(18px, 2.4vw, 34px);
    width: min(1220px, 100%);
    margin: 0 auto;
}

.portal-action {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: clamp(18px, 2vw, 28px);
    row-gap: 18px;
    min-height: 206px;
    position: relative;
    overflow: hidden;
    padding: clamp(20px, 2.3vw, 30px);
    text-decoration: none;
    border: 1px solid rgba(38, 54, 90, 0.13);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 18px 48px rgba(24, 45, 74, 0.10);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.portal-action:hover,
.portal-action:focus-visible {
    transform: translateY(-5px);
    box-shadow: 0 26px 70px rgba(24, 45, 74, 0.16);
}

.portal-action:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring), 0 26px 70px rgba(24, 45, 74, 0.16);
}

.portal-action::after {
    position: absolute;
    inset: -80% auto auto -30%;
    width: 70%;
    height: 220%;
    content: "";
    opacity: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.52), transparent);
    transform: rotate(18deg) translateX(-140%);
    transition: opacity 180ms ease;
}

.portal-action:hover::after,
.portal-action:focus-visible::after {
    opacity: 1;
    animation: button-shine 1.15s ease-out;
}

@keyframes button-shine {
    from { transform: rotate(18deg) translateX(-150%); }
    to { transform: rotate(18deg) translateX(330%); }
}

.action-icon {
    display: grid;
    width: clamp(76px, 7vw, 108px);
    aspect-ratio: 1;
    align-self: start;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    place-items: center;
}

.action-icon svg {
    width: 72%;
    height: 72%;
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action-copy {
    display: grid;
    align-content: center;
    gap: 10px;
    min-width: 0;
}

.action-copy strong {
    font-size: clamp(1.68rem, 2.05vw, 2.55rem);
    line-height: 1.05;
}

.action-copy small {
    max-width: 480px;
    color: var(--kk-muted);
    font-size: clamp(1rem, 1.16vw, 1.18rem);
    line-height: 1.5;
}

.action-cta {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 58px;
    color: #ffffff;
    font-weight: 700;
    font-size: clamp(1rem, 1.2vw, 1.22rem);
    border-radius: 14px;
}

.action-cta svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.3;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 160ms ease;
}

.portal-action:hover .action-cta svg,
.portal-action:focus-visible .action-cta svg {
    transform: translateX(6px);
}

.device-action {
    border-color: rgba(0, 150, 58, 0.24);
    background: linear-gradient(145deg, rgba(255,255,255,0.88), rgba(235,249,240,0.76));
}

.device-action .action-icon {
    border: 1px solid rgba(0, 150, 58, 0.24);
}

.device-action .action-icon svg,
.device-action .action-copy strong {
    color: var(--kk-green);
    stroke: var(--kk-green);
}

.device-action .action-cta {
    background: linear-gradient(135deg, var(--kk-green-strong), #00ae49);
    box-shadow: 0 14px 28px rgba(0, 150, 58, 0.22);
}

.service-action {
    border-color: rgba(21, 89, 197, 0.24);
    background: linear-gradient(145deg, rgba(255,255,255,0.88), rgba(235,242,255,0.78));
}

.service-action .action-icon {
    border: 1px solid rgba(21, 89, 197, 0.24);
}

.service-action .action-icon svg,
.service-action .action-copy strong {
    color: var(--kk-blue-strong);
    stroke: var(--kk-blue-strong);
}

.service-action .action-cta {
    background: linear-gradient(135deg, var(--kk-blue-strong), #0f68d8);
    box-shadow: 0 14px 28px rgba(21, 89, 197, 0.24);
}

.portal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #7a8495;
    font-size: 0.95rem;
}

.portal-footer a {
    text-decoration: none;
}

.portal-footer a:hover,
.portal-footer a:focus-visible {
    color: var(--kk-blue-strong);
    outline: none;
    text-decoration: underline;
    text-underline-offset: 4px;
}

@media (max-width: 1050px) {
    .portal-stage {
        grid-template-rows: auto auto auto auto;
    }

    .portal-actions {
        grid-template-columns: 1fr;
    }

    .connection-map {
        width: min(980px, 100%);
    }
}

@media (max-width: 720px) {
    .portal-page {
        padding: 10px;
        place-items: stretch;
    }

    .portal-stage {
        min-height: calc(100dvh - 20px);
        padding: 24px 16px 18px;
        gap: 18px;
        border-radius: 28px;
    }

    .portal-logo {
        width: min(320px, 90vw);
    }

    .portal-header h1 {
        font-size: clamp(2.25rem, 12vw, 3.75rem);
    }

    .portal-header p {
        font-size: 0.96rem;
    }

    .portal-visual {
        min-height: 260px;
        overflow: hidden;
    }

    .connection-map {
        width: 820px;
        max-width: none;
        margin-left: 50%;
        transform: translateX(-50%);
    }

    .portal-action {
        min-height: 178px;
        padding: 18px;
        border-radius: 22px;
    }

    .action-icon {
        width: 68px;
    }

    .action-copy strong {
        font-size: 1.55rem;
    }

    .action-copy small {
        font-size: 0.94rem;
    }
}

@media (max-height: 820px) and (min-width: 1051px) {
    .portal-stage {
        min-height: auto;
        gap: 16px;
        padding-block: 26px 20px;
    }

    .portal-logo {
        width: 410px;
        margin-bottom: 10px;
    }

    .portal-header h1 {
        font-size: clamp(2.6rem, 4.1vw, 4.2rem);
    }

    .portal-visual {
        min-height: 280px;
    }

    .connection-map {
        width: min(980px, 100%);
    }

    .portal-action {
        min-height: 178px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
