/* =========================================================================
   Outsourcing Agency — sistema de diseño
   1. Tokens · 2. Reset · 3. Tipografía · 4. Layout · 5. Componentes
   6. Secciones · 7. Formularios · 8. Cabecera y pie · 9. Animación
   ====================================================================== */

/* -------------------------------------------------- 1. Tokens */
:root {
    --paper: #f7f5f2;
    --paper-2: #efece7;
    --ink: #0b0b0e;
    --ink-2: #16161b;
    --muted: #6b6b73;
    --muted-invert: #a3a3ad;
    --accent: #d5015a;
    --accent-dark: #b00149;
    --accent-soft: #ffe8f1;
    --line: rgba(11, 11, 14, 0.14);
    --line-strong: rgba(11, 11, 14, 0.28);
    --line-invert: rgba(247, 245, 242, 0.18);

    --font-display: "Bricolage Grotesque", "Inter Tight", system-ui, sans-serif;
    --font-body: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-serif: "Instrument Serif", Georgia, serif;
    --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

    --shell: 1240px;
    --gutter: clamp(1.25rem, 5vw, 3.5rem);
    --section: clamp(4.5rem, 10vw, 9rem);
    --radius: 4px;
    --radius-lg: 10px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* -------------------------------------------------- 2. Reset */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img,
svg,
video { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

button,
input,
select,
textarea { font: inherit; color: inherit; }

ul, ol { padding: 0; list-style: none; }

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

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999;
    background: var(--ink);
    color: var(--paper);
    padding: 0.75rem 1.25rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

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

/* -------------------------------------------------- 3. Tipografía */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 1.4rem + 5.2vw, 5.4rem); }
h2 { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.6rem); }
h3 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); line-height: 1.12; }
h4 { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem); line-height: 1.2; letter-spacing: -0.02em; }

p { text-wrap: pretty; }

.balance { text-wrap: balance; }

.serif {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.accent { color: var(--accent); }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.eyebrow::before {
    content: "";
    width: 1.75rem;
    height: 1px;
    background: var(--accent);
    flex: none;
}
.eyebrow--invert { color: var(--muted-invert); }

.lead {
    font-size: clamp(1.1rem, 1rem + 0.7vw, 1.4rem);
    line-height: 1.5;
    color: var(--ink);
    max-width: 44ch;
}

.muted { color: var(--muted); }
.muted-invert { color: var(--muted-invert); }

.prose p + p,
.prose p + ul,
.prose ul + p { margin-top: 1.1em; }
.prose > * + h2 { margin-top: 2.5em; }
.prose > * + h3 { margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.8em; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose strong { font-weight: 600; }

/* -------------------------------------------------- 4. Layout */
.shell {
    width: min(100% - (var(--gutter) * 2), var(--shell));
    margin-inline: auto;
}
.shell--narrow { max-width: 760px; }

.section { padding-block: var(--section); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.section--dark { background: var(--ink); color: var(--paper); }
.section--paper2 { background: var(--paper-2); }
.section--dark .muted,
.section--dark p.muted { color: var(--muted-invert); }

.rule {
    height: 1px;
    background: var(--line);
    border: 0;
}

.grid { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }

.split {
    display: grid;
    gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
}
@media (min-width: 900px) {
    .split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
    .split--reverse > :first-child { order: 2; }
    .split--even { grid-template-columns: 1fr 1fr; }
}

.stack > * + * { margin-top: 1.1rem; }
.stack-lg > * + * { margin-top: 2rem; }

/* -------------------------------------------------- 5. Componentes */

/* Botones */
.btn {
    --btn-bg: var(--ink);
    --btn-fg: var(--paper);
    --btn-border: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 1.6rem;
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: 1px solid var(--btn-border);
    border-radius: 100px;
    font-weight: 500;
    font-size: 0.98rem;
    letter-spacing: -0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.25s var(--ease), color 0.25s var(--ease),
                border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn::after {
    content: "→";
    transition: transform 0.3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:hover::after { transform: translateX(4px); }
.btn:active { transform: translateY(0); }

.btn--accent { --btn-bg: var(--accent); --btn-border: var(--accent); --btn-fg: #fff; }
.btn--accent:hover { --btn-bg: var(--accent-dark); --btn-border: var(--accent-dark); }

.btn--ghost {
    --btn-bg: transparent;
    --btn-fg: var(--ink);
    --btn-border: var(--line-strong);
}
.btn--ghost:hover { --btn-bg: var(--ink); --btn-fg: var(--paper); --btn-border: var(--ink); }

.btn--ghost-invert {
    --btn-bg: transparent;
    --btn-fg: var(--paper);
    --btn-border: var(--line-invert);
}
.btn--ghost-invert:hover { --btn-bg: var(--paper); --btn-fg: var(--ink); --btn-border: var(--paper); }

.btn--plain::after { content: none; }

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
}

/* Enlace con flecha */
.arrow-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--line-strong);
    padding-bottom: 2px;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.arrow-link::after { content: "→"; transition: transform 0.3s var(--ease); }
.arrow-link:hover { color: var(--accent); border-color: var(--accent); }
.arrow-link:hover::after { transform: translateX(4px); }

/* Tarjeta numerada */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), background 0.3s var(--ease);
}
.card:hover { border-color: var(--ink); transform: translateY(-3px); }
.card__num {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    color: var(--accent);
}
.card__title { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem); }
.card p { color: var(--muted); }
.card .arrow-link { margin-top: auto; align-self: flex-start; padding-top: 0.5rem; }

.section--dark .card { border-color: var(--line-invert); }
.section--dark .card:hover { border-color: var(--paper); }
.section--dark .card p { color: var(--muted-invert); }

/* Tarjeta de servicio destacada (enlace completo) */
.service {
    position: relative;
    display: grid;
    gap: 1rem;
    padding: clamp(1.75rem, 3vw, 2.75rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}
.service::before {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.45s var(--ease);
}
.service:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.service:hover::before { transform: scaleX(1); }
.service__num {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    color: var(--muted);
}
.service__title { font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); }
.service__text { color: var(--muted); max-width: 52ch; }
.service__more {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

/* Variante ancha: título a la izquierda, explicación a la derecha. */
@media (min-width: 920px) {
    .service--row {
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
        column-gap: clamp(2rem, 4vw, 4rem);
        row-gap: 1rem;
        align-items: start;
    }
    .service--row .service__num   { grid-column: 1; grid-row: 1; }
    .service--row .service__title { grid-column: 1; grid-row: 2; }
    .service--row .service__more  { grid-column: 1; grid-row: 3; align-self: end; }
    .service--row .service__text  { grid-column: 2; grid-row: 1 / span 2; max-width: none; }
    .service--row .tags           { grid-column: 2; grid-row: 3; }
}

/* Lista de comprobación */
.checks { display: grid; gap: 0.85rem; }
.checks li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: start;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
}
.checks li::before {
    content: "";
    width: 9px;
    height: 9px;
    margin-top: 0.6rem;
    background: var(--accent);
    border-radius: 2px;
    transform: rotate(45deg);
}
.section--dark .checks li { border-color: var(--line-invert); }

/* Lista de datos / tabla clave-valor */
.facts { display: grid; gap: 0; }
.facts div {
    display: grid;
    gap: 0.25rem 2rem;
    padding: 1.1rem 0;
    border-top: 1px solid var(--line);
}
@media (min-width: 720px) {
    .facts div { grid-template-columns: 200px 1fr; }
}
.facts dt {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}
.facts dd { margin: 0; }
.section--dark .facts div { border-color: var(--line-invert); }
.section--dark .facts dt { color: var(--muted-invert); }

/* Proceso en pasos */
.steps { counter-reset: step; display: grid; gap: 0; }
.step {
    counter-increment: step;
    display: grid;
    gap: 0.5rem 2.5rem;
    padding: clamp(1.5rem, 3vw, 2.25rem) 0;
    border-top: 1px solid var(--line);
}
@media (min-width: 820px) {
    .step { grid-template-columns: 6rem 1fr 1.1fr; align-items: start; }
}
.step::before {
    content: "0" counter(step);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    color: var(--accent);
}
.step h3 { font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem); }
.step p { color: var(--muted); }
.section--dark .step { border-color: var(--line-invert); }
.section--dark .step p { color: var(--muted-invert); }

/* Cita */
.quote {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.9rem);
    line-height: 1.16;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

/* Preguntas frecuentes */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 1.4rem 0;
    cursor: pointer;
    list-style: none;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem);
    letter-spacing: -0.02em;
    transition: color 0.2s var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+";
    font-family: var(--font-mono);
    font-size: 1.4rem;
    color: var(--accent);
    flex: none;
    transition: transform 0.3s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--accent); }
.faq details > div {
    padding-bottom: 1.5rem;
    color: var(--muted);
    max-width: 68ch;
}

/* Imagen con marco */
.figure {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--paper-2);
}
.figure img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
.figure--tall img { aspect-ratio: 3 / 4; }
.figure--wide img { aspect-ratio: 16 / 9; }
.figure figcaption {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    padding-top: 0.75rem;
}

/* Cinta en movimiento */
.ticker {
    border-block: 1px solid var(--line);
    padding-block: 1.1rem;
    overflow: hidden;
    white-space: nowrap;
}
.ticker__track {
    display: inline-flex;
    gap: 3rem;
    will-change: transform;
}
.ticker span {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 3rem;
}
.ticker span::after {
    content: "◆";
    color: var(--accent);
    font-size: 0.6rem;
}

/* Etiquetas */
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 100px;
    color: var(--muted);
}
.section--dark .tag { border-color: var(--line-invert); color: var(--muted-invert); }

/* -------------------------------------------------- 6. Secciones */

/* Héroe de portada */
.hero {
    position: relative;
    padding-top: clamp(4rem, 12vh, 8rem);
    padding-bottom: clamp(3rem, 8vw, 6rem);
}
.hero__title {
    font-size: clamp(2.8rem, 1rem + 8.4vw, 7.5rem);
    line-height: 0.95;
    letter-spacing: -0.045em;
    max-width: 16ch;
}
.hero__title em {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.02em;
}
.hero__grid {
    display: grid;
    gap: clamp(2rem, 5vw, 4rem);
    margin-top: clamp(2.5rem, 5vw, 4rem);
    align-items: end;
}
@media (min-width: 900px) {
    .hero__grid { grid-template-columns: 1.15fr 0.85fr; }
}
.hero__meta {
    display: grid;
    gap: 1rem;
    border-top: 1px solid var(--line);
    padding-top: 1.25rem;
}
.hero__figure img { aspect-ratio: 5 / 4; object-fit: cover; width: 100%; border-radius: var(--radius-lg); }

/* Cabecera de páginas interiores */
.pagehead {
    padding-top: clamp(3rem, 9vh, 6rem);
    padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
    border-bottom: 1px solid var(--line);
}
.pagehead__title { max-width: 18ch; }
.pagehead__intro {
    margin-top: 1.75rem;
    font-size: clamp(1.1rem, 1rem + 0.7vw, 1.4rem);
    line-height: 1.5;
    max-width: 52ch;
    color: var(--muted);
}

/* Fondos fotográficos de héroe y cabeceras.
   La imagen sobresale un poco por arriba y abajo para dejar margen al paralaje. */
.hero--image,
.pagehead--image {
    isolation: isolate;
    overflow: hidden;
}
.hero__bg,
.pagehead__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}
.hero__bg img,
.pagehead__bg img {
    position: absolute;
    left: 0;
    top: -8%;
    width: 100%;
    height: 116%;
    max-width: none;
    object-fit: cover;
}

/* Portada: foto clara anclada a la derecha; el texto ocupa la zona vacía */
.hero--image { padding-bottom: clamp(4rem, 10vw, 8rem); }
.hero--image .hero__bg { background: #e9e8ed; }
.hero--image .hero__bg img { object-position: 72% 35%; }
.hero--image .hero__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--paper) 65%, transparent) 0%, color-mix(in srgb, var(--paper) 88%, transparent) 55%, var(--paper) 100%);
}
.hero--image .hero__bg img { opacity: 0.5; }
.hero--image .hero__grid { grid-template-columns: minmax(0, 36rem); }
@media (min-width: 900px) {
    .hero--image .hero__bg { left: auto; width: 62%; }
    .hero--image .hero__bg img { opacity: 1; object-position: 60% 30%; }
    .hero--image .hero__bg::after {
        background:
            linear-gradient(90deg, var(--paper) 0%, color-mix(in srgb, var(--paper) 40%, transparent) 28%, transparent 55%),
            linear-gradient(0deg, var(--paper) 0%, transparent 20%);
    }
    .hero--image .hero__title {
        font-size: clamp(3rem, 1rem + 5.2vw, 6.25rem);
        max-width: 10ch;
    }
}

/* Páginas interiores: foto oscurecida con texto claro */
.pagehead--image {
    position: relative;
    background: var(--ink);
    color: var(--paper);
    border-bottom: 0;
    padding-top: clamp(5rem, 16vh, 9rem);
    padding-bottom: clamp(4rem, 10vw, 7rem);
}
.pagehead--image .pagehead__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(11, 11, 14, 0.9) 0%, rgba(11, 11, 14, 0.7) 50%, rgba(11, 11, 14, 0.35) 100%),
        linear-gradient(0deg, rgba(11, 11, 14, 0.55) 0%, transparent 45%);
}
.pagehead--image .pagehead__title { color: var(--paper); }
.pagehead--image .pagehead__intro { color: rgba(247, 245, 242, 0.78); }

/* Encabezado de sección con dos columnas */
.sechead {
    display: grid;
    gap: 1.5rem 3rem;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
@media (min-width: 900px) {
    .sechead { grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); align-items: end; }
}
.sechead p { color: var(--muted); max-width: 52ch; }

/* Llamada final */
.cta {
    background: var(--ink);
    color: var(--paper);
    padding-block: clamp(4rem, 9vw, 7rem);
}
.cta__inner { max-width: 900px; }
.cta__title {
    font-size: clamp(2.2rem, 1.2rem + 4vw, 4.4rem);
    max-width: 16ch;
}
.cta__title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.cta__text {
    margin-top: 1.5rem;
    color: var(--muted-invert);
    max-width: 50ch;
    font-size: 1.1rem;
}
.cta__actions { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* Bloque de texto legal */
.legal { padding-block: clamp(3rem, 7vw, 5rem); }
.legal h2 {
    font-size: clamp(1.3rem, 1.1rem + 1vw, 1.8rem);
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}
.legal p { color: var(--muted); }
.legal p + p { margin-top: 1rem; }
.legal ul { margin-top: 1rem; display: grid; gap: 0.5rem; }
.legal ul li { padding-left: 1.25rem; position: relative; color: var(--muted); }
.legal ul li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* -------------------------------------------------- 7. Formularios */
.form { display: grid; gap: 1.25rem; }
@media (min-width: 720px) {
    .form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
}
.field { display: grid; gap: 0.5rem; }
.field label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}
.field .req { color: var(--accent); }
.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    background: var(--paper);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.field textarea { min-height: 170px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--accent);
    outline: none;
    background: #fff;
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(107, 107, 115, 0.65); }

.consent {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: start;
    font-size: 0.92rem;
    color: var(--muted);
}
.consent input { margin-top: 0.25rem; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.consent a { color: var(--accent); }

.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.notice {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
    font-size: 0.95rem;
}
.notice--ok { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.notice--error { border-color: #b00149; background: #fff1f5; color: #7a0132; }

/* -------------------------------------------------- 8. Cabecera y pie */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--line); }

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding-block: 1.1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
    flex: none;
}
.brand__mark {
    width: auto;
    height: 30px;
    flex: none;
    transition: transform 0.45s var(--ease);
}
.brand:hover .brand__mark { transform: translateY(-2px) scale(1.04); }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.035em;
}
.brand__sub {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 2px;
}

.nav { display: none; }
@media (min-width: 1000px) {
    .nav { display: flex; align-items: center; gap: 2rem; }
}
.nav ul { display: flex; align-items: center; gap: 1.75rem; }
.nav li { position: relative; }
.nav a {
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding-block: 0.4rem;
    position: relative;
    display: inline-block;
}
.nav a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s var(--ease);
}
.nav a:hover::after,
.nav .current-menu-item > a::after,
.nav .current-menu-ancestor > a::after,
.nav .current_page_item > a::after { transform: scaleX(1); transform-origin: left; }

/* Submenú de escritorio */
.nav .sub-menu {
    position: absolute;
    top: 100%;
    left: -1rem;
    min-width: 260px;
    padding: 0.75rem;
    margin-top: 0.6rem;
    display: grid;
    gap: 0.15rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 40px rgba(11, 11, 14, 0.09);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
}
.nav li:hover > .sub-menu,
.nav li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav .sub-menu a {
    display: block;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.92rem;
}
.nav .sub-menu a::after { content: none; }
.nav .sub-menu a:hover { background: var(--paper-2); color: var(--accent); }

.header__cta { display: none; }
@media (min-width: 1000px) {
    .header__cta { display: inline-flex; }
}

/* Selector de idioma (Polylang) */
.lang-switch { display: flex; align-items: center; gap: 0.15rem; }
.lang-switch a {
    display: inline-block;
    padding: 0.35rem 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--muted);
    border-radius: var(--radius);
    transition: color 0.2s var(--ease);
}
.lang-switch a:hover { color: var(--accent); }
.lang-switch a.is-current { color: var(--ink); font-weight: 600; }
.lang-switch--invert a { color: var(--muted-invert); }
.lang-switch--invert a.is-current { color: var(--paper); }
.mobile-nav .lang-switch { margin-top: 1.75rem; }

/* Botón hamburguesa */
.burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 10px;
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: 100px;
    cursor: pointer;
}
@media (min-width: 1000px) { .burger { display: none; } }
.burger span {
    display: block;
    height: 1.5px;
    background: currentColor;
    transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Panel móvil */
.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 99;
    background: var(--ink);
    color: var(--paper);
    padding: 6rem var(--gutter) 3rem;
    overflow-y: auto;
    display: none;
}
.mobile-nav.is-open { display: block; }
@media (min-width: 1000px) { .mobile-nav { display: none !important; } }
.mobile-nav ul { display: grid; gap: 0.25rem; }
.mobile-nav > ul > li > a,
.mobile-nav > ul > li > .sub-menu { display: block; }
.mobile-nav ul a {
    display: block;
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line-invert);
}
.mobile-nav .sub-menu { padding-left: 1.25rem; }
.mobile-nav .sub-menu a {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--muted-invert);
}
.mobile-nav .btn { margin-top: 2rem; }

body.nav-open { overflow: hidden; }

/* Pie */
.site-footer {
    background: var(--ink);
    color: var(--paper);
    padding-top: clamp(3rem, 6vw, 5rem);
    padding-bottom: 2.5rem;
}
.site-footer a { text-decoration: none; }
.footer__top {
    display: grid;
    gap: 2.5rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--line-invert);
}
@media (min-width: 860px) {
    .footer__top { grid-template-columns: 1.3fr 1fr 1fr; }
}
.footer__about { color: var(--muted-invert); max-width: 38ch; margin-top: 1.25rem; }
.footer__title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted-invert);
    margin-bottom: 1.1rem;
}
.footer__list { display: grid; gap: 0.6rem; }
.footer__list a { color: var(--paper); transition: color 0.2s var(--ease); }
.footer__list a:hover { color: var(--accent); }
.footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 2rem;
    font-size: 0.85rem;
    color: var(--muted-invert);
}
.footer__bottom ul { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer__bottom a:hover { color: var(--accent); }
.site-footer .brand__sub { color: var(--muted-invert); }

/* Página 404 y búsqueda */
.center-block {
    padding-block: clamp(5rem, 14vw, 9rem);
    text-align: center;
}
.center-block .actions { justify-content: center; }
.search-form { display: flex; gap: 0.5rem; max-width: 420px; }
.search-form label { flex: 1; }
.search-form input[type="search"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--paper);
}

/* Listado de entradas */
.entry { padding-block: 2.5rem; border-bottom: 1px solid var(--line); }
.entry__meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.75rem;
}
.entry h2 a { text-decoration: none; }
.entry h2 a:hover { color: var(--accent); }

.pagination { display: flex; gap: 0.5rem; padding-block: 2.5rem; }
.pagination .page-numbers {
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
}
.pagination .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* -------------------------------------------------- 9. Animación */

/* Estado inicial solo si hay JS: sin él, el contenido es visible. */
.js [data-oa-reveal],
.js [data-oa-split],
.js [data-oa-stagger] > * {
    opacity: 0;
    transform: translateY(18px);
}
.js .oa-in {
    opacity: 1;
    transform: none;
}

.js [data-oa-split] .oa-line { display: block; overflow: hidden; }
.js [data-oa-split] .oa-line > span { display: block; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .js [data-oa-reveal],
    .js [data-oa-split],
    .js [data-oa-stagger] > * { opacity: 1; transform: none; }
}
