:root {
    --pink: #ff8af4;
    --violet: #8c7dff;
    --mint: #7ef29d;
    --cyan: #5ffbf1;
    --glass: rgba(15, 20, 34, 0.65);
    --glass-strong: rgba(28, 32, 52, 0.8);
    --border: rgba(255, 255, 255, 0.08);
    --text-soft: rgba(239, 240, 255, 0.75);
    --surface-gradient: radial-gradient(circle at top, #1c1b29 0%, #0f111b 45%, #090a0f 100%);
    --main-backdrop: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.04), transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(255, 138, 244, 0.08), transparent 45%),
        radial-gradient(circle at 50% 80%, rgba(92, 255, 210, 0.08), transparent 50%);
    --shell-header-bg: rgba(10, 12, 22, 0.9);
    --shell-footer-bg: rgba(9, 10, 17, 0.9);
}

:root[data-theme="lunar"] {
    --pink: #fed6ff;
    --violet: #c2b6ff;
    --mint: #b1ffef;
    --cyan: #6be8ff;
    --surface-gradient: radial-gradient(circle at 15% 10%, rgba(103, 153, 255, 0.25), rgba(5, 7, 20, 0.95)),
        radial-gradient(circle at 80% 0%, rgba(255, 214, 255, 0.2), rgba(6, 7, 12, 1));
    --main-backdrop: radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.08), transparent 40%),
        radial-gradient(circle at 70% 20%, rgba(255, 214, 255, 0.15), transparent 55%);
    --shell-header-bg: rgba(7, 9, 22, 0.9);
    --shell-footer-bg: rgba(6, 7, 18, 0.92);
}

:root[data-theme="noir"] {
    --pink: #ff92a5;
    --violet: #5d5dff;
    --mint: #7ef29d;
    --cyan: #5ffbf1;
    --surface-gradient: radial-gradient(circle at 15% 25%, rgba(0, 0, 0, 0.7), rgba(6, 6, 6, 1));
    --main-backdrop: radial-gradient(circle at 80% 80%, rgba(255, 62, 0, 0.15), transparent 60%),
        radial-gradient(circle at 0% 30%, rgba(40, 66, 255, 0.15), transparent 50%);
    --shell-header-bg: rgba(5, 5, 5, 0.95);
    --shell-footer-bg: rgba(10, 10, 10, 0.95);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #f9f9ff;
    font-size: 16px;
    background: var(--surface-gradient);
}

h1,
h2,
h3,
p {
    margin: 0;
}

.hero__content h1:focus,
.hero__content h1:focus-visible {
    outline: none;
}

a {
    color: var(--cyan);
}

section {
    margin-bottom: clamp(3rem, 8vw, 5.5rem);
}

.hero {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(1.5rem, 4vw, 3rem);
    padding: clamp(2rem, 5vw, 4rem);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(120deg, rgba(255, 138, 244, 0.7), rgba(92, 255, 210, 0.7), rgba(140, 125, 255, 0.7));
    filter: blur(2px);
    opacity: 0.65;
    animation: heroBorder 14s linear infinite;
    z-index: -2;
    pointer-events: none;
}

.hero__content,
.hero__panel {
    position: relative;
    z-index: 1;
}

.hero__content h1 {
    font-size: clamp(2.5rem, 6vw, 3.8rem);
    line-height: 1.1;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-height: 7.2rem;
}

.hero__title {
    display: block;
}

.hero__tagline {
    display: inline-flex;
    margin-top: 0.6rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    background: linear-gradient(120deg, var(--pink), var(--cyan));
    -webkit-background-clip: text;
    color: transparent;
}

.hero__glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    filter: blur(60px);
    opacity: 0.7;
}

.hero__glow--primary {
    background: radial-gradient(circle, rgba(143, 81, 255, 0.45), transparent 60%);
}

.hero__glow--secondary {
    background: radial-gradient(circle at 70% 30%, rgba(255, 138, 244, 0.4), transparent 55%);
}

.hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(transparent 80%, rgba(255, 255, 255, 0.08) 90%),
        linear-gradient(90deg, transparent 80%, rgba(255, 255, 255, 0.08) 90%);
    background-size: 220px 220px;
    opacity: 0.3;
    animation: gridDrift 32s linear infinite;
    z-index: 0;
    pointer-events: none;
}

.hero__orb {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    filter: blur(30px);
    opacity: 0.45;
    animation: orbDrift 18s ease-in-out infinite;
    mix-blend-mode: screen;
    pointer-events: none;
}

.hero__orb--alpha {
    top: 5%;
    right: 10%;
    background: radial-gradient(circle, rgba(255, 138, 244, 0.8), rgba(0, 0, 0, 0));
    animation-delay: -4s;
}

.hero__orb--beta {
    bottom: 4%;
    left: 8%;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(92, 255, 210, 0.8), rgba(0, 0, 0, 0));
}

.hero__actions {
    margin: 1.2rem 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.8rem;
    color: var(--text-soft);
    margin-bottom: 0.5rem;
}

.lede {
    color: var(--text-soft);
    max-width: 60ch;
    font-size: 1rem;
    line-height: 1.6;
}

.pill {
    border-radius: 999px;
    padding: 0.6rem 1.5rem;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.8rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.pill--primary {
    background: linear-gradient(120deg, var(--pink), var(--violet));
    border-color: rgba(255, 255, 255, 0.2);
    color: #080914;
    font-weight: 600;
}

.pill--ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.3);
    color: #f2f3ff;
}

.pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.hero__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat {
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.03);
}

.stat__value {
    font-size: 1.4rem;
    font-weight: 600;
}

.stat__label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-top: 0.2rem;
}

.floating-card {
    border-radius: 1.5rem;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.floating-card,
.module-card,
.lab-card {
    animation: floatCard 9s ease-in-out infinite;
}

.floating-card::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.4;
    pointer-events: none;
}

.floating-card__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.6rem;
}

.floating-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 1.5rem;
}

.floating-card__badges span {
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.floating-card__progress .progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.progress-track {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-track span {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, var(--mint), var(--cyan));
    border-radius: inherit;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.section__header {
    margin-bottom: 2rem;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.module-card {
    padding: 1.5rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.module-card:hover {
    transform: translateY(-6px);
}

.module-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.12), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.module-card:hover::before {
    opacity: 1;
}

.module-card__eyebrow {
    letter-spacing: 0.28em;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.35rem;
}

.module-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 1rem 0;
}

.module-card__badges span {
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: rgba(12, 12, 22, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
}

.module-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.glass-panel {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.metrics-panel,
.signal-panel {
    padding: 2rem;
}

.metric-card {
    padding: 1.1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.metric-card:last-child {
    border-bottom: none;
}

.metric-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.metric-card__header span {
    font-size: 0.85rem;
    color: var(--text-soft);
}

.metric-card__footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-soft);
    margin-top: 0.4rem;
}

.metric-trend {
    font-size: 1rem;
}

.metric-trend--up {
    color: var(--mint);
}

.metric-trend--down {
    color: #ff7b7b;
}

.signal-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.signal-list li {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.signal-list li:last-child {
    border-bottom: none;
}

.signal-list span {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.signal-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.journey-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 2fr;
    gap: 1.5rem;
}

.journey-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.journey-chip {
    min-width: 180px;
    max-width: 260px;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1rem;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.journey-chip small {
    display: block;
    color: var(--text-soft);
    margin-top: 0.2rem;
}

.journey-chip.active {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(6px);
}

.journey-detail {
    padding: 2rem;
    color: #fff;
}

.journey-detail__lede {
    margin: 1rem 0;
    max-width: 60ch;
}

.journey-detail ul {
    padding-left: 1.25rem;
    color: var(--text-soft);
    line-height: 1.6;
}

.labs .lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.lab-card {
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--glass-strong);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.2);
}

.lab-card__tag {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
}

#blazor-error-ui {
    background: rgba(18, 26, 40, 0.95);
    color: #fff;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    margin-left: 1rem;
}

.loading-progress {
    position: relative;
    width: 8rem;
    height: 8rem;
    margin: 18vh auto 1rem;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
}

.loading-progress circle {
    fill: none;
    stroke-width: 0.5rem;
}

.loading-progress circle:first-child {
    stroke: rgba(255, 255, 255, 0.15);
}

.loading-progress circle:last-child {
    stroke: #ff8af4;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.08s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    inset: calc(18vh + 3rem) 0 auto 0;
    text-align: center;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Launching");
}

code {
    font-family: 'Space Grotesk', 'Fira Code', monospace;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.2rem 0.4rem;
    border-radius: 0.4rem;
}

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

    .journey-list {
        flex-direction: column;
    }

    .journey-chip {
        max-width: none;
        width: 100%;
    }

    .hero {
        grid-template-columns: 1fr;
    }
}

@keyframes heroBorder {
    0% { filter: hue-rotate(0deg) blur(2px); }
    50% { filter: hue-rotate(120deg) blur(4px); }
    100% { filter: hue-rotate(360deg) blur(2px); }
}

@keyframes gridDrift {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 200px 200px, 200px 200px; }
}

@keyframes orbDrift {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(20px, -30px, 0) scale(1.1); }
    100% { transform: translate3d(-10px, 10px, 0) scale(0.95); }
}

@keyframes floatCard {
    0%,
    100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
