/* ============================================================
   Enterprise Thinking — fialka.es
   Sistema visual sacado del logo: azul marino #052352,
   gris azulado #79808A, blanco roto. Serif para titulares
   (Libre Caslon Text) + sans para lectura (Inter).
============================================================ */

/* ---------- Fonts ---------- */
@font-face {
    font-family: 'Libre Caslon Text';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/libre-caslon-text-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('../fonts/inter-latin.woff2') format('woff2');
}

/* Arial ajustada a las métricas de Inter: el cambio de fuente no mueve el texto */
@font-face {
    font-family: 'Inter Fallback';
    src: local('Arial');
    size-adjust: 107.12%;
    ascent-override: 90.44%;
    descent-override: 22.52%;
    line-gap-override: 0%;
}

/* ---------- Tokens ---------- */
:root {
    --navy: #052352;
    --navy-deep: #031838;
    --grey: #79808A;          /* detalles, líneas, texto grande */
    --grey-text: #5A616D;     /* texto pequeño secundario (AA sobre papel) */
    --ink: #1B2638;           /* texto de lectura */
    --paper: #FAFAF8;
    --white: #FFFFFF;
    --line: rgba(5, 35, 82, 0.14);
    --line-strong: rgba(5, 35, 82, 0.28);
    --on-dark: rgba(255, 255, 255, 0.86);
    --on-dark-soft: rgba(255, 255, 255, 0.62);
    --grad: linear-gradient(180deg, var(--navy), var(--grey));

    --serif: 'Libre Caslon Text', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', 'Inter Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --fs-body: clamp(1.0625rem, 0.98rem + 0.32vw, 1.1875rem);
    --fs-small: 0.9rem;
    --fs-lead: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem);
    --fs-h1: clamp(2.9rem, 1.8rem + 4.6vw, 5.4rem);
    --fs-h2: clamp(2rem, 1.45rem + 2.2vw, 3.1rem);
    --fs-h3: clamp(1.25rem, 1.15rem + 0.4vw, 1.45rem);
    --fs-statement: clamp(2.1rem, 1.3rem + 3.4vw, 4rem);

    --measure: 66ch;
    --wrap: 1180px;
    --gutter: clamp(20px, 5vw, 48px);
    --section: clamp(80px, 6vw + 48px, 150px);
    --header-h: 76px;

    --ease: cubic-bezier(.22, .61, .36, 1);
    --slow: 900ms;
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: var(--fs-body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--navy); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
p, ul, ol, figure, blockquote { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 400;
    color: var(--navy);
    line-height: 1.15;
    letter-spacing: -0.005em;
    text-wrap: balance;
}

p, li, blockquote { text-wrap: pretty; }

::selection { background: var(--navy); color: var(--white); }

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

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

.skip {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--navy);
    color: var(--white);
    font-weight: 600;
    text-decoration: none;
}
.skip:focus { top: 12px; }

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

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.1em; }

.section { padding-block: var(--section); }
.section + .section { padding-top: 0; }

.section-title {
    font-size: var(--fs-h2);
    margin-bottom: clamp(28px, 3vw, 44px);
}

.lead {
    font-size: var(--fs-lead);
    line-height: 1.55;
    color: var(--ink);
}

.muted { color: var(--grey-text); }

.statement {
    font-family: var(--serif);
    font-size: var(--fs-statement);
    line-height: 1.12;
    color: var(--navy);
    text-wrap: balance;
}

/* Separador: el círculo abierto del logo */
.sep {
    display: flex;
    justify-content: center;
    padding-block: clamp(8px, 2vw, 24px);
}
.sep svg { width: 34px; height: 34px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    min-height: 50px;
    padding: 0.85em 1.6em;
    border: 1px solid var(--navy);
    border-radius: 2px;
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 250ms var(--ease), color 250ms var(--ease), border-color 250ms var(--ease);
}

.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-deep); }

.btn-secondary { background: transparent; color: var(--navy); }
.btn-secondary:hover { background: var(--navy); color: var(--white); }

.on-dark .btn-primary { background: var(--white); color: var(--navy); border-color: var(--white); }
.on-dark .btn-secondary { color: var(--white); border-color: rgba(255, 255, 255, 0.6); }
.on-dark .btn-secondary:hover { background: var(--white); color: var(--navy); }
.on-dark :focus-visible { outline-color: var(--white); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

.text-link {
    display: inline-block;
    padding-top: 10px;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid var(--line-strong);
    padding-bottom: 2px;
    transition: border-color 250ms var(--ease);
}
.text-link:hover { border-color: var(--navy); }
.text-link::after { content: ' →'; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(250, 250, 248, 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color 300ms var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

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

.brand {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--navy);
}
.brand img { width: auto; height: 46px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; }
@media (max-width: 380px) {
    .header-inner .brand { gap: 9px; }
    .header-inner .brand img { height: 34px; }
    .header-inner .brand-name { font-size: 1rem; }
}
.brand-name { font-family: var(--serif); font-size: 1.12rem; }
.brand-by { font-size: 0.78rem; color: var(--grey-text); letter-spacing: 0.02em; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.nav-list { display: flex; gap: 26px; }
.nav-list a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    padding-block: 6px;
    background: linear-gradient(var(--navy), var(--navy)) 0 100% / 0 1px no-repeat;
    transition: background-size 300ms var(--ease), color 200ms;
}
.nav-list a:hover,
.nav-list a[aria-current="page"] { color: var(--navy); background-size: 100% 1px; }

.langs { display: flex; align-items: center; gap: 2px; font-size: 0.85rem; }
.langs li + li::before { content: '·'; color: var(--grey); margin-inline: 4px; }
.langs a {
    color: var(--grey-text);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 4px 2px;
}
.langs a:hover { color: var(--navy); }
.langs a[aria-current="true"] { color: var(--navy); border-bottom: 1px solid var(--navy); }

.nav-toggle {
    display: none;
    width: 44px; height: 44px;
    border: 0;
    background: none;
    cursor: pointer;
    position: relative;
}
.nav-toggle .bars,
.nav-toggle .bars::before,
.nav-toggle .bars::after {
    position: absolute;
    left: 11px;
    width: 22px;
    height: 1.5px;
    background: var(--navy);
    transition: transform 300ms var(--ease), opacity 200ms;
    content: '';
}
.nav-toggle .bars { top: 21px; }
.nav-toggle .bars::before { left: 0; top: -7px; }
.nav-toggle .bars::after { left: 0; top: 7px; }
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 960px) {
    .nav-toggle { display: block; }
    .brand img { height: 40px; }
    .site-nav {
        position: fixed;
        inset: var(--header-h) 0 auto 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 28px;
        padding: 28px var(--gutter) 36px;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 30px 40px -30px rgba(5, 35, 82, 0.25);
        visibility: hidden;
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity 250ms var(--ease), transform 250ms var(--ease), visibility 0s 250ms;
    }
    .site-nav.is-open {
        visibility: visible;
        opacity: 1;
        transform: none;
        transition: opacity 250ms var(--ease), transform 250ms var(--ease);
    }
    .nav-list { flex-direction: column; gap: 6px; width: 100%; }
    .nav-list a { display: block; font-family: var(--serif); font-size: 1.5rem; padding-block: 8px; }
    .langs { font-size: 1rem; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(40px, 6vw, 96px) clamp(24px, 3vw, 40px); }

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center;
    gap: clamp(32px, 5vw, 80px);
}

.hero h1 {
    font-size: var(--fs-h1);
    line-height: 1.02;
    letter-spacing: -0.015em;
}

.hero-sub {
    margin-top: clamp(20px, 2.4vw, 30px);
    max-width: 30ch;
    font-family: var(--serif);
    font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem);
    line-height: 1.35;
    color: var(--grey-text);
}

.hero .btn-row { margin-top: clamp(28px, 3.4vw, 44px); }

.hero-art { width: 100%; max-width: 560px; justify-self: center; }

@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-art { order: -1; max-width: 300px; margin-bottom: -8px; }
}

/* Hero SVG: círculo que se dibuja + nodos que se ordenan y conectan */
.ring-draw {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}
/* Puzle del hero: piezas claras con juntas grises; dos piezas de acento */
.pz { transform-box: fill-box; transform-origin: center; }
.pz path { fill: #EDF0F5; stroke: var(--grey); stroke-width: 1.3; stroke-linejoin: round; }
.pz.is-key path { fill: var(--navy); stroke: var(--navy); }
.pz.is-alt path { fill: #CDD2DA; }
.pz-whole { fill: none; stroke: var(--grey); stroke-width: 1.2; opacity: 0.45; }
/* La π del logo, a la derecha de la abertura del círculo */
.art-pi path { fill: none; stroke: var(--navy); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Problem ---------- */
.problem .prose p:not(.statement) { font-size: var(--fs-lead); line-height: 1.55; }
.problem .statement { margin-top: clamp(36px, 4vw, 56px); }

/* ---------- What is ET (diagram) ---------- */
.et-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(32px, 6vw, 96px);
    align-items: center;
}
.et-grid h2 { font-size: var(--fs-h2); }
.et-grid .lead { margin-top: 24px; }

.diagram { width: 100%; max-width: 620px; justify-self: center; }
.diagram text {
    font-family: var(--sans);
    font-size: 19px;
    font-weight: 600;
    fill: var(--navy);
    letter-spacing: 0.01em;
}
.diagram .chord { stroke: var(--grey); stroke-width: 1; opacity: 0.38; fill: none; }
.diagram .rim { stroke: var(--navy); stroke-width: 1.4; opacity: 0.7; fill: none; }
.diagram .dot { fill: var(--paper); stroke: var(--navy); stroke-width: 2; }
.diagram .core { fill: var(--navy); }

.diagram-arcs { display: none; }

@media (max-width: 960px) {
    .et-grid { grid-template-columns: 1fr; }
    .et-grid > div { max-width: var(--measure); }
}
@media (max-width: 560px) {
    .diagram-circle { display: none; }
    .diagram-arcs { display: block; max-width: 380px; }
}

/* ---------- How I help: questions ---------- */
.questions {
    margin-block: clamp(28px, 3vw, 44px);
    border-top: 1px solid var(--line);
}
.questions li {
    padding-block: clamp(16px, 1.8vw, 24px);
    border-bottom: 1px solid var(--line);
    font-family: var(--serif);
    font-size: clamp(1.35rem, 1.1rem + 1vw, 1.95rem);
    line-height: 1.3;
    color: var(--navy);
}
.help-lead { font-weight: 600; color: var(--navy); }

/* ---------- Symptoms → causes ---------- */
.symptoms-table {
    width: 100%;
    margin-block: clamp(28px, 3vw, 44px);
    border-collapse: collapse;
}
.symptoms-table th {
    padding: 0 0 14px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--grey-text);
    text-align: left;
}
.symptoms-table td {
    padding: clamp(16px, 1.8vw, 22px) 0;
    border-top: 1px solid var(--line);
    vertical-align: baseline;
}
.symptoms-table td:first-child {
    width: 46%;
    font-family: var(--serif);
    font-size: var(--fs-h3);
    color: var(--navy);
    padding-right: 16px;
}
.symptoms-table td:last-child { position: relative; padding-left: 56px; color: var(--grey-text); }
.symptoms-table td:last-child::before { content: '→'; position: absolute; left: 12px; color: var(--grey); }
.symptoms-table th:last-child { padding-left: 56px; }
.symptoms-table tr:last-child td { border-bottom: 1px solid var(--line); }

@media (max-width: 640px) {
    .symptoms-table thead { display: none; }
    .symptoms-table, .symptoms-table tbody, .symptoms-table tr, .symptoms-table td { display: block; width: auto; }
    .symptoms-table tr { padding: 18px 0; border-top: 1px solid var(--line); }
    .symptoms-table tr:last-child { border-bottom: 1px solid var(--line); }
    .symptoms-table td, .symptoms-table tr:last-child td { border: 0; padding: 0; }
    .symptoms-table td:first-child { width: auto; }
    .symptoms-table td:last-child { padding-left: 24px; margin-top: 6px; }
    .symptoms-table td:last-child::before { content: '↳'; left: 2px; }
}

.big-question {
    margin-block: clamp(20px, 2vw, 28px) clamp(28px, 3vw, 40px);
    font-family: var(--serif);
    font-size: var(--fs-statement);
    line-height: 1.12;
    color: var(--navy);
    text-wrap: balance;
    max-width: 22ch;
}

/* ---------- Services ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(36px, 4vw, 56px) clamp(28px, 3.4vw, 52px);
}
.service { padding-top: 22px; border-top: 1px solid var(--line-strong); }
.service-icon { width: 34px; height: 34px; color: var(--navy); margin-bottom: 18px; }
.service h3 { font-size: var(--fs-h3); margin-bottom: 10px; }
.service p { font-size: 1rem; line-height: 1.65; color: var(--grey-text); }

@media (max-width: 960px) { .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .services-grid { grid-template-columns: 1fr; } }

/* ---------- Approach ---------- */
.split {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: clamp(28px, 6vw, 96px);
}
.split .section-title { margin-bottom: 0; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.highlights {
    margin-block: clamp(32px, 3.4vw, 48px);
    padding-left: clamp(18px, 2vw, 28px);
    border-left: 2px solid;
    border-image: var(--grad) 1;
}
.highlights p {
    font-family: var(--serif);
    font-size: clamp(1.45rem, 1.15rem + 1.2vw, 2.2rem);
    line-height: 1.25;
}
.highlights p:first-child { color: var(--grey); }
.highlights p + p { margin-top: 0.5em; color: var(--navy); }

/* ---------- Transformation (dark manifesto band) ---------- */
.band {
    background: var(--navy);
    color: var(--on-dark);
    padding-block: var(--section);
    position: relative;
    overflow: clip;
}
.band h2 { color: var(--white); font-size: var(--fs-h2); max-width: 18ch; }
.band .prose { margin-top: clamp(28px, 3vw, 40px); }
.band-ring {
    position: absolute;
    width: min(78vw, 900px);
    right: -18vw;
    top: 50%;
    translate: 0 -50%;
    opacity: 0.12;
    pointer-events: none;
}

.strike-list {
    margin-block: clamp(24px, 3vw, 36px);
    display: flex;
    flex-direction: column;
    gap: 0.2em;
}
.strike-list li {
    font-family: var(--serif);
    font-size: clamp(1.45rem, 1.1rem + 1.5vw, 2.4rem);
    line-height: 1.3;
    color: var(--white);
}
.strike-list s {
    position: relative;
    text-decoration: none;
    color: var(--on-dark-soft);
    transition: color 900ms var(--ease);
}
.strike-list s::after {
    content: '';
    position: absolute;
    left: -2px;
    right: -2px;
    top: 56%;
    height: 2px;
    background: currentColor;
    transform-origin: 0 50%;
    transition: transform 900ms var(--ease);
}
/* Con JS: empiezan sin tachar y se tachan una a una al entrar en pantalla */
.js .strike-list:not(.is-visible) s { color: var(--white); }
.js .strike-list:not(.is-visible) s::after { transform: scaleX(0); }
.strike-list li:nth-child(1) s, .strike-list li:nth-child(1) s::after { transition-delay: 400ms; }
.strike-list li:nth-child(2) s, .strike-list li:nth-child(2) s::after { transition-delay: 1100ms; }
.strike-list li:nth-child(3) s, .strike-list li:nth-child(3) s::after { transition-delay: 1800ms; }
.strike-list li:nth-child(4) s, .strike-list li:nth-child(4) s::after { transition-delay: 2500ms; }

.band-closing {
    margin-top: clamp(40px, 5vw, 72px);
    font-family: var(--serif);
    font-size: var(--fs-statement);
    line-height: 1.12;
    color: var(--white);
    max-width: 20ch;
}

/* ---------- Book ---------- */
.book-feature {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(40px, 7vw, 110px);
    align-items: center;
}
@media (max-width: 860px) { .book-feature { grid-template-columns: 1fr; } }

.book-3d {
    perspective: 1600px;
    display: flex;
    justify-content: center;
    padding-block: 12px 28px;
}
.book-3d .book {
    display: block;
    position: relative;
    width: min(100%, 360px);
    transform: rotateY(-16deg) rotateX(2deg);
    transform-style: preserve-3d;
    transition: transform 900ms var(--ease);
    box-shadow:
        1px 1px 0 rgba(5, 35, 82, 0.15),
        24px 30px 50px -18px rgba(5, 35, 82, 0.45),
        6px 10px 18px -6px rgba(5, 35, 82, 0.25);
}
.book-3d:hover .book { transform: rotateY(-6deg) rotateX(1deg); }
.book-3d .book img { width: 100%; height: auto; }
/* lomo y brillo para el efecto de libro */
.book-3d .book::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 5%;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.22), rgba(255, 255, 255, 0.15) 60%, rgba(0, 0, 0, 0.06));
}
.book-3d .book::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(255, 255, 255, 0.18), transparent 38%);
    pointer-events: none;
}

.book-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--grey-text);
    margin-bottom: 14px;
}
.book-title { font-size: var(--fs-h2); }
.book-subtitle {
    margin-top: 10px;
    font-family: var(--serif);
    font-size: var(--fs-lead);
    color: var(--grey-text);
    line-height: 1.4;
}
.book-feature .lead { margin-top: 24px; max-width: 46ch; }
.book-feature .btn-row { margin-top: 32px; }

/* ---------- Who I work with ---------- */
.checks { margin-top: 28px; display: grid; gap: 0; }
.checks li {
    position: relative;
    padding: 14px 0 14px 40px;
    border-bottom: 1px solid var(--line);
}
.checks li:first-child { border-top: 1px solid var(--line); }
.checks li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 1.15em;
    width: 15px;
    height: 8px;
    border-left: 1.5px solid var(--navy);
    border-bottom: 1.5px solid var(--navy);
    transform: rotate(-45deg);
}

.pull-quote {
    margin-top: clamp(32px, 4vw, 52px);
    padding-left: clamp(18px, 2vw, 28px);
    border-left: 2px solid;
    border-image: var(--grad) 1;
}
.pull-quote .quote-lead { color: var(--grey-text); }
.pull-quote blockquote {
    margin-top: 6px;
    font-family: var(--serif);
    font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.7rem);
    line-height: 1.2;
    color: var(--navy);
}

/* ---------- About (short + page) ---------- */
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
    gap: clamp(32px, 6vw, 96px);
    align-items: start;
}
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

.portrait {
    position: relative;
    max-width: 420px;
}
.portrait img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 22%; filter: grayscale(0.15); }
.portrait::after {
    content: '';
    position: absolute;
    inset: auto -14px -14px auto;
    width: 64%;
    height: 64%;
    border-right: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
    pointer-events: none;
}

.about-quote {
    margin-block: 8px 24px;
    font-family: var(--serif);
    font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem);
    line-height: 1.22;
    color: var(--navy);
}
.about-grid .text-link { display: inline-block; margin-top: 26px; }

.connections {
    margin-block: 1.2em;
    font-family: var(--serif);
    font-size: clamp(1.4rem, 1.15rem + 1vw, 2rem);
    color: var(--navy);
    line-height: 1.3;
}

.background {
    margin-top: clamp(64px, 8vw, 120px);
    padding-top: clamp(40px, 5vw, 64px);
    border-top: 1px solid var(--line);
}
.background h2 { font-size: var(--fs-h3); margin-bottom: 18px; }
.background p { font-size: 1rem; color: var(--grey-text); }

/* ---------- CTA + forms ---------- */
.cta-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(36px, 6vw, 96px);
    align-items: start;
}
@media (max-width: 900px) { .cta-grid { grid-template-columns: 1fr; } }

.cta-strong { font-weight: 600; color: var(--navy); }
.signature { margin-top: clamp(28px, 3vw, 40px); }
.signature p { font-family: var(--serif); font-size: var(--fs-h3); color: var(--navy); line-height: 1.35; }
.signature p + p { color: var(--grey); }

.form {
    display: grid;
    gap: 18px;
    padding: clamp(24px, 3vw, 40px);
    background: var(--white);
    border: 1px solid var(--line);
}
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.field label { font-size: 0.9rem; font-weight: 600; color: var(--navy); }
.field label .opt { font-weight: 400; color: var(--grey-text); }
.field input,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--paper);
    border: 1px solid var(--line-strong);
    border-radius: 2px;
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 200ms, background-color 200ms;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--navy); background: var(--white); box-shadow: 0 0 0 3px rgba(5, 35, 82, 0.12); }
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: #8A1C1C; }

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

.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 0.92rem; color: var(--grey-text); }
.consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--navy); flex-shrink: 0; }

.form-status { min-height: 1.5em; font-size: 0.95rem; }
.form-status.is-error { color: #8A1C1C; }
.form-status.is-success { color: var(--navy); font-weight: 600; }

.contact-direct { display: grid; gap: 18px; margin-top: 36px; }
.contact-direct dt { font-size: 0.85rem; color: var(--grey-text); }
.contact-direct dd { margin: 2px 0 0; font-size: 1.1rem; }
.contact-direct a { text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.contact-direct a:hover { border-color: var(--navy); }

/* ---------- Book page ---------- */
.page-hero { padding-block: clamp(48px, 6vw, 96px) var(--section); }
.page-hero h1 { font-size: var(--fs-h1); line-height: 1.04; }

.facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 10px 28px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    font-size: 0.98rem;
}
.facts dt { color: var(--grey-text); }
.facts dd { margin: 0; color: var(--ink); }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 10px; } }

.learn-list { margin-top: 24px; counter-reset: learn; }
.learn-list li {
    position: relative;
    padding: 14px 0 14px 44px;
    border-bottom: 1px solid var(--line);
}
.learn-list li:first-child { border-top: 1px solid var(--line); }
.learn-list li::before {
    counter-increment: learn;
    content: counter(learn, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 15px;
    font-family: var(--serif);
    font-size: 0.95rem;
    color: var(--grey);
}

.quote-band {
    background: var(--white);
    border-block: 1px solid var(--line);
    padding-block: clamp(56px, 7vw, 110px);
}
.quote-band blockquote {
    font-family: var(--serif);
    font-size: clamp(1.6rem, 1.2rem + 1.9vw, 2.8rem);
    line-height: 1.25;
    color: var(--navy);
    max-width: 30ch;
}
.quote-band .tagline { margin-top: 24px; color: var(--grey-text); }

.editions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(24px, 3vw, 44px);
    margin-top: 32px;
}
@media (max-width: 760px) { .editions { grid-template-columns: 1fr; } }
.edition { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: start; }
.edition img { width: 96px; box-shadow: 6px 8px 18px -8px rgba(5, 35, 82, 0.45); }
.edition h3 { font-size: 1.15rem; margin-bottom: 6px; }
.edition p { font-size: 0.9rem; color: var(--grey-text); line-height: 1.5; }
.edition .text-link { display: inline-block; margin-top: 10px; font-size: 0.92rem; }

/* ---------- Legal ---------- */
.legal { padding-block: clamp(48px, 6vw, 88px) var(--section); }
.legal h1 { font-size: var(--fs-h2); }
.legal .updated { margin-top: 10px; font-size: 0.92rem; color: var(--grey-text); }
.legal-body { max-width: 72ch; margin-top: 40px; font-size: 1rem; }
.legal-body > * + * { margin-top: 1em; }
.legal-body h2 { font-size: var(--fs-h3); margin-top: 2.2em; }
.legal-body h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; margin-top: 1.6em; }
.legal-body ul { padding-left: 1.2em; }
.legal-body li + li { margin-top: 0.4em; }
.legal-data { list-style: none; padding: 18px 22px !important; background: var(--white); border: 1px solid var(--line); }
.legal-note { padding: 12px 16px; border-left: 2px solid var(--grey); background: var(--white); font-size: 0.95rem; }
.table-wrap { overflow-x: auto; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: var(--white); }
.legal-table th, .legal-table td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal-table th { font-weight: 600; color: var(--navy); }
.legal-table code { font-size: 0.88em; color: var(--navy); }
.legal-back { margin-top: 48px; }

@media (max-width: 640px) {
    .legal-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .legal-table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; width: 100%; }
    .legal-table tr { border: 1px solid var(--line); margin-bottom: 12px; }
    .legal-table td { border: 0; border-top: 1px solid var(--line); padding: 8px 12px; }
    .legal-table td:first-child { border-top: 0; }
    .legal-table td::before { content: attr(data-label); display: block; font-size: 0.78rem; font-weight: 600; color: var(--grey-text); }
    .legal-table { background: none; }
    .legal-table tr { background: var(--white); }
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--navy);
    color: var(--on-dark);
    padding-block: clamp(56px, 7vw, 96px) 32px;
    font-size: 0.95rem;
}
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
    gap: 40px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { display: flex; gap: 14px; align-items: center; }
.footer-brand img { height: 56px; width: auto; }
.footer-brand .brand-name { color: var(--white); font-size: 1.3rem; }
.footer-brand .brand-by { color: var(--on-dark-soft); }
.footer-tagline { margin-top: 20px; max-width: 32ch; font-family: var(--serif); font-size: 1.15rem; line-height: 1.45; color: var(--on-dark); }
.footer-col h2 { font-family: var(--sans); font-size: 0.85rem; font-weight: 600; color: var(--on-dark-soft); margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul:not(.langs) { display: grid; gap: 8px; }
.site-footer .langs a { color: var(--on-dark-soft); }
.site-footer .langs a[aria-current="true"] { color: var(--white); border-color: var(--white); }
.site-footer .langs li + li::before { color: var(--on-dark-soft); }
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--on-dark-soft);
    font-size: 0.88rem;
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 18px; }
.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--white);
    cursor: pointer;
    font-size: inherit;
}
.link-button:hover { text-decoration: underline; }
.site-footer :focus-visible { outline-color: var(--white); }

/* ---------- Cookie banner ---------- */
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 60;
    max-width: 640px;
    margin-inline: auto;
    padding: 20px 22px;
    background: var(--white);
    border: 1px solid var(--line-strong);
    box-shadow: 0 24px 50px -20px rgba(5, 35, 82, 0.35);
    font-size: 0.92rem;
    line-height: 1.55;
    transform: translateY(16px);
    opacity: 0;
    transition: transform 400ms var(--ease), opacity 400ms var(--ease);
}
.cookie-banner.is-shown { transform: none; opacity: 1; }
.cookie-banner[hidden] { display: none; }
.cookie-actions { display: flex; gap: 10px; margin-top: 14px; }
.cookie-actions .btn { min-height: 42px; padding: 0.55em 1.3em; font-size: 0.92rem; }

/* ---------- Motion ---------- */
/* Revelado lento al hacer scroll (solo con JS y sin "reducir movimiento") */
@media (prefers-reduced-motion: no-preference) {
    .js .reveal {
        opacity: 0;
        translate: 0 24px;
        transition: opacity var(--slow) var(--ease), translate var(--slow) var(--ease);
        transition-delay: calc(var(--i, 0) * 110ms);
    }
    .js .reveal.is-visible { opacity: 1; translate: 0 0; }

    /* Hero: el círculo se dibuja y los nodos dispersos se ordenan y conectan */
    .ring-draw { animation: draw 2200ms var(--ease) 150ms both; }
    /* Las piezas llegan dispersas y giradas y encajan con un pequeño rebote */
    .pz {
        animation: piece-in 1100ms cubic-bezier(.2, 1.12, .35, 1) both;
        animation-delay: calc(400ms + var(--i) * 70ms);
    }
    /* La pieza clave llega sola, tras una breve pausa */
    .pz.is-key { animation-delay: calc(400ms + var(--i) * 70ms + 380ms); }
    .pz-whole { animation: fade-in 900ms ease 150ms both; }
    /* Completo: las juntas se suavizan y se lee como un todo */
    .pz path { animation: seam-soft 1400ms ease 2850ms both; }
    .art-pi { animation: pi-in 1200ms var(--ease) 2850ms both; }

    /* Diagramas: se trazan al entrar en pantalla */
    .js .diagram:not(.is-visible) .chord,
    .js .diagram:not(.is-visible) .rim { stroke-dashoffset: 1; }
    .js .diagram:not(.is-visible) .dot,
    .js .diagram:not(.is-visible) text { opacity: 0; }
    .diagram .chord,
    .diagram .rim { stroke-dasharray: 1; transition: stroke-dashoffset 1400ms var(--ease); transition-delay: calc(700ms + var(--i, 0) * 60ms); }
    .diagram .dot,
    .diagram text { transition: opacity 800ms var(--ease); transition-delay: calc(200ms + var(--i, 0) * 90ms); }
}

@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pi-in { from { opacity: 0; translate: 14px 0; } }
@keyframes piece-in {
    0% { opacity: 0; translate: var(--dx) var(--dy); rotate: var(--rot); }
    35% { opacity: 1; }
    100% { opacity: 1; translate: 0 0; rotate: 0deg; }
}
@keyframes seam-soft { to { stroke-opacity: 0.35; } }
@keyframes fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }
}

@media print {
    .site-header, .site-footer, .cookie-banner, .hero-art, .btn-row { display: none !important; }
    body { background: #fff; }
}
