:root {
    color-scheme: dark;
    --ink: #ececec;
    --muted: #a3a3a3;
    --line: #2e2e2e;
    --surface: #1b1b1b;
    --background: #111111;
    --accent: #e3a83f;
    --accent-soft: rgba(227, 168, 63, 0.14);
    --radius: 10px;
    --max-width: 1080px;
}

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

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--background);
}

a {
    color: inherit;
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Encabezado */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    flex-wrap: wrap;
}

.brand {
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
}

.site-header nav {
    display: flex;
    gap: 20px;
}

.site-header nav a {
    text-decoration: none;
    color: var(--muted);
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}

.site-header nav a:hover,
.site-header nav a.active {
    color: var(--ink);
    border-bottom-color: var(--accent);
}

/* Contenido */

main.container {
    padding-top: 40px;
    padding-bottom: 56px;
}

.intro h1 {
    font-size: 2.2rem;
    font-weight: 300;
    margin: 0 0 8px;
}

.intro p {
    margin: 0 0 32px;
    color: var(--muted);
    max-width: 640px;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 16px;
}

.series {
    margin-bottom: 48px;
}

.more a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.more a:hover {
    text-decoration: underline;
}

/* Tarjetas */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 20px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover {
    border-color: #3d3d3d;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    transform: translateY(-2px);
}

.card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--line);
    display: block;
}

.card-featured {
    flex-direction: row;
}

.card-featured .card-image {
    width: 55%;
    flex-shrink: 0;
}

.card-featured .card-body {
    justify-content: center;
    padding: 24px 28px;
}

.card-featured .card-title {
    font-size: 1.5rem;
}

.card-featured .card-date {
    margin: 0;
    color: var(--accent);
    font-weight: 600;
}

.card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1f1f1f, #2a2418);
    color: var(--accent);
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.card-series {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
}

.card-date {
    margin: auto 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

/* Etiquetas del blog */

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.tag {
    font-size: 0.85rem;
    text-decoration: none;
    padding: 4px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
}

.tag:hover,
.tag.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--ink);
}

/* Experiencia */

.timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.job,
.block {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.block {
    margin-bottom: 20px;
}

.job-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.job-head h2 {
    margin: 0;
    font-size: 1.1rem;
}

.job-head .org {
    color: var(--muted);
    font-weight: 400;
}

.job-head .org::before {
    content: "· ";
}

.job-date {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
    white-space: nowrap;
}

.job p,
.job ul {
    margin: 10px 0 0;
}

.job ul {
    padding-left: 20px;
}

.job li {
    margin-bottom: 4px;
}

.stack {
    font-size: 0.85rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.skills {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 16px;
    margin: 0;
}

.skills dt {
    font-weight: 600;
}

.skills dd {
    margin: 0;
    color: var(--muted);
}

/* Pie */

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 20px;
    padding-bottom: 20px;
}

.footer-inner a {
    margin-left: 16px;
    text-decoration: none;
}

.footer-inner a:hover {
    color: var(--ink);
}

/* Móvil */

@media (max-width: 600px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding-top: 12px;
        padding-bottom: 10px;
    }

    .site-header nav {
        gap: 18px;
    }

    .intro h1 {
        font-size: 1.8rem;
    }

    .skills {
        grid-template-columns: 1fr;
    }

    .card-featured {
        flex-direction: column;
    }

    .card-featured .card-image {
        width: 100%;
    }

    .card-featured .card-title {
        font-size: 1.2rem;
    }

    .skills dd {
        margin-bottom: 8px;
    }

    .footer-inner a {
        margin-left: 0;
        margin-right: 16px;
    }
}
