* {
    box-sizing: border-box;
}

:root {
    --terminal-green: #00ff00;
    --terminal-green-soft: rgba(0, 255, 0, 0.15);
    --terminal-green-faint: rgba(0, 255, 0, 0.08);
    --terminal-green-bright: #b8ffb8;
    --terminal-glow: 0 0 2px rgba(0, 255, 0, 0.72), 0 0 8px rgba(0, 255, 0, 0.22);
    --terminal-glow-peak: 0 0 2px rgba(0, 255, 0, 0.9), 0 0 12px rgba(0, 255, 0, 0.32);
    --black: #000;
    --panel: #111;
}

body[data-theme="red"] {
    --terminal-green: #ff3030;
    --terminal-green-soft: rgba(255, 48, 48, 0.16);
    --terminal-green-faint: rgba(255, 48, 48, 0.08);
    --terminal-green-bright: #ffb3b3;
    --terminal-glow: 0 0 2px rgba(255, 48, 48, 0.72), 0 0 8px rgba(255, 48, 48, 0.24);
    --terminal-glow-peak: 0 0 2px rgba(255, 90, 90, 0.95), 0 0 14px rgba(255, 48, 48, 0.36);
}

body[data-theme="pink"] {
    --terminal-green: #ff4dff;
    --terminal-green-soft: rgba(255, 77, 255, 0.17);
    --terminal-green-faint: rgba(255, 77, 255, 0.09);
    --terminal-green-bright: #ffd1ff;
    --terminal-glow: 0 0 2px rgba(255, 77, 255, 0.72), 0 0 10px rgba(255, 77, 255, 0.25);
    --terminal-glow-peak: 0 0 2px rgba(255, 150, 255, 0.95), 0 0 16px rgba(255, 77, 255, 0.4);
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--black);
    color: var(--terminal-green);
    font-family: "Courier New", monospace;
    text-shadow: var(--terminal-glow);
    animation: terminal-shimmer 7s ease-in-out infinite;
}

body::before,
body::after,
.screen::before,
.screen::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.03),
        rgba(255, 255, 255, 0.03) 1px,
        transparent 2px,
        transparent 4px
    );
}

body::after {
    background: repeating-linear-gradient(
        transparent 0,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 2px
    );
    opacity: 0.25;
}

.screen {
    position: relative;
    width: min(90vw, 1400px);
    height: min(85vh, 900px);
    overflow: hidden;
    transform: perspective(1200px) rotateX(1deg);
    border: 4px solid #0a0a0a;
    border-radius: 24px;
    background: var(--black);
    box-shadow:
        inset 0 0 80px var(--terminal-green-faint),
        inset 0 0 150px rgba(0, 0, 0, 0.8),
        0 0 30px var(--terminal-green-soft);
}

.screen::before,
.screen::after {
    position: absolute;
}

.screen::before {
    background: radial-gradient(
        ellipse at center,
        transparent 48%,
        rgba(0, 0, 0, 0.42) 100%
    );
}

.screen::after {
    background: radial-gradient(
        ellipse at center,
        transparent 65%,
        rgba(0, 0, 0, 0.35) 100%
    );
    box-shadow: inset 0 0 100px rgba(255, 255, 255, 0.05);
}

.crt-frame {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 20px;
    overflow: hidden;
    border-radius: 18px;
    background: var(--panel);
    box-shadow:
        inset 0 0 25px var(--black),
        0 0 50px rgba(0, 0, 0, 0.8);
}

.status-logo {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 2;
    max-width: calc(100% - 60px);
    opacity: 0.88;
    color: var(--terminal-green);
}

.status-logo pre,
.terminal,
.module-panel pre {
    margin: 0;
}

.status-logo pre {
    width: max-content;
    white-space: pre;
    font-size: 14px;
    line-height: 1.18;
}

.terminal {
    width: 100%;
    white-space: pre-wrap;
    height: 100%;
    padding-right: min(520px, 42vw);
    overflow: auto;
    scrollbar-color: var(--terminal-green-soft) transparent;
    font-size: 18px;
    line-height: 1.4;
}

.module-panel {
    position: absolute;
    left: 20px;
    bottom: 20px;
    z-index: 2;
    width: min(680px, calc(100% - 520px));
    max-height: calc(100% - 70px);
    padding: 18px;
    overflow: auto;
    border: 1px solid currentColor;
    background: rgba(0, 0, 0, 0.32);
    scrollbar-color: var(--terminal-green-soft) transparent;
}

.module-panel[hidden] {
    display: none;
}

.module-title {
    margin: 0 0 18px;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 400;
}

.module-grid {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
}

.module-row {
    display: grid;
    grid-template-columns: minmax(130px, 180px) 1fr;
    gap: 16px;
    font-size: 14px;
    line-height: 1.35;
}

.progress-readout {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
    font-size: 14px;
}

.progress-value {
    font-size: 28px;
    line-height: 1;
}

.progress-track {
    position: relative;
    height: 24px;
    overflow: hidden;
    border: 1px solid currentColor;
    background: var(--terminal-green-faint);
}

.progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--progress, 0%);
    background: linear-gradient(
        90deg,
        var(--terminal-green-soft),
        color-mix(in srgb, var(--terminal-green) 55%, transparent),
        color-mix(in srgb, var(--terminal-green-bright) 72%, transparent)
    );
}

.progress-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent 0,
        transparent 9px,
        rgba(0, 0, 0, 0.24) 10px,
        rgba(0, 0, 0, 0.24) 12px
    );
}

.module-log {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.45;
}

.module-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.terminal-button,
.contact-form button {
    padding: 7px 10px;
    border: 1px solid currentColor;
    background: rgba(0, 0, 0, 0.2);
    color: inherit;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.terminal-button:hover,
.terminal-button:focus-visible,
.contact-form button:hover,
.contact-form button:focus-visible {
    outline: none;
    background: var(--terminal-green-soft);
    color: var(--terminal-green-bright);
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 16px;
}

.contact-form input {
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid currentColor;
    background: rgba(0, 0, 0, 0.34);
    color: inherit;
    font: inherit;
    font-size: 12px;
    text-shadow: inherit;
}

.contact-form input:focus-visible {
    outline: none;
    background: var(--terminal-green-faint);
}

.network-map {
    margin-top: 18px;
    white-space: pre;
    font-size: 13px;
    line-height: 1.18;
    overflow-x: auto;
}

.glitch-event {
    position: absolute;
    left: 20px;
    top: 20px;
    z-index: 5;
    max-width: min(620px, calc(100% - 420px));
    padding: 8px 10px;
    border: 1px solid currentColor;
    background: rgba(0, 0, 0, 0.62);
    font-size: 13px;
    line-height: 1.3;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

.glitch-event.is-visible {
    opacity: 1;
    transform: translateY(0);
    animation: glitch-pulse 420ms steps(2, end) infinite;
}

.boot-screen {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.92);
    transition: opacity 420ms ease, visibility 420ms ease;
}

.boot-screen.is-complete {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.boot-screen pre {
    width: min(620px, 100%);
    margin: 0;
    white-space: pre-wrap;
    font-size: 18px;
    line-height: 1.55;
}

.theme-switcher {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 10px;
    padding: 6px;
    border: 1px solid currentColor;
    background: rgba(0, 0, 0, 0.22);
}

.theme-switcher button {
    min-width: 0;
    padding: 6px 4px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 10px;
    line-height: 1.2;
    cursor: pointer;
}

.theme-switcher button:hover,
.theme-switcher button:focus-visible,
.theme-switcher button.is-active {
    outline: none;
    background: var(--terminal-green-soft);
    color: var(--terminal-green-bright);
}

.mobile-menu-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 6;
    display: none;
    width: 42px;
    height: 38px;
    padding: 8px;
    border: 1px solid currentColor;
    background: var(--black);
    color: inherit;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 4px 0;
    background: currentColor;
    box-shadow: var(--terminal-glow);
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible,
.mobile-menu-toggle.is-open {
    outline: none;
    background: var(--terminal-green-soft);
    color: var(--terminal-green-bright);
}

.sidebar {
    position: absolute;
    top: 235px;
    right: 30px;
    z-index: 3;
    width: 170px;
}

.menu {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid currentColor;
    background: rgba(0, 0, 0, 0.28);
}

.menu button {
    display: block;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 12px;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}

.menu button:hover,
.menu button:focus-visible,
.menu button.is-active {
    outline: none;
    background: var(--terminal-green-soft);
    color: var(--terminal-green-bright);
}

.cursor {
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

@keyframes terminal-shimmer {
    0%,
    100% {
        text-shadow: var(--terminal-glow);
    }

    45%,
    55% {
        text-shadow: var(--terminal-glow-peak);
    }
}

@keyframes glitch-pulse {
    0% {
        clip-path: inset(0 0 18% 0);
    }

    50% {
        clip-path: inset(16% 0 0 0);
    }

    100% {
        clip-path: inset(0 0 0 0);
    }
}

@media (min-width: 1800px) {
    body {
        padding: 32px;
    }

    .screen {
        width: min(92vw, 1760px);
        height: min(88vh, 1100px);
    }

    .crt-frame {
        padding: 28px;
    }

    .status-logo {
        top: 38px;
        right: 38px;
    }

    .status-logo pre {
        font-size: 15px;
    }

    .terminal {
        padding-right: min(610px, 38vw);
        font-size: 20px;
    }

    .module-panel {
        left: 28px;
        bottom: 28px;
        width: min(820px, calc(100% - 640px));
        padding: 22px;
    }

    .module-title {
        font-size: 20px;
    }

    .module-row,
    .progress-readout,
    .module-log {
        font-size: 15px;
    }

    .progress-value {
        font-size: 32px;
    }

    .progress-track {
        height: 28px;
    }

    .network-map {
        font-size: 14px;
    }

    .sidebar {
        top: 258px;
        right: 38px;
        width: 190px;
    }

    .menu button {
        padding: 8px 10px;
        font-size: 13px;
    }

    .theme-switcher button {
        font-size: 11px;
    }
}


@media (min-width: 3000px) {
    body {
        padding: 48px;
    }

    .screen {
        width: min(88vw, 2600px);
        height: min(86vh, 1500px);
        border-width: 6px;
        border-radius: 32px;
    }

    .crt-frame {
        padding: 40px;
        border-radius: 24px;
    }

    .status-logo {
        top: 52px;
        right: 52px;
    }

    .status-logo pre {
        font-size: 20px;
        line-height: 1.16;
    }

    .terminal {
        padding-right: min(850px, 34vw);
        font-size: 24px;
        line-height: 1.42;
    }

    .module-panel {
        left: 40px;
        bottom: 40px;
        width: min(1080px, calc(100% - 900px));
        padding: 30px;
    }

    .module-title {
        font-size: 26px;
        margin-bottom: 24px;
    }

    .module-grid {
        gap: 14px;
        margin-bottom: 24px;
    }

    .module-row,
    .progress-readout,
    .module-log {
        font-size: 18px;
    }

    .progress-value {
        font-size: 42px;
    }

    .progress-track {
        height: 36px;
    }

    .network-map {
        font-size: 18px;
    }

    .terminal-button,
    .contact-form button,
    .contact-form input,
    .menu button,
    .theme-switcher button {
        font-size: 16px;
    }

    .sidebar {
        top: 370px;
        right: 52px;
        width: 250px;
    }

    .menu,
    .theme-switcher {
        gap: 8px;
        padding: 14px;
    }

    .menu button {
        padding: 11px 14px;
    }

    .glitch-event {
        left: 40px;
        top: 40px;
        max-width: min(920px, calc(100% - 900px));
        font-size: 18px;
    }
}

@media (max-width: 1180px) {
    body {
        padding: 16px;
    }

    .screen {
        width: min(96vw, 1120px);
        height: min(88vh, 860px);
    }

    .crt-frame {
        padding: 16px;
    }

    .status-logo {
        top: 24px;
        right: 24px;
    }

    .status-logo pre {
        font-size: 12px;
    }

    .terminal {
        padding-right: min(390px, 38vw);
        font-size: 16px;
        line-height: 1.36;
    }

    .module-panel {
        left: 16px;
        bottom: 16px;
        width: min(560px, calc(100% - 410px));
        max-height: calc(100% - 48px);
        padding: 14px;
    }

    .module-title {
        font-size: 16px;
    }

    .module-row,
    .progress-readout,
    .module-log {
        font-size: 13px;
    }

    .network-map {
        font-size: 12px;
    }

    .sidebar {
        top: 202px;
        right: 24px;
        width: 158px;
    }

    .menu button,
    .theme-switcher button {
        font-size: 11px;
    }
}


@media (min-width: 761px) and (max-width: 980px) {
    body {
        padding: 14px;
    }

    .screen {
        width: 100%;
        height: calc(100vh - 28px);
        transform: none;
    }

    .crt-frame {
        padding: 16px;
    }

    .status-logo {
        position: static;
        max-width: calc(100% - 56px);
        overflow-x: auto;
        margin-bottom: 18px;
    }

    .status-logo pre {
        font-size: 13px;
    }

    .terminal {
        height: calc(100% - 180px);
        padding-right: 0;
        font-size: 15px;
    }

    .module-panel {
        left: 16px;
        right: 16px;
        bottom: 84px;
        width: auto;
        max-height: calc(100% - 250px);
    }

    .sidebar {
        left: 16px;
        right: 16px;
        bottom: 16px;
        top: auto;
        width: auto;
    }

    .menu {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .theme-switcher {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 8px;
    }

    .menu button {
        text-align: center;
        font-size: 12px;
    }

    .glitch-event {
        left: 16px;
        right: 16px;
        top: 16px;
        max-width: none;
    }
}

@media (max-width: 760px) {
    body {
        padding: 12px;
    }

    .screen {
        width: 100%;
        height: calc(100vh - 24px);
        transform: none;
    }

    .crt-frame {
        padding: 14px;
    }

    .status-logo {
        position: static;
        max-width: calc(100% - 56px);
        overflow-x: auto;
        margin-bottom: 18px;
    }

    .status-logo pre {
        font-size: clamp(10px, 2.8vw, 14px);
    }

    .terminal {
        height: calc(100% - 142px);
        padding-right: 0;
        font-size: 14px;
        line-height: 1.35;
    }

    .module-panel {
        left: 14px;
        right: 14px;
        bottom: 76px;
        width: auto;
        max-height: calc(100% - 230px);
        padding: 12px;
    }

    .module-title {
        font-size: 15px;
    }

    .module-row {
        grid-template-columns: 1fr;
        gap: 2px;
        font-size: 12px;
    }

    .progress-readout {
        font-size: 12px;
    }

    .progress-value {
        font-size: 22px;
    }

    .contact-form {
        grid-template-columns: 1fr;
    }

    .network-map {
        font-size: 11px;
    }

    .glitch-event {
        left: 14px;
        right: 14px;
        top: 14px;
        max-width: none;
        font-size: 11px;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .sidebar {
        left: auto;
        right: 14px;
        top: 62px;
        bottom: auto;
        width: min(220px, calc(100% - 28px));
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
        background: var(--black);
        box-shadow: 0 0 22px rgba(0, 0, 0, 0.86), 0 0 18px var(--terminal-green-soft);
        transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
    }

    .sidebar.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .menu {
        grid-template-columns: 1fr;
        padding: 6px;
        background: var(--black);
    }

    .menu button {
        padding: 8px 8px;
        text-align: left;
        font-size: 11px;
    }

    .theme-switcher {
        margin-top: 6px;
        padding: 5px;
        background: var(--black);
    }

    .theme-switcher button {
        font-size: 9px;
    }

    .boot-screen pre {
        font-size: 14px;
    }
}


@media (max-width: 430px) {
    body {
        padding: 8px;
    }

    .screen {
        height: calc(100vh - 16px);
        border-width: 3px;
        border-radius: 18px;
    }

    .crt-frame {
        padding: 10px;
        border-radius: 13px;
    }

    .status-logo {
        max-width: calc(100% - 48px);
        margin-bottom: 12px;
    }

    .status-logo pre {
        font-size: 9px;
    }

    .terminal {
        height: calc(100% - 118px);
        font-size: 12px;
    }

    .module-panel {
        left: 10px;
        right: 10px;
        bottom: 68px;
        max-height: calc(100% - 190px);
        padding: 10px;
    }

    .module-title {
        margin-bottom: 12px;
        font-size: 13px;
    }

    .module-log,
    .module-row,
    .progress-readout,
    .terminal-button,
    .contact-form button,
    .contact-form input {
        font-size: 11px;
    }

    .progress-track {
        height: 20px;
    }

    .network-map {
        font-size: 9px;
    }

    .mobile-menu-toggle {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 34px;
        padding: 6px;
    }

    .sidebar {
        right: 10px;
        top: 52px;
        width: min(200px, calc(100% - 20px));
    }

    .menu {
        gap: 2px;
        padding: 5px;
    }

    .menu button {
        padding: 7px 6px;
        font-size: 9px;
    }

    .theme-switcher button {
        padding: 6px 2px;
        font-size: 8px;
    }

    .boot-screen {
        padding: 14px;
    }

    .boot-screen pre {
        font-size: 12px;
    }
}


