/* =========================================================
   ; javier del moral
   Dirección visual: DESIGN.md · Decisiones de conversión: MARKETING.md
   ========================================================= */

/* ---------- Fuentes (alojadas en local, licencia OFL) ---------- */
@font-face {
    font-family: 'Archivo';
    src: url('../assets/fonts/archivo-latin-var.woff2') format('woff2');
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Geist Mono';
    src: url('../assets/fonts/geist-mono-latin-var.woff2') format('woff2');
    font-weight: 400 500;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Respaldos con las medidas de Archivo y Geist Mono. Si la conexión es lenta y el texto se pinta antes de que
   llegue la fuente, Arial (o Roboto/Helvetica) ocupa el mismo espacio y nada salta al cambiar (CLS).
   size-adjust se ha medido comparando anchos reales; ascent/descent son los de Archivo divididos por size-adjust. */
@font-face {
    font-family: 'Archivo Fallback';
    src: local('Arial'), local('ArialMT'), local('Roboto'), local('Helvetica Neue'), local('Helvetica');
    font-weight: 100 900;
    size-adjust: 99%;
    ascent-override: 88.9%;
    descent-override: 21.2%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'Archivo Condensed Fallback';
    src: local('Arial Bold'), local('Arial-BoldMT'), local('Roboto Bold'), local('Roboto-Bold'), local('Helvetica Neue Bold'), local('Helvetica Bold');
    font-weight: 100 900;
    font-stretch: 50% 200%;
    size-adjust: 71%;
    ascent-override: 124%;
    descent-override: 29.6%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'Geist Mono Fallback';
    src: local('Courier New'), local('CourierNewPSMT'), local('Menlo'), local('Consolas');
    font-weight: 100 900;
    size-adjust: 100%;
    ascent-override: 101%;
    descent-override: 30%;
    line-gap-override: 0%;
}

/* Notas manuscritas. Solo se aplica cuando main.js la ha cargado (clase .has-hand), para no frenar la carga inicial */
@font-face {
    font-family: 'Caveat';
    src: url('../assets/fonts/caveat-600-subset.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* Gótico mínimo: solo las cifras, para los números de sección */
@font-face {
    font-family: 'Pirata One';
    src: url('../assets/fonts/pirata-one-digits.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0030-0039;
}

/* ---------- Tokens animables (el fondo cambia suave entre secciones) ---------- */
@property --bg     { syntax: '<color>'; inherits: true; initial-value: #0a0a0d; }
@property --fg     { syntax: '<color>'; inherits: true; initial-value: #f2efe9; }
@property --muted  { syntax: '<color>'; inherits: true; initial-value: #a8a3b5; }
@property --line   { syntax: '<color>'; inherits: true; initial-value: rgba(242, 239, 233, 0.14); }
@property --accent { syntax: '<color>'; inherits: true; initial-value: #c4b5fd; }

:root {
    /* Paleta */
    --ink: #0a0a0d;          /* negro profundo */
    --ink-2: #121017;        /* negro con un punto morado (secciones alternas) */
    --paper: #f2efe9;        /* blanco roto */
    --lilac: #c4b5fd;        /* lila */
    --purple: #7c3aed;       /* morado eléctrico: solo fondos, bordes, sombras y texto grande */
    --deep: #150d22;         /* sombras del duotono */

    --font-display: 'Archivo', 'Archivo Condensed Fallback', sans-serif;
    --font-body: 'Archivo', 'Archivo Fallback', sans-serif;
    --font-mono: 'Geist Mono', 'Geist Mono Fallback', ui-monospace, monospace;
    --font-hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
    --font-goth: 'Pirata One', 'Old English Text MT', serif;

    --pad: clamp(1rem, 4vw, 3.5rem);
    --max: 1680px;
    --header-h: 4.5rem;
    --radius: 4px;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

@media (min-width: 900px) {
    :root { --header-h: 5.5rem; }
}

/* Temas por sección (main.js cambia body[data-theme] al hacer scroll) */
body {
    --bg: var(--ink);
    --fg: var(--paper);
    --muted: #a8a3b5;
    --line: rgba(242, 239, 233, 0.14);
    --accent: var(--lilac);
    --accent-ink: var(--ink);
}

body[data-theme="dark2"] {
    --bg: var(--ink-2);
}

body[data-theme="lilac"] {
    --bg: var(--lilac);
    --fg: var(--ink);
    --muted: #3b2a6b;
    --line: rgba(10, 10, 13, 0.22);
    --accent: var(--ink);
    --accent-ink: var(--paper);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: clip;
    scroll-padding-top: var(--header-h);
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

body {
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: --bg 0.8s var(--ease-in-out), --fg 0.8s var(--ease-in-out),
                --muted 0.8s var(--ease-in-out), --line 0.8s var(--ease-in-out),
                --accent 0.8s var(--ease-in-out);
}

body.is-locked {
    overflow: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

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

button {
    background: none;
    border: 0;
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

::selection {
    background: var(--purple);
    color: var(--paper);
}

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

/* ---------- Utilidades ---------- */
.wrap {
    width: min(100% - 2 * var(--pad), var(--max));
    margin-inline: auto;
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.5;
}

.label {
    color: var(--muted);
    margin-bottom: 1.5rem;
}

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

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 400;
    padding: 0.75rem 1.25rem;
    background: var(--paper);
    color: var(--ink);
    border-radius: var(--radius);
    transform: translateY(-200%);
    transition: transform 0.3s var(--ease);
}

.skip-link:focus {
    transform: none;
}

/* Sprite con el motivo del alambre de espino */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    color: #5a536b;
}

/* ---------- Grano de foto con flash ---------- */
.grain {
    position: fixed;
    inset: -120px;
    z-index: 450;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1.4 0 0 0 -.45'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
    opacity: 0.07;
    animation: grain 1.1s steps(1, end) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate3d(0, 0, 0); }
    17% { transform: translate3d(-60px, 40px, 0); }
    33% { transform: translate3d(50px, -70px, 0); }
    50% { transform: translate3d(-30px, -40px, 0); }
    67% { transform: translate3d(70px, 20px, 0); }
    83% { transform: translate3d(-50px, 80px, 0); }
}

/* ---------- Pegatinas ---------- */
.sticker {
    display: inline-flex;
    align-items: center;
    gap: 0.55em;
    width: fit-content;
    padding: 0.5em 0.85em 0.45em;
    border: 1px solid var(--ink);
    border-radius: 3px;
    background: var(--lilac);
    color: var(--ink);
    box-shadow: 3px 3px 0 var(--purple);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.2;
    white-space: nowrap;
    rotate: -4deg;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--purple);
    animation: pulse 2.4s infinite;
}

/* Pulso de los pilotos: cada uno define su color (--pulse) y su alcance (--pulse-size) */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--pulse, rgba(124, 58, 237, 0.6)); }
    70% { box-shadow: 0 0 0 var(--pulse-size, 7px) transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Botones y enlaces ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 3rem;
    padding: 0 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 650;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s,
                box-shadow 0.3s var(--ease), translate 0.3s var(--ease), transform 0.7s var(--ease);
}

.btn-sm {
    min-height: 2.75rem;
    padding: 0 1.1rem;
    font-size: 0.9rem;
}

.btn-lg {
    min-height: 3.5rem;
    padding: 0 1.75rem;
    font-size: 1.05rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 0;
    width: 3.5rem;
    flex-shrink: 0;
}

/* CTA principal: el único botón relleno (efecto Von Restorff) */
.btn-accent {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.btn-line {
    border-color: color-mix(in srgb, var(--fg) 42%, transparent);
}

.btn-line:hover {
    border-color: var(--fg);
    background-color: color-mix(in srgb, var(--fg) 8%, transparent);
}

@media (hover: hover) {
    /* Sombra dura morada, como una pegatina que se levanta */
    .btn-accent:hover {
        box-shadow: 4px 4px 0 var(--purple);
        translate: -2px -2px;
    }
}

.btn-accent:active {
    box-shadow: none;
    translate: 0 0;
}

/* Botones magnéticos (main.js mueve --mx/--my con el ratón) */
.magnetic {
    transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
}

.magnetic.is-pulling {
    transition: background-color 0.3s, color 0.3s, border-color 0.3s,
                box-shadow 0.3s var(--ease), translate 0.3s var(--ease), transform 0.15s linear;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--line);
    transition: border-color 0.3s;
}

.link-arrow span {
    display: inline-block;
    transition: transform 0.3s var(--ease);
}

.link-arrow:hover {
    border-color: var(--fg);
}

.link-arrow:hover span {
    transform: translateY(2px);
}

/* ---------- Cursor: etiqueta «ver caso» sobre los proyectos (solo ratón) ---------- */
.cursor {
    display: none;
}

.has-cursor .cursor {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 300;
    pointer-events: none;
}

.cursor-dot {
    position: absolute;
    top: -46px;
    left: -46px;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: var(--lilac);
    transform: scale(0);
    transition: transform 0.45s var(--ease);
}

.cursor-label {
    position: absolute;
    top: 0;
    left: 0;
    color: var(--ink);
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
    transition: opacity 0.25s, transform 0.45s var(--ease);
}

.cursor[data-state="view"] .cursor-dot {
    transform: scale(1);
}

.cursor[data-state="view"] .cursor-label {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ---------- Cabecera ---------- */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--header-h);
    padding-inline: max(var(--pad), calc((100% - var(--max)) / 2));
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--fg);
    border-bottom: 1px solid transparent;
    transition: background-color 0.4s, border-color 0.4s;
}

.site-header.is-scrolled,
.no-js .site-header {
    background-color: color-mix(in srgb, var(--bg) 84%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom-color: var(--line);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 2.75rem;
    line-height: 1;
}

.logo-mark {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 900;
    line-height: 0.8;
    color: var(--accent);
    transition: rotate 0.5s var(--ease);
}

.logo:hover .logo-mark {
    rotate: -10deg;
}

.logo-name {
    font-size: 0.8rem;
    color: var(--fg);
}

.main-nav {
    margin-left: auto;
}

.nav-list {
    display: flex;
    gap: clamp(1.25rem, 2.4vw, 2.5rem);
}

.nav-link {
    position: relative;
    display: inline-block;
    padding-block: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0.45rem;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.45s var(--ease);
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link.is-current::after {
    transform: scaleX(1);
    transform-origin: left;
}

.header-cta {
    margin-left: 0.5rem;
}

.menu-toggle {
    display: none;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    min-height: 2.75rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.menu-toggle-icon {
    position: relative;
    width: 22px;
    height: 9px;
}

.menu-toggle-icon span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1.5px;
    background: currentColor;
    transition: transform 0.5s var(--ease), top 0.5s var(--ease);
}

.menu-toggle-icon span:first-child { top: 0; }
.menu-toggle-icon span:last-child { top: calc(100% - 1.5px); }

.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:first-child {
    top: calc(50% - 0.75px);
    transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:last-child {
    top: calc(50% - 0.75px);
    transform: rotate(-45deg);
}

.mobile-menu {
    display: none;
}

@media (max-width: 899px) {
    .main-nav,
    .header-cta {
        display: none;
    }

    .js .menu-toggle {
        display: inline-flex;
    }

    /* Sin JS: navegación simple visible */
    .no-js .main-nav {
        display: block;
    }

    .no-js .nav-list {
        gap: 0.9rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .no-js .logo-name {
        display: none;
    }

    .js .mobile-menu {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 90;
        flex-direction: column;
        justify-content: space-between;
        gap: 2rem;
        padding: calc(var(--header-h) + 1.5rem) var(--pad) calc(1.5rem + env(safe-area-inset-bottom));
        background: var(--bg);
        overflow-y: auto;
        visibility: hidden;
        clip-path: inset(0 0 100% 0);
        transition: clip-path 0.7s var(--ease), visibility 0s linear 0.7s;
    }

    .js .mobile-menu.is-open {
        visibility: visible;
        clip-path: inset(0 0 0 0);
        transition: clip-path 0.7s var(--ease), visibility 0s;
    }

    .mobile-list {
        border-top: 1px solid var(--line);
    }

    .mobile-list a {
        display: flex;
        align-items: baseline;
        gap: 1rem;
        padding-block: 0.5rem 0.4rem;
        border-bottom: 1px solid var(--line);
        font-family: var(--font-display);
        font-size: clamp(2.6rem, 13vw, 4.5rem);
        font-weight: 900;
        font-stretch: 62%;
        line-height: 1;
    }

    .mobile-list span {
        min-width: 1.6em;
        font-family: var(--font-goth);
        font-size: 1.5rem;
        font-weight: 400;
        font-stretch: 100%;
        color: var(--accent);
    }

    .mobile-list li {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
    }

    .mobile-menu.is-open .mobile-list li {
        opacity: 1;
        transform: none;
    }

    .mobile-menu.is-open .mobile-list li:nth-child(2) { transition-delay: 0.04s; }
    .mobile-menu.is-open .mobile-list li:nth-child(3) { transition-delay: 0.08s; }
    .mobile-menu.is-open .mobile-list li:nth-child(4) { transition-delay: 0.12s; }
    .mobile-menu.is-open .mobile-list li:nth-child(5) { transition-delay: 0.16s; }

    .mobile-menu-actions {
        display: grid;
        gap: 0.75rem;
    }

    .mobile-menu-mail {
        justify-self: center;
        padding-block: 0.75rem;
        font-size: 1rem;
        font-weight: 500;
        overflow-wrap: anywhere;
    }
}

/* ---------- Títulos tipo póster ---------- */
.hero-title,
.section-title,
.work-title,
.service-title,
.step-title,
.contact-title,
.case-title,
.case-next-title,
.case-cta-title,
.work-band-text,
.process-end-text,
.legal-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-stretch: 62%;
    letter-spacing: 0;
    text-transform: uppercase;
}

/* Efecto de distorsión al pasar el ratón (contorno + sombra morada desplazada, estilo portada phonk).
   Solo con ratón y sin «reducir movimiento». */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .fx {
        transition: color 0.25s, text-shadow 0.35s var(--ease), transform 0.5s var(--ease);
    }

    .fx:hover,
    a:hover .fx,
    a:focus-visible .fx {
        color: transparent;
        -webkit-text-stroke: 1.5px var(--fg);
        text-shadow: 0.05em 0.04em 0 var(--purple);
        transform: skewX(-8deg);
    }

    .fx:hover .accent-text {
        color: transparent;
        -webkit-text-stroke-color: var(--accent);
    }
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    isolation: isolate;
}

/* Golpe de flash: un foco lila suave y las esquinas que caen a negro */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(48% 52% at 78% 40%, rgba(196, 181, 253, 0.13), transparent 72%),
        radial-gradient(130% 95% at 50% 42%, transparent 52%, rgba(0, 0, 0, 0.6));
}

.hero-matrix {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    padding-top: calc(var(--header-h) + 1rem);
    padding-bottom: clamp(2rem, 6vh, 4rem);
    pointer-events: none;
}

.hero-inner a,
.hero-inner button,
.hero-title {
    pointer-events: auto;
}

.hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding-top: 0.5rem;
    color: var(--muted);
}

.hero-main {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.9fr);
    gap: 1.5rem 4vw;
    align-items: center;
    padding-top: clamp(1.25rem, 4vh, 3rem);
}

/* El titular se dimensiona con el ancho de su columna (cqi): sus tres líneas siempre caben */
.hero-copy {
    grid-column: 1;
    grid-row: 1;
    container-type: inline-size;
}

/* Hueco donde la matriz dibuja el «;» (lo mide js/matrix.js) */
.hero-art {
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
    min-height: 12rem;
}

.hero-title {
    width: fit-content;
    font-size: clamp(2.75rem, min(18cqi, 15vh), 10rem);
    line-height: 0.86;
}

.hero-line {
    display: block;
}

.hero-intro {
    max-width: 34rem;
    margin-top: clamp(1.25rem, 3vh, 2rem);
    font-size: clamp(1.05rem, 0.5vw + 0.9rem, 1.3rem);
    line-height: 1.55;
    color: var(--muted);
    text-wrap: pretty;
}

.hero-intro strong {
    color: var(--fg);
    font-weight: 600;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.75rem;
    margin-top: clamp(1.5rem, 3.5vh, 2.25rem);
}

.hero-note {
    margin-top: 1.1rem;
    color: var(--muted);
}

.hero-note span {
    white-space: nowrap;
}

@media (max-width: 1099px) {
    .hero-main {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(4.5rem, 1fr) auto;
        align-items: stretch;
    }

    .hero-art {
        grid-column: 1;
        grid-row: 1;
        min-height: 4.5rem;
    }

    .hero-copy {
        grid-column: 1;
        grid-row: 2;
    }
}

@media (max-width: 599px) {
    .hero-role {
        display: none;
    }

    .hero-actions .btn {
        flex: 1 1 100%;
    }

    .hero-actions .link-arrow {
        margin-inline: auto;
    }

    .hero-note {
        text-align: center;
    }
}

/* ---------- Cinta lila con el stack ---------- */
.ticker {
    position: relative;
    z-index: 2;
    overflow: hidden;
    padding-block: clamp(1.25rem, 3vw, 2.75rem);
}

.tape-band {
    width: 104%;
    margin-left: -2%;
    padding-block: 0.7rem 0.6rem;
    border-block: 1px solid var(--ink);
    background: var(--lilac);
    color: var(--ink);
    rotate: -2deg;
}

.ticker-track {
    display: flex;
    width: max-content;
    will-change: transform;
}

.ticker-group {
    display: flex;
    flex-shrink: 0;
    align-items: center;
}

.ticker-group span {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.6vw, 3.25rem);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 1;
    white-space: nowrap;
}

.ticker-group .ticker-sep {
    padding-inline: clamp(0.9rem, 2.2vw, 2rem);
    color: var(--purple);
}

/* ---------- Secciones ---------- */
.section {
    position: relative;
    padding-block: clamp(4rem, 10vh, 8rem);
}

.section-head {
    max-width: 72rem;
    margin-bottom: clamp(2.5rem, 7vh, 5rem);
    container-type: inline-size;
}

/* Número de sección en gótico + etiqueta en minúsculas */
.sec-label {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    margin-bottom: clamp(1rem, 2.5vh, 1.5rem);
    color: var(--muted);
}

.sec-num {
    font-family: var(--font-goth);
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    font-weight: 400;
    line-height: 0.8;
    color: var(--accent);
}

.section-title {
    width: fit-content;
    max-width: 6.6em;
    font-size: clamp(3.25rem, 19cqi, 9rem);
    line-height: 0.86;
    text-wrap: balance;
}

.section-intro {
    max-width: 34em;
    margin-top: 1.5rem;
    font-size: clamp(1.05rem, 0.4vw + 0.95rem, 1.25rem);
    color: var(--muted);
    text-wrap: pretty;
}

/* Separador de alambre de espino (línea fina que se dibuja al entrar) */
.wire {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 24px;
    translate: 0 -50%;
    color: #5a536b;
    pointer-events: none;
}

.wire svg {
    width: 100%;
    height: 24px;
    overflow: visible;
}

.wire-line {
    stroke: currentColor;
    stroke-width: 1;
}

.js .wire svg {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.8s var(--ease);
}

.js .wire.is-in svg {
    clip-path: inset(0 0 0 0);
}

/* Trazos SVG que se dibujan al entrar en pantalla (pathLength="1") */
.js [data-draw] .draw {
    stroke-dasharray: 1 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 1.5s var(--ease);
}

.js [data-draw].is-in .draw {
    stroke-dashoffset: 0;
}

.js [data-draw].is-in .draw + .draw {
    transition-delay: 0.35s;
}

.js [data-draw].is-in .draw + .draw + .draw {
    transition-delay: 0.6s;
}

/* ---------- Duotono negro-lila (recupera el color con hover, foco o al centrarse en móvil) ---------- */
.duo {
    position: relative;
    display: block;
    overflow: hidden;
    isolation: isolate;
    border-radius: var(--radius);
    background: var(--deep);
}

.duo > img,
.duo > video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) contrast(1.15);
    transition: filter 0.7s var(--ease), transform 0.9s var(--ease);
}

.duo::before,
.duo::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.7s var(--ease);
}

/* Las luces pasan a lila; las sombras, a negro con un punto morado */
.duo::before {
    background: var(--lilac);
    mix-blend-mode: multiply;
}

.duo::after {
    background: var(--deep);
    mix-blend-mode: lighten;
}

.duo.is-color > img,
.duo.is-color > video {
    filter: none;
}

.duo.is-color::before,
.duo.is-color::after {
    opacity: 0;
}

@media (hover: hover) {
    .duo:hover > img,
    .duo:hover > video,
    .work-link:hover .duo > img,
    .work-link:focus-visible .duo > img {
        filter: none;
    }

    .duo:hover::before,
    .duo:hover::after,
    .work-link:hover .duo::before,
    .work-link:hover .duo::after,
    .work-link:focus-visible .duo::before,
    .work-link:focus-visible .duo::after {
        opacity: 0;
    }
}

/* ---------- Notas manuscritas ---------- */
.note {
    position: absolute;
    bottom: clamp(1.25rem, 2.5vw, 2rem);
    left: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    max-width: min(21rem, 86%);
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 1rem;
    font-style: italic;
    line-height: 1.15;
    rotate: -2deg;
}

.has-hand .note,
.no-js .note {
    font-family: var(--font-hand);
    font-size: clamp(1.4rem, 0.9vw + 1.1rem, 1.75rem);
    font-style: normal;
    font-weight: 600;
    line-height: 1;
}

.note-arrow {
    flex-shrink: 0;
    width: 3.25rem;
    height: auto;
    overflow: visible;
    translate: 0 -0.85rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Proyectos (composición editorial asimétrica) ---------- */
.work-item {
    position: relative;
    padding-block: clamp(2rem, 5vw, 4rem) clamp(5.5rem, 8vw, 7rem);
    border-top: 1px solid var(--line);
}

.work-item:last-child {
    border-bottom: 1px solid var(--line);
}

.work-link {
    display: grid;
    gap: 1.5rem;
    transition: opacity 0.4s;
}

.work-media {
    aspect-ratio: 16 / 11;
}

.work-media img {
    object-position: top center;
}

.work-info {
    display: grid;
    gap: 0.9rem;
    align-content: end;
    min-width: 0;
    container-type: inline-size;
}

.work-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    color: var(--muted);
}

.work-title {
    display: block;
    width: fit-content;
    font-size: clamp(2.75rem, 18cqi, 7rem);
    line-height: 0.86;
}

.work-summary {
    max-width: 30em;
    color: var(--muted);
    font-size: clamp(1rem, 0.3vw + 0.95rem, 1.15rem);
}

.work-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.4rem;
    color: var(--fg);
    white-space: nowrap;
}

.work-arrow {
    display: grid;
    place-items: center;
    width: 2.75rem;
    aspect-ratio: 1;
    border: 1px solid color-mix(in srgb, var(--fg) 42%, transparent);
    border-radius: 50%;
    font-size: 1rem;
    transition: background-color 0.4s, color 0.4s, border-color 0.4s, transform 0.6s var(--ease);
}

@media (min-width: 900px) {
    .work-link {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        column-gap: clamp(1.25rem, 2.5vw, 2.5rem);
        align-items: end;
    }

    .work-media {
        grid-column: 1 / span 7;
        grid-row: 1;
    }

    .work-info {
        grid-column: 8 / span 5;
        grid-row: 1;
    }

    .work-item:nth-child(even) .work-media {
        grid-column: 6 / span 7;
    }

    .work-item:nth-child(even) .work-info {
        grid-column: 1 / span 5;
    }

    /* La nota va en el margen, bajo la columna de texto, con la flecha hacia la captura */
    .work-item:nth-child(odd) .note--work {
        left: calc(58.33% + 1rem);
    }

    .work-item:nth-child(even) .note--work {
        left: auto;
        right: calc(58.33% + 1rem);
        flex-direction: row-reverse;
        text-align: right;
        rotate: 2deg;
    }
}

@media (hover: hover) and (pointer: fine) {
    .work-list:hover .work-item:not(:hover) .work-link {
        opacity: 0.55;
    }

    .work-link:hover .work-media img {
        transform: scale(1.03);
    }

    .work-link:hover .work-arrow,
    .work-link:focus-visible .work-arrow {
        background: var(--accent);
        border-color: var(--accent);
        color: var(--accent-ink);
        transform: rotate(45deg);
    }
}

.work-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    margin-top: clamp(2.5rem, 6vh, 4rem);
}

.work-band-text {
    font-size: clamp(2rem, 4.2vw, 3.75rem);
    line-height: 0.9;
}

/* ---------- Opiniones (pendiente de testimonios reales) ---------- */
.quote-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.quote {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.quote-text p {
    font-size: clamp(1.2rem, 1.8vw, 1.6rem);
    line-height: 1.4;
}

.quote-author {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.quote-author strong {
    display: block;
}

.quote-author .mono {
    color: var(--muted);
}

.quote-avatar {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--line);
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.4rem;
}

@media (max-width: 899px) {
    .quote-list {
        grid-template-columns: 1fr;
    }
}

/* ---------- Incluido en todas las webs (cabecera de Servicios) ---------- */
.included {
    display: grid;
    grid-template-columns: minmax(10rem, 0.8fr) minmax(0, 3fr);
    gap: 1rem 2rem;
    margin-bottom: clamp(2rem, 5vh, 3.5rem);
    padding-block: 1.25rem;
    border-block: 1px solid var(--line);
}

.included-label {
    color: var(--muted);
    padding-top: 0.2rem;
}

.included-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 2rem;
    color: var(--muted);
    font-size: 0.98rem;
}

.included-list strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--fg);
    font-weight: 600;
}

.included-score {
    color: var(--accent);
    font-weight: 600;
}

@media (max-width: 899px) {
    .included,
    .included-list {
        grid-template-columns: 1fr;
    }
}

/* ---------- Servicios ---------- */
.service-list {
    border-top: 1px solid var(--line);
}

.service {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1.1fr) minmax(0, 1fr);
    grid-template-areas:
        "icon title text"
        "num  for   tags"
        ".    price link";
    gap: 0.6rem 2rem;
    align-items: start;
    padding-block: clamp(1.75rem, 4vw, 3rem);
    border-bottom: 1px solid var(--line);
    transition: color 0.5s var(--ease);
}

/* Relleno lila al pasar el ratón */
.service::before {
    content: '';
    position: absolute;
    inset: 0 calc(var(--pad) * -1);
    z-index: -1;
    background: var(--lilac);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.6s var(--ease);
}

.service-icon {
    grid-area: icon;
    width: 2.6rem;
    height: 2.6rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: var(--accent);
    transition: color 0.5s var(--ease);
}

.service-num {
    grid-area: num;
    color: var(--muted);
}

.service-title {
    grid-area: title;
    font-size: clamp(2.2rem, 4.2vw, 4.25rem);
    line-height: 0.88;
}

.service-for {
    grid-area: for;
    color: var(--muted);
}

.service-text {
    grid-area: text;
    max-width: 34em;
    font-size: clamp(1rem, 0.3vw + 0.95rem, 1.15rem);
}

.service-tags {
    grid-area: tags;
    color: var(--muted);
}

.service-price {
    grid-area: price;
    font-weight: 600;
}

.service-link {
    grid-area: link;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    margin-top: 0.35rem;
    font-weight: 600;
    border-bottom: 1px solid currentColor;
}

.service-num,
.service-for,
.service-tags {
    transition: color 0.5s var(--ease);
}

@media (hover: hover) {
    .service:hover {
        color: var(--ink);
    }

    .service:hover::before {
        transform: scaleY(1);
        transform-origin: top;
    }

    .service:hover .service-icon {
        color: var(--ink);
    }

    .service:hover .service-num,
    .service:hover .service-for,
    .service:hover .service-tags {
        color: #3b2a6b;
    }

    .service-link:focus-visible {
        outline-color: currentColor;
    }
}

@media (max-width: 899px) {
    .service {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "icon  num"
            "title title"
            "for   for"
            "text  text"
            "tags  tags"
            "price price"
            "link  link";
        column-gap: 1rem;
    }

    .service-num {
        align-self: center;
    }
}

/* ---------- Sobre mí ---------- */
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 3.5rem 7vw;
    align-items: start;
}

.about-copy {
    container-type: inline-size;
}

.about-copy .section-title {
    margin-bottom: 2.25rem;
}

.about-copy p:not(.sec-label) {
    max-width: 36em;
    margin-top: 1.25rem;
    color: var(--muted);
    font-size: clamp(1rem, 0.3vw + 0.95rem, 1.15rem);
}

.about-copy .about-lead {
    color: var(--fg);
    font-size: clamp(1.3rem, 2vw, 1.85rem);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.about-copy .about-cta {
    margin-top: 2rem;
    color: var(--fg);
}

/* Ficha como una etiqueta de ropa */
.tag {
    position: relative;
    justify-self: center;
    width: min(100%, 27rem);
    margin-top: clamp(0rem, 6vh, 4rem);
    padding: 3rem 1.5rem 1.4rem;
    border-radius: 6px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 6px 6px 0 var(--purple);
    rotate: 2.5deg;
}

/* Ojal de la etiqueta */
.tag::before {
    content: '';
    position: absolute;
    top: 1rem;
    left: 50%;
    width: 0.95rem;
    height: 0.95rem;
    margin-left: -0.475rem;
    border-radius: 50%;
    background: var(--bg);
    box-shadow: 0 0 0 3px rgba(10, 10, 13, 0.14);
}

.tag-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px dashed rgba(10, 10, 13, 0.35);
    color: #5b5566;
}

.tag-mark {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 900;
    line-height: 0.8;
    color: var(--purple);
}

.tag-list > div {
    display: grid;
    grid-template-columns: minmax(8.5rem, 0.8fr) minmax(0, 1.2fr);
    gap: 0.2rem 1rem;
    align-items: baseline;
    padding-block: 0.7rem;
    border-bottom: 1px dashed rgba(10, 10, 13, 0.22);
}

.tag-list > div:last-child {
    border-bottom: 0;
}

.tag-list dt {
    color: #5b5566;
}

.tag-list dd {
    font-weight: 600;
    line-height: 1.35;
}

@media (max-width: 899px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .tag {
        width: min(100% - 1.25rem, 27rem);
        rotate: 1.5deg;
    }
}

@media (max-width: 479px) {
    .tag-list > div {
        grid-template-columns: 1fr;
    }
}

/* ---------- Proceso ---------- */
.process-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 4rem 7vw;
}

.process-intro {
    position: sticky;
    top: calc(var(--header-h) + 2.5rem);
    align-self: start;
    container-type: inline-size;
}

.process-lead {
    max-width: 30em;
    margin-top: 2rem;
    color: var(--muted);
    font-size: clamp(1rem, 0.3vw + 0.95rem, 1.15rem);
}

.process-counter {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    margin-top: clamp(2rem, 8vh, 5rem);
    font-family: var(--font-display);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 0.8;
}

.js-step-num {
    font-size: clamp(5rem, 12vw, 13rem);
    color: transparent;
    -webkit-text-stroke: 1.5px var(--fg);
    font-variant-numeric: tabular-nums;
}

.process-counter-total {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 400;
    font-stretch: 100%;
    color: var(--muted);
    padding-bottom: 0.5rem;
}

.process-track {
    position: relative;
    padding-left: 3rem;
}

.process-trace {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 6px;
    width: 1px;
    background: var(--line);
}

.process-trace-fill {
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: scaleY(var(--progress, 0));
    transform-origin: top;
}

.step {
    position: relative;
    padding-block: clamp(1.75rem, 5.5vh, 3.5rem);
}

.step:first-child {
    padding-top: 0.5rem;
}

.step-node {
    position: absolute;
    left: calc(-3rem + 6px - 6.5px);
    top: calc(clamp(1.75rem, 5.5vh, 3.5rem) + 0.15rem);
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 1px solid var(--muted);
    background: var(--bg);
    transition: background-color 0.4s, border-color 0.4s;
}

.step:first-child .step-node {
    top: 0.65rem;
}

.step-tag {
    color: var(--muted);
    margin-bottom: 1rem;
}

.step-title {
    margin-bottom: 1rem;
    font-size: clamp(2.2rem, 3.8vw, 3.75rem);
    line-height: 0.9;
}

.step-text {
    max-width: 32em;
    color: var(--muted);
    font-size: clamp(1rem, 0.3vw + 0.95rem, 1.15rem);
}

/* Solo el título se atenúa (contraste mínimo 4:1 en texto grande); el texto siempre es legible */
.js .step-title {
    opacity: 0.45;
    transition: opacity 0.5s var(--ease);
}

.js .step.is-active .step-title {
    opacity: 1;
}

.step.is-active .step-node {
    background: var(--accent);
    border-color: var(--accent);
}

.process-end {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    padding-top: clamp(1.5rem, 4vh, 2.5rem);
}

.process-end-text {
    font-size: clamp(1.6rem, 2.8vw, 2.6rem);
    line-height: 0.95;
}

@media (max-width: 899px) {
    .process-grid {
        grid-template-columns: 1fr;
    }

    .process-intro {
        position: static;
    }

    .process-counter {
        display: none;
    }

    .process-track {
        padding-left: 2.25rem;
    }

    .step-node {
        left: calc(-2.25rem + 6px - 6.5px);
    }
}

/* ---------- Preguntas frecuentes ---------- */
.faq-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    gap: 2.5rem 6vw;
    align-items: start;
}

.faq-head {
    position: sticky;
    top: calc(var(--header-h) + 2.5rem);
    container-type: inline-size;
}

.faq-list {
    border-top: 1px solid var(--line);
}

.faq-item {
    border-bottom: 1px solid var(--line);
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 3rem;
    padding-block: 1.35rem;
    list-style: none;
    cursor: pointer;
    font-size: clamp(1.15rem, 1.6vw, 1.5rem);
    font-weight: 650;
    letter-spacing: -0.015em;
    line-height: 1.2;
    transition: color 0.3s;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary:hover {
    color: var(--accent);
}

.faq-icon {
    position: relative;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid color-mix(in srgb, var(--fg) 42%, transparent);
    border-radius: 50%;
    color: var(--fg);
    transition: background-color 0.3s, border-color 0.3s;
}

.faq-icon::before,
.faq-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 11px;
    height: 1px;
    margin: -0.5px 0 0 -5.5px;
    background: currentColor;
    transition: transform 0.4s var(--ease);
}

.faq-icon::after {
    transform: rotate(90deg);
}

.faq-item[open] .faq-icon {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.faq-item[open] .faq-icon::after {
    transform: rotate(0deg);
}

.faq-answer {
    max-width: 42em;
    padding: 0 3.75rem 1.5rem 0;
    color: var(--muted);
    font-size: clamp(1rem, 0.3vw + 0.95rem, 1.15rem);
}

@media (max-width: 899px) {
    .faq-grid {
        grid-template-columns: 1fr;
    }

    .faq-head {
        position: static;
    }

    .faq-answer {
        padding-right: 0;
    }
}

/* ---------- Contacto (sección lila) ---------- */
.contact {
    padding-bottom: clamp(4rem, 10vh, 7rem);
}

.contact > .wrap {
    container-type: inline-size;
}

.contact-title {
    width: fit-content;
    margin-block: 0.25rem clamp(2.5rem, 6vh, 4rem);
    font-size: clamp(3.5rem, 18.5cqi, 17rem);
    line-height: 0.84;
}

/* «Derrape»: entra inclinado y se endereza con el scroll (main.js mueve --drift de 1 a 0) */
.contact-title-line {
    display: inline-block;
    transform: skewX(calc(var(--drift, 0) * -14deg));
    transform-origin: 0 100%;
}

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 3rem 6vw;
    align-items: start;
}

.contact-info {
    display: grid;
    gap: 2.5rem;
    min-width: 0;
}

.contact-text {
    max-width: 28em;
    font-size: clamp(1.1rem, 0.6vw + 0.95rem, 1.4rem);
    line-height: 1.45;
}

.contact-alt-label {
    margin-bottom: 0.75rem;
    color: var(--muted);
}

.contact-mail {
    display: inline-block;
    max-width: 100%;
    font-size: clamp(1.3rem, 2.4vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    overflow-wrap: anywhere;
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 100% 2px;
    padding-bottom: 0.15em;
    transition: background-size 0.6s var(--ease);
}

@media (hover: hover) {
    .contact-mail {
        background-size: 0% 2px;
    }

    .contact-mail:hover,
    .contact-mail:focus-visible {
        background-size: 100% 2px;
    }
}

.contact-alt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.contact-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.contact-meta dt {
    color: var(--muted);
}

/* Formulario: tarjeta negra sobre la sección lila */
.contact-form,
.form-success {
    --bg: var(--ink);
    --fg: var(--paper);
    --muted: #a8a3b5;
    --line: rgba(242, 239, 233, 0.16);
    --accent: var(--lilac);
    --accent-ink: var(--ink);
    grid-column: 2;
    grid-row: 1;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    border-radius: 6px;
    background: var(--bg);
    color: var(--fg);
    box-shadow: 8px 8px 0 var(--purple);
}

.contact-form {
    position: relative;
    display: grid;
    gap: 1.4rem;
}

.contact-form:focus {
    outline: none;
}

.sticker--form {
    position: absolute;
    top: -0.9rem;
    right: clamp(0.75rem, 3vw, 1.75rem);
    rotate: 5deg;
}

.form-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.2vw, 3rem);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 0.9;
    text-transform: uppercase;
}

.field {
    display: grid;
    gap: 0.5rem;
    min-width: 0;
    border: 0;
}

.field-label {
    color: var(--fg);
}

.field-optional {
    color: var(--muted);
}

.field-input {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.8rem 1rem;
    font-size: 1.05rem;
    color: var(--fg);
    background: rgba(242, 239, 233, 0.05);
    border: 1px solid rgba(242, 239, 233, 0.42);
    border-radius: var(--radius);
    transition: border-color 0.25s, background-color 0.25s;
}

textarea.field-input {
    min-height: 6.5rem;
    resize: vertical;
}

.field-input:hover {
    border-color: var(--fg);
}

.field-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-color: var(--accent);
    background: rgba(242, 239, 233, 0.08);
}

.field-input[aria-invalid="true"] {
    border: 2px solid var(--accent);
    background: rgba(196, 181, 253, 0.08);
}

.field-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.92rem;
    font-weight: 600;
}

.field-error::before {
    content: '!';
    display: grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent);
    color: var(--ink);
    font-size: 0.75rem;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chips input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(242, 239, 233, 0.42);
    border-radius: 999px;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}

.chip:hover {
    border-color: var(--fg);
}

.chips input:checked + .chip {
    background: var(--lilac);
    border-color: var(--lilac);
    color: var(--ink);
}

.chips input:focus-visible + .chip {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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

.form-submit[disabled] {
    opacity: 0.6;
    cursor: progress;
}

.form-note {
    font-size: 0.9rem;
    color: var(--muted);
}

.form-note a {
    color: var(--fg);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.form-status {
    font-weight: 600;
}

.form-status:empty {
    display: none;
}

.form-success {
    display: grid;
    gap: 1rem;
    align-content: start;
}

.form-success:focus {
    outline: none;
}

.form-success-led {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--lilac);
    --pulse: rgba(196, 181, 253, 0.55);
    --pulse-size: 8px;
    animation: pulse 2s infinite;
}

/* Sin Formspree: aún falta darle a enviar en el correo (piloto hueco, «en espera») */
.form-success.is-pending .form-success-led {
    background: transparent;
    border: 2px solid var(--lilac);
    animation: none;
}

.form-mail {
    display: grid;
    gap: 0.75rem;
}

.form-mail a {
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.form-mail-text {
    min-height: 9rem;
    font-size: 0.95rem;
    resize: vertical;
}

.form-mail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.form-success-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 3.6vw, 3.4rem);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 0.9;
    text-transform: uppercase;
}

.form-success-text {
    max-width: 30em;
    font-size: 1.05rem;
}

.form-success-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    margin-top: 0.5rem;
}

@media (max-width: 899px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-form,
    .form-success {
        grid-column: 1;
        grid-row: auto;
        box-shadow: 5px 5px 0 var(--purple);
    }
}

@media (max-width: 599px) {
    .contact-meta {
        grid-template-columns: 1fr;
    }
}

/* ---------- Footer ---------- */
.site-footer {
    padding-block: 1.75rem;
    border-top: 1px solid var(--line);
    font-size: 0.9rem;
}

.footer-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
}

.footer-mark {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--accent);
    margin-right: 0.35rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.25rem;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 4px;
    transition: text-decoration-color 0.3s;
}

.footer-links a:hover {
    text-decoration-color: currentColor;
}

.back-top {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
}

/* ---------- CTA fijo en móvil (zona del pulgar) ---------- */
.mobile-cta {
    display: none;
}

@media (max-width: 899px) {
    .js .mobile-cta {
        display: flex;
        gap: 0.5rem;
        position: fixed;
        left: 0.75rem;
        right: 0.75rem;
        bottom: calc(0.75rem + env(safe-area-inset-bottom));
        z-index: 80;
        max-width: 30rem;
        margin-inline: auto;
        padding: 0.4rem;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: color-mix(in srgb, var(--bg) 86%, transparent);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
        transform: translateY(calc(100% + 1.5rem));
        transition: transform 0.5s var(--ease);
    }

    .js .mobile-cta.is-visible {
        transform: none;
    }

    .mobile-cta .btn-accent {
        flex: 1;
    }

    .site-footer {
        padding-bottom: calc(1.75rem + env(safe-area-inset-bottom));
    }
}

/* ---------- Casos de estudio (panel a pantalla completa) ---------- */
.case {
    --bg: var(--ink);
    --fg: var(--paper);
    --muted: #a8a3b5;
    --line: rgba(242, 239, 233, 0.14);
    --accent: var(--lilac);
    --accent-ink: var(--ink);
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bg);
    color: var(--fg);
    clip-path: inset(100% 0 0 0);
    transition: clip-path 0.9s var(--ease);
}

.case.is-active,
.no-js .case:target {
    display: block;
}

.case.is-open,
.no-js .case:target {
    clip-path: inset(0 0 0 0);
}

.case-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--header-h);
    padding-inline: var(--pad);
    color: var(--muted);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.case-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.case-close {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 2.75rem;
    padding-inline: 1.1rem;
    border: 1px solid color-mix(in srgb, var(--fg) 42%, transparent);
    border-radius: var(--radius);
    color: var(--fg);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.case-close:hover {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

.case-head {
    padding-block: clamp(3rem, 12vh, 8rem) clamp(2rem, 5vh, 3rem);
    container-type: inline-size;
}

.case-title {
    font-size: clamp(3rem, 17cqi, 13rem);
    line-height: 0.84;
    text-wrap: balance;
}

.case-lead {
    max-width: 34em;
    margin-top: clamp(1.5rem, 4vh, 2.5rem);
    font-size: clamp(1.1rem, 1.8vw, 1.6rem);
    line-height: 1.4;
    color: var(--muted);
}

.case-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem 1.5rem;
    padding-block: 1.25rem;
    border-top: 1px solid var(--line);
}

.case-meta dt {
    color: var(--muted);
    margin-bottom: 0.3rem;
}

.case-media {
    margin-block: clamp(1.5rem, 4vw, 3rem);
}

.case-media img,
.case-media video {
    height: auto;
}

.case-media video {
    aspect-ratio: 16 / 9;
}

.case-story {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 2rem clamp(2rem, 4vw, 4rem);
    padding-block: clamp(2rem, 6vh, 4rem);
}

.case-block-title {
    margin-bottom: 0.9rem;
    color: var(--accent);
}

.case-block p {
    max-width: 40em;
    font-size: clamp(1.05rem, 1.3vw, 1.3rem);
    line-height: 1.5;
}

.case-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(0.75rem, 2vw, 1.5rem);
}

.case-pair .case-media {
    margin-block: 0;
}

.case-quote {
    padding-block: clamp(2rem, 6vh, 4rem);
}

.case-quote blockquote p {
    max-width: 30em;
    font-size: clamp(1.5rem, 3vw, 2.75rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.case-quote figcaption {
    margin-top: 1.25rem;
    color: var(--muted);
}

.case-cta {
    display: grid;
    justify-items: start;
    gap: 1.25rem;
    margin-top: clamp(2rem, 6vh, 4rem);
    padding-block: clamp(2.5rem, 7vh, 4.5rem);
    border-top: 1px solid var(--line);
}

.case-cta-title {
    max-width: 12em;
    font-size: clamp(2.4rem, 5.5vw, 5rem);
    line-height: 0.88;
}

.case-next {
    display: grid;
    gap: 1rem;
    justify-items: center;
    padding: clamp(3.5rem, 10vh, 7rem) var(--pad);
    border-top: 1px solid var(--line);
    text-align: center;
}

.case-next .mono {
    color: var(--muted);
}

.case-next-title {
    font-size: clamp(2.8rem, 9vw, 9rem);
    line-height: 0.86;
}

@media (max-width: 899px) {
    .case-meta {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 599px) {
    .case-pair {
        grid-template-columns: 1fr;
    }

    .case-bar-cta {
        display: none;
    }
}

/* ---------- Páginas legales (aviso-legal.html y privacidad.html) ---------- */
.legal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--header-h);
    border-bottom: 1px solid var(--line);
}

.legal {
    padding-block: clamp(3rem, 10vh, 6rem);
}

.legal-title {
    margin-bottom: 1rem;
    font-size: clamp(3rem, 9vw, 6.5rem);
    line-height: 0.86;
}

.legal-updated {
    margin-bottom: 2.5rem;
    color: var(--muted);
}

.legal h2 {
    margin: 2.5rem 0 0.75rem;
    font-size: clamp(1.3rem, 2vw, 1.7rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.legal p,
.legal li {
    max-width: 42em;
    color: var(--muted);
}

.legal p + p {
    margin-top: 0.9rem;
}

.legal ul {
    margin-top: 0.75rem;
    padding-left: 1.25rem;
    list-style: disc;
}

.legal li + li {
    margin-top: 0.4rem;
}

.legal a {
    color: var(--fg);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal strong {
    color: var(--fg);
    font-weight: 600;
}

.legal-pending {
    padding: 0 0.3em;
    border-radius: 3px;
    background: #ffb84d;
    color: var(--ink);
    font-weight: 600;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    z-index: 250;
    max-width: calc(100% - 2rem);
    padding: 0.85rem 1.3rem;
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    box-shadow: 4px 4px 0 var(--purple);
    text-align: center;
    opacity: 0;
    transform: translate(-50%, 150%);
    transition: opacity 0.4s, transform 0.6s var(--ease);
    pointer-events: none;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- Vista previa de huecos pendientes (?pendientes) ---------- */
.pending-preview [data-pending] {
    position: relative;
    outline: 2px dashed #ffb84d;
    outline-offset: 4px;
}

.pending-preview [data-pending]::after {
    content: 'pendiente';
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    z-index: 3;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: #ffb84d;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

/* ---------- Animaciones de entrada (solo con JS) ---------- */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s var(--ease), transform 1.1s var(--ease);
    transition-delay: var(--d, 0s);
}

.js [data-reveal].is-in {
    opacity: 1;
    transform: none;
}

/* La máscara de cada palabra deja aire arriba (tildes de mayúsculas) y a la derecha (sombra del efecto) */
.split-w {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding: 0.16em 0.1em 0.1em 0;
    margin: -0.16em -0.1em -0.1em 0;
}

.split-w > span {
    display: inline-block;
}

.js .split-w > span {
    transform: translateY(118%);
    transition: transform 1.1s var(--ease);
    transition-delay: calc(var(--i, 0) * 0.045s);
}

.js .hero-title .split-w > span {
    transition-delay: calc(0.12s + var(--i, 0) * 0.06s);
}

.is-in .split-w > span,
.is-loaded .hero-title .split-w > span {
    transform: none;
}

/* ---------- Movimiento reducido: sin grano, sin distorsión, sin animaciones ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }

    .grain {
        display: none;
    }

    .contact-title-line {
        transform: none;
    }

    .js [data-reveal],
    .js .split-w > span {
        opacity: 1;
        transform: none;
    }

    .js [data-draw] .draw {
        stroke-dashoffset: 0;
    }

    .js .wire svg {
        clip-path: none;
    }
}

/* ---------- Modo de alto contraste del sistema ---------- */
@media (forced-colors: active) {
    .grain,
    .duo::before,
    .duo::after {
        display: none;
    }

    .duo > img,
    .duo > video {
        filter: none;
    }
}
