﻿@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=VT323&display=swap');

/* ---------------- Core Theme Vars ---------------- */
:root {
    --cb-bg-color: #000000;
    --cb-text-color: #f8f8f8;
    --cb-accent-color: #3cbcfc; /* NES palette color-21 */
    --cb-primary-bg: #00b800; /* NES palette color-19 */
    --cb-primary-color: #fcfcfc;
    --cb-border-color: #d8d8d8;
    --cb-nav-bg: #f8f8f8;
    --cb-footer-bg: #f8f8f8;
    --cb-hover-bg: #d8d8d8;
    --content-top-gap: 1.1rem;
    --content-x-gap: 1.5rem;
    --header-height: 3.5rem;
}

@property --sky-color-top {
    syntax: '<color>';
    initial-value: #a4e4fc;
    inherits: true;
}

@property --sky-color-mid {
    syntax: '<color>';
    initial-value: #7cc6f4;
    inherits: true;
}

@property --sky-color-bottom {
    syntax: '<color>';
    initial-value: #4a86cf;
    inherits: true;
}

[data-bs-theme='dark'] {
    --cb-bg-color: #000000;
    --cb-text-color: #f0d0b0;
    --cb-border-color: #787878;
    --cb-nav-bg: #000000;
    --cb-footer-bg: #000000;
    --cb-hover-bg: #787878;
}

/* ---------------- Base ---------------- */
html, body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--cb-bg-color);
    color: var(--cb-text-color);
    font-size: 16px;
}

.navbar-brand {
    font-family: 'VT323', monospace;
}

@media (max-width: 600px) {
    html, body {
        font-size: 18px;
    }
}

.logo, .logo-hero {
    image-rendering: pixelated;
}

.logo {
    height: 2rem;
    margin-right: 0.5rem;
}

.logo-hero {
    height: 6rem;
    margin-right: 0.5rem;
}

a, .btn-link {
    color: var(--cb-accent-color);
}

.btn-primary {
    color: var(--cb-primary-color);
    background-color: var(--cb-primary-bg);
    border-color: var(--cb-primary-bg);
}

.btn-outline-primary {
    color: var(--cb-primary-bg);
    border-color: var(--cb-primary-bg);
}

    .btn-outline-primary:hover {
        color: var(--cb-primary-color);
        background-color: var(--cb-primary-bg);
        border-color: var(--cb-primary-bg);
    }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #fcfcfc, 0 0 0 0.25rem var(--cb-accent-color);
}

.content {
    padding-top: var(--content-top-gap);
}

article.content.px-4 {
    padding-left: var(--content-x-gap);
    padding-right: var(--content-x-gap);
}

article.content:has(> .page-container.home-page) {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #58d854;
}

.invalid {
    outline: 1px solid #881400;
}

.validation-message {
    color: #881400;
}

/* ---------------- Error Boundary ---------------- */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #a80020;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* ---------------- Forms / Tables ---------------- */
.darker-border-checkbox.form-check-input {
    border-color: #787878;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.table tbody tr:hover {
    background-color: var(--cb-hover-bg);
}

/* ---------------- Site Header ---------------- */
.top-row {
    background-color: var(--cb-nav-bg);
    border-bottom: 1px solid var(--cb-border-color);
    padding: 0 1rem;
    min-height: 3.5rem;
}

    .top-row .navbar-brand {
        font-size: 1.2rem;
    }

    .top-row a {
        color: var(--cb-text-color);
        text-decoration: none;
    }

/* ---------------- What You Get Heading -------------- */

.what-you-get-heading {
    font-size: 2rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

/* ---------------- Proof Points Section -------------- */

.proof-points {
    text-align: center;
}

    .proof-points div {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .proof-points ul {
        text-align: left;
        list-style: none;
        padding-left: 0;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .proof-points li {
        font-size: 1.35rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        background: rgba(6, 20, 34, 0.75);
        border: 2px solid var(--cb-accent-color);
        padding: 0.75rem 1.25rem;
        border-radius: 6px;
        color: var(--bs-light);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
        text-align: left;
    }

        .proof-points li::before {
            content: "★";
            color: var(--cb-accent-color);
            font-size: 1.5rem;
        }

/* ---------------- Fun Header Message ---------------- */
.fun-header-message {
    background-color: var(--cb-nav-bg);
    padding: 0.25rem 1rem;
    text-align: center;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--cb-text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.fun-header-prefix {
    font-style: normal;
    font-weight: 600;
}

.fun-header-text {
    display: inline-flex;
    align-items: center;
    text-wrap: balance;
}

.deferred-content {
    min-height: var(--deferred-content-min-height, auto);
}

.deferred-content--loading {
    opacity: 0.65;
}

.deferred-content--ready {
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

.top-row a:hover {
    text-decoration: underline;
    color: var(--cb-accent-color);
}

/* ---------------- Footer ---------------- */
.site-footer {
    background-color: var(--cb-footer-bg);
    border-top: 1px solid var(--cb-border-color);
    padding: 1rem 0;
    margin-top: 2rem;
}

    .site-footer a {
        color: var(--cb-text-color);
        margin: 0 0.5rem;
        text-decoration: none;
    }

        .site-footer a:hover {
            text-decoration: underline;
            color: var(--cb-accent-color);
        }

    .site-footer span {
        color: var(--cb-text-color);
    }

/* ---------------- Nav Menu ---------------- */
.navbar-toggler {
    appearance: none;
    width: 3.5rem;
    height: 2.5rem;
    color: #bcbcbc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: 0.25rem;
    padding: 0;
    border: 1px solid rgba(0, 168, 0, 0.1);
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 168, 0, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(0, 168, 0, 0.1);
}

    .navbar-toggler:checked {
        background-color: rgba(0, 168, 0, 0.5);
    }

    .navbar-toggler:focus {
        outline: 2px solid var(--cb-accent-color);
        outline-offset: 2px;
    }

.navbar-brand {
    font-size: 1.1rem;
}

.bi {
    display: inline-block;
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    top: -1px;
    background-size: cover;
}

.bi-house-door-fill-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5Z'/%3E%3C/svg%3E");
}

.bi-plus-square-fill-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-plus-square-fill' viewBox='0 0 16 16'%3E%3Cpath d='M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z'/%3E%3C/svg%3E");
}

.bi-search-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20fill%3D%27white%27%20class%3D%27bi%20bi-search%27%20viewBox%3D%270%200%2016%2016%27%3E%3Cpath%20d%3D%27M11.742%2010.344a6.5%206.5%200%201%200-1.397%201.398h-.001q.044.06.098.115l3.85%203.85a1%201%200%200%200%201.415-1.414l-3.85-3.85a1%201%200%200%200-.115-.1zM12%206.5a5.5%205.5%200%201%201-11%200%205.5%205.5%200%200%201%2011%200%27%2F%3E%3C%2Fsvg%3E");
}

.bi-list-nested-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
}

.bi-box-arrow-right-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-box-arrow-right' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0z'/%3E%3Cpath fill-rule='evenodd' d='M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708z'/%3E%3C/svg%3E");
}

.bi-life-preserver-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2716%27%20height%3D%2716%27%20fill%3D%27white%27%20viewBox%3D%270%200%2016%2016%27%3E%3Cpath%20d%3D%27M8%2016A8%208%200%201%200%208%200a8%208%200%200%200%200%2016m6.43-5.228a7.03%207.03%200%200%201-3.658%203.658l-1.115-2.788a4%204%200%200%200%201.985-1.985zM5.228%2014.43a7.03%207.03%200%200%201-3.658-3.658l2.788-1.115a4%204%200%200%200%201.985%201.985zm9.202-9.202-2.788%201.115a4%204%200%200%200-1.985-1.985l1.115-2.788a7.03%207.03%200%200%201%203.658%203.658m-8.087-.87a4%204%200%200%200-1.985%201.985L1.57%205.228A7.03%207.03%200%200%201%205.228%201.57zM8%2011a3%203%200%201%201%200-6%203%203%200%200%201%200%206%27/%3E%3C/svg%3E");
}

.nav-item {
    font-size: 1rem;
    padding-bottom: 0.5rem;
}

.sidebar .nav-item:first-of-type {
    padding-top: 1rem;
}

.sidebar .nav-item:last-of-type {
    padding-bottom: 1rem;
}

.nav-item .nav-link {
    color: #bcbcbc;
    background: none;
    border: none;
    border-radius: 4px;
    height: 3rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
    width: 100%;
}

.dropdown-menu {
    background-color: var(--cb-nav-bg);
    border: 1px solid var(--cb-border-color);
}

.dropdown-item {
    color: var(--cb-text-color);
}

    .dropdown-item:hover,
    .dropdown-item:focus {
        background-color: var(--cb-primary-bg);
        color: var(--cb-primary-color);
    }

.nav-group {
    padding-bottom: 0.5rem;
}

    .nav-group summary {
        color: #bcbcbc;
        height: 3rem;
        display: flex;
        align-items: center;
        padding: 0 1rem;
        border-radius: 4px;
    }

        .nav-group[open] summary, .nav-group summary:hover {
            background-color: var(--cb-primary-bg);
            color: var(--cb-primary-color);
        }

.nav-item a.active {
    background-color: var(--cb-primary-bg);
    color: var(--cb-primary-color);
}

.nav-item .nav-link:hover {
    background-color: var(--cb-primary-bg);
    color: var(--cb-primary-color);
}

.nav-scrollable {
    display: none;
}

.navbar-toggler:checked ~ .nav-scrollable {
    display: block;
}

@media (min-width: 641px) {
    .navbar-toggler {
        display: none;
    }

    .nav-scrollable {
        display: block;
        height: calc(100vh - 3.5rem);
        overflow-y: auto;
    }
}

/* ---------------- Main Layout ---------------- */
@media (max-width: 640px) {
    .authenticated .top-row {
        display: none;
    }
}

.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.sidebar {
    background-image: linear-gradient(180deg, #4428bc 0%, #9878f8 70%);
}

    .sidebar .form-label .text-light-gray {
        color: #d8d8d8;
    }

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        flex: 0 0 250px;
        flex-shrink: 0;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* ---------------- Home Page / Hero ---------------- */
.page-container {
    position: relative;
    overflow: hidden;
    min-height: calc(100svh - var(--header-height));
    display: flex;
    flex-direction: column;
}

.page-container.home-page {
    --earth-height: clamp(48px, calc((100svh - var(--header-height)) * 0.1), 120px);
}

.content > .page-container.home-page {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: calc(-1 * var(--content-top-gap));
}

/* Stars */
.starfield-svg {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
    animation: stars-day-night 60s infinite linear;
}

.star {
    fill: white;
    animation: blink 2s infinite alternate;
}

@keyframes blink {
    0%,100% {
        opacity: 1
    }

    50% {
        opacity: .4
    }
}

@keyframes stars-day-night {
    0%,45% {
        opacity: 0
    }

    55%,95% {
        opacity: 1
    }

    100% {
        opacity: 0
    }
}

/* Sky + Steam */
.hero {
    --viewport-height: calc(100svh - var(--header-height));
    --hero-width: min(1240px, 100vw);
    --pixel-size: clamp(4px, calc(var(--hero-width) / 160), 12px);
    --earth-height: clamp(48px, calc(var(--viewport-height) * 0.1), 120px);
    --hero-top-padding: clamp(calc(var(--pixel-size) * 7), 6vh, calc(var(--pixel-size) * 10));
    --hero-bottom-padding: clamp(calc(var(--pixel-size) * 7), 6vh, calc(var(--pixel-size) * 10));
    min-height: var(--viewport-height);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    flex: 1 1 auto;
    box-sizing: border-box;
    padding: var(--hero-top-padding) clamp(1.5rem, 5vw, 3rem) calc(var(--hero-bottom-padding) + var(--earth-height));
    --sky-color-top: #a4e4fc;
    --sky-color-mid: #7cc6f4;
    --sky-color-bottom: #4a86cf;
    background:
        linear-gradient(var(--sky-color-top) 0%, var(--sky-color-mid) 48%, var(--sky-color-bottom) 100%);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    image-rendering: pixelated;
    font-family: 'VT323', monospace;
    animation: day-night 60s infinite linear;
}

    .hero .coffee-logo .steam rect {
        animation: steam-rise 1.8s infinite ease-in-out;
    }

        .hero .coffee-logo .steam rect:nth-child(1) {
            animation-delay: 0s
        }

        .hero .coffee-logo .steam rect:nth-child(2) {
            animation-delay: .3s
        }

        .hero .coffee-logo .steam rect:nth-child(3) {
            animation-delay: .6s
        }

@keyframes steam-rise {
    0% {
        transform: translateY(0);
        opacity: 1
    }

    100% {
        transform: translateY(-6px);
        opacity: 0
    }
}

/* the moving “point” */
.orbit {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0; /* important: zero-size point */
    offset-rotate: 0deg;
    -webkit-offset-rotate: 0deg;
    will-change: offset-distance, opacity;
    pointer-events: none;
}

/* drive distance on the WRAPPERs */
.orbit-sun {
    display: block;
    animation: sun-run 60s linear infinite both;
}

.orbit-moon {
    display: block;
    animation: moon-run 60s linear infinite both;
}

/* discs sit ON the wrapper’s local (0,0) and use transform to place bottom on path */
.sun, .moon {
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(-50%, -100%); /* center X, bottom Y on path point */
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
}

.sun {
    width: 80px;
    height: 80px;
    background: #f8b800;
}

.moon {
    width: 60px;
    height: 60px;
    background: #d8d8d8;
    overflow: hidden;
}

    .moon::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 50%;
        background: var(--sky-color-top);
        animation: moon-phases 240s linear infinite;
    }

/* distance mapping – unchanged, just targets .orbit-* now */
@keyframes sun-run {
    0% {
        offset-distance: 0%;
        -webkit-offset-distance: 0%;
        opacity: 1
    }

    50% {
        offset-distance: 100%;
        -webkit-offset-distance: 100%;
        opacity: 1
    }

    50.01% {
        opacity: 0
    }

    100% {
        offset-distance: 100%;
        -webkit-offset-distance: 100%;
        opacity: 0
    }
}

@keyframes moon-run {
    0%,49.99% {
        offset-distance: 0%;
        -webkit-offset-distance: 0%;
        opacity: 0
    }

    50% {
        offset-distance: 0%;
        -webkit-offset-distance: 0%;
        opacity: 1
    }

    100% {
        offset-distance: 100%;
        -webkit-offset-distance: 100%;
        opacity: 1
    }
}

/* Phases (unchanged) */
@keyframes moon-phases {
    0%,24.999% {
        transform: translateX(30px);
    }

    25%,49.999% {
        transform: translateX(60px);
    }

    50%,74.999% {
        transform: translateX(-30px);
    }

    75%,99.999% {
        transform: translateX(-60px);
    }

    100% {
        transform: translateX(30px);
    }
}

/* Stacking: stars(1) < bodies/tracks(2) < content(3) < earth(4) */
.hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    display: flex;
    justify-content: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.title-box {
    width: min(720px, 100%);
    max-width: 100%;
    min-height: clamp(360px, 56vh, 560px);
    max-height: none;
    border: 4px solid var(--cb-accent-color);
    padding: clamp(2rem, 4vh, 2.75rem);
    text-align: center;
    background-color: rgba(0, 0, 0, 0.82);
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: clamp(1.15rem, 2.8vh, 1.75rem);
    margin-block: auto;
    box-shadow: 0 0 0 6px rgba(60, 188, 252, 0.1), 0 0 32px rgba(0, 0, 0, 0.65);
}

    .title-box h1 {
        font-size: 4rem;
        margin-bottom: 0;
    }

.hero-story {
    width: min(520px, 100%);
    flex: 0 1 clamp(180px, 24vh, 220px);
    height: clamp(180px, 24vh, 220px);
    margin: clamp(0.75rem, 2vh, 1.5rem) auto;
    overflow: hidden;
    border: 3px solid var(--cb-accent-color);
    background: rgba(0, 0, 0, 0.65);
    padding: 0.75rem 0.85rem;
    color: var(--bs-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.5rem;
    line-height: 1.4;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.45);
    display: flex;
    --hero-story-scroll-distance: 0px;
    box-sizing: border-box;
}

    .hero-story .story-track {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
        animation-delay: 4.5s;
        animation: hero-scroll 30s linear infinite;
        animation-fill-mode: forwards;
        will-change: transform;
        opacity: 1;
        flex: 0 0 auto;
        min-height: max-content;
        width: min(600px, 100%);
        padding-bottom: var(--hero-story-bottom-padding, 0px);
        box-sizing: border-box;
    }

    .hero-story p {
        margin: 0;
        word-break: break-word;
    }

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 0;
}

.cta-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: rgba(12, 26, 44, 0.85);
    border: 3px solid var(--cb-accent-color);
    padding: 0.75rem 1.5rem 1rem;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.hero-btn {
    min-width: 140px;
    font-size: 1.35rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    padding: 0.5rem 1.75rem;
}

.cta-option .btn-outline-light.hero-btn {
    border-width: 3px;
}

.cta-description {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--bs-light);
}

@keyframes hero-scroll {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    4% {
        transform: translateY(0);
        opacity: 1;
    }

    52% {
        transform: translateY(calc(var(--hero-story-scroll-distance, 0px) * -0.5));
        opacity: 1;
    }

    82% {
        transform: translateY(calc(var(--hero-story-scroll-distance, 0px) * -1));
        opacity: 1;
    }

    90% {
        transform: translateY(calc(var(--hero-story-scroll-distance, 0px) * -1));
        opacity: 1;
    }

    96% {
        transform: translateY(calc(var(--hero-story-scroll-distance, 0px) * -1));
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 0;
    }
}

.earth {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: var(--earth-height);
    background: linear-gradient(180deg, #3a9b44 0%, #1e4e25 100%);
    border-top: 4px solid #1b3c20;
    box-shadow: inset 0 8px 0 rgba(196, 248, 156, 0.25), inset 0 -12px 0 rgba(12, 28, 16, 0.65);
    image-rendering: pixelated;
    z-index: 4;
    pointer-events: none;
}

    .earth::before {
        content: "";
        position: absolute;
        inset: 0;
        background: repeating-linear-gradient(90deg, rgba(28, 78, 44, 0.55) 0 16px, rgba(28, 78, 44, 0) 16px 32px);
        mix-blend-mode: soft-light;
        opacity: 0.35;
    }

.shooting-star {
    position: absolute;
    top: clamp(8px, 6vh, 24px);
    left: -52%;
    width: clamp(260px, 45vw, 480px);
    height: 3px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.6) 40%, rgba(215, 241, 255, 0.85) 60%, rgba(170, 215, 255, 0) 100%);
    transform: rotate(32deg);
    transform-origin: left center;
    z-index: 2;
    opacity: 0;
    animation: shooting-star 60s linear infinite;
    filter: drop-shadow(0 0 8px rgba(200, 230, 255, 0.7));
    pointer-events: none;
}

    .shooting-star::after {
        content: "";
        position: absolute;
        top: 50%;
        right: clamp(18px, 16%, 48px);
        width: clamp(8px, 2.4vw, 14px);
        aspect-ratio: 1 / 1;
        transform: translateY(-50%);
        border-radius: 50%;
        background: radial-gradient(circle, #ffffff 0%, #d8f0ff 55%, rgba(216, 240, 255, 0) 70%);
        box-shadow: 0 0 10px rgba(200, 230, 255, 0.75);
    }

@keyframes shooting-star {
    0%, 54% {
        opacity: 0;
        transform: translate3d(0, 0, 0) rotate(32deg);
    }

    58% {
        opacity: 1;
        transform: translate3d(-24vw, -18vh, 0) rotate(32deg);
    }

    66% {
        transform: translate3d(48vw, 28vh, 0) rotate(32deg);
        opacity: 0.85;
    }

    70% {
        transform: translate3d(70vw, 48vh, 0) rotate(32deg);
        opacity: 0;
    }

    100% {
        opacity: 0;
        transform: translate3d(0, 0, 0) rotate(32deg);
    }
}

.home-content {
    padding: 2rem;
}

.value-card {
    height: 100%;
    background: rgba(6, 20, 34, 0.8);
    border: 3px solid var(--cb-accent-color);
    padding: 1.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    color: var(--bs-light);
}

    .value-card h4 {
        font-size: 1.5rem;
        text-transform: uppercase;
    }

    .value-card p {
        margin-bottom: 0;
        font-size: 1rem;
    }

.pixel-icon {
    display: inline-flex;
    padding: 0.5rem;
    background: rgba(10, 10, 10, 0.75);
    border: 2px solid var(--cb-accent-color);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.5);
}

@media (max-width: 600px) {
    .hero {
        --hero-width: min(640px, 100vw);
        --pixel-size: clamp(3px, calc(var(--hero-width) / 170), 9px);
        --hero-top-padding: clamp(calc(var(--pixel-size) * 6), 5vh, calc(var(--pixel-size) * 8));
        --hero-bottom-padding: clamp(calc(var(--pixel-size) * 8), 7vh, calc(var(--pixel-size) * 11));
        --earth-height: clamp(48px, calc(var(--viewport-height) * 0.12), 96px);
        padding: var(--hero-top-padding) 1rem calc(var(--hero-bottom-padding) + var(--earth-height));
    }

    .page-container.home-page {
        --earth-height: clamp(48px, calc((100svh - var(--header-height)) * 0.12), 96px);
    }

    .title-box {
        min-height: auto;
        width: 100%;
        padding: 1rem;
        gap: 1rem;
    }

        .title-box h1 {
            font-size: 2.5rem;
        }

    .hero-cta {
        gap: 1rem;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .cta-option {
        width: 100%;
    }

    .hero-btn {
        width: 100%;
    }

    .hero-story {
        display: none;
    }

    .shooting-star {
        left: -68%;
        width: clamp(220px, 86vw, 360px);
        top: clamp(0%, 18vh, 24%);
    }

    .home-content {
        padding: 1rem;
    }

    /* remove sun and moon orbit on small device */
    .orbit-sun {
        display: none;
    }

    .orbit-moon {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-story {
        overflow-y: auto;
    }

        .hero-story .story-track {
            animation: none;
            transform: none;
            opacity: 1;
        }

    .shooting-star {
        animation: none !important;
    }
}

/* Day/Night sky gradient animation */
@keyframes day-night {
    0% {
        --sky-color-top: #a4e4fc;
        --sky-color-mid: #7cc6f4;
        --sky-color-bottom: #4a86cf;
    }

    45% {
        --sky-color-top: #6888fc;
        --sky-color-mid: #3d6fc7;
        --sky-color-bottom: #045060;
    }

    55% {
        --sky-color-top: #001a33;
        --sky-color-mid: #000d1f;
        --sky-color-bottom: #000000;
    }

    95% {
        --sky-color-top: #001a33;
        --sky-color-mid: #000d1f;
        --sky-color-bottom: #000000;
    }

    100% {
        --sky-color-top: #a4e4fc;
        --sky-color-mid: #7cc6f4;
        --sky-color-bottom: #4a86cf;
    }
}

/* ---------------- How It Works ---------------- */
.how-it-works {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    justify-items: center;
    padding-left: 0;
}

    .how-it-works li {
        text-align: center;
    }

/* ---------------- Docs ---------------- */
.doc-page table {
    width: 100%;
    max-width: 100%;
    display: block;
    overflow-x: auto;
}

.doc-page th,
.doc-page td {
    word-break: break-word;
}

.doc-page pre {
    overflow-x: auto;
}

/* ---------------- Plans Page ---------------- */
.current-plan {
    opacity: 0.5;
}

.current-plan-banner {
    position: absolute;
    top: 2rem;
    left: -2.5rem;
    transform: rotate(-45deg);
    clip-path: polygon(20% 0, 85% 0, 100% 100%, 0% 100%);
    background-color: rgba(0, 0, 0, 0.75);
    color: #fcfcfc;
    padding: 0.25rem 2.5rem;
    font-weight: bold;
    pointer-events: none;
}

    .current-plan-banner + .card-body {
        margin-top: 0.5rem;
    }

@media (max-width: 576px) {
    .current-plan-banner + .card-body {
        margin-top: 1.25rem;
    }
}

/* ---------------- Tenant Selector ----------- */
.tenant-selector {
    max-width: 320px;
    flex-shrink: 0;
}

@media (max-width: 991.98px) {
    .tenant-selector {
        width: 100%;
    }
}

/* ----------------- User Dropdown ----------- */
#userDropdown {
    line-height: 1rem;
}

#userDropdown span {
    margin-top: 4px;
}