:root {
    --bg: #07111f;
    --bg-soft: rgba(10, 25, 45, 0.74);
    --panel-strong: #0b1b31;
    --text: #edf4ff;
    --muted: #9eb3ca;
    --line: rgba(143, 187, 255, 0.16);
    --line-strong: rgba(130, 232, 255, 0.3);
    --cyan: #82e8ff;
    --teal: #3fd0c9;
    --gold: #ffd37a;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    --shadow-glow: 0 24px 80px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(130, 232, 255, 0.06), 0 0 42px rgba(63, 208, 201, 0.08);
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(63, 208, 201, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(130, 232, 255, 0.12), transparent 24%),
        linear-gradient(180deg, #07111f 0%, #08172b 50%, #06101d 100%);
    color: var(--text);
    font-family: "Manrope", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(130, 232, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(130, 232, 255, 0.04) 1px, transparent 1px);
    background-size: 90px 90px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 90%);
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    inset: -10%;
    background:
        radial-gradient(circle at 18% 22%, rgba(63, 208, 201, 0.14), transparent 26%),
        radial-gradient(circle at 82% 18%, rgba(130, 232, 255, 0.1), transparent 24%),
        radial-gradient(circle at 50% 80%, rgba(255, 211, 122, 0.08), transparent 22%);
    filter: blur(28px);
    opacity: 0.8;
    animation: auroraShift 16s ease-in-out infinite alternate;
    pointer-events: none;
}

a {
    color: inherit;
}

button {
    font: inherit;
}

.labs-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding: 20px 0 48px;
}

.labs-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
    padding: 14px 0 12px;
    margin-bottom: 26px;
    background: linear-gradient(180deg, rgba(7, 17, 31, 0.94), rgba(7, 17, 31, 0.62));
    backdrop-filter: blur(16px);
    transition: padding 0.25s ease, background 0.25s ease;
}

.labs-header.is-condensed {
    padding: 10px 0 8px;
}

.labs-brand,
.labs-nav a,
.eyebrow,
.breadcrumb,
.lab-meta {
    font-family: "Chakra Petch", sans-serif;
}

.labs-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-left: 10px;
    text-decoration: none;
    flex: 0 0 auto;
}

.labs-brand-logo {
    display: block;
    width: auto;
    height: 84px;
    object-fit: contain;
}

.labs-brand-text {
    display: none;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cyan);
}

.labs-nav-toggle {
    display: none;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
}

.labs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding-right: 28px;
    align-items: center;
}

.labs-nav a {
    position: relative;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.95rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.labs-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), transparent);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.25s ease;
}

.labs-nav a:hover,
.labs-nav a:focus-visible,
.labs-nav a.active {
    color: var(--text);
    transform: translateY(-1px);
}

.labs-nav a:hover::after,
.labs-nav a:focus-visible::after,
.labs-nav a.active::after {
    transform: scaleX(1);
}

.hero-card,
.content-card,
.lab-card,
.note-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, rgba(8, 20, 38, 0.94), rgba(12, 28, 49, 0.8));
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.hero-card::after,
.content-card::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    right: -140px;
    top: -120px;
    background: radial-gradient(circle, rgba(255, 211, 122, 0.18), transparent 72%);
    pointer-events: none;
}

.hero-card {
    padding: 36px;
    margin-bottom: 26px;
    --hero-shift-x: 0px;
    --hero-shift-y: 0px;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at calc(50% + var(--hero-shift-x)) calc(35% + var(--hero-shift-y)), rgba(130, 232, 255, 0.1), transparent 28%),
        linear-gradient(120deg, rgba(255, 255, 255, 0.02), transparent 38%);
    opacity: 0.95;
    pointer-events: none;
}

.hero-card > *,
.content-card > * {
    position: relative;
    z-index: 1;
}

.eyebrow,
.lab-meta {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.82rem;
}

.hero-card h1,
.content-card h2 {
    line-height: 0.96;
}

.hero-card h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    max-width: 11ch;
}

.content-card h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.hero-card p,
.content-card p,
.lab-card p,
.note-card p,
.list li {
    color: var(--muted);
    line-height: 1.7;
    font-size: 1rem;
}

.hero-card p {
    max-width: 62ch;
    margin-top: 18px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.stack {
    display: grid;
    gap: 18px;
}

.lab-card,
.content-card,
.note-card {
    padding: 24px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.lab-card {
    text-decoration: none;
}

.lab-card:hover,
.lab-card:focus-visible,
.content-card:hover,
.note-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(130, 232, 255, 0.22);
}

.lab-card h3,
.content-card h2,
.note-card h3 {
    margin-bottom: 12px;
}

.list {
    list-style: none;
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.list li::before {
    content: ">";
    color: var(--cyan);
    margin-right: 10px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 22px;
}

.btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.22) 50%, transparent 80%);
    transform: translateX(-130%);
    transition: transform 0.55s ease;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-2px);
}

.btn:hover::before,
.btn:focus-visible::before {
    transform: translateX(130%);
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan), var(--teal));
    color: #04101a;
}

.btn-secondary {
    border: 1px solid rgba(130, 232, 255, 0.18);
    color: var(--text);
    background: rgba(8, 22, 40, 0.88);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    border-color: rgba(130, 232, 255, 0.34);
    background: rgba(12, 30, 53, 0.96);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 0.95rem;
}

.breadcrumb a {
    color: var(--cyan);
    text-decoration: none;
}

.footer-note {
    margin-top: 28px;
    color: var(--muted);
    text-align: center;
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes auroraShift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    100% {
        transform: translate3d(1.5%, -1.5%, 0) scale(1.04);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 960px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .hero-card,
    .content-card,
    .lab-card,
    .note-card {
        padding: 28px;
    }

    .labs-brand-logo {
        height: 74px;
    }
}

@media (max-width: 760px) {
    .labs-header {
        flex-wrap: wrap;
    }

    .labs-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
    }

    .labs-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 14px;
        padding: 18px;
        border: 1px solid var(--line);
        border-radius: var(--radius-md);
        background: rgba(8, 20, 38, 0.95);
    }

    .labs-nav.is-open {
        display: flex;
    }
}

@media (max-width: 640px) {
    .labs-shell {
        width: min(100% - 20px, 1180px);
    }

    .labs-brand-logo {
        height: 62px;
    }

    .hero-card h1,
    .content-card h2 {
        max-width: none;
        font-size: clamp(2.2rem, 10vw, 3.5rem);
    }

    .hero-card,
    .content-card,
    .lab-card,
    .note-card {
        border-radius: 22px;
    }
}
