:root {
    --bg: #1a1f29;
    --bg-card: rgba(17, 24, 39, 0.5);
    --bg-card-dim: rgba(17, 24, 39, 0.25);

    --text: #f3f4f6;
    --text-dim: #d1d5db;
    --muted: #9ca3af;
    --muted-2: #6b7280;
    --muted-3: #4b5563;

    --border: #374151;
    --border-dim: #283041;
    --rule-strong: #4b5563;

    --accent: #7dd3fc;
    --accent-dim: #38bdf8;
    --accent-bg: rgba(125, 211, 252, 0.05);

    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, monospace;
}

[data-theme="gruvbox"] {
    --bg: #282828;
    --bg-card: rgba(60, 56, 54, 0.5);
    --bg-card-dim: rgba(60, 56, 54, 0.25);

    --text: #ebdbb2;
    --text-dim: #d5c4a1;
    --muted: #bdae93;
    --muted-2: #a89984;
    --muted-3: #7c6f64;

    --border: #504945;
    --border-dim: #3c3836;
    --rule-strong: #665c54;

    --accent: #83a598;
    --accent-dim: #458588;
    --accent-bg: rgba(131, 165, 152, 0.05);
}

[data-theme="solarized"] {
    --bg: #002b36;
    --bg-card: rgba(7, 54, 66, 0.5);
    --bg-card-dim: rgba(7, 54, 66, 0.25);

    --text: #93a1a1;
    --text-dim: #839496;
    --muted: #657b83;
    --muted-2: #586e75;
    --muted-3: #586e75;

    --border: #073642;
    --border-dim: #002b36;
    --rule-strong: #586e75;

    --accent: #268bd2;
    --accent-dim: #268bd2;
    --accent-bg: rgba(38, 139, 210, 0.05);
}

[data-theme="nord"] {
    --bg: #2e3440;
    --bg-card: rgba(59, 66, 82, 0.5);
    --bg-card-dim: rgba(59, 66, 82, 0.25);

    --text: #eceff4;
    --text-dim: #e5e9f0;
    --muted: #a8b1c0;
    --muted-2: #6c7a91;
    --muted-3: #4c566a;

    --border: #434c5e;
    --border-dim: #3b4252;
    --rule-strong: #4c566a;

    --accent: #88c0d0;
    --accent-dim: #5e81ac;
    --accent-bg: rgba(136, 192, 208, 0.05);
}

[data-theme="matrix"] {
    --bg: #060a06;
    --bg-card: rgba(10, 30, 10, 0.5);
    --bg-card-dim: rgba(10, 30, 10, 0.25);

    --text: #b8ffc8;
    --text-dim: #7ce896;
    --muted: #4fcc6a;
    --muted-2: #2f9c4a;
    --muted-3: #1f5e2c;

    --border: #1f5e2c;
    --border-dim: #133a1c;
    --rule-strong: #2f9c4a;

    --accent: #00ff41;
    --accent-dim: #00cc44;
    --accent-bg: rgba(0, 255, 65, 0.05);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
    padding: 2rem 1.25rem;
}

.page {
    max-width: 52rem;
    margin: 0 auto;
    padding-top: 2rem;
}

@media (min-width: 640px) {
    .page {
        padding-top: 3.5rem;
    }
}

/* ─── masthead ─── */

.masthead {
    margin-bottom: 1.25rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
}

@media (min-width: 640px) {
    .masthead {
        margin-bottom: 1.5rem;
        gap: 2rem;
    }
}

.masthead-text {
    min-width: 0;
    padding-bottom: 1rem;
    border-bottom: 3px double var(--rule-strong);
}

.masthead-art {
    max-width: 120px;
    justify-self: end;
}

@media (min-width: 640px) {
    .masthead-art {
        max-width: 180px;
    }
}

.masthead-art img,
.masthead-art video {
    display: block;
    width: 100%;
    height: auto;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.banner {
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.75rem;
    line-height: 1.15;
    margin: 0;
    white-space: pre;
    overflow-x: auto;
}

@media (min-width: 640px) {
    .banner {
        font-size: 0.9375rem;
    }
}

.dateline {
    margin: 1rem 0 0;
    font-size: 0.8125rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted-2);
}

/* ─── lede ─── */

.lede {
    margin: 0 0 1.25rem;
    color: var(--text-dim);
    line-height: 1.7;
    text-wrap: pretty;
}

.lede-cta {
    margin: 0 0 2.5rem;
    color: var(--text);
    line-height: 1.6;
}

/* ─── paths ─── */

.paths {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 3rem;
}

@media (min-width: 640px) {
    .paths {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 1.25rem;
    }
}

.path {
    border: 1px solid var(--border-dim);
    padding: 1.25rem 1.25rem 1.125rem;
    background: var(--bg-card-dim);
    display: flex;
    flex-direction: column;
}

.path-ssh {
    border-color: var(--accent-dim);
    background: var(--accent-bg);
}

.path-label {
    display: block;
    font-size: 0.8125rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted-2);
    margin-bottom: 0.875rem;
}

.path-ssh .path-label {
    color: var(--accent);
}

/* ─── command buttons ─── */

.cmd {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.8125rem 1rem;
    margin: 0 0 0.875rem;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.cmd:hover {
    border-color: var(--muted-3);
}

.cmd-primary:hover {
    border-color: var(--accent-dim);
}

.cmd-line {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.prompt {
    color: var(--muted-3);
    flex-shrink: 0;
    line-height: 1.5;
}

.cmd-text {
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
    font-size: 0.875rem;
    line-height: 1.5;
}

.copy-indicator {
    color: var(--muted-3);
    font-size: 0.75rem;
    flex-shrink: 0;
    min-width: 6ch;
    text-align: right;
    line-height: 1.75;
    transition: color 0.2s;
}

.cmd:hover .copy-indicator {
    color: var(--muted-2);
}

.copy-indicator.copied {
    color: var(--accent);
}

/* ─── path notes ─── */

.path-note {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--muted);
    line-height: 1.55;
}

.path-note + .path-note {
    margin-top: 0.35rem;
}

.path-note-dim {
    color: var(--muted-2);
    font-size: 0.75rem;
}

.path-note a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--muted-3);
    text-underline-offset: 2px;
}

.path-note a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent-dim);
}

.path-note code {
    color: var(--muted);
    font-family: var(--mono);
}

/* ─── demo ─── */

.demo {
    margin: 0 0 3rem;
    padding: 0;
    border: 1px solid var(--border);
    background: #000;
    overflow: hidden;
}

.demo img,
.demo video {
    display: block;
    width: 100%;
    height: auto;
}

/* ─── boxscore / features table ─── */

.boxscore {
    margin-bottom: 2.25rem;
    padding: 0.5rem 0 0.25rem;
    border-top: 3px double var(--rule-strong);
}

.section-label {
    display: block;
    margin: 0.5rem 0 0.875rem;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.features {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.features th {
    text-align: left;
    font-size: 0.6875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted-2);
    font-weight: 400;
    padding: 0.4rem 0.75rem 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.features td {
    padding: 0.55rem 0.75rem 0.55rem 0;
    vertical-align: baseline;
}

.features th[scope="row"] {
    color: var(--text);
    width: 20%;
    white-space: nowrap;
    padding-right: 1.25rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    vertical-align: baseline;
    font-size: inherit;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    border-bottom: 0;
}

.features td:last-child {
    color: var(--muted);
    padding-right: 0;
}

.features tbody tr + tr th,
.features tbody tr + tr td {
    border-top: 1px dotted var(--border-dim);
}

/* ─── agate (host key) ─── */

.agate {
    font-size: 0.75rem;
    color: var(--muted-2);
    margin-bottom: 2rem;
    padding: 0.5rem 0 0.875rem;
    border-top: 3px double var(--rule-strong);
    line-height: 1.6;
}

.agate-block + .agate-block {
    margin-top: 0.875rem;
    padding-top: 0.875rem;
    border-top: 1px dotted var(--border-dim);
}

.agate strong {
    color: var(--text-dim);
    font-weight: 600;
}

.agate a {
    color: var(--muted);
    text-decoration: underline;
    text-decoration-color: var(--muted-3);
    text-underline-offset: 2px;
}

.agate a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent-dim);
}

.agate-label {
    display: block;
    font-size: 0.8125rem;
    letter-spacing: 0.18em;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.agate .fingerprint {
    color: var(--text-dim);
    word-break: break-all;
    font-family: var(--mono);
    padding: 0;
    background: none;
}

.cmd-agate {
    margin: 0.5rem 0 0;
    padding: 0.5rem 0.75rem;
}

.cmd-agate .cmd-text {
    font-size: 0.75rem;
}

.cmd-multi .cmd-text {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.55;
}

/* ─── colophon ─── */

.colophon {
    font-size: 0.75rem;
    color: var(--muted-2);
    padding: 0.5rem 0 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
    align-items: center;
}

.colophon a {
    color: var(--muted);
    text-decoration: none;
}

.colophon a:hover {
    color: var(--accent);
}

.colophon .sep {
    color: var(--muted-3);
}

.colophon .muted {
    color: var(--muted-3);
}

.theme-picker {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted-3);
}

.theme-picker select {
    font: inherit;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--border-dim);
    border-radius: 0;
    padding: 0.1rem 1.25rem 0.1rem 0.4rem;
    cursor: pointer;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position:
        calc(100% - 0.55rem) 50%,
        calc(100% - 0.35rem) 50%;
    background-size: 0.25rem 0.25rem;
    background-repeat: no-repeat;
}

.theme-picker select:hover {
    color: var(--accent);
    border-color: var(--muted-3);
}

.theme-picker option {
    background: var(--bg);
    color: var(--text);
}
