:root {
    color-scheme: dark;

    --background: #0d1117;
    --panel: #161b22;
    --panel-hover: #1b222c;
    --border: #30363d;

    --text: #e6edf3;
    --muted: #8b949e;
    --subtle: #6e7681;

    --green: #7ee787;
    --green-dark: #238636;

    --terminal: #090d11;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;

    background-color: var(--background);

    background-image:
        linear-gradient(
            rgba(48, 54, 61, 0.08) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(48, 54, 61, 0.08) 1px,
            transparent 1px
        );

    background-size:
        32px 32px,
        32px 32px;

    color: var(--text);

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

/* ============================================================
   Main page
   ============================================================ */

.portal {
    width: min(900px, calc(100% - 36px));
    margin: 0 auto;
    padding: 34px 0 26px;
}

/* ============================================================
   Hero
   ============================================================ */

.portal-header {
    margin-bottom: 30px;
    text-align: center;
}

.brand {
    color: var(--text);

    font-size: 52px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -4px;
}

.brand span {
    color: var(--green);
}

.tagline {
    margin-top: 10px;

    color: var(--green);

    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.19em;
}

.subtitle {
    margin: 7px 0 0;

    color: var(--muted);

    font-size: 13px;
}

/* ============================================================
   Portal tiles
   ============================================================ */

.tiles {
    display: grid;

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

    gap: 14px;

    margin-bottom: 20px;
}

.tile {
    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 225px;

    padding: 20px;

    background:
        rgba(22, 27, 34, 0.96);

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

    border-top:
        3px solid var(--green-dark);

    border-radius: 5px;

    color: var(--text);
    text-decoration: none;

    transition:
        transform 150ms ease,
        background 150ms ease,
        border-color 150ms ease,
        box-shadow 150ms ease;
}

.tile:hover {
    background: var(--panel-hover);

    border-color:
        var(--green-dark);

    transform:
        translateY(-2px);

    box-shadow:
        0 9px 26px rgba(0, 0, 0, 0.24),
        0 0 18px rgba(126, 231, 135, 0.055);
}

.tile:focus-visible {
    outline:
        2px solid var(--green);

    outline-offset: 3px;
}

.tile-icon {
    min-height: 48px;

    color: var(--green);

    font-family:
        Consolas,
        Monaco,
        monospace;

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

.code-icon {
    letter-spacing: -4px;
}

.tile-content {
    margin-top: auto;
}

.tile h2 {
    margin: 0 0 6px;

    color: var(--text);

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

.tile p {
    margin: 0 0 13px;

    color: var(--muted);

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

.tile-state {
    color: var(--green);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.13em;
}

/* ============================================================
   Captain's Log
   ============================================================ */

.captains-log {
    overflow: hidden;

    background:
        var(--terminal);

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

    border-radius: 5px;

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

.terminal-body {
    padding:
        17px 20px 18px;

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

    font-size: 12px;
    line-height: 1.55;
}

.terminal-entry {
    padding: 11px 0;

    border-bottom:
        1px solid rgba(48, 54, 61, 0.55);
}

.terminal-entry:first-child {
    padding-top: 0;
}

.terminal-entry:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.terminal-entry-heading {
    display: flex;
    align-items: baseline;

    flex-wrap: wrap;

    gap: 8px;
}

.terminal-entry time {
    color: var(--green);
}

.terminal-entry strong {
    color: var(--text);

    font-size: 12px;
    letter-spacing: 0.025em;
}

.terminal-entry p {
    margin:
        3px 0 0;

    color: var(--muted);

    line-height: 1.55;
}

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

/* ============================================================
   Footer
   ============================================================ */

footer {
    margin-top: 25px;

    color: var(--subtle);

    font-size: 11px;
    text-align: center;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 700px) {

    .portal {
        width:
            min(100% - 28px, 900px);

        padding-top: 27px;
    }

    .brand {
        font-size: 45px;
    }

    .tiles {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .tile {
        min-height: 155px;

        padding: 17px;
    }

    .tile-icon {
        min-height: 38px;

        font-size: 25px;
    }

    .terminal-body {
        padding:
            15px 16px;

        font-size: 11px;
    }
}

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

    .tile {
        transition: none;
    }
}

/* ============================================================
   Captain's Log - Six-row scrolling window
   ============================================================ */

.terminal-entries {
    --log-row-height: 58px;

    max-height:
        calc(var(--log-row-height) * 6);

    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: thin;
    scrollbar-color:
        #30363d
        #090d11;
}

.terminal-entry {
    min-height:
        var(--log-row-height);
}

/* Chromium / Safari scrollbar */

.terminal-entries::-webkit-scrollbar {
    width: 7px;
}

.terminal-entries::-webkit-scrollbar-track {
    background: #090d11;
}

.terminal-entries::-webkit-scrollbar-thumb {
    background: #30363d;

    border-radius: 999px;
}

.terminal-entries::-webkit-scrollbar-thumb:hover {
    background: #238636;
}

@media (max-width: 700px) {

    .terminal-entries {
        --log-row-height: 62px;
    }
}
