/* ==========================================================
   ADROC.DEV — DIGITAL AFTERDARK
   Hoja de estilos consolidada
   ========================================================== */

/* 1. Variables y temas
   ---------------------------------------------------------- */

:root {
    color-scheme: dark;

    --background: #0b0b16;
    --background-soft: #10101d;
    --surface: #151525;
    --surface-hover: #202039;

    --text: #ede9ff;
    --muted: #aaa5c0;
    --subtle: #77738e;

    --accent: #a78bfa;
    --highlight: #d63383;
    --electric-blue: #2679c8;
    --warm-accent: #e88a43;

    --border: #302b46;
    --border-light: #403956;

    --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);

    --font-heading: "Space Grotesk", "Segoe UI", sans-serif;
    --font-body: "Inter", "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", "Cascadia Code", monospace;

    --container-width: 1080px;
    --transition: 180ms ease;
}

html[data-theme="light"] {
    color-scheme: light;

    --background: #f3f0f8;
    --background-soft: #eae5f2;
    --surface: #ffffff;
    --surface-hover: #eee8f6;

    --text: #211b32;
    --muted: #706980;
    --subtle: #9189a1;

    --accent: #7655b5;
    --highlight: #b83278;
    --electric-blue: #2868a5;
    --warm-accent: #bc7137;

    --border: #ded6e9;
    --border-light: #cec3dd;

    --shadow: 0 12px 40px rgba(48, 30, 70, 0.08);
}

/* 2. Base y accesibilidad
   ---------------------------------------------------------- */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;

    background: var(--background);
    color: var(--text);

    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.75;

    transition:
        background-color var(--transition),
        color var(--transition);
}

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

a:hover {
    color: var(--highlight);
}

button {
    font: inherit;
}

::selection {
    background: var(--highlight);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--highlight);
    outline-offset: 4px;
}

.container {
    width: min(calc(100% - 44px), var(--container-width));
    margin-inline: auto;
}

#main-content {
    position: relative;
    z-index: 1;
    flex: 1;
}

.site-header,
.site-footer {
    position: relative;
    z-index: 1;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 15px;
    z-index: 1000;
    padding: 10px 15px;

    background: var(--surface);
    color: var(--text);
}

.skip-link:focus {
    top: 15px;
}

/* 3. Iluminación ambiental
   ---------------------------------------------------------- */

.ambient {
    position: fixed;
    z-index: 0;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(120px);
    opacity: 0.08;
}

.ambient-purple {
    top: 5%;
    right: -250px;
    background: var(--highlight);
}

.ambient-blue {
    top: 45%;
    left: -300px;
    background: var(--electric-blue);
}

html[data-theme="light"] .ambient {
    opacity: 0.035;
}

/* 4. Cabecera y navegación
   ---------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    background: color-mix(in srgb, var(--background) 90%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

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

.logo {
    display: inline-flex;
    align-items: center;

    color: var(--text);
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.logo:hover {
    color: var(--text);
}

.logo-dot {
    color: var(--highlight);
}

.logo-cursor {
    margin-left: 2px;
    color: var(--electric-blue);
    animation: cursor-blink 1.2s steps(2, start) infinite;
}

@keyframes cursor-blink {
    to {
        visibility: hidden;
    }
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 27px;
}

.nav-link {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nav-link:hover {
    color: var(--highlight);
}

.theme-toggle {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;

    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--warm-accent);

    font-size: 1.15rem;
    cursor: pointer;

    transition:
        background var(--transition),
        border-color var(--transition),
        transform var(--transition);
}

.theme-toggle:hover {
    background: var(--surface-hover);
    border-color: var(--highlight);
    transform: translateY(-2px);
}

/* 5. Elementos compartidos
   ---------------------------------------------------------- */

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;

    color: var(--highlight);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 20px;
    height: 1px;
    background: var(--highlight);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 35px;

    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.back-link:hover {
    color: var(--text);
}

.back-link span {
    color: var(--highlight);
    transition: transform var(--transition);
}

.back-link:hover span {
    transform: translateX(-4px);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;

    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.post-meta span:not(:last-child)::after {
    content: "/";
    margin-left: 10px;
    color: var(--highlight);
}

.tags,
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags span,
.post-tags span {
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.68rem;
}


/* 6. Portada — Digital Afterdark
   ---------------------------------------------------------- */


/* El hero conserva su paleta oscura en ambos temas */

.hero h1 {
    color: #ede9ff;
}

.hero-description {
    color: #c4bdd8;
}

.hero-link {
    color: #ede9ff;
}

.hero-eyebrow,
.hero .eyebrow {
    color: #e879b4;
}

.hero {
    position: relative;
    isolation: isolate;

    display: flex;
    align-items: center;

    width: 100vw;
    min-height: 410px;

    margin-left: calc(50% - 50vw);

    padding-block: 65px;
    padding-inline: max(22px,
            calc((100vw - var(--container-width)) / 2));

    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.hero-copy {
    position: relative;
    z-index: 2;

    width: 100%;
    max-width: 680px;
}

.hero h1 {
    max-width: 720px;
    margin-block: 20px;

    font-family: var(--font-heading);
    font-size: clamp(2.8rem, 5vw, 4rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.055em;
}

.hero-description {
    max-width: 440px;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;

    margin-top: 22px;
    padding-bottom: 5px;

    border-bottom: 1px solid var(--highlight);
    color: var(--text);

    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
}

.hero-link span {
    color: var(--highlight);
    transition: transform var(--transition);
}

.hero-link:hover span {
    transform: translateX(5px);
}

.hero-visual {
    position: absolute;
    z-index: 0;
    inset: 0;

    overflow: hidden;
    background: #17152b;
}

.hero-background {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center 35%;
}

.hero-overlay {
    position: absolute;
    inset: 0;

    background:
        linear-gradient(90deg,
            rgba(11, 11, 22, 0.94) 0%,
            rgba(11, 11, 22, 0.78) 32%,
            rgba(11, 11, 22, 0.30) 65%,
            rgba(11, 11, 22, 0.12) 100%),
        linear-gradient(0deg,
            rgba(11, 11, 22, 0.55) 0%,
            transparent 35%);
}

.hero-caption {
    position: absolute;
    z-index: 2;
    bottom: 18px;
    right: max(22px,
            calc((100vw - var(--container-width)) / 2));

    color: #e879b4;
    font-family: var(--font-mono);
    font-size: 0.57rem;
    letter-spacing: 0.08em;
}

.posts-section {
    padding-top: 38px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.section-heading h2 {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-heading h2 span {
    color: var(--highlight);
}

.section-index {
    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.05em;
}

.post-list {
    display: flex;
    flex-direction: column;
}

.post-preview {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: center;
    gap: 36px;
    padding-block: 32px;
    border-bottom: 1px solid var(--border);

    transition:
        border-color var(--transition),
        background-color var(--transition);
}

.post-preview:hover {
    border-bottom-color: var(--border-light);
}

.post-cover {
    position: relative;
    display: block;
    align-self: center;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
}

.post-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(214, 51, 131, 0.12),
            transparent 65%);
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 250ms ease;
}

.post-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform 450ms ease,
        filter 450ms ease;
}

.post-preview:hover .post-cover img {
    transform: scale(1.045);
    filter: saturate(1.12);
}

.post-preview:hover .post-cover::after {
    opacity: 0.25;
}

.post-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;

    background:
        radial-gradient(circle at 70% 30%,
            rgba(214, 51, 131, 0.3),
            transparent 48%),
        linear-gradient(135deg, #151525, #292052);

    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

.placeholder-cursor {
    color: var(--highlight);
}

.post-preview-content {
    min-width: 0;
}

.post-preview-content h3 {
    margin-block: 13px 9px;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.04em;
}

.post-preview-content h3 a {
    color: var(--text);
    transition: color var(--transition);
}

.post-preview-content h3 a:hover {
    color: var(--highlight);
}

.post-preview-content>p {
    max-width: 620px;
    margin-block: 9px 16px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.75;
}

.post-preview-content .tags {
    gap: 8px;
    margin-top: 14px;
}

.post-preview-content .tags span {
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--surface);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    transition:
        border-color var(--transition),
        color var(--transition);
}

.post-preview:hover .tags span {
    border-color: var(--border-light);
}

.empty-posts {
    padding-block: 35px;
    color: var(--muted);
}

/* 7. Artículo individual
   ---------------------------------------------------------- */

.single-post {
    max-width: 850px;
    margin-inline: auto;
    padding-block: 45px 70px;
}

.post-header {
    margin-bottom: 32px;
}

.post-header .post-meta {
    gap: 14px;
}

.post-header h1 {
    max-width: 800px;
    margin-block: 24px 15px;

    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.055em;
}

.post-description {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
    font-size: 1.12rem;
    line-height: 1.8;
}

.updated {
    margin-top: 18px;
    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.04em;
}

.post-featured-image {
    margin: 35px 0 45px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--surface);
}

.post-featured-image img {
    display: block;
    width: 100%;
    max-height: 440px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.post-content {
    max-width: 740px;
    margin: 0 auto;
    color: var(--text);
    font-size: 1.02rem;
    line-height: 1.95;
}

.post-content h2,
.post-content h3 {
    font-family: var(--font-heading);
    line-height: 1.35;
}

.post-content h2 {
    margin-top: 2.7em;
    margin-bottom: 0.8em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 1.8rem;
}

.post-content h3 {
    margin-top: 2.2em;
    margin-bottom: 0.7em;
    font-size: 1.35rem;
}

.post-content p {
    margin-block: 1.35em;
}

.post-content a {
    color: var(--highlight);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 4px;
}

.post-content a:hover {
    text-decoration-color: var(--highlight);
}

.post-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin-block: 30px;
    border-radius: 5px;
}

.post-content blockquote {
    margin-inline: 0;
    padding: 12px 22px;
    border-left: 3px solid var(--highlight);
    background: var(--surface);
    color: var(--muted);
}

.post-content ul,
.post-content ol {
    padding-left: 25px;
}

.post-content li {
    padding-left: 5px;
    margin-block: 5px;
}

.post-content li::marker {
    color: var(--highlight);
}

.post-content pre {
    overflow-x: auto;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.85em;
}

.post-content :not(pre)>code {
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
}

.post-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.post-content th,
.post-content td {
    padding: 11px 15px;
    border: 1px solid var(--border);
    text-align: left;
}

.post-content th {
    background: var(--surface);
    color: var(--accent);
}

.post-tags {
    max-width: 740px;
    margin: 55px auto 0;
    padding-top: 25px;
    border-top: 1px solid var(--border);
}

.tags-label {
    display: block;
    margin-bottom: 14px;
    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
}

.post-tags .tags {
    gap: 8px;
}

.post-navigation {
    max-width: 740px;
    margin: 35px auto 0;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Enlaces permanentes de los encabezados: visibles al pasar el ratón o al enfocarlos. */
.heading-link {
    margin-left: 0.4em;
    color: var(--highlight);
    opacity: 0;
    text-decoration: none;
    transition: opacity var(--transition);
}

h1:hover>.heading-link,
h2:hover>.heading-link,
h3:hover>.heading-link,
h4:hover>.heading-link,
.heading-link:focus-visible {
    opacity: 0.7;
}

/* 8. Resaltado de código (Pygments)
   ---------------------------------------------------------- */

.highlight {
    color: var(--text);
}

.highlight .c,
.highlight .c1,
.highlight .cm,
.highlight .cp {
    color: #85819a;
    font-style: italic;
}

.highlight .k,
.highlight .kn,
.highlight .kc,
.highlight .kd {
    color: #c4a7ff;
}

.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb {
    color: #a6dca8;
}

.highlight .n,
.highlight .nf,
.highlight .nc {
    color: #89b4fa;
}

.highlight .mi,
.highlight .mf {
    color: #f5a6c9;
}

.highlight .o,
.highlight .p {
    color: #b9a9d1;
}

/* 9. Archivo
   ---------------------------------------------------------- */

.archive-page {
    width: 100%;
    margin-inline: auto;
    padding-block: 65px 80px;
}

.archive-header {
    padding-bottom: 35px;
    border-bottom: 1px solid var(--border);
}

.archive-header h1 {
    margin-block: 20px 10px;
    font-family: var(--font-heading);
    font-size: clamp(3rem, 7vw, 4.5rem);
    line-height: 1.1;
    letter-spacing: -0.055em;
}

.archive-header h1 span {
    color: var(--highlight);
}

.archive-description {
    color: var(--muted);
    font-size: 1.05rem;
}

.archive-total {
    margin-top: 25px;
    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
}

.archive-year {
    margin-top: 45px;
}

.archive-year-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.archive-year-heading h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.archive-year-heading>span {
    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: 0.65rem;
}

.archive-month {
    margin-top: 25px;
}

.archive-month h3 {
    margin-bottom: 10px;
    color: var(--highlight);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.09em;
}

.archive-post {
    display: grid;
    grid-template-columns: 95px minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding-block: 17px;
    border-bottom: 1px solid var(--border);
}

.archive-post time {
    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: 0.68rem;
}

.archive-post-info {
    min-width: 0;
}

.archive-post-info h4 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 500;
}

.archive-post-info h4 a {
    color: var(--text);
}

.archive-post-info h4 a:hover {
    color: var(--highlight);
}

.archive-post-info p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.archive-post-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: 0.61rem;
    white-space: nowrap;
}

.archive-back {
    display: inline-block;
    margin-top: 45px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.archive-back:hover {
    color: var(--highlight);
}

.archive-empty {
    padding-block: 40px;
    color: var(--muted);
}

/* 10. Páginas estáticas
   ---------------------------------------------------------- */

.static-page {
    width: 100%;
    margin-inline: auto;
    padding-block: 65px 80px;
}

.static-page-header {
    padding-bottom: 35px;
    border-bottom: 1px solid var(--border);
}

.static-page-header h1 {
    margin-block: 20px 12px;
    font-family: var(--font-heading);
    font-size: clamp(3rem, 7vw, 4.5rem);
    line-height: 1.1;
    letter-spacing: -0.055em;
}

.static-page-header h1 span {
    color: var(--highlight);
}

.static-page-description {
    max-width: 650px;
    color: var(--muted);
    font-size: 1.05rem;
}

.static-page-content {
    max-width: 740px;
    margin: 40px auto 0;
    font-size: 1rem;
    line-height: 1.95;
}

.static-page-content h2 {
    margin-top: 2.5em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-heading);
    font-size: 1.55rem;
}

.static-page-content h3 {
    margin-top: 2em;
    font-family: var(--font-heading);
}

.static-page-content p {
    margin-block: 1.2em;
}

.static-page-content strong {
    color: var(--accent);
}

.static-page-content em {
    color: var(--muted);
}

.static-page-footer {
    max-width: 740px;
    margin: 45px auto 0;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

/* 11. Pie de página
   ---------------------------------------------------------- */

.site-footer {
    position: relative;
    margin-top: 100px;
    border-top: 1px solid var(--border);
    background:
        radial-gradient(ellipse at 15% 0%,
            rgba(214, 51, 131, 0.055),
            transparent 45%),
        var(--background-soft);
}

.footer-inner {
    padding-block: 55px 24px;
}

.footer-main {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 50px;
    padding-bottom: 45px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo {
    color: var(--text);
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.055em;
}

.footer-logo span:first-child {
    color: var(--highlight);
}

.footer-cursor {
    color: var(--accent);
    animation: cursor-blink 1.2s step-end infinite;
}

.footer-brand p {
    margin-block: 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-location {
    margin-top: 12px;
    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.07em;
}

.footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 13px;
}

.footer-column h3 {
    margin: 5px 0 8px;
    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: 0.67rem;
    font-weight: 500;
    letter-spacing: 0.1em;
}

.footer-column a {
    color: var(--muted);
    font-size: 0.83rem;
    transition:
        color var(--transition),
        transform var(--transition);
}

.footer-column a:hover {
    color: var(--highlight);
    transform: translateX(4px);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.035em;
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-built {
    color: var(--subtle);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #5ebd86;
    box-shadow: 0 0 8px rgba(94, 189, 134, 0.4);
}

/* 12. Adaptación a pantallas pequeñas
   ---------------------------------------------------------- */

@media (min-width: 701px) and (max-width: 900px) {
    .post-preview {
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 24px;
    }
}

@media (max-width: 700px) {
    .hero {
        min-height: 390px;
        padding-block: 50px;
    }

    .hero h1 {
        font-size: clamp(2.4rem, 8vw, 3.2rem);
    }

    .hero-description {
        max-width: 340px;
        font-size: 0.95rem;
    }

    .hero-overlay {
        background:
            linear-gradient(90deg,
                rgba(11, 11, 22, 0.94) 0%,
                rgba(11, 11, 22, 0.72) 65%,
                rgba(11, 11, 22, 0.42) 100%),
            linear-gradient(0deg,
                rgba(11, 11, 22, 0.58) 0%,
                transparent 65%);
    }

    .hero-background {
        object-position: 65% center;
    }

    .post-preview {
        grid-template-columns: 155px minmax(0, 1fr);
        gap: 18px;
        padding-block: 22px;
    }

    .post-preview-content h3 {
        font-size: 1.15rem;
    }

    .post-preview-content>p {
        font-size: 0.82rem;
    }
}

@media (max-width: 650px) {
    .container {
        width: min(calc(100% - 32px), var(--container-width));
    }

    .header-inner {
        min-height: 68px;
        flex-wrap: wrap;
        gap: 15px;
        padding-block: 12px;
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }

    .nav-link {
        font-size: 0.65rem;
    }

    .theme-toggle {
        margin-left: auto;
    }

    .single-post {
        padding-block: 30px 50px;
    }

    .post-header h1 {
        font-size: 2.4rem;
    }

    .post-description {
        font-size: 0.98rem;
    }

    .post-featured-image {
        margin-block: 25px 35px;
    }

    .post-content {
        font-size: 0.96rem;
    }

    .post-content h2 {
        font-size: 1.5rem;
    }

    .archive-page,
    .static-page {
        padding-block: 40px 55px;
    }

    .archive-post {
        grid-template-columns: 75px minmax(0, 1fr);
        gap: 12px;
    }

    .archive-post-meta {
        grid-column: 2;
        flex-direction: row;
        align-items: center;
    }

    .archive-year-heading h2 {
        font-size: 1.7rem;
    }

    .static-page-header h1 {
        font-size: 2.6rem;
    }

    .static-page-content {
        font-size: 0.96rem;
    }

    .post-meta {
        gap: 8px;
        font-size: 0.61rem;
    }

    .post-meta span:not(:last-child)::after {
        margin-left: 8px;
    }

    .post-content pre {
        padding: 14px;
    }

    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .ambient {
        opacity: 0.04;
    }

    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 35px 25px;
    }

    .footer-brand {
        grid-column: 1 / -1;
        padding-bottom: 10px;
    }

    .footer-inner {
        padding-block: 40px 22px;
    }

    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
    }
}

@media (max-width: 480px) {
    .post-preview {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .post-cover {
        aspect-ratio: 16 / 9;
    }

    .post-preview-content h3 {
        font-size: 1.3rem;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .section-index {
        font-size: 0.55rem;
    }
}

/* 13. Movimiento reducido
   ---------------------------------------------------------- */

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

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .post-cover img {
        transition: none;
    }
}

/* ==========================================================
   BUSCADOR — PAGEFIND
   ========================================================== */

/* Controles de la cabecera */

.header-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-left: auto;
}

.search-toggle {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;

    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);

    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;

    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition),
        transform var(--transition);
}

.search-toggle:hover {
    background: var(--surface-hover);
    border-color: var(--highlight);
    color: var(--highlight);
    transform: translateY(-2px);
}

/* Ventana de búsqueda */

.search-dialog {
    width: min(680px, calc(100% - 32px));
    max-width: none;
    max-height: min(80vh, 760px);
    padding: 0;

    overflow: auto;
    border: 1px solid var(--border-light);
    border-radius: 12px;

    background: var(--background-soft);
    color: var(--text);
    box-shadow: var(--shadow);
}

.search-dialog::backdrop {
    background: rgba(3, 3, 12, 0.78);
    backdrop-filter: blur(7px);
}

.search-dialog-inner {
    padding: 25px;
}

.search-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.search-dialog-title {
    color: var(--highlight);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.search-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;

    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);

    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition);
}

.search-close:hover {
    border-color: var(--highlight);
    color: var(--highlight);
}

.search-hint {
    margin: 20px 0 0;
    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: 0.68rem;
}

/* ==========================================================
   PAGEFIND COMPONENT UI — DIGITAL AFTERDARK
   ========================================================== */

/* Tema oscuro */

html[data-theme="dark"] {
    --pf-text: #ede9ff;
    --pf-text-secondary: #aaa5c0;
    --pf-text-muted: #77738e;

    --pf-background: #10101d;
    --pf-border: #302b46;
    --pf-border-focus: #a78bfa;

    --pf-skeleton: #202039;
    --pf-skeleton-shine: #302b46;

    --pf-hover: #202039;
    --pf-mark: #ffffff;
    --pf-scroll-shadow: rgba(0, 0, 0, 0.35);

    --pf-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --pf-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --pf-shadow-lg: 0 20px 65px rgba(0, 0, 0, 0.55);

    --pf-error-bg: #321b29;
    --pf-error-border: #71304d;
    --pf-error-text: #ff8ebc;
    --pf-error-text-secondary: #ffb2d0;

    --pf-outline-focus: #d63383;
    --pf-outline-width: 2px;
    --pf-outline-offset: 3px;

    --pf-font: var(--font-body);

    --pf-input-height: 48px;
    --pf-input-font-size: 16px;
    --pf-summary-font-size: 12px;
    --pf-result-title-font-size: 16px;
    --pf-result-excerpt-font-size: 13px;

    --pf-results-display: flex;
    --pf-results-flex-direction: column;
    --pf-results-flex-wrap: nowrap;
    --pf-results-gap: 12px;

    --pf-border-radius: 8px;

    --pf-image-width: 88px;
    --pf-image-height: 66px;

    --pf-modal-backdrop: rgba(3, 3, 12, 0.82);
    --pf-modal-max-width: 680px;
    --pf-modal-max-height: min(78dvh, 760px);
    --pf-modal-top: 10dvh;

    --pf-searchbox-max-width: 480px;
    --pf-searchbox-dropdown-max-height: 360px;
}

/* Tema claro */

html[data-theme="light"] {
    --pf-text: #211b32;
    --pf-text-secondary: #706980;
    --pf-text-muted: #9189a1;

    --pf-background: #f3f0f8;
    --pf-border: #ded6e9;
    --pf-border-focus: #7655b5;

    --pf-skeleton: #eae5f2;
    --pf-skeleton-shine: #ffffff;

    --pf-hover: #eee8f6;
    --pf-mark: #211b32;
    --pf-scroll-shadow: rgba(48, 30, 70, 0.08);

    --pf-shadow-sm: 0 2px 8px rgba(48, 30, 70, 0.05);
    --pf-shadow-md: 0 8px 24px rgba(48, 30, 70, 0.09);
    --pf-shadow-lg: 0 20px 65px rgba(48, 30, 70, 0.16);

    --pf-error-bg: #fff0f4;
    --pf-error-border: #efb9cb;
    --pf-error-text: #a52256;
    --pf-error-text-secondary: #812047;

    --pf-outline-focus: #b83278;

    --pf-font: var(--font-body);

    --pf-input-height: 48px;
    --pf-input-font-size: 16px;
    --pf-summary-font-size: 12px;
    --pf-result-title-font-size: 16px;
    --pf-result-excerpt-font-size: 13px;

    --pf-results-display: flex;
    --pf-results-flex-direction: column;
    --pf-results-flex-wrap: nowrap;
    --pf-results-gap: 12px;

    --pf-border-radius: 8px;

    --pf-image-width: 88px;
    --pf-image-height: 66px;

    --pf-modal-backdrop: rgba(30, 20, 45, 0.55);
    --pf-modal-max-width: 680px;
    --pf-modal-max-height: min(78dvh, 760px);
    --pf-modal-top: 10dvh;

    --pf-searchbox-max-width: 480px;
    --pf-searchbox-dropdown-max-height: 360px;
}

/* Botón de búsqueda */

.header-actions pagefind-modal-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
}

.header-actions .pf-trigger-btn {
    display: grid;
    place-items: center;

    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;

    padding: 0;
    box-sizing: border-box;

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

    background: var(--surface);
    color: var(--muted);

    line-height: 1;

    transition: all var(--transition);
}

.header-actions .pf-trigger-btn:hover {
    border-color: var(--highlight);
    background: var(--surface-hover);
    color: var(--highlight);
}

/* Modal */

.pf-modal {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.pf-modal-header {
    border-bottom: 1px solid var(--border);
}

.pf-modal-close {
    color: var(--muted);
}

.pf-modal-close:hover {
    color: var(--highlight);
}

/* Campo de búsqueda */

.pf-searchbox-input {
    font-family: var(--font-body);
}

.pf-searchbox-input:focus {
    border-color: var(--highlight);
}

/* Resultados */

.pf-result {
    border-color: var(--border);
}

.pf-result-title,
.pf-searchbox-result-title {
    font-family: var(--font-heading);
    font-weight: 600;
}

.pf-result-excerpt,
.pf-searchbox-result-excerpt {
    color: var(--muted);
    line-height: 1.6;
}

.pf-result a:hover,
.pf-searchbox-result:hover {
    color: var(--highlight);
}

.pf-result mark,
.pf-searchbox-result mark {
    background: color-mix(in srgb, var(--highlight) 25%, transparent);
    color: var(--text);
}

/* Móviles */

@media (max-width: 650px) {
    .header-actions {
        gap: 7px;
    }

    .pf-modal {
        width: calc(100vw - 24px);
        max-width: none;
    }
}

/* Igualar botón Pagefind al selector de tema */

html body header.site-header .header-inner .header-actions pagefind-modal-trigger .pf-trigger-btn {
    box-sizing: border-box !important;

    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;

    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;

    padding: 0 !important;
    margin: 0 !important;

    display: grid !important;
    place-items: center !important;

    border-radius: 6px !important;
}

.footer-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 22px;
    margin-bottom: 30px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.footer-links a {
    color: var(--muted);
    transition: color 0.2s ease;
}

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

.footer-discord {
    color: var(--muted);
}

.footer-discord strong {
    color: var(--accent);
    font-weight: 600;
}


.hero .hero-description {
    color: #c4bdd8;
}

.hero .hero-link {
    color: #ede9ff;
}

.hero .hero-link span {
    color: #e879b4;
}