/* ================= HERO ================= */

.platform-hero {
    position: relative;
    padding: 170px 0 100px 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* layout */
.platform-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 80px;
}

/* text */
.platform-hero-content {
    flex: 1.3;
}

.platform-hero h1 {
    font-size: 61px;
    font-weight: 700;
    margin-bottom: 25px;
    line-height: 1.2;
    color: #000000;
}

.platform-hero p {
    font-size: 20px;
    line-height: 1.6;
    max-width: 640px;
}

.platform-hero .hero-lead {
    font-size: 20px;
    font-weight: 500;
}

.platform-hero .hero-buttons {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

/* image */
.platform-hero-image {
    flex: 1;
    text-align: right;
}

.platform-hero-image img {
    width: 90%;
    max-width: 680px;
    height: auto;
}


/* ======================================================
   PLATFORM ARCHITECTURE
====================================================== */

.platform-architecture {
    background: #eef6f3;
    padding: 50px 0;
}

/* Titles */

.architecture-section-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #128c6a;
}

.architecture-section-subtitle {
    color: #666;
    margin-bottom: 80px;
    font-size: 18px;
    text-align: center;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/* Layout */

.architecture-layout {
    display: grid;
    grid-template-columns: 720px 1fr;
    gap: 80px;
    align-items: center;
}

.architecture-section-footer {
    margin-top: 110px;
    font-size: 20px;
    font-weight: 600;
    color: #e57a2e;
}

/* ================= DIAGRAM ================= */

.diagram-wrapper {
    position: relative;
    width: 900px;
    height: 900px;
    margin: 0 auto;
    transform: translateX(80px);
}

.diagram-center {
    position: absolute;
    inset: 50%;
    width: 360px;
    aspect-ratio: 1;
    translate: -50% -50%;
    border-radius: 50%;
    border: 6px solid #f5f7f6;
    background: #ffffff;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 20px;
    z-index: 2;
    transition: all 0.3s ease;
    color: #000;
    font-size: 35px;
}

.center-content {
    text-align: center;
}

.center-title {
    font-size: 38px;
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
}

.diagram-center a {
    width: 100%;    
    height: 100%;    
    border-radius: 50%;    
    display: grid;    
    place-items: center;    
    color: inherit;    
    text-decoration: none;
}

.diagram-center p {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
    max-width: 260px;
    margin-top: 10px;
    color: #555;
}

/* Hover a aktivní stav */
.diagram-center:hover,
.diagram-center.active-module {
    scale: 1.08;
    background: #128c6a;
    color: white;
}

.diagram-circle {
    inset: 0;
    border: 8px solid #b7ded3;
    border-radius: 50%;
    position: absolute;
}

/* Rotate whole circle */
@keyframes rotateCircle {
    from { transform: rotate(0deg); } 
    to { transform: rotate(360deg); }
}

/* Items */
.diagram-items {
    position: absolute;
    inset: 0;
    --items: 5;
    --radius: 450px;
    animation: rotateCircle 160s linear infinite;
}

.diagram-item {
    position: absolute;
    width: 175px;
    height: 175px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    /*display: grid;
    place-items: center;
    text-align: center;
    font-size: 14px;
    font-weight: 600;*/
    color: #000;
    cursor: pointer;    
    transition: all 0.25s ease;

    left: 50%;
    top: 50%;

    --angle: calc(var(--i) * (360 / var(--items)));

    transform: 
        translate(-50%, -50%) 
        rotate(calc(var(--angle) * 1deg)) 
        translate(var(--radius), 0)
        rotate(calc(-1 * var(--angle) * 1deg));

    transform-origin: center center;
}

.diagram-item span {        
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 20px;
    font-weight: 550;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
    line-height: 1.2;

    /* Counter-rotace → text zůstane vždy horizontální*/
    transform:
        translate(-50%, -50%)
        rotate(calc(-1 * var(--angle) * 1deg));

    animation: counterRotate 160s linear infinite;
}

@keyframes counterRotate { 
    from { transform: rotate(0deg); } 
    to { transform: rotate(-360deg); } 
}

.diagram-item:hover {
    background: #128c6a;
    color: #fff;
    transform:        
        translate(-50%, -50%)         
        rotate(calc(var(--angle) * 1deg))         
        translate(var(--radius), 0)     
        rotate(calc(-1 * var(--angle) * 1deg))
        scale(1.12);
}

.diagram-item:hover span {
    color: inherit;                   /* zdědí bílou barvu */
}

.diagram-wrapper:hover .diagram-items {
    animation-play-state: paused;
}

.diagram-wrapper:hover .diagram-circle {
    animation-play-state: paused;
}

.diagram-items,
.diagram-item span {
    will-change: transform;
}

.diagram-wrapper:hover .diagram-item span {
    animation-play-state: paused;
}

.diagram-wrapper:hover .diagram-circle {
    border-color: #128c6a;
}

/* ================= MODULE CARDS ================= */

.architecture-modules-platform {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 580px;
    margin-left: auto;
}

.module-card-platform {
    position: relative;
    background: #ffffff;
    padding: 30px;
    border-radius: 20px;
    text-decoration: none;
    color: #000;
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.module-card-navcalc-one {
    position: relative;
    background: #f6fbf9;
    border: 2px solid #128c6a;
    padding: 30px;
    border-radius: 20px;
    text-decoration: none;
    color: #000;
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

/*.module-bug {
    position: absolute;
    width: 55px;
    height: 55px;
    background: #bfe6db;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
    transition: all 0.4s ease;
}

.module-bug img {
    width: 32px;
    transition: all 0.4s ease;
}

.bug-top-left    { top: -22px; left: 20px; }
.bug-top-right   { top: -22px; right: 20px; }
.bug-bottom-left { bottom: -22px; left: 20px; }
.bug-bottom-right{ bottom: -22px; right: 20px; }

.module-card:hover .bug-top-left {
    transform: translate(-10px, -10px) scale(1.15);
}

.module-card:hover .bug-top-right {
    transform: translate(10px, -10px) scale(1.15);
}

.module-card:hover .bug-bottom-left {
    transform: translate(-10px, 10px) scale(1.15);
}

.module-card:hover .bug-bottom-right {
    transform: translate(10px, 10px) scale(1.15);
}

.module-card:hover .module-bug {
    box-shadow: 0 20px 40px rgba(18,140,106,0.25);
}

.module-card:hover .module-bug img {
    transform: rotate(10deg) scale(1.1);
}*/

.module-card-platform h4 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
}

.module-card-platform p {
    font-size: 18px;
    color: #555;
}

.module-card-navcalc-one h4 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px; 
}

.module-card-navcalc-one p {
    font-size: 18px;
    color: #555;
}

/* Hover */

.module-card-platform:hover {
    transform: translateY(-8px);
}

/*.module-card-navcalc-one:hover {
    transform: translateY(-8px);
}*/

/* Highlight state */

.active-module {
    background: #128c6a !important;
    color: #fff !important;
    /*transform: scale(1.05);*/
}

.active-module h4,
.active-module p {
    color: #fff !important;
}

/* ================= EVOLUTION ================= */

.platform-evolution {
    padding: 80px 0;
    font-size: 22px;
    font-weight: 500;
}

/* ================= RESPONSIVE ================= */

@media screen and (min-width: 1800px) {

    .container {
        max-width: 1800px;
    }

    .platform-hero h1  {
        font-size: 68px;
        line-height: 1.05;
    }

    .platform-hero p {
        font-size: 25px;
    }

    .platform-hero .hero-lead {
        font-size: 25px;
    }

    .platform-hero-image {
        flex: 1.2;
        text-align: right;
    }

    .platform-hero-image img {
        width: 100%;
        max-width: 780px;
        height: auto;
    }

    /*.architecture-layout {
        grid-template-columns: 720px 1fr;
        gap: 80px;
        align-items: center;
    }*/

    .architecture-section-title {
        font-size: 52px;
    }

    .architecture-section-subtitle {
        font-size: 25px;
        margin-bottom: 100px;
    }

    .architecture-section-footer {
        font-size: 25px;
    }

    /* ================= DIAGRAM ================= */

    /*.diagram-wrapper {
        width: 720px;
        height: 720px;
    }*/

    .diagram-items {
        --radius: 450px;
    }

    /*.diagram-center {
        width: 340px;
        font-size: 42px;
    }

    .diagram-item {
        width: 150px;
        height: 150px;
    }

    .diagram-item span {
        font-size: 18px;
    }*/

    /* ================= MODULE CARDS ================= */

    /*.architecture-modules {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        max-width: 520px;
    }

    .module-card {
        padding: 30px;
        border-radius: 20px;
    }

    .module-card h4 {
        font-size: 22px;
    }

    .module-card p {
        font-size: 18px;
    }*/
}

@media screen and (min-width: 1221px) and (max-width: 1600px) {

    .architecture-layout{
        grid-template-columns: 620px 1fr;
        gap: 70px;
        align-items: center;
    }

    /* DIAGRAM */

    .diagram-wrapper{
        width: 600px;
        height: 600px;
        transform: translateX(1px);
    }

    .diagram-items{
        --radius: 280px;
    }

    .diagram-center{
        width: 260px;
        font-size: 26px;
    }

    .center-title{
        font-size: 26px;
    }

    .diagram-center p{
        font-size: 13px;
    }

    .diagram-item{
        width: 150px;
        height: 150px;
    }

    .diagram-item span{
        font-size: 18px;
    }

    /* MODULE CARDS */

    .architecture-modules-platform{
        max-width: 520px;
        gap: 26px;
    }

    .module-card-platform{
        padding: 26px;
    }

    .module-card-platform h4{
        font-size: 20px;
    }

    .module-card-platform p{
        font-size: 16px;
    }

}


@media screen and (max-width: 1220px) {

    /* ================= HERO ================= */

    .platform-hero-inner {
        gap: 60px;
    }

    .platform-hero h1 {
        font-size: 42px;
        line-height: 1.15;
    }

    .platform-hero-image {
        max-width: 500px;
    }

    /* ================= ARCHITECTURE ================= */

    .platform-architecture {
        padding: 90px 0;
    }

    /* STACK layout */
    .architecture-layout {
        grid-template-columns: 1fr;
        gap: 70px;
        justify-items: center;
    }

    .architecture-section-title {
        font-size: 34px;
    }

    .architecture-section-subtitle {
        margin-bottom: 60px;
        font-size: 16px;
    }

    /* ================= DIAGRAM ================= */

    .diagram-wrapper {
        width: 620px;
        height: 620px;
        transform: none;
        margin: 0 auto;
    }

    .diagram-items {
        --radius: 300px;
    }

    .diagram-center {
        width: 260px;
    }

    .center-title {
        font-size: 28px;
    }

    .diagram-center p {
        font-size: 14px;
        max-width: 220px;
    }

    .diagram-item {
        width: 130px;
        height: 130px;
    }

    .diagram-item span {
        font-size: 15px;
    }

    /* ================= MODULE CARDS ================= */

    .architecture-modules-platform {

        grid-template-columns: repeat(2, 1fr);

        gap: 28px;

        max-width: 720px;

        margin: 0 auto;
    }

    .module-card-platform,
    .module-card-navcalc-one {
        padding: 24px;
    }

    .module-card-platform h4,
    .module-card-navcalc-one h4 {
        font-size: 19px;
    }

    .module-card-platform p,
    .module-card-navcalc-one p {
        font-size: 15px;
        line-height: 1.55;
    }

}


@media screen and (max-width: 1030px) {

    .platform-hero-inner {
        flex-direction: column;
        text-align: center;
    }

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

    .platform-hero-image {
        text-align: center;
        margin-top: 40px;
    }

    .platform-hero-image img {
        width: 100%;
        max-width: 600px;
    }

    .platform-hero .hero-buttons {
        justify-content: center;
    }

    /* ================= ARCHITECTURE ================= */

    .architecture-layout {
        grid-template-columns: 1fr;
        gap: 70px;
    }

    .architecture-section-title {
        font-size: 32px;
    }

    .architecture-section-subtitle {
        font-size: 16px;
        margin-bottom: 60px;
    }

    /* ================= DIAGRAM ================= */

    .diagram-wrapper {
        width: 500px;
        height: 500px;
        margin: 0 auto 40px auto;
        transform: none; 
    }

    .diagram-center {
        position: absolute;
        inset: 50%;
        width: 300px;
        height: 300px;
        translate: -50% -50%;
        border-radius: 50%;
        border: 6px solid #f5f7f6;
    
        background: #ffffff;
    
        display: flex;
        align-items: center;
        justify-content: center;
    
        padding: 50px;
    
        box-shadow: 
            0 20px 50px rgba(0,0,0,0.08),
            0 5px 15px rgba(0,0,0,0.04);
    
        transition: all 0.3s ease;
        z-index: 2;
    }

    .center-title {
        font-size: 30px;
        font-weight: 700;
        line-height: 1.1;
        margin-bottom: 10px;
    }

    .diagram-center p {
        font-size: 14px;
        font-weight: 400;
        line-height: 1.5;
        max-width: 270px;
        margin: 0 auto;
        color: #555;
    }

    .center-content {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .diagram-items {
        --radius: 240px;
    }

    .diagram-item {
        width: 110px;
        height: 110px;
    }

    .diagram-item span {
        font-size: 13px;
    }

    /* ================= MODULE CARDS ================= */

    .architecture-modules-platform {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        max-width: 600px;
        margin: 0 auto;
    }

    .module-card-platform,
    .module-card-navcalc-one {
        padding: 20px;
    }

    .module-card-platform h4,
    .module-card-navcalc-one h4 {
        font-size: 20px;
    }

    .module-card-platform p,
    .module-card-navcalc-one p {
        font-size: 15px;
    }

    .module-bug {
        width: 60px;
        height: 60px;
    }

    .module-bug img {
        width: 40px;
    }

}

@media screen and (max-width: 768px) {

    .platform-hero {
        padding: 110px 0 70px 0;
        text-align: center;
    }

    .platform-hero h1 {
        font-size: 30px;
        line-height: 1.2;
        margin-bottom: 20px;
    }

    .platform-hero p {
        font-size: 15px;
        line-height: 1.6;
        margin-bottom: 18px;
        padding: 0 10px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 260px;
    }

    .platform-hero-image {
        margin-top: 5px;
        max-width: 95%;
        margin-left: auto;
        margin-right: auto;
    }

    .platform-architecture {
        padding: 60px 0;
    }

    .architecture-section-title {
        font-size: 34px;
    }

    .architecture-section-subtitle {
        font-size: 20px;
        margin-bottom: 40px;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }

    .architecture-layout {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    /* ================= DIAGRAM TRANSFORM ================= */

    .diagram-wrapper {
        width: 100%;
        height: auto;
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        margin-bottom: 30px;
        transform: none;
    }
    
    .diagram-circle,
    .diagram-items {
        display: none;
    }
    
    .diagram-item {
        display: none;
    }

    .diagram-center {
        position: relative;
        inset: auto;
        translate: none;
    
        width: auto !important; 
        height: auto !important;
        aspect-ratio: auto !important;

        display: flex;
        align-items: center;
        justify-content: center;
    
        padding: 14px 26px;
        border-radius: 40px;
    
        font-size: 16px;
        font-weight: 600;
    
        box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    }

    .center-content {
        text-align: center;
    }

    .center-title {
        font-size: 20px;
    }
    
    .diagram-center a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    .diagram-center p {
        font-size: 15px;
    }

    .diagram-center:active {
        transform: scale(0.96);
    }

    /* ================= MODULE CARDS ================= */

    .architecture-modules-platform {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .module-card-platform {
        padding: 18px 20px;
        border-radius: 18px;
    }

    .module-card-platform h4 {
        font-size: 20px;
    }

    .module-card-platform p {
        font-size: 15px;
    }

    .module-card-navcalc-one {
        padding: 18px 20px;
    }

    .module-card-navcalc-one h4 {
        font-size: 20px;
    }

    .module-card-navcalc-one p {
        font-size: 15px;
    }

    /* Brouček menší 
    .module-bug {
        width: 50px;
        height: 50px;
    }

    .module-bug img {
        width: 30px;
    }*/

}
