/* =====================================================================================================
   Research & innovation: title, subtitle and the wireframe sphere with four programme balls orbiting it.
   The orbit animation lives in js/sections/research.js; this file lays the balls out statically where the
   design puts them (used without JS, with reduced motion, and as the first frame before the JS starts).
   ===================================================================================================== */

.section--research {
    /* Sphere diameter: 440px at the 1440 design, 56vw on small screens (all orbits must fit at 360px). */
    --research-sphere: clamp(12.5rem, 56vw, 27.5rem);
    /* Ball diameter: 0.3 × sphere as in the design (132px at 1440), never below 72px so the text stays legible. */
    --research-ball: max(4.5rem, var(--research-sphere) * 0.3);

    /* No bottom padding: the orbit box already leaves room below the sphere, and the gap to Use cases is half of
       what a full section space would give (user feedback). */
    padding-block: var(--section-space) 0;
    overflow-x: clip;               /* safety net: orbits are sized to fit, but never cause horizontal scroll */
}

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

/* The title is height-driven (.section-title); on very narrow screens max-width: 100% caps its width, so keep
   the aspect ratio instead of squashing it (the title is ~24:1). */
.research__title img { object-fit: contain; }

.research__subtitle {
    margin-top: clamp(0.5rem, 0.3rem + 0.6vw, 1rem);
    font-size: clamp(1.125rem, 0.8rem + 1.4vw, 1.8125rem);   /* 18 → 29px */
    font-weight: 400;
    line-height: 1.3;
    color: var(--text);
}

/* Room around the sphere for the parts of the orbits (and the balls) that stick out of it. */
.research__orbit {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: clamp(0.75rem, 0.25rem + 1.6vw, 2rem);   /* small gap under the subtitle; the padding below leaves room for the orbits */
    padding-block: calc(var(--research-ball) * 0.5);
}

/* Square box the size of the sphere; balls are positioned from its centre. Own stacking context so the
   ball/sphere z-indexes never interact with the rest of the page. */
.research__stage {
    position: relative;
    width: var(--research-sphere);
    aspect-ratio: 1;
    isolation: isolate;
}

.research__sphere {
    position: relative;
    z-index: 50;                    /* balls go above (in front) or below (behind); see research.js */
    width: 100%;
    height: 100%;
    pointer-events: none;
    user-select: none;
}

.research__balls {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Each ball sits on the stage centre and is moved with a transform. --x / --y: design position of the ball
   centre, in sphere radii from the sphere centre (x right, y down). */
.research__ball {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 60;
    width: var(--research-ball);
    height: var(--research-ball);
    margin: calc(var(--research-ball) / -2) 0 0 calc(var(--research-ball) / -2);
    border-radius: 50%;
    transform: translate(calc(var(--x) * var(--research-sphere) / 2), calc(var(--y) * var(--research-sphere) / 2));
    will-change: transform;
}

.research__ball:focus-visible { outline-offset: 4px; }

.research__ball--horizon-europe        { --x: -0.71; --y: -0.53; }
.research__ball--academic-partnerships { --x:  0.54; --y: -0.76; }
.research__ball--technology-transfer   { --x:  0.80; --y:  0.42; }
.research__ball--chips-ju              { --x: -0.60; --y:  0.64; }

.research__ball .baked__img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    user-select: none;
    -webkit-user-drag: none;
}

/* Text layer for the future text-free balls: white Poppins centred in the circle (~19px at 1440). */
.research__ball-text {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6%;
    border-radius: 50%;
    font-size: calc(var(--research-ball) * 0.14);
    font-weight: 400;
    line-height: 1.15;
    text-align: center;
    color: var(--white);
}
