/* =========================================================
   CVEWORKS - LINUX SIMULATOR
   Light / Red / White visual identity
   Terminal remains dark by design
========================================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: #f7f7f8;
    color: #202124;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

/* =========================================================
   TERMINAL FEEDBACK
   Discreet text directly below the terminal
========================================================= */

.terminal-feedback {
    margin-top: 8px;
    padding: 0 2px;

    color: #92969a;

    font-size: 11px;
    line-height: 1.5;

    text-align: right;
}

.terminal-feedback a {
    color: #c90000;

    font-weight: 600;

    text-decoration: none;
}

.terminal-feedback a:hover {
    text-decoration: underline;
}

/* =========================================================
 //  BUTTON DARK/LIGHT
========================================================= */

#themeButton.theme-light {
    background: #ffffff;
    color: #202124;
    border-color: #cfd1d4;
}

#themeButton.theme-light:hover {
    background: #f3f3f3;
    color: #202124;
    border-color: #bfc2c5;
}

#themeButton.theme-dark {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
}

#themeButton.theme-dark:hover {
    background: #2a2a2a;
    color: #ffffff;
    border-color: #2a2a2a;
}


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

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e5e7;
}

.header-content {
    height: 72px;

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

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    background: #c90000;
    color: #ffffff;

    border-radius: 8px;

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.logo-name {
    color: #202124;
}

.logo-name span {
    color: #c90000;
}

.navigation {
    display: flex;
    align-items: center;
    gap: 32px;
}

.navigation a {
    color: #5f6368;

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

    transition: color 0.2s ease;
}

.navigation a:hover {
    color: #c90000;
}


/* =========================================================
   ADVERTISING BANNERS
========================================================= */

.affiliate-banner {
    width: 100%;

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

    margin: 15px auto;

    overflow: hidden;
}

.affiliate-banner a {
    display: block;
    width: min(1136px, calc(100% - 40px));
}

.affiliate-banner img {
    display: block;

    width: 100%;
    max-width: 1136px;
    height: auto;

    margin: 0 auto;
}

.affiliate-banner-bottom {
    margin-top: 15px;
    margin-bottom: 15px;
}


/* =========================================================
   HERO
========================================================= */

.page-hero {
    padding: 55px 0 70px;
}

.page-heading {
    width: 100%;

    margin-bottom: 35px;

    text-align: center;
}

.section-label {
    display: inline-block;

    margin-bottom: 18px;
    padding: 9px 16px;

    color: #c90000;
    background: #ffffff;

    border: 1px solid #f3bcbc;
    border-radius: 999px;

    font-size: 12px;
    font-weight: 800;

    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.page-heading h1 {
    margin-bottom: 12px;

    color: #202124;

    font-size: clamp(38px, 5vw, 56px);
    line-height: 1.08;
    letter-spacing: -1.8px;
}

.page-heading h1 span {
    color: #d71920;
}

.page-heading p {
    max-width: 820px;
    margin: 0 auto;

    color: #5f6368;

    font-size: 17px;
    line-height: 1.7;
}


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

.terminal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    margin-bottom: 12px;
}

.status-area,
.toolbar-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;
}

.status {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    min-height: 34px;

    padding: 7px 11px;

    color: #55595d;
    background: #ffffff;

    border: 1px solid #dcdde0;
    border-radius: 7px;

    font-family:
        Consolas,
        Monaco,
        "Courier New",
        monospace;

    font-size: 12px;
}

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

    background: #2e9d50;

    border-radius: 50%;

    box-shadow:
        0 0 8px rgba(46, 157, 80, 0.45);
}

.status-dot.local {
    background: #d69a1f;

    box-shadow:
        0 0 8px rgba(214, 154, 31, 0.45);
}

.tool-button {
    min-height: 36px;

    padding: 0 13px;

    color: #3c4043;
    background: #ffffff;

    border: 1px solid #cfd1d4;
    border-radius: 7px;

    font-size: 12px;
    font-weight: 700;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

.tool-button:hover {
    color: #c90000;
    border-color: #c90000;
}

.tool-button:active {
    transform: translateY(1px);
}

.tool-button.danger {
    color: #ffffff;
    background: #c90000;
    border-color: #c90000;
}

.tool-button.danger:hover {
    color: #ffffff;
    background: #a90000;
    border-color: #a90000;
}


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

.terminal-window {
    overflow: hidden;

    background: #090c0e;

    border: 1px solid #d7d8da;
    border-radius: 12px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08);
}


/* =========================================================
   TERMINAL CSS FULLSCREEN
   Keeps ESC available to Vim/vi because the browser
   Fullscreen API is intentionally not used.
========================================================= */

body.terminal-fullscreen-open {
    overflow: hidden;
}

.terminal-window.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 99999;

    width: 100vw;
    height: 100vh;

    margin: 0;

    border: 0;
    border-radius: 0;

    box-shadow: none;
}

.terminal-window.is-fullscreen .terminal-titlebar {
    flex: 0 0 44px;
}

.terminal-window.is-fullscreen .terminal {
    height: calc(100vh - 44px);
    max-height: none;
}


.terminal-titlebar {
    position: relative;

    height: 44px;

    display: flex;
    align-items: center;

    padding: 0 15px;

    background: #1c2024;

    border-bottom: 1px solid #30353a;
}

.window-buttons {
    display: flex;
    gap: 8px;
}

.window-button {
    width: 12px;
    height: 12px;

    border-radius: 50%;
}

.window-close {
    background: #ff5f57;
}

.window-minimize {
    background: #febc2e;
}

.window-maximize {
    background: #28c840;
}

.terminal-title {
    position: absolute;

    left: 50%;

    transform: translateX(-50%);

    color: #a9afb4;

    font-family:
        Consolas,
        Monaco,
        "Courier New",
        monospace;

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

    white-space: nowrap;
}


.terminal-fullscreen-button {
    position: absolute;
    top: 50%;
    right: 12px;

    width: 30px;
    height: 30px;

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

    transform: translateY(-50%);

    color: #a9afb4;
    background: transparent;

    border: 1px solid transparent;
    border-radius: 6px;

    font-size: 17px;
    line-height: 1;

    cursor: pointer;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
}

.terminal-fullscreen-button:hover {
    color: #ffffff;
    background: #2a3035;
    border-color: #3a4248;
}

.terminal-fullscreen-button:active {
    transform: translateY(-50%) scale(0.94);
}

.terminal-fullscreen-button:focus-visible {
    outline: 2px solid #75baff;
    outline-offset: 2px;
}

.terminal {
    position: relative;

    height: 640px;

    overflow-y: auto;

    padding: 20px 21px 28px;

    color: #d7d7d7;
    background: #090c0e;

    font-family:
        "Cascadia Code",
        "Fira Code",
        Consolas,
        Monaco,
        "Courier New",
        monospace;

    font-size: 14px;
    line-height: 1.55;

    cursor: text;

    scrollbar-color: #41464b #090c0e;
    scrollbar-width: thin;
}

.terminal::-webkit-scrollbar,
.vim-buffer::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.terminal::-webkit-scrollbar-track,
.vim-buffer::-webkit-scrollbar-track {
    background: #090c0e;
}

.terminal::-webkit-scrollbar-thumb,
.vim-buffer::-webkit-scrollbar-thumb {
    background: #41464b;

    border: 2px solid #090c0e;
    border-radius: 999px;
}

.terminal-line {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.terminal-output {
    color: #c6c9cc;
}

.terminal-error {
    color: #ff656d;
}

.terminal-warning {
    color: #f0bc4c;
}

.terminal-success {
    color: #60d394;
}

.terminal-info {
    color: #75baff;
}

.prompt-user,
.prompt-host {
    color: #4bd477;
    font-weight: 700;
}

.prompt-separator,
.prompt-symbol {
    color: #d7d7d7;
}

.prompt-path {
    color: #6096ff;
    font-weight: 700;
}

.input-row {
    display: flex;
    align-items: flex-start;

    min-height: 24px;
}

.prompt {
    flex: 0 0 auto;
    white-space: nowrap;
}

.terminal-input {
    flex: 1;

    min-width: 30px;

    margin: 0;
    padding: 0 0 0 7px;

    color: #ffffff;
    background: transparent;

    border: 0;
    outline: 0;

    caret-color: #ffffff;

    font: inherit;
    line-height: inherit;
}

.cursor-loading::after {
    content: "▋";

    margin-left: 3px;

    animation: blink 0.75s infinite;
}

@keyframes blink {

    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0;
    }

}



/* =========================================================
   TERMINAL LIGHT MODE
   Only the Linux terminal / Vim interface changes theme.
========================================================= */

.terminal-window.terminal-light {
    background: #ffffff;

    border-color: #d9dadd;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.07);
}

.terminal-window.terminal-light .terminal-titlebar {
    background: #f1f1f2;

    border-bottom-color: #d9dadd;
}

.terminal-window.terminal-light .terminal-title {
    color: #5f6368;
}


.terminal-window.terminal-light .terminal-fullscreen-button {
    color: #5f6368;
}

.terminal-window.terminal-light .terminal-fullscreen-button:hover {
    color: #202124;
    background: #e4e5e7;
    border-color: #cfd1d4;
}

.terminal-window.terminal-light .terminal {
    color: #202124;
    background: #ffffff;

    scrollbar-color: #c7c9cc #ffffff;
}

.terminal-window.terminal-light .terminal::-webkit-scrollbar-track,
.terminal-window.terminal-light .vim-buffer::-webkit-scrollbar-track {
    background: #ffffff;
}

.terminal-window.terminal-light .terminal::-webkit-scrollbar-thumb,
.terminal-window.terminal-light .vim-buffer::-webkit-scrollbar-thumb {
    background: #c7c9cc;

    border-color: #ffffff;
}

.terminal-window.terminal-light .terminal-output {
    color: #3c4043;
}

.terminal-window.terminal-light .terminal-error {
    color: #b00020;
}

.terminal-window.terminal-light .terminal-warning {
    color: #9a6700;
}

.terminal-window.terminal-light .terminal-success {
    color: #1e7c3a;
}

.terminal-window.terminal-light .terminal-info {
    color: #1769aa;
}

.terminal-window.terminal-light .prompt-user,
.terminal-window.terminal-light .prompt-host {
    color: #17823b;
}

.terminal-window.terminal-light .prompt-separator,
.terminal-window.terminal-light .prompt-symbol {
    color: #202124;
}

.terminal-window.terminal-light .prompt-path {
    color: #2457c5;
}

.terminal-window.terminal-light .terminal-input {
    color: #202124;

    caret-color: #202124;
}


/* Vim / vi light mode */

.terminal-window.terminal-light .vim-editor {
    background: #ffffff;
    color: #202124;
}

.terminal-window.terminal-light .vim-gutter {
    color: #8a8e92;
    background: #f5f5f6;

    border-right-color: #dedfe1;
}

.terminal-window.terminal-light .vim-buffer {
    background: #ffffff;
    color: #202124;

    caret-color: #202124;
}

.terminal-window.terminal-light .vim-buffer.vim-normal {
    caret-color: #17823b;
}

.terminal-window.terminal-light .vim-status {
    background: #e7e7e9;
    color: #202124;
}

.terminal-window.terminal-light .vim-mode {
    background: #5f6368;
    color: #ffffff;
}

.terminal-window.terminal-light .vim-mode.insert {
    background: #1769aa;
}

.terminal-window.terminal-light .vim-mode.command {
    background: #8a5a00;
}

.terminal-window.terminal-light .vim-commandline {
    background: #ffffff;
    color: #202124;

    border-top-color: #dedfe1;
}

.terminal-window.terminal-light .vim-command-input {
    color: #202124;
}

.terminal-window.terminal-light .vim-message {
    color: #202124;
    background: #ffffff;
}

.terminal-window.terminal-light .vim-message.error {
    color: #b00020;
}

.terminal-window.terminal-light .vim-message.info {
    color: #1769aa;
}

.terminal-window.terminal-light .vim-message.success {
    color: #1e7c3a;
}


/* =========================================================
   QUICK HELP
========================================================= */

.quick-help {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;

    margin-top: 24px;
}

.help-card {
    position: relative;

    overflow: hidden;

    min-height: 145px;

    padding: 20px;

    background: #ffffff;

    border: 1px solid #e1e2e4;
    border-radius: 10px;

    box-shadow:
        0 3px 15px rgba(0, 0, 0, 0.025);
}

.help-card {
    position: relative;

    overflow: hidden;

    min-height: 145px;

    padding: 20px;

    background: #ffffff;

    border: 1px solid #f3bcbc;
    border-radius: 10px;

    box-shadow:
        0 3px 15px rgba(0, 0, 0, 0.025);
}

.help-card h2 {
    margin-bottom: 11px;

    color: #202124;

    font-size: 15px;
    font-weight: 800;
}

.help-card p {
    color: #777b80;

    font-size: 13px;
    line-height: 1.65;
}

.help-card code {
    color: #c90000;

    font-family:
        Consolas,
        Monaco,
        monospace;

    font-size: 12px;
    font-weight: 700;
}


/* =========================================================
   VIM / VI EDITOR
========================================================= */

.vim-editor {
    position: absolute;

    inset: 0;
    z-index: 20;

    display: flex;
    flex-direction: column;

    background: #070a0c;
    color: #d7d7d7;

    font-family:
        "Cascadia Code",
        "Fira Code",
        Consolas,
        Monaco,
        "Courier New",
        monospace;

    font-size: 14px;
    line-height: 1.45;
}

.vim-buffer-wrap {
    position: relative;

    flex: 1;

    min-height: 0;

    display: flex;

    overflow: hidden;
}

.vim-gutter {
    flex: 0 0 auto;

    min-width: 48px;

    padding: 12px 8px 12px 6px;

    text-align: right;
    white-space: pre;

    color: #596168;
    background: #090d10;

    border-right: 1px solid #1d2429;

    user-select: none;

    overflow: hidden;
}

.vim-buffer {
    flex: 1;

    width: 100%;
    height: 100%;

    resize: none;

    margin: 0;
    padding: 12px 14px;

    border: 0;
    outline: 0;

    background: #070a0c;
    color: #d9dde0;

    caret-color: #ffffff;

    font: inherit;
    line-height: 1.45;

    tab-size: 4;
    white-space: pre;

    overflow: auto;
}

.vim-buffer.vim-normal {
    caret-color: #8bd450;
}

.vim-status {
    flex: 0 0 27px;

    height: 27px;

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

    gap: 12px;

    padding: 0 9px;

    background: #d7d7d7;
    color: #101315;

    font-size: 12px;
    font-weight: 700;
}

.vim-mode {
    display: inline-block;

    min-width: 76px;

    margin-right: 9px;
    padding: 2px 7px;

    background: #30373d;
    color: #ffffff;

    text-align: center;
}

.vim-mode.insert {
    background: #2878bd;
}

.vim-mode.command {
    background: #8b5a17;
}

.vim-commandline {
    height: 27px;

    display: flex;
    align-items: center;

    padding: 0 9px;

    background: #070a0c;
    color: #d7d7d7;

    border-top: 1px solid #151b1f;
}

.vim-command-input {
    flex: 1;

    min-width: 0;

    padding: 0 4px;

    border: 0;
    outline: 0;

    background: transparent;
    color: #ffffff;

    font: inherit;
}

.vim-message {
    height: 27px;

    padding: 4px 9px;

    color: #d7d7d7;
    background: #070a0c;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vim-message.error {
    color: #ff656d;
}

.vim-message.info {
    color: #75baff;
}

.vim-message.success {
    color: #60d394;
}

.vim-hidden {
    display: none !important;
}

.terminal.vim-active {
    overflow: hidden;
    padding: 0;
}

.terminal.vim-active > .input-row,
.terminal.vim-active > .terminal-line {
    visibility: hidden;
}


/* =========================================================
   HACKERDNA AFFILIATE
========================================================= */

.affiliate-section {
    padding: 64px 0;

    background: #f7f7f8;
}

.affiliate-box {
    position: relative;

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

    gap: 40px;

    padding: 38px 42px;

    background: #ffffff;

    border: 1px solid #e5e5e5;
    border-radius: 14px;

    box-shadow:
        0 3px 15px rgba(0, 0, 0, 0.035);

    overflow: hidden;
}

.affiliate-box::after {
    content: "";

    position: absolute;

    width: 260px;
    height: 260px;

    right: -120px;
    top: -130px;

    border-radius: 50%;

    background: #d71920;

    opacity: 0.035;

    pointer-events: none;
}

.affiliate-content {
    position: relative;
    z-index: 1;

    max-width: 760px;
}

.affiliate-content .section-label {
    margin-bottom: 0;
}

.affiliate-box h2 {
    margin-top: 12px;

    color: #171717;

    font-size: 28px;
    line-height: 1.2;
}

.affiliate-box p {
    margin-top: 8px;

    color: #686868;

    font-size: 14px;
    line-height: 1.7;
}

.affiliate-button {
    position: relative;
    z-index: 1;

    flex-shrink: 0;

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

    gap: 12px;

    min-height: 46px;

    padding: 0 20px;

    border-radius: 8px;

    background: #d71920;
    color: #ffffff;

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

    box-shadow:
        0 5px 16px rgba(215, 25, 32, 0.18);

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.affiliate-button:hover {
    background: #bd151b;

    transform: translateY(-1px);
}

.affiliate-button span {
    font-size: 18px;
}

.affiliate-disclosure {
    margin-top: 13px !important;

    color: #999999 !important;

    font-size: 11px !important;
    line-height: 1.5 !important;
}


/* =========================================================
   FOOTER
========================================================= */

.site-footer {
    background: #ffffff;

    border-top: 1px solid #e4e4e6;
}

.footer-bottom {
    border-top: 1px solid #eeeeef;
}

.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 18px 0;

    color: #92969a;

    font-size: 11px;
}

.footer-bottom-inner a {
    color: #c90000;
}

.footer-bottom-inner a:hover {
    text-decoration: underline;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .quick-help {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 820px) {

    .terminal-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .toolbar-buttons {
        width: 100%;
    }

    .terminal {
        height: 560px;

        font-size: 13px;
    }

}


@media (max-width: 700px) {

    .terminal-feedback {
        text-align: left;
    }

    .container {
        width: min(100% - 28px, 1180px);
    }

    .header-content {
        height: 64px;
    }

    .navigation {
        gap: 16px;
    }

    .page-hero {
        padding: 42px 0 52px;
    }

    .page-heading h1 {
        font-size: 38px;
    }

    .affiliate-banner a {
        width: min(100% - 28px, 1136px);
    }

    .affiliate-section {
        padding: 52px 0;
    }

    .affiliate-box {
        align-items: flex-start;
        flex-direction: column;

        gap: 22px;

        padding: 27px;
    }

    .affiliate-box h2 {
        font-size: 25px;
    }

    .affiliate-button {
        width: 100%;
    }

    .footer-bottom-inner {
        align-items: flex-start;
        flex-direction: column;
    }

}


@media (max-width: 620px) {

    .navigation a {
        font-size: 12px;
    }

    .logo-name {
        font-size: 18px;
    }

    .logo-mark {
        width: 36px;
        height: 36px;
    }

    .terminal-title {
        display: none;
    }


    .terminal-fullscreen-button {
        right: 9px;
    }

    .terminal {
        height: 520px;

        padding: 15px 13px 22px;

        font-size: 12px;
    }

    .toolbar-buttons {
        display: grid;

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

    .tool-button {
        width: 100%;
    }

    .quick-help {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 480px) {

    .page-heading h1 {
        font-size: 34px;
    }

    .page-heading p {
        font-size: 15px;
    }

    .status-area {
        width: 100%;
    }

}
