:root {
    --bg-dark: #000000;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --accent: #00f2ff;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --blur: 20px;
    --font-main: 'Inter', -apple-system, system-ui, sans-serif;
    --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    overflow-x: hidden;
    text-align: center;
    line-height: 1.25;
}

/* Preloader */
#preloader {
    position: fixed;
    inset: 0;
    background-color: var(--bg-dark);
    /* Explicit color for transition */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Transition background-color to transparent */
    transition: background-color 1.2s ease-in-out;
    pointer-events: none;
    /* Allow clicking through once transparent */
}

/* Helper to make background transparent */
#preloader.transparent-bg {
    background-color: transparent;
    z-index: 0;
    /* Move behind hero content (which should be higher) */
}

.dna-loader {
    width: 200px;
    height: 400px;
    position: relative;
    perspective: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;

    /* GLOBAL SPIN: Continuous rotation */
    animation: container-spin 3s linear infinite;
    transition: transform 1.5s cubic-bezier(0.2, 0, 0.2, 1), opacity 1.5s ease;
}

@keyframes container-spin {
    0% {
        transform: rotateY(0deg);
    }

    100% {
        transform: rotateY(360deg);
    }
}

.base-pair {
    position: absolute;
    width: 80px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    transform-style: preserve-3d;

    /* HELIX STATE (Default) */
    top: 50%;
    left: 50%;
    transform: translate3d(-50%, calc(var(--i) * 10px - 150px), 0) rotateY(calc(var(--i) * 20deg));

    /* Smooth transition for Shape Changes */
    /* Default (Return to Helix): Quicker, responsive to scroll start */
    transition: transform 0.6s cubic-bezier(0.2, 0, 0.4, 1), width 0.6s, background 0.6s;
}

/* When morphing TO circle (Rest state), take longer (Speed ramp out) */
.dna-loader.circle-morph .base-pair {
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1), width 1.2s, background 1.2s;
    width: 120px;
    background: rgba(255, 255, 255, 0.15);
    transform: translate3d(-50%, -50%, 0) rotateZ(calc(var(--i) * 12deg)) rotateY(0deg) translateX(120px);
}

.base-pair::before,
.base-pair::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 10px var(--accent);
    transition: all 1s var(--ease);
}

.base-pair::before {
    left: 0;
    background: #00f2ff;
}

.base-pair::after {
    right: 0;
    background: #5d2de0;
}

/* STATE 3: Hero Background Scale */
.dna-loader.hero-bg {
    /* Scale UP massively to become the environment */
    /* User requested ~250% scale up. Previous was 3.5. 3.5 * 2.5 ~= 8.75 */
    transform: scale(8.5) rotateX(15deg);
    opacity: 0.1;
    /* Slightly more subtle at this huge size */
    pointer-events: none;
}

/* Animated Background */
.bg-canvas {
    position: fixed;
    inset: 0;
    z-index: -2;
    /* Behind the loader-as-bg */
    opacity: 0.6;
    filter: blur(80px);
}

.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.03;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 10rem 0;
    z-index: 10;
    /* Ensure content is above the background loader */
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 1.25rem 1rem;
    z-index: 120;
    pointer-events: none;
}

.nav-center {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    min-height: 1.4rem;
}

.nav-logo {
    position: static;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    font-weight: 700;
    text-transform: uppercase;
    color: #ffffff;
    mix-blend-mode: difference;
    transition: opacity 0.35s var(--ease), transform 0.45s var(--ease), letter-spacing 0.45s var(--ease);
    white-space: nowrap;
    width: max-content;
    text-align: center;
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1.25rem;
    padding: 0;
    background: transparent;
    border: 0;
    backdrop-filter: none;
    opacity: 0;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scaleX(0.7);
    transform-origin: center;
    pointer-events: none;
    transition: opacity 0.35s var(--ease), transform 0.45s var(--ease);
    white-space: nowrap;
}

.nav-center:hover .nav-links,
.nav-links:hover {
    opacity: 1;
    transform: translate(-50%, -50%) scaleX(1);
    pointer-events: auto;
}

.nav-center:hover .nav-logo {
    opacity: 0;
    transform: scaleX(1.25);
    letter-spacing: 0.24em;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 600;
    transition: color 0.3s var(--ease);
    mix-blend-mode: difference;
    white-space: nowrap;
}


.nav-links a:hover {
    color: var(--text-main);
}

.nav-support {
    position: relative;
    animation: nav-heartbeat 3s ease-in-out infinite;
}

@keyframes nav-heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    12% {
        transform: scale(1.06);
    }

    24% {
        transform: scale(1);
    }

    36% {
        transform: scale(1.08);
    }

    48% {
        transform: scale(1);
    }
}

.footer-egg {
    margin-top: 0.8rem;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: none;
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), filter 0.6s var(--ease);
    will-change: opacity, transform, filter;
}

.footer-egg.is-fading {
    opacity: 0;
    transform: translateY(6px);
    filter: blur(2px);
}

/* Typography */
h1 {
    font-size: clamp(3.5rem, 8vw, 7rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 2rem;
    transition: filter 1s var(--ease), transform 1s var(--ease);
}

.solution-headline {
    max-width: 1200px;
    text-wrap: balance;
}

.lead.vision-text {
    max-width: 840px;
}

.tag {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    background: var(--glass);
    padding: 0.5rem 1.5rem;
    border-radius: 99px;
    border: 1px solid var(--glass-border);
    margin-bottom: 2rem;
    backdrop-filter: blur(var(--blur));
}

p.lead {
    font-size: 1.5rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 3rem;
    font-weight: 500;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    /* Improve readability over bg */
}

.team-lead {
    max-width: 900px;
    text-wrap: balance;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    width: 100%;
    margin: 2rem auto 0;
    align-items: stretch;
}

.team-grid .frosted-card {
    height: 100%;
}

@media (max-width: 680px) {
    .team-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        max-width: 520px;
        justify-items: center;
        justify-content: center;
    }
}

.nowrap {
    white-space: nowrap;
}

/* Pill row */
.pill-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin: 0 auto 3rem;
    overflow-x: visible;
    padding: 0 0.5rem;
}

@media (max-width: 720px) {
    .pill-row {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 0.6rem;
        column-gap: 0.6rem;
    }

    .pill {
        font-size: 0.95rem;
        padding: 0.4rem 0.8rem;
    }
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    letter-spacing: -0.01em;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(6px);
    white-space: nowrap;
}

.challenge-card {
    overflow: hidden;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    height: 135px;
    position: relative;
}

.challenge-card:hover,
.challenge-card:focus-within,
.challenge-card.is-open {
    height: auto;
}

.challenge-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    max-width: 1000px;
    margin-top: 1rem;
}

.challenge-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: stretch;
    width: 100%;
}

.challenge-row .challenge-card {
    width: 320px;
}

@media (max-width: 900px) {
    .challenge-row {
        flex-wrap: wrap;
    }

    .challenge-row .challenge-card {
        width: 300px;
    }
}

.challenge-card .card-more {
    margin-top: 0;
    max-height: 0;
    opacity: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text-muted);
    transition: max-height 0.4s var(--ease), opacity 0.4s var(--ease), margin-top 0.4s var(--ease);
}

.challenge-card:hover .card-more,
.challenge-card:focus-within .card-more {
    margin-top: 0.75rem;
    max-height: 260px;
    opacity: 1;
}

.challenge-card.is-open .card-more {
    margin-top: 0.75rem;
    max-height: 260px;
    opacity: 1;
}

.high-costs-card:hover .card-more,
.high-costs-card:focus-within .card-more,
.high-costs-card.is-open .card-more {
    max-height: 800px;
}

.card-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 50%;
    bottom: 1.1rem;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    animation: arrow-float 2.4s ease-in-out infinite;
    transition: opacity 0.25s var(--ease);
    pointer-events: none;
}

.challenge-card:hover .card-arrow,
.challenge-card:focus-within .card-arrow,
.challenge-card.is-open .card-arrow {
    opacity: 0;
}

@keyframes arrow-float {
    0%,
    100% {
        transform: translate(-50%, 0);
    }

    50% {
        transform: translate(-50%, 4px);
    }
}

/* Subtext under Taste it */


/* Components */
.frosted-card {
    background: var(--glass);
    backdrop-filter: blur(var(--blur));
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: 40px;
    width: 100%;
    margin-bottom: 2rem;
    transition: transform 0.6s var(--ease), border-color 0.6s;
}

.solution-row {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    max-width: 1400px;
    margin: 2rem auto 0;
}

.solution-row .frosted-card {
    flex: 1 1 280px;
    min-width: 260px;
    max-width: 320px;
    margin-bottom: 0;
}

.solution-row .frosted-card h2 {
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.solution-row .frosted-card p {
    color: var(--text-muted);
}

@media (max-width: 980px) {
    .solution-row {
        flex-wrap: wrap;
    }

    .solution-row .frosted-card {
        flex: 1 1 260px;
    }
}

.frosted-card:hover {
    border-color: var(--accent);
}

.btn-bold {
    background: #ffffff;
    color: #000000;
    padding: 1.5rem 3.5rem;
    border-radius: 99px;
    font-weight: 800;
    font-size: 1.125rem;
    text-decoration: none;
    transition: transform 0.3s var(--ease), box-shadow 0.3s;
    display: inline-block;
}

.btn-bold:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(255, 255, 255, 0.2);
}

.rainbow-button {
    padding: 1px;
    position: relative;
    display: inline-flex;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.08);
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
    transform-origin: center;
}

.rainbow-button::before {
    content: '';
    display: block;
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background-image: conic-gradient(from 0 at 50% 50%, transparent 50%, rgba(0, 242, 255, 0.4), rgba(0, 242, 255, 0.9), rgba(0, 242, 255, 0.4), transparent);
    z-index: 1;
    animation: rainbow-rotate 2s linear infinite;
    filter: blur(10px);
}

.rainbow-button::after {
    content: '';
    display: block;
    width: 100%;
    top: 0;
    bottom: 0;
    background-image: conic-gradient(from 0 at 50% 50%, rgba(0, 242, 255, 0.6), rgba(0, 242, 255, 1), rgba(0, 242, 255, 0.6));
    position: absolute;
    z-index: 0;
    opacity: 0;
    filter: blur(0px);
    border-radius: 100px;
    transition: opacity 0.25s ease-in-out, filter 0.25s ease-in-out;
    pointer-events: none;
}

.rainbow-button__btn {
    position: relative;
    z-index: 1;
    border: none;
    padding: 20px 35px;
    border-radius: 100px;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
}

.rainbow-button:hover {
    transform: scale(1.06);
    animation: none;
}

.rainbow-button:hover::before {
    animation: rainbow-rotate-fast 0.8s linear infinite;
    filter: blur(10px);
}


.rainbow-button:hover .rainbow-button__btn {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.rainbow-button:active {
    transform: translateY(2px);
}

.rainbow-button:active::before {
    opacity: 1;
    background-image: conic-gradient(from 0 at 50% 50%, rgba(0, 242, 255, 0.6), rgba(0, 242, 255, 1), rgba(0, 242, 255, 0.6));
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0.25);
}

.rainbow-button-dark {
    background: rgba(255, 255, 255, 0.06);
}

.rainbow-button-dark .rainbow-button__btn {
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.rainbow-button-dark:hover::before {
    box-shadow: none;
}

.rainbow-button-dark:hover .rainbow-button__btn {
    background: rgba(0, 0, 0, 0.2);
    color: #ffffff;
}

.rainbow-button-dark:active::before {
    opacity: 1;
    box-shadow: 0 1px 2px #000000;
    background-image: conic-gradient(from 0 at 50% 50%, rgba(0, 242, 255, 0.6), rgba(0, 242, 255, 1), rgba(0, 242, 255, 0.6));
}

.rainbow-button-light {
    background: rgba(255, 255, 255, 0.9);
}


@keyframes rainbow-rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes rainbow-rotate-fast {
    0% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(260deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    text-decoration: none;
    transition: border-color 0.6s var(--ease), color 0.6s var(--ease);
}

.social-icon:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.hiring-card {
    position: relative;
    overflow: hidden;
}

.hiring-border {
    position: absolute;
    inset: 14px;
    width: calc(100% - 28px);
    height: calc(100% - 28px);
    pointer-events: none;
    overflow: visible;
}

.hiring-border text {
    font-size: 0.24rem;
    letter-spacing: 0.35em;
    fill: var(--text-muted);
    text-transform: uppercase;
}

.hiring-center {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

/* Animations & Effects */
.deblur {
    /* FAIL-SAFE DEFAULT: VISIBLE */
    filter: blur(0);
    opacity: 1;
    transform: translateY(0);
    /* Default: Faster for scroll interactions (1s) */
    transition: filter 1s ease-out, opacity 1s ease-out, transform 1s ease-out;
    will-change: filter, opacity, transform;
}

/* JS ENHANCEMENT: Hide initially only if JS is running */
body.js-active .deblur {
    filter: blur(12px);
    opacity: 0;
    transform: translateY(20px);
}

/* Modifier: Keep the slow, soft feel for the intro/preloader connection */
.deblur.slow-intro {
    transition: filter 3s ease-out, opacity 2.5s ease-in-out, transform 3s ease-out;
}

/* REVEAL STATE (must override the hidden state) */
body.js-active .deblur.active {
    filter: blur(0);
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 3rem;
    }

    p.lead {
        font-size: 1.1rem;
    }

    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
}
