/* =========================
   ~/informatica — estilo de terminal
   Paleta inspirada en editores de código reales (no verde-neón de peli de hacker):
   fondo "circuit-slate" casi negro, verde menta para prompts/enlaces, ambar para
   énfasis, lila apagado para comentarios/meta — como un tema de sintaxis real.
   ========================= */

:root {
    --term-bg: #0b0f14;
    --term-panel: #10151c;
    --term-border: #1f2733;
    --term-green: #6ee7b7;
    --term-amber: #f6ad55;
    --term-purple: #c792ea;
    --term-red: #f47174;
    --term-text: #d7dee5;
    --term-muted: #6b7684;
}

* {
    box-sizing: border-box;
}

body.term {
    margin: 0;
    background-color: var(--term-bg);
    color: var(--term-text);
    font-family: "JetBrains Mono", "Fira Code", ui-monospace, Consolas, monospace;
    font-size: 15px;
    line-height: 1.6;
}

::selection {
    background-color: var(--term-green);
    color: #0b0f14;
}

a {
    color: var(--term-green);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--term-amber);
    outline-offset: 2px;
}


/* TEXTURA DE PANTALLA (muy sutil, no anima para no distraer/por accesibilidad) */

.term-scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.015) 0px,
        rgba(255, 255, 255, 0.015) 1px,
        transparent 1px,
        transparent 3px
    );
}


/* BARRA SUPERIOR */

.term-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;

    padding: 20px 40px;
    border-bottom: 1px solid var(--term-border);
}

.term-topbar-brand {
    color: var(--term-text);
    text-decoration: none;
    font-weight: 700;
}

.term-topbar-nav {
    display: flex;
    flex-wrap: wrap;
    row-gap: 6px;
    gap: 18px;
}

.term-topbar-nav a {
    color: var(--term-muted);
    text-decoration: none;
    font-size: 14px;
}

.term-topbar-nav a:hover {
    color: var(--term-green);
}


/* CONTENIDO */

.term-main {
    max-width: 780px;
    margin: 0 auto;
    padding: 48px 20px 100px;
}

.term-main > section + section,
.term-main > p {
    margin-top: 32px;
}


/* VENTANA DE TERMINAL (hero) */

.term-window {
    background-color: var(--term-panel);
    border: 1px solid var(--term-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.term-window-bar {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 12px 16px;
    background-color: #0d1219;
    border-bottom: 1px solid var(--term-border);
}

.term-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.term-dot-red { background-color: #f47174; }
.term-dot-amber { background-color: #f6ad55; }
.term-dot-green { background-color: #6ee7b7; }

.term-window-title {
    margin-left: 8px;
    color: var(--term-muted);
    font-size: 13px;
}

.term-window-body {
    padding: 24px;
    min-height: 148px;
}

.term-window-body p {
    margin: 0 0 10px;
    white-space: pre-wrap;
}

.term-prompt {
    color: var(--term-green);
    font-weight: 700;
}

.term-out {
    color: var(--term-purple);
}


/* CURSOR PARPADEANTE */

.term-cursor {
    display: inline-block;
    background-color: var(--term-green);
    color: var(--term-green);
    width: 8px;
    animation: term-blink 1s steps(1) infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .term-cursor {
        animation: none;
    }
}

.term-cursor-line {
    color: var(--term-muted);
}


/* BUSCADOR */

.term-search-form {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 4px;
    font-size: 15px;
}

.term-search-cmd {
    color: var(--term-purple);
    white-space: nowrap;
}

.term-search {
    flex: 1;
    min-width: 0;
    max-width: 360px;

    background-color: var(--term-panel);
    border: 1px solid var(--term-border);
    border-radius: 3px;
    padding: 6px 10px;

    color: var(--term-text);
    font-family: "JetBrains Mono", monospace;
    font-size: 14px;
}

.term-search::placeholder {
    color: var(--term-muted);
}

.term-search:focus {
    outline: none;
    border-color: var(--term-green);
}


/* PANELES ls -la */

.term-panel-head {
    color: var(--term-muted);
    margin-bottom: 12px;
}

.term-panel-head .term-prompt {
    margin-right: 4px;
}

.term-panel-body {
    border: 1px solid var(--term-border);
    border-radius: 8px;
    overflow: hidden;
}

.term-row {
    position: relative;
    display: grid;
    grid-template-columns: 11ch 1fr auto auto;
    grid-template-areas:
        "perm name date copy"
        "gap  desc desc copy";
    column-gap: 16px;
    row-gap: 2px;
    align-items: baseline;

    padding: 12px 16px;
    color: var(--term-text);
    border-bottom: 1px solid var(--term-border);

    transition: background-color 0.1s ease;
}

.term-panel-body .term-row:last-child {
    border-bottom: none;
}

.term-row-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.term-row:hover {
    background-color: rgba(110, 231, 183, 0.06);
}

.term-row-perm {
    grid-area: perm;
    color: var(--term-muted);
    font-size: 13px;
}

.term-row-name {
    grid-area: name;
    color: var(--term-green);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.term-row-title {
    grid-area: desc;
    color: var(--term-muted);
    font-size: 13px;
}

.term-row-copy {
    position: relative;
    z-index: 2;
    grid-area: copy;
    align-self: center;

    width: 26px;
    height: 26px;
    padding: 0;

    background-color: var(--term-panel);
    border: 1px solid var(--term-border);
    border-radius: 3px;

    color: var(--term-green);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.1s ease;
}

.term-row-copy:hover {
    border-color: var(--term-green);
}

.term-row-date,
.term-row-action {
    grid-area: date;
    justify-self: end;
    color: var(--term-amber);
    font-size: 13px;
    white-space: nowrap;
}

.term-empty {
    padding: 16px;
    margin: 0;
    color: var(--term-red);
    font-size: 14px;
}


@media (max-width: 640px) {

    .term-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 20px;
    }

    .term-topbar-nav {
        gap: 16px;
        flex-wrap: wrap;
    }

    .term-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "perm"
            "name"
            "desc"
            "date"
            "copy";
        row-gap: 4px;
    }

    .term-row-date,
    .term-row-action {
        justify-self: start;
    }

    .term-row-copy {
        justify-self: start;
    }

}
