/* ══════════════════════════════════════════════════
   DESIGN TOKENS
══════════════════════════════════════════════════ */
:root {
    --clr-primary:      rgb(0, 157, 224);
    --clr-primary-80:   hsla(198, 100%, 44%, 0.8);
    --clr-primary-60:   hsla(198, 100%, 44%, 0.6);
    --clr-secondary:    rgb(252, 78, 3);
    --clr-secondary-80: hsla(18, 98%, 50%, 0.8);
    --clr-secondary-60: hsla(18, 98%, 50%, 0.6);
    --clr-third:        rgb(38, 66, 80);
    --clr-third-80:     hsla(200, 36%, 23%, 0.8);
    --clr-third-60:     hsla(200, 36%, 23%, 0.6);
    --clr-fourth:       hsl(186, 72%, 54%);
    --clr-fourth-80:    hsla(186, 72%, 54%, 0.8);
    --clr-fourth-60:    hsla(186, 72%, 54%, 0.6);
    --clr-white:        #ffffff;
    --clr-heading-black:#212529;

    --fs-900: clamp(2rem,   15vw, 5rem);
    --fs-800: clamp(1.8rem, 13vw, 3rem);
    --fs-700: clamp(1.6rem, 11vw, 2rem);
    --fs-600: clamp(1.4rem,  9vw, 1.8rem);
    --fs-500: clamp(1.2rem,  6vw, 1.4rem);
    --fs-400: clamp(0.9rem,  2vw, 1rem);
    --fs-300: clamp(0.7rem, 1.5vw, 0.8rem);
    --fs-200: clamp(0.6rem,  1vw, 0.7rem);

    --fw-300: 300;
    --fw-400: 400;
    --fw-500: 500;
    --fw-600: 600;
    --fw-700: 700;

    --ff-body:    "Open Sans", serif;
    --ff-heading: "Roboto Condensed", sans-serif;
}

/* ══════════════════════════════════════════════════
   HERO SHELL
══════════════════════════════════════════════════ */
.hero {
    position: relative;
    min-height: 40vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--clr-third);
}

/* ══════════════════════════════════════════════════
   BACKGROUND LAYERS
══════════════════════════════════════════════════ */
.bg-base {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(
        135deg,
        hsl(200, 36%, 10%) 0%,
        hsl(200, 36%, 16%) 40%,
        hsl(198, 55%, 14%) 100%
    );
}

.bg-photo {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image: url('https://bioscience.fi/wp-content/themes/helium-child/custom/images/headers/tcb_header.png');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: auto 100%;
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        transparent 30%,
        rgba(0, 0, 0, 0.25) 42%,
        rgba(0, 0, 0, 0.65) 55%,
        rgba(0, 0, 0, 0.88) 70%,
        black 85%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        transparent 30%,
        rgba(0, 0, 0, 0.25) 42%,
        rgba(0, 0, 0, 0.65) 55%,
        rgba(0, 0, 0, 0.88) 70%,
        black 85%
    );
    -webkit-mask-composite: source-in;
}

.bg-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(8, 21, 32, 0.55) 80%,
        rgba(8, 21, 32, 0.9) 100%
    );
}

.bg-tint {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        radial-gradient(ellipse 55% 80% at 85% 50%,  hsla(198, 100%, 44%, 0.12) 0%, transparent 65%),
        radial-gradient(ellipse 40% 60% at 100% 100%, hsla(18,  98%,  50%, 0.07) 0%, transparent 60%);
}

.bg-glow {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        radial-gradient(ellipse 55% 70% at 0%  50%, hsla(200, 36%, 10%, 0.95) 0%, transparent 70%),
        radial-gradient(ellipse 45% 45% at 10% 75%, hsla(186, 72%, 54%, 0.08) 0%, transparent 60%);
}

.bg-hex {
    position: absolute;
    inset: 0;
    z-index: 3;
    opacity: 0.03;
}

.bg-hex svg {
    width: 100%;
    height: 100%;
}

.bg-scanlines {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0, 0, 0, 0.04) 3px,
        rgba(0, 0, 0, 0.04) 4px
    );
}

/* ══════════════════════════════════════════════════
   FLOATING ORBS
══════════════════════════════════════════════════ */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 3;
}

.orb-1 {
    width: 500px;
    height: 500px;
    top: -15%;
    right: 5%;
    background: radial-gradient(circle, hsla(198, 100%, 44%, 0.14), transparent 70%);
    animation: drift 24s ease-in-out infinite alternate;
}

.orb-2 {
    width: 300px;
    height: 300px;
    bottom: 0;
    left: 5%;
    background: radial-gradient(circle, hsla(186, 72%, 54%, 0.10), transparent 70%);
    animation: drift 30s ease-in-out infinite alternate-reverse;
}

/* ══════════════════════════════════════════════════
   HERO BODY GRID
══════════════════════════════════════════════════ */
.hero-body {
    position: relative;
    z-index: 10;
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
    padding: clamp(50px, 8vh, 90px) clamp(20px, 5vw, 72px);
    align-items: center;
}

/* ══════════════════════════════════════════════════
   HERO LEFT — TEXT
══════════════════════════════════════════════════ */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--ff-body);
    font-size: var(--fs-300);
    font-weight: var(--fw-600);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--clr-fourth);
    margin-bottom: 1.4rem;
    opacity: 0;
    animation: fadeUp 0.7s ease 0.3s forwards;
}

.eyebrow-line {
    display: block;
    width: 30px;
    height: 1.5px;
    background: var(--clr-fourth);
}

h1.hero-title {
    font-family: var(--ff-heading);
    font-weight: var(--fw-300);
    font-size: clamp(3rem, 6vw, 5.5rem);
    line-height: 1.0;
    color: var(--clr-white);
    letter-spacing: -0.01em;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 0.8s ease 0.45s forwards;
}

h1.hero-title .strong { font-weight: var(--fw-700); }

h1.hero-title .highlight {
    color: var(--clr-primary);
    position: relative;
    display: inline-block;
}

h1.hero-title .highlight::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--clr-primary), var(--clr-fourth));
    transform: scaleX(0);
    transform-origin: left;
    animation: lineIn 0.6s ease 1.3s forwards;
}

.title-rule {
    width: 64px;
    height: 3px;
    background: linear-gradient(90deg, var(--clr-secondary), var(--clr-primary));
    margin: 1.6rem 0;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.7s forwards;
}

.hero-desc {
    font-family: var(--ff-body);
    font-size: var(--fs-400);
    font-weight: var(--fw-300);
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.68);
    max-width: 500px;
    margin-bottom: 1.6rem;
    opacity: 0;
    animation: fadeUp 0.8s ease 0.85s forwards;
}

.hero-tagline {
    font-family: var(--ff-heading);
    font-size: var(--fs-600);
    font-weight: var(--fw-300);
    color: var(--clr-secondary);
    letter-spacing: 0.04em;
    margin-bottom: 2.6rem;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 0.7s ease 1.0s forwards;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    opacity: 0;
    animation: fadeUp 0.7s ease 1.15s forwards;
}

.btn-primary-custom {
    font-family: var(--ff-heading);
    font-size: var(--fs-300);
    font-weight: var(--fw-600);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 14px 32px;
    background: var(--clr-secondary);
    color: var(--clr-white);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    display: inline-block;
    transition: transform 0.22s, box-shadow 0.3s;
}

.btn-primary-custom::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px hsla(18, 98%, 50%, 0.4);
}

.btn-primary-custom:hover::before { opacity: 1; }

.btn-hero-ghost {
    font-family: var(--ff-heading);
    font-size: var(--fs-300);
    font-weight: var(--fw-600);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 12px 30px;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    display: inline-block;
    transition: border-color 0.25s, color 0.25s, transform 0.22s;
}

.btn-hero-ghost:hover {
    border-color: var(--clr-primary);
    color: var(--clr-primary);
    transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════
   HERO RIGHT — GLASSMORPHISM KPI TILES
   Scoped to .stats-cluster to avoid conflict
══════════════════════════════════════════════════ */
.hero-right {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    padding-left: 3rem;
    padding-bottom: 1rem;
    opacity: 0;
    animation: fadeIn 1.2s ease 1.0s forwards;
}

.stats-cluster {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: min(380px, 100%);
}

.stats-cluster .stat-card {
    background: hsla(200, 36%, 12%, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 16px 20px;
    position: relative;
    overflow: hidden;
    animation: floatY ease-in-out infinite alternate;
    height: 100%;
    border-radius: 5px;
}
.stat-card {
    background: hsla(200, 36%, 12%, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 16px 20px;
    position: relative;
    overflow: hidden;
    animation: floatY ease-in-out infinite alternate;
        height: 100%;
        border-radius: 5px;

}

.stats-cluster .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.stats-cluster .stat-card-1::before { background: var(--clr-primary); }
.stats-cluster .stat-card-2::before { background: var(--clr-fourth); }
.stats-cluster .stat-card-3::before { background: var(--clr-secondary); }
.stats-cluster .stat-card-4::before { background: var(--clr-primary); }

.stats-cluster .stat-card-1 { animation-duration: 6s; }
.stats-cluster .stat-card-2 { animation-duration: 7.5s; animation-delay: 0.8s; }
.stats-cluster .stat-card-3 { animation-duration: 5.5s; animation-delay: 1.6s; }
.stats-cluster .stat-card-4 { animation-duration: 8s;   animation-delay: 2.4s; }

.stats-cluster .stat-num {
    font-family: var(--ff-heading);
    font-size: 2rem;
    font-weight: var(--fw-700);
    line-height: 1;
    margin-bottom: 4px;
}

.stats-cluster .stat-card-1 .stat-num { color: var(--clr-primary); }
.stats-cluster .stat-card-2 .stat-num { color: var(--clr-fourth); }
.stats-cluster .stat-card-3 .stat-num { color: var(--clr-secondary); }
.stats-cluster .stat-card-4 .stat-num { color: var(--clr-primary); }

.stats-cluster .stat-lbl {
    font-family: var(--ff-body);
    font-size: var(--fs-200);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.3;
}

/* ══════════════════════════════════════════════════
   STAT HERO SECTION — HIGHLIGHTS
   Scoped to .stat-hero to avoid conflict
══════════════════════════════════════════════════ */
.stat-hero {
    position: relative;
    overflow: hidden;
    min-height: 460px;
    display: flex;
    align-items: center;
}

.stat-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: url('https://bioscience.fi/wp-content/uploads/2025/03/Biocity-Turku-Bioscience-scaled.jpg')
        center / cover no-repeat;
    background-attachment: fixed;
    transform: scale(1.03);
    transition: transform 8s ease;
}

.stat-hero:hover .stat-hero__bg {
    transform: scale(1.07);
}

.stat-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        135deg,
        rgba(0, 15, 60, 0.84) 0%,
        rgba(0, 55, 115, 0.70) 100%
    );
}

.stat-hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
}

/* Highlight stat cards — scoped */
.stat-hero .stat-card {
    display: block;
    padding: 2.5rem 2rem;
    text-decoration: none;
    transition: transform 0.3s ease;
    height: 100%;
}

.stat-hero .stat-card:hover {
    transform: translateY(-8px);
}

.stat-hero .stat-card i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.80);
}

.stat-hero .stat-card__number {
    color: var(--clr-white);
    font-size: 3rem;
    font-weight: var(--fw-700);
    letter-spacing: -1px;
    line-height: 1;
    margin: 1rem 0 0;
    font-family: var(--ff-heading);
}

.stat-hero .stat-card__number::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 2px;
    margin: 0.6rem auto 0;
}

.stat-hero .stat-card__label {
    color: var(--clr-white);
    font-size: 1.05rem;
    font-weight: var(--fw-600);
    margin: 0.75rem 0 0.4rem;
    letter-spacing: 0.3px;
    font-family: var(--ff-heading);
}

.stat-hero .stat-card__desc {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.875rem;
    line-height: 1.65;
    margin: 0 0.5rem;
}

/* Vertical dividers desktop */
.stat-col-mid {
    border-left:  1px solid rgba(255, 255, 255, 0.18);
    border-right: 1px solid rgba(255, 255, 255, 0.18);
}

/* ══════════════════════════════════════════════════
   BOTTOM BAR
══════════════════════════════════════════════════ */
.hero-bottom {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px clamp(20px, 5vw, 72px);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(10, 26, 34, 0.75);
    backdrop-filter: blur(10px);
    opacity: 0;
    animation: fadeIn 0.8s ease 1.5s forwards;
}

.meta-partners {
    display: flex;
    align-items: center;
    gap: 20px;
    font-family: var(--ff-body);
    font-size: var(--fs-200);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.38);
}

.meta-sep {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.15);
}

.meta-partners a {
    color: rgba(255, 255, 255, 0.38);
    text-decoration: none;
    transition: color 0.25s;
}

.meta-partners a:hover { color: var(--clr-fourth); }

.scroll-cue {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--ff-body);
    font-size: var(--fs-200);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.22);
}

.scroll-track {
    width: 36px;
    height: 1.5px;
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;
    position: relative;
}

.scroll-track::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--clr-primary);
    animation: trackSlide 2.4s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════
   KEYFRAMES — deduplicated
══════════════════════════════════════════════════ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes lineIn {
    to { transform: scaleX(1); }
}

@keyframes floatY {
    from { transform: translateY(0); }
    to   { transform: translateY(-8px); }
}

@keyframes drift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(30px, -25px) scale(1.06); }
}

@keyframes trackSlide {
    to { left: 100%; }
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════ */
@media (max-width: 860px) {
    .hero-body  { grid-template-columns: 1fr; }
    .hero-right { display: none; }
}

@media (max-width: 767.98px) {
    .stat-col-mid {
        border-left:   none;
        border-right:  none;
        border-top:    1px solid rgba(255, 255, 255, 0.18);
        border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    }
}