:root {
    /* OrbitOS palette */

    --ink: #151513;
    --ink-deep: #10100f;

    --desk: #191a16;

    --window: #24251f;
    --window-top: #2a2b24;
    --window-soft: #303129;

    --paper: #e6e0cf;
    --paper-soft: #c8c2b2;
    --paper-dim: #969287;

    --clay: #c87852;
    --clay-light: #d8916d;
    --clay-dark: #9d593d;

    --violet: #92869c;
    --violet-soft: #746a7d;

    --sage: #829171;
    --sage-light: #9baa86;

    --line: #3a3b33;
    --line-light: #46473d;

    --black-soft: #0c0c0b;

    --orbit-green: #39FF14;
    --orbit-cyan: #00FFFF;
    --orbit-blue: #7DF9FF;
    --orbit-sky: #00CCFF;
    --orbit-bright-cyan: #03D8F3;

    --window-radius: 9px;
    --button-radius: 6px;
    --dock-radius: 11px;
}

#desktop.grid-hidden::before {
    display: none;
}
/* =========================================
   RESET
========================================= */

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


html,
body {
    width: 100%;
    height: 100%;
}


body {
    overflow: hidden;

    background: var(--desk);

    color: var(--paper);

    font-family: "Space Grotesk", sans-serif;

    -webkit-font-smoothing: antialiased;
}


/* =========================================
   DESKTOP
========================================= */

#desktop {
    position: relative;

    width: 100vw;
    height: 100vh;

    overflow: hidden;

    background-color: var(--desk);

    /*
        Quiet grid.
        It gives the desktop a slightly technical
        feeling without looking like a sci-fi template.
    */

    background-image:
        linear-gradient(
            rgba(230, 224, 207, 0.018) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(230, 224, 207, 0.018) 1px,
            transparent 1px
        );

    background-size: 36px 36px;
}


/*
    Very subtle darkening around the edges.
*/

#desktop::after {
    content: "";

    position: absolute;

    inset: 0;

    pointer-events: none;

    box-shadow:
        inset 0 0 90px rgba(0, 0, 0, 0.18);

    z-index: 1;
}


/* =========================================
   TOP BAR
========================================= */

.top-bar {
    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 50px;

    padding: 0 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: var(--ink);

    border-bottom: 1px solid var(--line);

    z-index: 500;
}


.brand {
    display: flex;
    align-items: center;

    gap: 9px;

    color: var(--paper);

    font-size: 14px;
    font-weight: 600;

    letter-spacing: 0.01em;
}


.brand-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--orbit-green);
}


.system-label {
    position: absolute;

    left: 50%;

    transform: translateX(-50%);

    color: var(--orbit-cyan);

    font-family: "DM Mono", monospace;

    font-size: 10px;

    letter-spacing: 0.08em;
}


.clock {
    color: var(--orbit-bright-cyan);

    font-family: "DM Mono", monospace;

    font-size: 11px;
}


/* =========================================
   WORKSPACE
========================================= */

.workspace {
    position: absolute;

    top: 50px;
    right: 0;
    bottom: 0;
    left: 0;

    overflow: hidden;

    z-index: 10;
}


/* =========================================
   WINDOW
========================================= */

.window {
    position: absolute;

    top: 90px;
    left: 70px;

    width: min(520px, calc(100vw - 30px));

    min-height: 280px;

    overflow: hidden;

    background: var(--window);

    border: 1px solid var(--line-light);

    border-radius: var(--window-radius);

    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.28);

    z-index: 10;

    /*
        Important for dragging.
    */

    touch-action: none;

    user-select: none;

    transition:
        box-shadow 120ms ease;
}


/*
    Active window gets slightly more definition.

    No glow.
*/

.window.active {
    border-color: var(--orbit-sky);

    box-shadow:
        0 16px 36px rgba(0, 0, 0, 0.36);
}


/*
    Hidden applications are actually hidden.
*/

.window.hidden {
    display: none;
}


/* =========================================
   WINDOW HEADER
========================================= */

.window-header {
    height: 40px;

    padding: 0 10px 0 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: var(--window-top);

    border-bottom: 1px solid var(--orbit-sky);

    cursor: grab;

    user-select: none;
}


.window-header:active {
    cursor: grabbing;
}


.window-title {
    display: flex;
    align-items: center;

    gap: 8px;

    color: var(--orbit-cyan);

    font-family: "DM Mono", monospace;

    font-size: 10px;

    letter-spacing: 0.02em;
}


.window-dot {
    width: 6px;
    height: 6px;

    flex-shrink: 0;

    border-radius: 50%;

    background: var(--orbit-bright-cyan);
}


/* =========================================
   CLOSE BUTTON
========================================= */

.window-close {
    width: 26px;
    height: 26px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid transparent;

    border-radius: var(--button-radius);

    background: transparent;

    color: var(--paper-dim);

    font-family: Arial, sans-serif;

    font-size: 18px;

    line-height: 1;

    cursor: pointer;
}


.window-close:hover {
    background: var(--window-soft);

    border-color: var(--orbit-sky);

    color: var(--orbit-bright-cyan);
}


.window-close:active {
    background: var(--line);
}


.window-close:focus-visible {
    outline: 2px solid var(--orbit-bright-cyan);

    outline-offset: 2px;
}


/* =========================================
   WINDOW CONTENT
========================================= */

.window-content {
    padding: 30px;

    user-select: text;
}


.window-content h1 {
    margin-bottom: 18px;

    color: var(--paper);

    font-size: clamp(28px, 4vw, 42px);

    font-weight: 600;

    line-height: 1.04;

    letter-spacing: -0.025em;
}


.window-content h2 {
    margin-bottom: 16px;

    color: var(--paper);

    font-size: 25px;

    font-weight: 600;
}


.eyebrow {
    margin-bottom: 13px;

    color: var(--orbit-blue);

    font-family: "DM Mono", monospace;

    font-size: 9px;

    letter-spacing: 0.12em;
}


.welcome-text {
    max-width: 420px;

    color: var(--paper-soft);

    font-size: 14px;

    line-height: 1.65;
}


/* =========================================
   STATUS
========================================= */

.status {
    margin-top: 24px;

    display: inline-flex;
    align-items: center;

    gap: 8px;

    padding: 7px 9px;

    background: var(--window-soft);

    border: 1px solid var(--orbit-sky);

    border-radius: var(--button-radius);

    color: var(--paper-dim);

    font-family: "DM Mono", monospace;

    font-size: 10px;
}


.status-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--orbit-green);
}


/* =========================================
   TERMINAL
========================================= */

.terminal-preview {
    background: #1d1e19;
}


.terminal-line {
    margin-bottom: 8px;

    color: var(--paper);

    font-family: "DM Mono", monospace;

    font-size: 12px;
}


.terminal-line.muted {
    color: var(--paper-dim);
}


/* =========================================
   DOCK
========================================= */

.dock {
    position: absolute;

    left: 50%;
    bottom: 18px;

    transform: translateX(-50%);

    display: flex;
    align-items: center;

    gap: 3px;

    padding: 5px;

    background: var(--ink);

    border: 1px solid var(--line);

    border-radius: var(--dock-radius);

    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.30);

    z-index: 600;
}


.dock-item {
    width: 51px;
    height: 48px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 3px;

    border: 1px solid transparent;

    border-radius: 7px;

    background: transparent;

    color: var(--paper-dim);

    cursor: pointer;

    transition:
        background 120ms ease,
        color 120ms ease,
        border-color 120ms ease;
}


.dock-item:hover {
    background: var(--window);

    border-color: var(--orbit-sky);

    color: var(--orbit-cyan);
}


.dock-item:active {
    background: var(--window-soft);
    border-color: var(--orbit-bright-cyan);
}


/*
    Active app.

    Clay is used only here,
    not everywhere.
*/

.dock-item.active {
    background: #19232b;

    border-color: var(--orbit-sky);

    color: var(--orbit-bright-cyan);
}


.dock-icon {
    display: block;

    color: inherit;

    font-size: 18px;

    line-height: 1;
}


.dock-label {
    display: block;

    color: inherit;

    font-family: "DM Mono", monospace;

    font-size: 7px;

    line-height: 1;
}


/* =========================================
   BUTTONS
========================================= */

button {
    font-family: inherit;
}


button:focus-visible {
    outline: 2px solid var(--orbit-bright-cyan);

    outline-offset: 2px;
}


/* =========================================
   FUTURE APPLICATION COLORS
========================================= */

/*
    These are intentionally subtle.

    They can be used later without changing
    the main OrbitOS palette.
*/

.app-clay {
    --app-color: var(--clay);
}


.app-violet {
    --app-color: var(--violet);
}


.app-sage {
    --app-color: var(--sage);
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 700px) {

    .top-bar {
        height: 48px;

        padding: 0 13px;
    }


    .system-label {
        display: none;
    }


    .clock {
        font-size: 10px;
    }


    .workspace {
        top: 48px;
    }


    .window {
        top: 16px;
        left: 12px;

        width: calc(100vw - 24px);

        min-height: 300px;

        border-radius: 8px;
    }


    .window-content {
        padding: 23px;
    }


    .window-content h1 {
        font-size: 30px;
    }


    .dock {
        right: 10px;
        left: 10px;

        bottom: 9px;

        transform: none;

        justify-content: center;

        overflow-x: auto;
    }


    .dock-item {
        flex: 0 0 48px;

        width: 48px;
        height: 46px;
    }
}


/* =========================================
   SMALL PHONES
========================================= */

@media (max-width: 420px) {

    .brand {
        font-size: 13px;
    }


    .window-content {
        padding: 20px;
    }


    .window-content h1 {
        font-size: 27px;
    }


    .welcome-text {
        font-size: 13px;
    }
}


/* =========================================
   REDUCED MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {

        scroll-behavior: auto !important;

        transition: none !important;

        animation: none !important;
    }
}
/* =========================================
   NOTES APP
========================================= */

.notes-app {
    width: 100%;
}


.notes-editor {
    display: block;

    width: 100%;
    min-height: 180px;

    margin-top: 18px;

    padding: 14px;

    resize: vertical;

    border: 1px solid var(--line);

    border-radius: 7px;

    background: #1b1c18;

    color: var(--paper);

    font-family: "Space Grotesk", sans-serif;

    font-size: 13px;

    line-height: 1.6;

    outline: none;
}


.notes-editor::placeholder {
    color: var(--paper-dim);
}


.notes-editor:focus {
    border-color: var(--orbit-bright-cyan);
}


.notes-info {
    display: flex;

    justify-content: space-between;

    gap: 15px;

    margin-top: 9px;

    color: var(--paper-dim);

    font-family: "DM Mono", monospace;

    font-size: 9px;
}


.notes-actions {
    display: flex;

    gap: 7px;

    margin-top: 16px;
}


.notes-button {
    padding: 7px 12px;

    border: 1px solid var(--line);

    border-radius: 6px;

    background: var(--window-soft);

    color: var(--paper-soft);

    font-size: 11px;

    cursor: pointer;
}


.notes-button:hover {
    background: #22303a;

    color: var(--paper);
}


.notes-button:active {
    background: var(--line);
}


.notes-save {
    background: var(--orbit-bright-cyan);

    border-color: var(--orbit-bright-cyan);

    color: var(--paper);
}


.notes-save:hover {
    background: var(--orbit-cyan);
}
/* =========================================
   TERMINAL APP
========================================= */

.terminal-app {
    padding: 24px;
    background: #1a1b17;
}


/* Terminal output */

.terminal-output {
    min-height: 210px;
    max-height: 280px;

    overflow-y: auto;

    padding: 4px 0;

    color: var(--orbit-cyan);

    font-family: "DM Mono", monospace;

    font-size: 11px;

    line-height: 1.7;

    white-space: pre-wrap;
}


.terminal-output::-webkit-scrollbar {
    width: 5px;
}


.terminal-output::-webkit-scrollbar-thumb {
    background: var(--line);

    border-radius: 3px;
}


.terminal-muted {
    color: var(--orbit-blue);
}


.terminal-command {
    color: var(--orbit-blue);
}


.terminal-error {
    color: #b87965;
}


/* Input */

.terminal-input-row {
    display: flex;

    align-items: center;

    gap: 8px;

    margin-top: 14px;

    padding-top: 12px;

    border-top: 1px solid var(--line);
}


.terminal-prompt {
    flex-shrink: 0;

    color: var(--orbit-green);

    font-family: "DM Mono", monospace;

    font-size: 11px;
}


.terminal-input {
    width: 100%;

    min-width: 0;

    border: 0;

    outline: none;

    background: transparent;

    color: var(--orbit-blue);

    font-family: "DM Mono", monospace;

    font-size: 11px;
}


.terminal-input::placeholder {
    color: var(--paper-dim);
}
/* =========================================
   MISSION CONTROL
========================================= */

.mission-app {
    padding: 26px;
}


.mission-intro {
    max-width: 390px;

    margin-bottom: 20px;

    color: var(--paper-dim);

    font-size: 12px;

    line-height: 1.55;
}


/* System status */

.mission-status {
    display: flex;

    align-items: center;

    gap: 11px;

    margin-bottom: 18px;

    padding: 11px 12px;

    background: var(--window-soft);

    border: 1px solid var(--orbit-sky);

    border-radius: 7px;
}


.mission-status-indicator {
    width: 7px;
    height: 7px;

    flex-shrink: 0;

    border-radius: 50%;

    background: var(--orbit-green);
}


.mission-status-title {
    color: var(--paper);

    font-size: 11px;

    font-weight: 500;
}


.mission-status-text {
    margin-top: 2px;

    color: var(--paper-dim);

    font-family: "DM Mono", monospace;

    font-size: 8px;
}


/* Information cards */

.mission-grid {
    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 7px;
}


.mission-card {
    min-height: 70px;

    display: flex;

    flex-direction: column;

    justify-content: space-between;

    padding: 11px;

    background: #20211c;

    border: 1px solid var(--orbit-sky);

    border-radius: 7px;
}


.mission-card-label {
    color: var(--paper-dim);

    font-family: "DM Mono", monospace;

    font-size: 8px;

    letter-spacing: 0.05em;
}


.mission-card strong {
    overflow: hidden;

    color: var(--paper);

    font-family: "DM Mono", monospace;

    font-size: 13px;

    font-weight: 500;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* Session information */

.mission-session {
    margin-top: 8px;

    padding: 10px 11px;

    background: #1c1d19;

    border: 1px solid var(--line);

    border-radius: 7px;
}


.mission-session-row {
    display: flex;

    justify-content: space-between;

    gap: 15px;

    padding: 5px 0;

    color: var(--paper-dim);

    font-family: "DM Mono", monospace;

    font-size: 9px;
}


.mission-session-row + .mission-session-row {
    border-top: 1px solid rgba(230, 224, 207, 0.05);
}


.mission-session-row strong {
    color: var(--orbit-cyan);

    font-weight: 400;
}


/* Refresh */

.mission-refresh {
    width: 100%;

    margin-top: 12px;

    padding: 8px 12px;

    border: 1px solid var(--orbit-sky);

    border-radius: 6px;

    background: var(--window-soft);

    color: var(--paper-soft);

    font-family: "DM Mono", monospace;

    font-size: 9px;

    cursor: pointer;
}


.mission-refresh:hover {
    background: #2e3a46;

    color: var(--orbit-cyan);
}


.mission-refresh:active {
    background: #1f2a32;
}


/* Mobile */

@media (max-width: 700px) {

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

}


@media (max-width: 420px) {

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

}
/* =========================================
   HOME APP
========================================= */

.home-app {
    padding: 30px;
}


.home-app h1 {
    max-width: 440px;

    margin-bottom: 14px;
}


.home-stats {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 7px;

    margin-top: 24px;
}


.home-stat {
    min-height: 62px;

    display: flex;

    flex-direction: column;

    justify-content: space-between;

    padding: 10px;

    background: #20211c;

    border: 1px solid var(--line);

    border-radius: 7px;
}


.home-stat-label {
    color: var(--paper-dim);

    font-family: "DM Mono", monospace;

    font-size: 8px;

    letter-spacing: 0.05em;
}


.home-stat strong {
    color: var(--orbit-cyan);

    font-family: "DM Mono", monospace;

    font-size: 11px;

    font-weight: 500;
}


/* Quick launch */

.home-launch {
    margin-top: 20px;
}


.home-launch-label {
    margin-bottom: 8px;

    color: var(--paper-dim);

    font-family: "DM Mono", monospace;

    font-size: 8px;

    letter-spacing: 0.06em;
}


.home-launch-buttons {
    display: flex;

    flex-wrap: wrap;

    gap: 6px;
}


.home-launch-button {
    padding: 7px 10px;

    border: 1px solid var(--line);

    border-radius: 6px;

    background: var(--window-soft);

    color: var(--paper-soft);

    font-family: "DM Mono", monospace;

    font-size: 9px;

    cursor: pointer;
}


.home-launch-button:hover {
    background: #22303a;

    color: var(--orbit-cyan);
}


.home-launch-button:active {
    background: #1c2931;
}


/* =========================================
   ABOUT APP
========================================= */

.about-app {
    padding: 28px;
}


.about-description {
    max-width: 420px;

    color: var(--paper-soft);

    font-size: 13px;

    line-height: 1.65;
}


.about-section {
    margin-top: 22px;

    padding-top: 16px;

    border-top: 1px solid var(--line);
}


.about-section-title {
    margin-bottom: 10px;

    color: var(--orbit-bright-cyan);

    font-family: "DM Mono", monospace;

    font-size: 8px;

    letter-spacing: 0.08em;
}


.tech-list {
    display: flex;

    flex-wrap: wrap;

    gap: 6px;
}


.tech-list span {
    padding: 6px 8px;

    background: #20211c;

    border: 1px solid var(--orbit-sky);

    border-radius: 5px;

    color: var(--orbit-cyan);

    font-family: "DM Mono", monospace;

    font-size: 8px;
}


.about-text {
    max-width: 430px;

    color: var(--paper-dim);

    font-size: 12px;

    line-height: 1.6;
}


.about-footer {
    display: flex;

    justify-content: space-between;

    margin-top: 24px;

    padding-top: 12px;

    border-top: 1px solid var(--line);

    color: var(--paper-dim);

    font-family: "DM Mono", monospace;

    font-size: 8px;
}


/* =========================================
   HOME / ABOUT MOBILE
========================================= */

@media (max-width: 700px) {

    .home-stats {
        grid-template-columns:
            repeat(3, 1fr);
    }

}


@media (max-width: 420px) {

    .home-stats {
        grid-template-columns: 1fr;
    }


    .home-stat {
        min-height: 50px;
    }

}