:root {
    --bg: #fdfdfc;
    --fg: #1d1d1f;
    --muted: #6b6b70;
    --accent: #2456c7;
    --line: #e4e4e7;
}

/* El oscuro sale del sistema, salvo que el usuario haya elegido otro con el botón */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #141416;
        --fg: #ececee;
        --muted: #9a9aa2;
        --accent: #7ea2ff;
        --line: #2a2a2e;
    }
}

:root[data-theme="dark"] {
    --bg: #141416;
    --fg: #ececee;
    --muted: #9a9aa2;
    --accent: #7ea2ff;
    --line: #2a2a2e;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* En pantallas anchas todo un 10% más grande; en el celular queda el tamaño base */
@media (min-width: 600px) {
    html {
        font-size: 110%;
    }
}

body {
    margin: 0 auto;
    max-width: 748px;
    padding: 48px 20px;
    font: 1.0625rem/1.6 system-ui, sans-serif;
    background: var(--bg);
    color: var(--fg);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1 { margin: 0; font-size: 2.5rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }

header { padding-bottom: 8px; }

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.theme {
    display: flex;
    padding: 8px;
    border: 0;
    border-radius: 999px;
    background: none;
    cursor: pointer;
}

.theme:hover {
    background: var(--line);
}

.theme svg {
    width: 20px;
    height: 20px;
    fill: var(--fg);
}

.theme .sun {
    display: none;
}

:root[data-theme="dark"] .theme .sun {
    display: block;
}

:root[data-theme="dark"] .theme .moon {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme .sun {
        display: block;
    }

    :root:not([data-theme="light"]) .theme .moon {
        display: none;
    }
}

.tagline { margin-top: 10px; font-size: 1.05rem; }
h2 { margin-top: 64px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
h3 { margin: 0; font-size: 1.25rem; }

.tagline, .muted, .stack {
    color: var(--muted);
}

.stack, .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.stack {
    margin: 6px 0 10px;
}

.stack span, .tags button {
    padding: 3px 9px;
    border: 1px solid color-mix(in srgb, var(--fg) 22%, transparent);
    border-radius: 999px;
    font: 0.8rem/1.4 ui-monospace, monospace;
    color: var(--fg);
    background: none;
    transition: color 0.2s, border-color 0.2s;
}

.tags button {
    cursor: pointer;
}

.tags button:hover {
    border-color: var(--accent);
}

.group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 6px;
    margin: 18px 0;
}

.group .tags {
    display: contents;
}

.group .label {
    min-width: 110px;
    color: var(--muted);
    font-size: 0.9rem;
}

.hint {
    margin-top: 20px;
    color: var(--muted);
    font-size: 0.8rem;
}

.stack span.on, .tags button.on {
    color: var(--accent);
    border-color: var(--accent);
}

nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
}

nav .sep {
    width: 1px;
    height: 1.1em;
    background: var(--muted);
}

@media (max-width: 480px) {

    nav .sep {
        display: none;
    }
}

nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

nav svg {
    width: 1em;
    height: 1em;
    fill: var(--fg);
}

.item {
    padding: 22px 0;
    transition: opacity 0.2s;
}

.item.dim {
    opacity: 0.3;
}

.head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
}

.item + .item {
    border-top: 1px solid var(--line);
}

.item h3 a::after {
    content: " ↗";
    color: var(--muted);
    font-size: 0.85em;
    transition: color 0.2s;
}

.item h3 a:hover::after {
    color: var(--accent);
}

.item .stack {
    margin: 0;
}

.item p {
    margin: 8px 0;
}

.more {
    display: flex;
    gap: 24px;
    font-size: 0.9rem;
}

.more button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--fg);
    cursor: pointer;
}

.more button::before {
    content: "▸ ";
    color: var(--muted);
}

.item:not(.collapsed) .more button::before {
    content: "▴ ";
}

.more button:hover {
    color: var(--accent);
}

.collapsed .extra {
    display: none;
}


.item ul {
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 0.95rem;
}

footer {
    margin-top: 64px;
    font-size: 0.9rem;
}

/* Al final para pisar a .head: en el celular las etiquetas van debajo del nombre */
@media (max-width: 480px) {
    .head {
        flex-direction: column;
        align-items: flex-start;
    }
}
