:root {
    --accent: #33ff66;
    --accent-bright: #b7ffcb;
    --accent-dim: rgba(51, 255, 102, 0.14);
    --accent-glow: rgba(51, 255, 102, 0.28);
    --danger: #ff4455;
    --warn: #ffd166;
    --muted: #5c6b60;
    --bg: #0b0d0c;
    --panel: #101412;
    --line: #233229;
    --text: #d8f5e0;
    --shadow: rgba(51, 255, 102, 0.18);
}
body[data-theme="amber"] {
    --accent: #ffb000;
    --accent-bright: #ffe9b0;
    --accent-dim: rgba(255, 176, 0, 0.14);
    --accent-glow: rgba(255, 176, 0, 0.3);
    --muted: #6b5f42;
    --bg: #0d0c0a;
    --panel: #14120f;
    --line: #332c1e;
    --text: #f8eed6;
    --shadow: rgba(255, 176, 0, 0.18);
}

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

body {
    font-family: "JetBrains Mono", "Cascadia Code", "Fira Code", "DejaVu Sans Mono", monospace;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
}

::selection {
    background: var(--accent);
    color: #000;
}

::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--line);
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

canvas#matrixCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.14;
}

.scanlines {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.28) 0px,
        rgba(0, 0, 0, 0.28) 1px,
        transparent 1px,
        transparent 3px
    );
    opacity: 0.6;
}

.vignette {
    position: fixed;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

.container {
    position: relative;
    z-index: 10;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

.menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding: 18px 24px;
    margin-top: 24px;
    background: var(--panel);
    border: 2px solid var(--line);
    box-shadow: 6px 6px 0 0 var(--shadow);
    position: sticky;
    top: 16px;
    z-index: 50;
}

.logo {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 1px;
    user-select: none;
    white-space: nowrap;
}
.logo .sq {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--accent);
    margin-right: 10px;
    vertical-align: -1px;
    box-shadow: 0 0 12px var(--accent-glow);
    animation: blink 1s steps(1) infinite;
}
.logo span {
    color: var(--accent);
}
.logo .path {
    color: var(--muted);
    font-weight: 400;
    font-size: 13px;
    margin-left: 10px;
}

.nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 14px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}
.nav a::before {
    content: "[";
    color: var(--accent);
}
.nav a::after {
    content: "]";
    color: var(--accent);
}
.nav a:hover,
.nav a.active {
    color: var(--text);
    border-color: var(--line);
    background: var(--accent-dim);
    box-shadow: 3px 3px 0 0 var(--shadow);
}

.controls {
    display: flex;
    gap: 10px;
}
.ctrl-btn {
    font-family: inherit;
    font-size: 13px;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.ctrl-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 3px 3px 0 0 var(--shadow);
}
.ctrl-btn.active {
    color: var(--danger);
    border-color: var(--danger);
}

.hero {
    margin-top: 72px;
    border: 2px solid var(--line);
    background: var(--panel);
    box-shadow: 8px 8px 0 0 var(--shadow);
}

.term-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 2px solid var(--line);
    font-size: 12px;
    color: var(--muted);
    background: var(--bg);
}
.term-head .title {
    color: var(--text);
}
.term-head .dots span {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 6px;
    background: var(--line);
}
.term-head .dots span:first-child {
    background: var(--danger);
}
.term-head .dots span:nth-child(2) {
    background: var(--warn);
}
.term-head .dots span:last-child {
    background: var(--accent);
}

.term-body {
    padding: 36px 40px 44px;
    overflow-x: auto;
}

.ascii {
    font-size: 13px;
    line-height: 1.1;
    color: var(--accent);
    text-shadow: 0 0 18px var(--accent-glow);
    user-select: none;
    white-space: pre;
    margin-bottom: 30px;
}
.ascii .r {
    color: var(--danger);
    text-shadow: 0 0 14px rgba(255, 68, 85, 0.5);
}
.ascii .muted {
    color: var(--muted);
    text-shadow: none;
    font-size: 12px;
}

.h1-line {
    font-size: clamp(28px, 5vw, 52px);
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.15;
    margin-bottom: 22px;
    white-space: nowrap;
}
.h1-line .blink {
    display: inline-block;
    width: 0.7ch;
    height: 0.95em;
    background: var(--accent);
    vertical-align: -0.08em;
    margin-left: 6px;
    animation: blink 1s steps(1) infinite;
}
.h1-line .dim {
    color: var(--muted);
}

.log {
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.9;
}
.log .ln {
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 1.9em;
}
.log .prompt {
    color: var(--accent);
}
.log .prompt::before {
    content: "$ ";
}
.log .ok {
    color: var(--accent);
}
.log .muted {
    color: var(--muted);
}
.log .err {
    color: var(--danger);
}
.log .cursor {
    display: inline-block;
    width: 0.6ch;
    height: 1.1em;
    background: var(--accent);
    vertical-align: -0.15em;
    animation: blink 1s steps(1) infinite;
}

.section {
    margin-top: 90px;
}
.section h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 6px;
}
.section h2::before {
    content: "> ";
}
.section .rule {
    height: 2px;
    background: var(--line);
    margin: 14px 0 32px;
    position: relative;
}
.section .rule::after {
    content: "";
    position: absolute;
    left: 0;
    top: -2px;
    width: 120px;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 26px;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    background: var(--panel);
    border: 2px solid var(--line);
    color: var(--text);
    text-decoration: none;
    transition: all 0.15s ease;
    position: relative;
}
.card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 6px 6px 0 0 var(--shadow);
    border-color: var(--accent);
}
.card:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}
.card .icon {
    font-size: 26px;
    color: var(--accent);
    user-select: none;
    text-shadow: 0 0 14px var(--accent-glow);
}
.card h3 {
    font-size: 17px;
    letter-spacing: 1px;
}
.card h3 .dot {
    color: var(--accent);
}
.card p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
    flex-grow: 1;
}
.card .status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    letter-spacing: 1px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}
.card .status .led {
    width: 9px;
    height: 9px;
    background: var(--line);
}
.card .status.online .led {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    animation: blink 1.6s steps(1) infinite;
}
.card .status.building .led {
    background: var(--warn);
}
.card .status .tag {
    color: var(--muted);
}
.card .status.online .tag {
    color: var(--accent);
}
.card .arrow {
    margin-left: auto;
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.15s ease;
}
.card:hover .arrow {
    opacity: 1;
}

.status-term {
    border: 2px solid var(--line);
    background: var(--panel);
    box-shadow: 8px 8px 0 0 var(--shadow);
    padding: 26px 30px;
    font-size: 14px;
    line-height: 2;
    overflow-x: auto;
}
.status-term .row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    white-space: nowrap;
}
.status-term .k {
    color: var(--muted);
    min-width: 150px;
}
.status-term .v {
    color: var(--text);
}
.status-term .v.ok {
    color: var(--accent);
}
.status-term .v.warn {
    color: var(--warn);
}

footer {
    margin-top: 110px;
    padding: 26px 0 40px;
    border-top: 2px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
}
footer .heart {
    color: var(--danger);
}

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

@media (max-width: 720px) {
    .menu {
        padding: 14px 16px;
        position: static;
    }
    .hero {
        margin-top: 40px;
    }
    .term-body {
        padding: 24px 18px 30px;
    }
    .h1-line {
        white-space: normal;
    }
    .ascii {
        font-size: 10px;
    }
    footer {
        justify-content: center;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .logo .sq,
    .h1-line .blink,
    .log .cursor,
    .card .status.online .led {
        animation: none;
    }
}
