:root {
    --black : #111111;
    --white: #ede8dd;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background-color: var(--black);
    color: var(--white);
}

body {
    position: relative;
    min-height: 100vh;
}

.main {
    display: none;
    min-height: 100vh;
    padding-left: 5rem;
    transition: padding-left 320ms ease;
}

body.sidebar-expanded .main {
    padding-left: 13rem;
}

body.is-ready .main {
    display: block;
}

.dashboard-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    display: flex;
    width: 5rem;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.25rem;
    padding: 1.5rem 0 2rem;
    border-right: 1px solid #ede8dd18;
    background: #111;
    transition: width 320ms ease, padding 320ms ease;
}

body.sidebar-expanded .dashboard-sidebar {
    width: 13rem;
    align-items: stretch;
    padding-right: 1rem;
    padding-left: 1rem;
}

.sidebar-toggle {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    width: 2.6rem;
    height: 2.6rem;
    place-items: center;
    align-self: center;
    margin: 0;
    border: 0;
    background: none;
    color: #ede8dd66;
    cursor: pointer;
    font-size: 1rem;
}

.sidebar-toggle:hover {
    color: var(--white);
}

.sidebar-toggle-icon-open {
    display: none;
}

.sidebar-mark {
    display: grid;
    width: 2.6rem;
    height: 2.6rem;
    place-items: center;
    color: #d1bd8e;
    font-size: 1.2rem;
    text-decoration: none;
}

.dashboard-nav {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    margin-top: 4.5rem;
}

.dashboard-nav-item {
    display: grid;
    width: 2.6rem;
    height: 2.6rem;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    background: none;
    color: #ede8dd55;
    cursor: pointer;
    font-size: 1rem;
}
body.sidebar-expanded .dashboard-nav-item {
    width: 100%;
    grid-template-columns: 2rem 1fr;
    justify-items: start;
    padding: 0 0.7rem;
    gap: 0.7rem;
    font-size: 0.9rem;
}

body.sidebar-expanded .sidebar-toggle,
body.sidebar-expanded .sidebar-mark {
    width: 100%;
    grid-template-columns: 2rem 1fr;
    justify-items: start;
    padding: 0 0.7rem;
    gap: 0.7rem;
}

body.sidebar-expanded .sidebar-toggle-icon-open {
    display: block;
}

body.sidebar-expanded .sidebar-toggle-icon-closed {
    display: none;
}

.nav-label {
    display: none;
    font: 0.65rem 'Space Mono', monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.sidebar-expanded .nav-label {
    display: block;
}

.dashboard-nav-item.active,
.dashboard-nav-item:hover {
    color: var(--white);
}

.dashboard-nav-item.active {
    border-color: #d1bd8e66;
    color: #d1bd8e;
    background: #d1bd8e0d;
}

.sidebar-bottom {
    margin-top: auto;
    color: #ede8dd44;
    font: 0.5rem/1.5 'Space Mono', monospace;
    letter-spacing: 0.1em;
    text-align: center;
}

.dashboard-header,
.dashboard-content {
    width: min(90rem, calc(100% - 8rem));
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 5rem;
    border-bottom: 1px solid color-mix(in srgb, var(--white) 14%, transparent);
    font-family: 'Space Mono', 'Menlo', 'Courier New', Courier, monospace;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
}

.dashboard-brand {
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.08em;
    text-decoration: none;
}

.dashboard-context,
.dashboard-status {
    display: flex;
    gap: 1.5rem;
    color: color-mix(in srgb, var(--white) 52%, transparent);
}

.dashboard-battery {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid #d1bd8e55;
    color: #d1bd8e;
    font: 0.6rem 'Space Mono', monospace;
    letter-spacing: 0.08em;
}

.dashboard-battery strong { color: var(--white); font-size: 0.75rem; }
.dashboard-battery small { color: #ede8dd66; font-size: 0.5rem; }

.dashboard-status {
    align-items: center;
    color: var(--white);
}

.status-light {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #a7d1b0;
    box-shadow: 0 0 0.8rem #a7d1b0;
}

.dashboard-content {
    padding-top: 3vh;
    padding-bottom: 5vh;
}

.eyebrow,
.section-heading span,
.panel-time,
.visual-label,
.system-state {
    margin: 0;
    color: color-mix(in srgb, var(--white) 48%, transparent);
    font-family: 'Space Mono', 'Menlo', 'Courier New', Courier, monospace;
    font-size: 0.65rem;
    letter-spacing: 0.14em;
}

.dashboard-intro h1 {
    max-width: 48rem;
    margin: 1.5rem 0;
    font-family: 'Glacial Indifference', 'Inter', sans-serif;
    font-size: clamp(4rem, 9vw, 9rem);
    font-weight: 400;
    letter-spacing: -0.08em;
    line-height: 0.82;
    transition: font-size 900ms ease, letter-spacing 900ms ease;
}

.dashboard-intro.greeting-seen h1 { font-size: 4rem; letter-spacing: -0.06em; }
.dashboard-content [hidden] { display: none !important; }

.overview-hero-layout { display: grid; grid-template-columns: minmax(0, 1fr) 32rem; grid-template-rows: auto auto; gap: 1rem; align-items: center; }
.overview-hero-layout .overview-layout { display: contents; }
.overview-hero-layout .dashboard-intro { grid-column: 1; grid-row: 1; align-self: center; }
.overview-hero-layout .overview-panel { grid-column: 1 / -1; grid-row: 2; }
.overview-hero-layout .habitat-rail { grid-column: 2; grid-row: 1; }

.dashboard-intro h1 em {
    color: color-mix(in srgb, var(--white) 54%, transparent);
    font-style: normal;
}

.intro-copy {
    max-width: 22rem;
    margin: 0 0 7rem;
    color: color-mix(in srgb, var(--white) 55%, transparent);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    transition: opacity 350ms ease;
}

.intro-copy.is-changing { opacity: 0; }

.overview-panel {
    padding: 2rem;
    border: 1px solid color-mix(in srgb, var(--white) 15%, transparent);
    background: #151515;
}

.overview-layout { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 1rem; align-items: start; }
.habitat-rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.rail-card { min-height: 10.5rem; padding: 1.25rem; border: 1px solid #ede8dd18; background: #151515; opacity: 0; transform: translateY(0.8rem); }
.habitat-rail.is-visible .rail-card { animation: rail-card-in 550ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.habitat-rail.is-visible .rail-card:nth-child(2) { animation-delay: 90ms; }
.habitat-rail.is-visible .rail-card:nth-child(3) { animation-delay: 180ms; }
.habitat-rail.is-visible .rail-card:nth-child(4) { animation-delay: 270ms; }
.rail-label { display: flex; align-items: center; gap: 0.5rem; color: #a8bfd0; font: 0.58rem 'Space Mono', monospace; letter-spacing: 0.1em; }
.rail-card strong { display: block; margin: 1.2rem 0 0.45rem; font: 0.95rem 'Inter', sans-serif; font-weight: 400; }
.rail-card > span { color: #ede8dd66; font: 0.62rem/1.45 'Space Mono', monospace; }
.warning-card { border-color: #a7d1b044; }
.warning-card .rail-label { color: #a7d1b0; }

@keyframes rail-card-in {
    to { opacity: 1; transform: translateY(0); }
}

.overview-heading,
.section-heading,
.card-topline,
.card-reading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.overview-heading h2 {
    margin: 0.7rem 0 0;
    font-family: 'Inter', sans-serif;
    font-size: 1.7rem;
    font-weight: 400;
}

.module-overview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 2rem 0; }
.module-overview-card { display: grid; grid-template-columns: auto 1fr auto; gap: 0.85rem; align-items: center; min-height: 8rem; padding: 1.25rem; border: 1px solid #ede8dd1c; background: #111; }
.module-overview-card i { color: #ede8dd66; font-size: 1.3rem; }
.module-overview-card div { display: flex; flex-direction: column; gap: 0.45rem; }
.module-overview-card span, .module-overview-card small { color: #ede8dd55; font: 0.55rem 'Space Mono', monospace; letter-spacing: 0.1em; }
.module-overview-card strong { font: 0.95rem 'Inter', sans-serif; font-weight: 400; }
.module-overview-card.active-module { border-color: #a7d1b044; }
.module-overview-card.active-module i, .module-overview-card.active-module strong { color: #a7d1b0; }

.overview-readings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.overview-readings div { display: flex; flex-direction: column; gap: 0.6rem; padding-right: 1rem; border-right: 1px solid #ede8dd22; }
.overview-readings div:last-child { border: 0; }
.overview-readings span { color: #ede8dd66; font: 0.6rem 'Space Mono', monospace; letter-spacing: 0.12em; }
.overview-readings strong { font: 1.5rem 'Inter', sans-serif; }
.overview-readings small { color: #ede8dd66; font-size: 0.65rem; }

.telemetry-graph { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #ede8dd22; }
.graph-heading { display: flex; justify-content: space-between; color: #ede8dd66; font: 0.6rem 'Space Mono', monospace; letter-spacing: 0.12em; }
.graph-heading strong { color: #d1bd8e; font-weight: 400; }
.telemetry-graph svg { width: 100%; height: 7rem; margin-top: 1rem; overflow: visible; }
.telemetry-graph polyline { fill: none; stroke: #a8bfd0; stroke-width: 2; vector-effect: non-scaling-stroke; }

.systems-section { margin-top: 7rem; }
.placeholder-panel { display: none; padding: 3rem; border: 1px solid #ede8dd18; background: #151515; }
.placeholder-panel:not([hidden]) { display: block; }
.placeholder-panel h2 { margin: 1rem 0; font: 3rem 'Inter', sans-serif; font-weight: 400; }
.placeholder-panel p:last-child { max-width: 28rem; color: #ede8dd66; font: 1rem/1.5 'Inter', sans-serif; }
.prototype-list { border-top: 1px solid #ede8dd1c; }
.prototype-list > div { display: grid; grid-template-columns: 2rem 1fr auto; gap: 1rem; align-items: center; padding: 1.2rem 0; border-bottom: 1px solid #ede8dd1c; }
.prototype-list i { color: #d1bd8e; font-size: 1rem; }
.prototype-list span { display: flex; flex-direction: column; gap: 0.35rem; }
.prototype-list strong { font: 0.95rem 'Inter', sans-serif; font-weight: 400; }
.prototype-list small, .prototype-list em { color: #ede8dd66; font: 0.6rem 'Space Mono', monospace; letter-spacing: 0.07em; font-style: normal; }
.prototype-list em { color: #d1bd8e; }
.dashboard-content.show-power .dashboard-intro,
.dashboard-content.show-power .overview-panel,
.dashboard-content.show-power .systems-section,
.dashboard-content.show-inventory .dashboard-intro,
.dashboard-content.show-inventory .overview-panel,
.dashboard-content.show-inventory .systems-section { display: none; }
.dashboard-content.show-power .placeholder-panel[data-panel="power"],
.dashboard-content.show-inventory .placeholder-panel[data-panel="inventory"] { display: block; }
.section-heading { align-items: center; margin-bottom: 1.5rem; }
.system-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.system-card { padding: 1.5rem; border: 1px solid #ede8dd18; background: #151515; }
.system-icon { color: #d1bd8e; font-size: 1.5rem; }
.system-state { color: #a7d1b0; font-size: 0.55rem; }
.system-card h3 { margin: 2rem 0 0.5rem; font: 1.2rem 'Inter', sans-serif; font-weight: 400; }
.system-card p { min-height: 2.5rem; margin: 0 0 2rem; color: #ede8dd66; font: 0.8rem/1.4 'Inter', sans-serif; }
.card-reading { align-items: baseline; justify-content: flex-start; gap: 0.5rem; }
.card-reading strong { font: 2rem 'Space Mono', monospace; }
.card-reading span { color: #ede8dd66; font: 0.65rem 'Space Mono', monospace; }
.reading-line { height: 1px; margin-top: 1rem; background: #ede8dd22; }
.reading-line span { display: block; height: 100%; background: #d1bd8e; }

@media (max-width: 900px) {
    .main, body.sidebar-expanded .main { padding-left: 0; padding-bottom: 5rem; }
    .dashboard-sidebar { top: auto; right: 0; width: auto; height: 4rem; flex-direction: row; padding: 0 1.5rem; border-top: 1px solid #ede8dd18; border-right: 0; }
    .sidebar-mark, .sidebar-bottom, .sidebar-toggle { display: none; }
    body.sidebar-expanded .dashboard-sidebar { width: auto; align-items: center; padding: 0 1.5rem; }
    body.sidebar-expanded .dashboard-nav-item { width: 2.4rem; grid-template-columns: 1fr; padding: 0; }
    body.sidebar-expanded .nav-label { display: none; }
    .dashboard-nav { flex-direction: row; width: 100%; justify-content: space-between; margin-top: 0; }
    .dashboard-nav-item { width: 2.4rem; }
    .dashboard-header, .dashboard-content { width: calc(100% - 3rem); }
    .dashboard-context { display: none; }
    .system-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .dashboard-header { height: 4rem; }
    .dashboard-status { font-size: 0.5rem; }
    .dashboard-content { padding-top: 4rem; }
    .dashboard-intro h1 { font-size: 4.5rem; }
    .intro-copy { margin-bottom: 4rem; }
    .overview-panel { padding: 1rem; }
    .overview-visual { height: 18rem; }
    .overview-readings { grid-template-columns: repeat(2, 1fr); }
    .module-overview-grid { grid-template-columns: repeat(2, 1fr); }
    .overview-hero-layout { grid-template-columns: 1fr; grid-template-rows: auto; }
    .overview-hero-layout .dashboard-intro,
    .overview-hero-layout .overview-panel,
    .overview-hero-layout .habitat-rail { grid-column: 1; grid-row: auto; }
    .habitat-rail { display: grid; grid-template-columns: repeat(2, 1fr); }
    .overview-readings div:nth-child(2) { border: 0; }
    .system-grid { grid-template-columns: 1fr; }
}

.loading {
    position: fixed;
    inset: 0;
    z-index: 10;
    background-color: inherit;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    font-family: 'Space Mono', 'Menlo', 'Courier New', Courier, monospace;
    font-size: 20rem;
    font-weight: 700;
    letter-spacing: -0.1em;
    padding-left: 0.1em;
    overflow: hidden;
}

.loading[hidden] {
    display: none;
}

.auth-page,
.dashboard-shell {
    display: none;
    min-height: 100vh;
}

body.auth-required .auth-page,
body.is-ready .dashboard-shell {
    display: grid;
}

.auth-page {
    place-items: center;
    padding: 2rem 1.5rem 5rem;
}

.auth-panel {
    width: min(100%, 34rem);
    padding: 0;
}

.dashboard-shell-content h1 {
    margin: 0.6rem 0 1.25rem;
    font-family: 'Cal Sans', sans-serif;
    font-size: clamp(3.5rem, 10vw, 7.5rem);
    font-weight: 400;
    letter-spacing: -0.08em;
    line-height: 0.86;
}

.dashboard-shell-content h1 em {
    color: #d1bd8e;
    font-family: 'Poiret One', sans-serif;
}

.auth-panel h1 {
    max-width: 36rem;
    margin: 0.85rem 0 1rem;
    font-family: 'Space Mono', 'Menlo', monospace;
    font-size: clamp(2.1rem, 4.4vw, 3.6rem);
    font-weight: 400;
    letter-spacing: -0.055em;
    line-height: 1;
}

.auth-kicker {
    margin: 0;
    color: #d1bd8e;
    font: 0.68rem 'Space Mono', 'Menlo', monospace;
    letter-spacing: 0.15em;
}

.auth-copy,
.dashboard-shell-content > p:last-child {
    max-width: 31rem;
    color: #ede8dd99;
    font: 0.86rem/1.7 'Space Mono', 'Menlo', monospace;
}

.auth-command {
    display: block;
    width: fit-content;
    margin-top: 1.25rem;
    border-left: 2px solid #d1bd8e;
    padding: 0.8rem 1rem;
    background: #ede8dd0a;
    color: var(--white);
    font: 0.9rem 'Space Mono', 'Menlo', monospace;
    user-select: text;
}

.auth-form {
    display: grid;
    gap: 0.7rem;
    margin-top: 2.5rem;
    border-top: 1px solid #ede8dd24;
    padding-top: 1.25rem;
    font: 0.68rem/1.4 'Space Mono', 'Menlo', monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-form input,
.auth-form button {
    border: 1px solid #ede8dd55;
    border-radius: 0;
    padding: 1rem;
    background: transparent;
    color: var(--white);
    font: 0.95rem 'Space Mono', 'Menlo', monospace;
}

.auth-input-row {
    display: contents;
}

.auth-input-row input {
    min-width: 0;
    letter-spacing: 0.06em;
}

.auth-form input:focus {
    outline: none;
    border-color: #d1bd8e;
}

.auth-form button {
    margin-top: 0.55rem;
    border-color: var(--white);
    background: var(--white);
    color: var(--black);
    cursor: pointer;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    transition: background 160ms ease, color 160ms ease;
}

.auth-form button:hover {
    background: #d1bd8e;
    border-color: #d1bd8e;
}

.auth-form button:active {
    background: var(--white);
}

.auth-error {
    min-height: 1.4em;
    margin: 0.4rem 0 0;
    color: #d8a6a0;
    font: 0.72rem/1.4 'Space Mono', 'Menlo', monospace;
}

@media (max-width: 34rem) {
    .auth-panel {
        width: min(100%, 26rem);
    }
}

.dashboard-shell {
    grid-template-rows: auto 1fr;
    padding: 2rem;
}

.dashboard-shell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #ede8dd20;
    padding-bottom: 1.2rem;
    font: 0.7rem 'Space Mono', 'Menlo', monospace;
    letter-spacing: 0.12em;
}

.dashboard-shell-status {
    color: #ede8dd99;
}

.dashboard-shell-content {
    align-self: center;
    max-width: 54rem;
    padding: 7vw;
}

.loading-hero {
    margin: 0;
    transform: translateY(0);
    opacity: 1;
}

.loading-status {
    display: flex;
    justify-content: center;
    width: 50vw;
    color: color-mix(in srgb, var(--white) 58%, transparent);
    font-family: 'Space Mono', 'Menlo', 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.08em;
}

.loading-location {
    margin-top: 0.8rem;
    color: color-mix(in srgb, var(--white) 32%, transparent);
    font-family: 'Space Mono', 'Menlo', 'Courier New', Courier, monospace;
    font-size: 0.65rem;
    letter-spacing: 0.28em;
    text-align: center;
}

.site-footer {
    position: absolute;
    right: 2rem;
    bottom: 0.2rem;
    left: 2rem;
    z-index: 11;
    display: flex;
    justify-content: space-between;
    color: color-mix(in srgb, var(--white) 42%, transparent);
    font-family: 'Space Mono', 'Menlo', 'Courier New', Courier, monospace;
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    margin-top: 1rem;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--white);
}

.loading-dots {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 4.6em;
}

.loading-error {
    display: none;
    margin: 2rem 0 0;
    color: #d8a6a0;
    font-family: 'Space Mono', 'Menlo', 'Courier New', Courier, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
}

.loading.has-error .loading-error {
    display: block;
}

.loading-dot {
    display: block;
    width: 0.25em;
    font-size: 5rem;
    font-style: normal;
    line-height: 0.5;
    opacity: 0.12;
}

.loading.is-leaving {
    pointer-events: none;
    animation: loadingCurtain 900ms cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

.loading.is-returning {
    animation: loadingReturn 500ms ease-out both;
}

.loading.is-leaving .loading-hero {
    animation: heroLift 900ms cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

@keyframes heroLift {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-1.15em);
    }
}

@keyframes loadingCurtain {
    from {
        opacity: 1;
        visibility: visible;
    }
    to {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes loadingReturn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .loading.is-leaving,
    .loading.is-leaving .loading-hero {
        animation-duration: 1ms;
    }

}

.build-commit {
    opacity: 0.4;
    transition: 0.2s ease;
}

#build-commit {
    opacity: 1;
    text-decoration: underline !important;
    transition: filter 0.2s ease;
}

.build-commit:hover {
    opacity: 0.75;
}
