/*
 * work-lab.css
 * Shared styles for /work.html and /lab.html.
 * Builds on projects.css (card pattern) + projects-mobile.css.
 *
 * Brand tokens come from main.css (--color-primary #FF3822, --color-secondary #FF9F22).
 * Differentiation rules per the page-split plan:
 *   - Work    : red-orange anchor accent (matches existing site)
 *   - Lab: orange accent on hero + status pills, subtle starfield motion
 */

/* ---------------------------------------------------------------
 * Hero intro paragraph (shared)
 * Sits below the page title, sets up narrative + cross-link.
 * ----------------------------------------------------------------*/
.page-hero-intro {
    color: var(--color-text-light);
    font-size: 18px;
    font-weight: 300;
    line-height: 1.55;
    max-width: 820px;
    margin: 0 0 30px 0;
}

.page-hero-link {
    color: var(--color-primary);
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid color-mix(in srgb, var(--color-secondary) 40%, transparent);
    padding-bottom: 1px;
    transition: border-color 0.2s ease;
}

.page-hero-link:hover {
    border-bottom-color: var(--color-secondary);
}

/* ---------------------------------------------------------------
 * Cross-link footer block (shared)
 * Sits between the last project card and the site footer.
 * ----------------------------------------------------------------*/
.page-cross-link {
    width: 94%;
    margin: 0 auto;
    padding: 60px 0 80px;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.page-cross-link p {
    color: var(--color-text-light);
    font-size: 16px;
    font-weight: 300;
    margin: 0;
}

.page-cross-link-arrow {
    color: var(--color-primary);
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
}

.page-cross-link-arrow:hover {
    text-decoration: underline;
    text-decoration-color: var(--color-secondary);
    text-underline-offset: 4px;
}

/* ---------------------------------------------------------------
 * Lab-only — hero heading swap to secondary accent
 * (Work uses the existing red-orange treatment in projects.css)
 * ----------------------------------------------------------------*/
.lab-page .lab-heading {
    color: var(--color-secondary);
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lab-page .lab-heading .letter-animation {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------------------------------------------------------------
 * Lab status pills
 * Three states: Production / Research / Day Zero.
 * Currently every Lab entry is Production; the other states
 * are scaffolded for future entries per the plan §9.
 * ----------------------------------------------------------------*/
.lab-status-row {
    margin-bottom: 16px;
}

.lab-status {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    padding: 6px 12px;
    border-radius: 20px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lab-status-production {
    background-color: color-mix(in srgb, var(--color-secondary) 12%, transparent);
    color: var(--color-secondary);
    border: 1px solid color-mix(in srgb, var(--color-secondary) 35%, transparent);
}

.lab-status-research {
    background-color: color-mix(in srgb, var(--color-primary) 12%, transparent);
    color: var(--color-primary);
    border: 1px solid color-mix(in srgb, var(--color-primary) 35%, transparent);
}

.lab-status-day-zero {
    background-color: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
    color: var(--color-text-primary);
    border: 1px solid color-mix(in srgb, var(--color-text-primary) 25%, transparent);
}

/* ---------------------------------------------------------------
 * Lab-only orbit spheres
 * CSS-built so Lab has its own R&D visual language while Work
 * keeps the original designer-exported project ornaments.
 * ----------------------------------------------------------------*/
.lab-orbit-sphere,
.lab-no-image-spacer {
    width: 150px;
    height: 150px;
}

.lab-orbit-sphere {
    --orbit-size: 150px;
    --orbit-tilt: -16deg;
    --orbit-duration: 20s;
    --orbit-accent: var(--color-secondary);
    --orbit-core: var(--color-primary);
    --orbit-soft: rgba(255, 255, 255, 0.32);
    position: absolute;
    top: 16%;
    left: 30%;
    width: var(--orbit-size);
    height: var(--orbit-size);
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(var(--orbit-tilt));
    z-index: 1;
    background:
        radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.92) 0 4%, rgba(255, 255, 255, 0.36) 5% 10%, transparent 11%),
        radial-gradient(circle at 58% 62%, color-mix(in srgb, var(--orbit-accent) 72%, transparent) 0 12%, transparent 34%),
        radial-gradient(circle at 42% 38%, var(--orbit-accent) 0 8%, var(--orbit-core) 36%, color-mix(in srgb, var(--color-bg-dark) 90%, transparent) 72%);
    box-shadow:
        0 0 34px color-mix(in srgb, var(--orbit-core) 24%, transparent),
        inset -18px -22px 34px rgba(0, 0, 0, 0.48),
        inset 10px 10px 22px rgba(255, 255, 255, 0.1);
    animation: lab-sphere-breathe 7s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.lab-orbit-sphere::before,
.lab-orbit-sphere::after {
    content: "";
    position: absolute;
    inset: 11%;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--orbit-accent) 44%, transparent);
    transform: rotate(68deg) scaleX(1.55);
    box-shadow: 0 0 18px color-mix(in srgb, var(--orbit-accent) 18%, transparent);
    animation: lab-orbit-spin var(--orbit-duration) linear infinite;
}

.lab-orbit-sphere::after {
    inset: 22%;
    border-color: rgba(255, 255, 255, 0.18);
    transform: rotate(-54deg) scaleX(1.72);
    animation-duration: calc(var(--orbit-duration) * 1.35);
    animation-direction: reverse;
}

.lab-orbit-dot {
    position: absolute;
    top: 13%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orbit-soft);
    box-shadow: 0 0 12px var(--orbit-soft);
    transform-origin: 0 calc(var(--orbit-size) * 0.37);
    animation: lab-orbit-dot var(--orbit-duration) linear infinite;
}

.lab-orbit-dot-secondary {
    top: 56%;
    width: 5px;
    height: 5px;
    opacity: 0.75;
    transform-origin: 0 calc(var(--orbit-size) * -0.25);
    animation-duration: calc(var(--orbit-duration) * 0.72);
    animation-direction: reverse;
}

/* Per-sphere variation now spans the full work-page sphere palette:
   the brand orange anchors (#FF3822 / #FF9F22) plus the deep cobalt
   indigo, royal blue, sky/cyan, violet, and magenta hues sampled from
   the project artwork (most prominently the indigo of project-009
   "Private Claude Workspace"). Sphere 01 stays brand-orange so the
   flagship TaskFox Factory entry still reads as the anchor. */

.lab-orbit-sphere-02 {
    --orbit-tilt: 14deg;
    --orbit-duration: 24s;
    --orbit-accent: #5d87e4;
    --orbit-core: #2847bf;
}

.lab-orbit-sphere-03 {
    --orbit-tilt: -28deg;
    --orbit-duration: 18s;
    --orbit-accent: #8a6fff;
    --orbit-core: #503c98;
}

.lab-orbit-sphere-04 {
    --orbit-tilt: 24deg;
    --orbit-duration: 28s;
    --orbit-accent: #6aa3ff;
    --orbit-core: #1d57c4;
}

.lab-orbit-sphere-05 {
    --orbit-tilt: -8deg;
    --orbit-duration: 22s;
    --orbit-accent: #8fd5ff;
    --orbit-core: #1094fa;
}

.lab-orbit-sphere-06 {
    --orbit-tilt: 14deg;
    --orbit-duration: 24s;
    --orbit-accent: #ffd06b;
    --orbit-core: #f4a226;
}

.lab-orbit-sphere-07 {
    --orbit-tilt: -8deg;
    --orbit-duration: 22s;
    --orbit-accent: #df74e8;
    --orbit-core: #8a2db8;
}

.lab-orbit-sphere-08 {
    --orbit-tilt: -28deg;
    --orbit-duration: 18s;
    --orbit-accent: #4dc9f6;
    --orbit-core: #0a4f9b;
}

.lab-orbit-sphere-09 {
    --orbit-tilt: 24deg;
    --orbit-duration: 28s;
    --orbit-accent: color-mix(in srgb, var(--color-primary) 70%, #fff);
    --orbit-core: var(--color-primary);
}

.lab-orbit-sphere-10 {
    --orbit-tilt: -8deg;
    --orbit-duration: 22s;
    --orbit-accent: #ffb088;
    --orbit-core: #d76b3a;
}

@keyframes lab-sphere-breathe {
    0%,
    100% {
        filter: saturate(0.94) brightness(0.95);
    }
    50% {
        filter: saturate(1.08) brightness(1.04);
    }
}

@keyframes lab-orbit-spin {
    from {
        rotate: 0deg;
    }
    to {
        rotate: 360deg;
    }
}

@keyframes lab-orbit-dot {
    from {
        rotate: 0deg;
    }
    to {
        rotate: 360deg;
    }
}

/* ---------------------------------------------------------------
 * Lab starfield canvas
 * Subtle motion behind the hero. Animation lives in
 * scripts/lab-animation.js (canvas painter).
 * Honors prefers-reduced-motion (canvas stays empty when reduced).
 * ----------------------------------------------------------------*/
.lab-starfield-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* Make sure the page content sits above the starfield. */
.lab-page main,
.lab-page footer {
    position: relative;
    z-index: 1;
}

/* ---------------------------------------------------------------
 * Mobile adjustments
 * ----------------------------------------------------------------*/
@media (max-width: 799px) {
    .page-hero-intro {
        font-size: 16px;
        padding: 0 16px;
        margin-bottom: 20px;
    }

    .page-cross-link {
        padding: 40px 16px 60px;
        width: 100%;
    }

    .page-cross-link p {
        font-size: 14px;
    }

    .lab-no-image-spacer {
        width: 100px;
        height: 100px;
    }

    .lab-orbit-sphere {
        --orbit-size: 100px;
        width: var(--orbit-size);
        height: var(--orbit-size);
        top: 50%;
        left: 13%;
    }

    .lab-status-row {
        margin-bottom: 12px;
    }

    .lab-starfield-canvas {
        /* Reduce density on mobile by lowering opacity rather than
           skipping the painter entirely; the JS already scales counts. */
        opacity: 0.35;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lab-orbit-sphere,
    .lab-orbit-sphere::before,
    .lab-orbit-sphere::after,
    .lab-orbit-dot {
        animation: none;
    }
}
