/* ============================================================
   WHarq® — hoja de estilos v3
   Editorial oscuro · Clash Display + Switzer · WCAG 2.2 AA
   Referencias: OMA (índice radical), BIG (diagrama narrativo),
   21st.dev (interacción contemporánea)
   ============================================================ */

:root {
  --bg: #0e0f11;
  --bg-soft: #16181b;
  --ink: #ece8e1;
  --ink-dim: #a9a49b;
  --line: rgba(236, 232, 225, 0.14);
  --accent: #c96f5f;
  --petrol: #4d96a8;

  --font-display: "Clash Display", "Arial Narrow", sans-serif;
  --font-body: "Switzer", "Segoe UI", sans-serif;
  --pad: clamp(1.25rem, 4vw, 4rem);
  --section: clamp(5rem, 12vw, 9rem);
}

[data-theme="light"] {
  --bg: #efede8;
  --bg-soft: #e4e1da;
  --ink: #16181b;
  --ink-dim: #5b574f;
  --line: rgba(22, 24, 27, 0.16);
  --accent: #a8503f;
  --petrol: #2f6f7e;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #efede8;
    --bg-soft: #e4e1da;
    --ink: #16181b;
    --ink-dim: #5b574f;
    --line: rgba(22, 24, 27, 0.16);
    --accent: #a8503f;
    --petrol: #2f6f7e;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: var(--font-body);
  font-weight: 300;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
  transition: background 0.4s ease, color 0.4s ease;
}

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

h1, h2 { font-family: var(--font-display); font-weight: 600; line-height: 1.02; letter-spacing: -0.015em; }
h2 { font-size: clamp(2.2rem, 6vw, 4.2rem); text-transform: uppercase; }

.eyebrow { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.2rem; }
.section-head { padding: var(--section) var(--pad) clamp(2rem, 5vw, 4rem); }
.section-sub { max-width: 52ch; margin-top: 1.5rem; color: var(--ink-dim); font-size: 1.05rem; }
.section-sub strong { color: var(--ink); font-weight: 600; }

/* ---------- Accesibilidad ---------- */
.skip-link { position: absolute; left: -200vw; top: 0; z-index: 300; background: var(--accent); color: #fff; padding: 0.8rem 1.4rem; font-weight: 600; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- Cursor personalizado (decorativo, pointer fino) ---------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 250; pointer-events: none;
  width: 36px; height: 36px; border: 1.5px solid var(--accent); border-radius: 50%;
  /* el JS mueve con `translate`; este transform centra el círculo en el puntero
     (las propiedades individuales y transform se componen, no se pisan) */
  transform: translate(-50%, -50%); opacity: 0;
  transition: width 0.25s ease, height 0.25s ease, opacity 0.3s ease, background 0.25s ease;
}
.cursor.on { opacity: 0.9; }
.cursor.grow { width: 64px; height: 64px; background: color-mix(in srgb, var(--accent) 14%, transparent); }
@media (pointer: coarse) { .cursor { display: none; } }

/* Con el círculo activo se oculta el puntero nativo (salvo donde se escribe) */
html.has-cursor body, html.has-cursor a, html.has-cursor button,
html.has-cursor .btn, html.has-cursor select, html.has-cursor label { cursor: none; }
html.has-cursor input:not([type="range"]), html.has-cursor textarea { cursor: text; }

/* ---------- Preloader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 400; display: grid; place-content: center; gap: 1.2rem;
  background: #0e0f11; color: #ece8e1;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-mark { width: min(220px, 50vw); }
.loader-mark .draw { stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 1.1s ease forwards; }
.loader-mark .draw:nth-child(2) { animation-delay: 0.25s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.loader-tag { text-align: center; font-size: 0.75rem; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(236,232,225,0.5); }

/* ---------- Barra de progreso ---------- */
.progress { position: fixed; top: 0; left: 0; z-index: 210; height: 2px; width: 100%; background: var(--accent); transform-origin: 0 50%; scale: 0 1; }

/* ---------- Botones ---------- */
.btn {
  display: inline-block; min-height: 44px; padding: 0.85rem 1.7rem;
  font-family: var(--font-display); font-weight: 500; font-size: 1rem; letter-spacing: 0.04em;
  text-decoration: none; text-transform: uppercase; text-align: center;
  border: 1px solid var(--ink); transition: background 0.2s ease, color 0.2s ease;
  will-change: transform;
}
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--bg); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header { position: fixed; inset-inline: 0; top: 0; z-index: 100; transition: background 0.3s ease, border-color 0.3s ease, transform 0.35s ease; border-bottom: 1px solid transparent; }
.site-header.scrolled { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom-color: var(--line); }
.site-header.hidden { transform: translateY(-100%); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.8rem var(--pad); }

.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand-logo { width: 56px; height: auto; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; letter-spacing: 0.06em; }
.brand-name sup { font-size: 0.55em; }

.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav a { position: relative; font-size: 0.88rem; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; color: var(--ink-dim); transition: color 0.2s ease; padding: 0.5rem 0; }
.main-nav a:not(.nav-cta)::after { content: ""; position: absolute; left: 0; bottom: 0.2rem; width: 100%; height: 1px; background: var(--accent); scale: 0 1; transform-origin: 100% 50%; transition: scale 0.3s ease; }
.main-nav a:not(.nav-cta):hover::after { scale: 1 1; transform-origin: 0 50%; }
.main-nav a:hover { color: var(--ink); }
.main-nav .nav-cta { color: var(--ink); border: 1px solid var(--line); padding: 0.55rem 1.1rem; }
.main-nav .nav-cta:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.header-actions { display: flex; align-items: center; gap: 0.6rem; }
.theme-toggle { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink-dim); }
.theme-toggle:hover { color: var(--ink); }
.theme-toggle svg { width: 21px; height: 21px; }
[data-theme="light"] .theme-toggle .rays { opacity: 0.35; }

/* Header sobre el hero (sin scroll): siempre texto claro — el hero siempre es oscuro */
.site-header:not(.scrolled) :is(.brand, .theme-toggle) { color: #ece8e1; }
.site-header:not(.scrolled) .nav-toggle span { background: #ece8e1; }
.site-header:not(.scrolled) .brand-logo { filter: invert(0.85) brightness(1.1) !important; }
@media (min-width: 761px) {
  .site-header:not(.scrolled) .main-nav a { color: rgba(236, 232, 225, 0.85); }
  .site-header:not(.scrolled) .main-nav a:hover { color: #fff; }
  .site-header:not(.scrolled) .main-nav .nav-cta { color: #ece8e1; border-color: rgba(236, 232, 225, 0.4); }
}

.nav-toggle { display: none; width: 44px; height: 44px; flex-direction: column; justify-content: center; align-items: center; gap: 6px; }
.nav-toggle span { width: 24px; height: 1.5px; background: var(--ink); transition: transform 0.25s ease; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; background: #0e0f11; color: #ece8e1; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: screen; opacity: 0.5; }
.hero-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,11,13,0.55) 0%, rgba(10,11,13,0.25) 40%, rgba(10,11,13,0.82) 100%); }
.hero-content { position: relative; z-index: 1; padding: 0 var(--pad) clamp(4rem, 9vh, 7rem); max-width: 1300px; }
.hero-kicker { font-size: 0.78rem; font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(236,232,225,0.75); margin-bottom: 1.6rem; min-height: 1.2em; }
.hero h1 { font-size: clamp(2.4rem, 7.2vw, 6rem); text-transform: uppercase; }
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span { display: inline-block; transform: translateY(110%); animation: riseUp 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; animation-delay: 1.1s; }
.hero h1 .line:nth-child(2) > span { animation-delay: 1.22s; }
.hero h1 .line:nth-child(3) > span { animation-delay: 1.34s; }
.noload .hero h1 .line > span { animation-delay: 0.1s; }
.noload .hero h1 .line:nth-child(2) > span { animation-delay: 0.2s; }
.noload .hero h1 .line:nth-child(3) > span { animation-delay: 0.3s; }
.hero h1 .hl { color: var(--accent); }
@keyframes riseUp { to { transform: translateY(0); } }
.hero-sub { max-width: 46ch; margin-top: 1.6rem; font-size: clamp(1rem, 1.5vw, 1.2rem); color: rgba(236,232,225,0.85); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.4rem; }
.hero .btn { border-color: #ece8e1; }
.hero .btn-solid { background: #ece8e1; color: #0e0f11; }
.hero .btn-solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.hero .btn-line { color: #ece8e1; }
.hero .btn-line:hover { background: #ece8e1; color: #0e0f11; }
.hero-formula { position: absolute; right: var(--pad); bottom: 1.4rem; z-index: 1; font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 0.12em; color: rgba(236,232,225,0.45); }
.hero-scrollcue { position: absolute; left: var(--pad); bottom: 1.4rem; z-index: 1; display: flex; align-items: center; gap: 0.7rem; font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(236,232,225,0.45); }
.hero-scrollcue span { display: block; width: 40px; height: 1px; background: rgba(236,232,225,0.3); position: relative; overflow: hidden; }
.hero-scrollcue span::after { content: ""; position: absolute; inset: 0; background: #ece8e1; translate: -100% 0; animation: cue 2.2s ease-in-out infinite; }
@keyframes cue { 50% { translate: 0 0; } 100% { translate: 100% 0; } }

/* ---------- Badge giratorio del hero ---------- */
.hero-badge {
  position: absolute; right: clamp(1.5rem, 5vw, 5rem); bottom: clamp(4.5rem, 11vh, 8rem); z-index: 2;
  width: 110px; height: 110px; display: grid; place-items: center; text-decoration: none;
}
.hero-badge svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 16s linear infinite; }
.hero-badge text { fill: rgba(236,232,225,0.8); font-family: var(--font-body); font-size: 11.5px; letter-spacing: 0.22em; text-transform: uppercase; }
.badge-center { font-size: 1.4rem; color: var(--accent); transition: translate 0.3s ease; }
.hero-badge:hover .badge-center { translate: 0 4px; }
@keyframes spin { to { rotate: 360deg; } }

/* ---------- Disciplinas: acordeón horizontal ---------- */
.disciplines { background: var(--bg); border-bottom: 1px solid var(--line); }
.d-accent { color: var(--accent); }
.disc-accordion {
  display: flex; gap: 4px; padding: 0 var(--pad) var(--section);
  min-height: clamp(420px, 62vh, 620px);
}
.disc-panel {
  position: relative; overflow: hidden; text-align: left;
  flex: 1; min-width: 0;
  transition: flex 0.65s cubic-bezier(0.3, 0.8, 0.25, 1);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.6rem; color: #ece8e1;
  background: var(--bg-soft);
}
.disc-panel.active { flex: 3.2; }
.disc-panel img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.05); transition: filter 0.5s ease, scale 0.8s ease; scale: 1.06;
}
.disc-panel.active img { filter: grayscale(0); scale: 1; }
.disc-wash {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,15,17,0.1), rgba(14,15,17,0.85));
  transition: opacity 0.5s ease;
}
.disc-wash-accent { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 30%, transparent), rgba(14,15,17,0.85)); }
.disc-panel:not(.active) .disc-wash { background: color-mix(in srgb, var(--accent) 55%, rgba(14,15,17,0.5)); mix-blend-mode: multiply; }
.disc-panel:not(.active):nth-child(even) .disc-wash { background: color-mix(in srgb, var(--petrol) 55%, rgba(14,15,17,0.5)); }
.disc-tag {
  position: relative; z-index: 1; align-self: flex-start;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  background: var(--accent); color: #fff; padding: 0.35rem 0.7rem; margin-bottom: 0.9rem;
  opacity: 0; translate: 0 10px; transition: opacity 0.4s ease 0.2s, translate 0.4s ease 0.2s;
}
.disc-panel.active .disc-tag { opacity: 1; translate: 0 0; }
.disc-name {
  position: relative; z-index: 1;
  font-family: var(--font-display); font-weight: 600; text-transform: uppercase; line-height: 1;
  font-size: clamp(1.4rem, 3.4vw, 2.8rem);
  writing-mode: vertical-rl; rotate: 180deg; align-self: flex-start; margin-top: auto;
  transition: all 0.5s ease;
}
.disc-panel.active .disc-name { writing-mode: horizontal-tb; rotate: 0deg; margin-top: 0; }
.disc-copy {
  position: relative; z-index: 1; font-size: 0.93rem; color: rgba(236,232,225,0.85); max-width: 46ch;
  margin-top: 0.7rem; display: none; opacity: 0; translate: 0 12px;
  transition: opacity 0.45s ease 0.25s, translate 0.45s ease 0.25s;
}
.disc-panel.active .disc-copy { display: block; opacity: 1; translate: 0 0; }
.disc-num { position: absolute; top: 1.2rem; right: 1.2rem; z-index: 1; font-family: var(--font-display); font-size: 0.85rem; color: rgba(236,232,225,0.7); }
.disc-topo { background: var(--petrol); }
.disc-panel.disc-topo:not(.active) .disc-wash { background: transparent; mix-blend-mode: normal; }
.disc-pattern { position: absolute; inset: 0; width: 100%; height: 100%; color: rgba(236,232,225,0.35); }

@media (max-width: 860px) {
  .disc-accordion { flex-direction: column; min-height: auto; }
  .disc-panel { min-height: 90px; flex: none; }
  .disc-panel.active { min-height: 380px; flex: none; }
  .disc-name, .disc-panel .disc-name { writing-mode: horizontal-tb; rotate: 0deg; margin-top: auto; }
  .disc-panel.active .disc-name { margin-top: 0; }
}

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 1rem 0; background: var(--bg); }
.marquee-track { display: flex; gap: 2.5rem; width: max-content; animation: marquee 28s linear infinite; font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Fórmula (diagrama narrativo estilo BIG) ---------- */
.formula { position: relative; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.formula-sticky { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: var(--section) var(--pad); text-align: center; }
.formula-stage { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: clamp(0.8rem, 3vw, 2rem); margin: 2.5rem 0; min-height: 180px; }
.f-step { display: flex; align-items: center; gap: clamp(0.8rem, 3vw, 2rem); opacity: 0; translate: 0 30px; transition: opacity 0.6s ease, translate 0.6s ease; }
.formula.s1 .f-step[data-step="1"], .formula.s2 .f-step[data-step="2"], .formula.s3 .f-step[data-step="3"] { opacity: 1; translate: 0 0; }
.f-box {
  display: grid; place-items: center; width: clamp(72px, 12vw, 130px); aspect-ratio: 1;
  border: 2px solid var(--ink); font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.5rem);
}
.f-d { background: var(--ink); color: var(--bg); }
.f-p { background: transparent; color: var(--ink); }
.f-op { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 3rem); color: var(--ink-dim); }
.f-wh { width: clamp(120px, 20vw, 220px); color: var(--accent); }
.f-result { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.5rem, 7vw, 5rem); color: var(--ink); }
.f-result sup { color: var(--accent); }
.formula-captions { position: relative; width: min(56ch, calc(100vw - 2 * var(--pad))); min-height: 7.5em; }
.f-caption { position: absolute; inset: 0; opacity: 0; translate: 0 14px; transition: opacity 0.5s ease, translate 0.5s ease; color: var(--ink-dim); font-size: 1.06rem; }
.f-caption strong { color: var(--ink); }
.formula.s1:not(.s2) .f-caption[data-step="1"],
.formula.s2:not(.s3) .f-caption[data-step="2"],
.formula.s3 .f-caption[data-step="3"] { opacity: 1; translate: 0 0; }

/* ---------- Espacios 2026 ---------- */
.spaces { background: var(--bg); }
.spaces-index { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(2rem, 4vw, 4rem); padding: 0 var(--pad) var(--section); align-items: start; }

.spaces-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.space-item { display: grid; grid-template-columns: 3.2rem 1fr; grid-template-areas: "num name" ". desc"; align-items: baseline; gap: 0.2rem 0; text-align: left; padding: 1.5rem 0.5rem; border-bottom: 1px solid var(--line); transition: background 0.25s ease; }
.space-item:hover, .space-item:focus-visible, .space-item.active { background: var(--bg-soft); }
.space-num { grid-area: num; font-family: var(--font-display); font-size: 0.85rem; color: var(--accent); letter-spacing: 0.1em; }
.space-name { grid-area: name; font-family: var(--font-display); font-weight: 500; font-size: clamp(1.3rem, 2.6vw, 2rem); text-transform: uppercase; letter-spacing: 0.01em; transition: color 0.2s ease, transform 0.25s ease; }
.space-item:hover .space-name, .space-item.active .space-name { color: var(--accent); transform: translateX(6px); }
.space-desc { grid-area: desc; color: var(--ink-dim); font-size: 0.92rem; max-width: 50ch; }

.spaces-preview { position: sticky; top: 110px; aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--line); }
.spaces-preview img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter 0.4s ease, opacity 0.3s ease, scale 0.6s ease; }
.spaces-preview:hover img, .spaces-preview img.color { filter: grayscale(0); scale: 1.03; }
.spaces-preview img.swapping { opacity: 0; }

/* ---------- El estudio ---------- */
.studio { background: var(--bg-soft); border-block: 1px solid var(--line); }
.studio-inner { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: clamp(2.5rem, 6vw, 6rem); padding: var(--section) var(--pad); align-items: center; }
.studio-lead { margin-top: 1.6rem; font-size: 1.15rem; max-width: 50ch; }
.studio-lead strong { font-weight: 600; }
.studio-quote { margin: 2.2rem 0; padding-left: 1.4rem; border-left: 2px solid var(--accent); }
.studio-quote p { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.35; }
.studio-quote cite { display: block; margin-top: 0.9rem; font-style: normal; font-size: 0.88rem; color: var(--ink-dim); }
.studio-facts { list-style: none; display: grid; gap: 0.9rem; max-width: 56ch; }
.studio-facts li { padding-left: 1.6rem; position: relative; font-size: 0.97rem; color: var(--ink-dim); }
.studio-facts li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 16px; height: 1.5px; background: var(--accent); }
.studio-facts strong { color: var(--ink); font-weight: 600; }

.studio-formula { text-align: center; display: grid; gap: 1.4rem; justify-items: center; }
.studio-logo { width: min(220px, 60%); height: auto; }
.formula-big { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: 0.05em; }
.formula-key { font-size: 0.88rem; color: var(--ink-dim); letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- Proyectos ---------- */
.projects { container-type: inline-size; }
.projects-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.view-toggle { display: flex; border: 1px solid var(--line); }
.view-toggle button { padding: 0.7rem 1.4rem; min-height: 44px; font-family: var(--font-display); font-weight: 500; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); transition: background 0.2s ease, color 0.2s ease; }
.view-toggle button.active { background: var(--ink); color: var(--bg); }

/* Vista índice (archivo OMA) */
.project-index { position: relative; padding: 0 var(--pad) var(--section); }
.pi-head, .pi-row { display: grid; grid-template-columns: 3.5rem 1.6fr 1fr 1fr; gap: 1rem; align-items: baseline; width: 100%; text-align: left; }
.pi-head { padding: 0.8rem 0.5rem; font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-dim); border-bottom: 1px solid var(--ink); }
.pi-row { padding: 1.3rem 0.5rem; border-bottom: 1px solid var(--line); transition: background 0.2s ease, padding-left 0.25s ease; }
.pi-row:hover, .pi-row:focus-visible { background: var(--bg-soft); padding-left: 1rem; }
.pi-row span:first-child { font-family: var(--font-display); font-size: 0.85rem; color: var(--accent); }
.pi-row span:nth-child(2) { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.3rem, 3vw, 2.2rem); text-transform: uppercase; line-height: 1.05; transition: color 0.2s ease; }
.pi-row:hover span:nth-child(2) { color: var(--accent); }
.pi-row span:nth-child(3), .pi-row span:nth-child(4) { font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); }

/* Imagen flotante que sigue al cursor en el índice */
.pi-float {
  position: fixed; z-index: 90; width: clamp(240px, 24vw, 360px); aspect-ratio: 4 / 3; object-fit: cover;
  pointer-events: none; opacity: 0; scale: 0.92; rotate: -2deg;
  translate: -50% -50%;
  transition: opacity 0.25s ease, scale 0.25s ease;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}
.pi-float.on { opacity: 1; scale: 1; }
@media (pointer: coarse) { .pi-float { display: none; } }

/* Vista grid (mosaico) */
.projects-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px;
  grid-auto-rows: clamp(260px, 32vw, 460px);
  padding: 0 var(--pad) var(--section);
}
.project { position: relative; display: block; height: 100%; overflow: hidden; text-align: left; }
.project.span-2 { grid-column: span 2; }
.project img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter 0.45s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.project:hover img, .project:focus-visible img { filter: grayscale(0); transform: scale(1.04); }
.project-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.2rem 1.2rem 1rem; background: linear-gradient(180deg, transparent, rgba(10,11,13,0.78)); color: #ece8e1; display: flex; flex-direction: column; }
.project-meta strong { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; letter-spacing: 0.04em; text-transform: uppercase; }
.project-meta em { font-style: normal; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(236,232,225,0.75); }

@container (max-width: 880px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@container (max-width: 560px) {
  .projects-grid { grid-template-columns: 1fr; }
  .project.span-2 { grid-column: span 1; }
}

/* ---------- Escáner de mapa ----------
   ACCENT_COLOR del escáner: cambia SOLO esta variable para probar
   otra paleta (p. ej. var(--accent) para terracota de marca). */
.scanner { --scan-accent: #3fd3ff; background: #0a0a0a; color: #ece8e1; border-block: 1px solid var(--line); }
.scanner .section-head { color: #ece8e1; }
/* Ancho limitado para que el mapa completo (aspecto 1000:620) quepa en el viewport
   sin desalinear los nodos posicionados en % */
.scan-stage { position: relative; width: min(100% - 2 * var(--pad), 118vh); margin: 0 auto var(--section); }
.scan-map { display: block; width: 100%; height: auto; }
.mx { fill: none; stroke: rgba(236, 232, 225, 0.45); stroke-width: 1.6; stroke-linejoin: round; }
.mx-topo { stroke: rgba(236, 232, 225, 0.07); stroke-dasharray: 4 9; }

/* Haz del escáner: recorre el mapa de arriba a abajo en loop */
.scan-beam-wrap { animation: scanSweep 7s linear infinite; }
.scan-beam-line { stroke: rgba(236, 232, 225, 0.45); stroke-width: 1; }
@keyframes scanSweep { 0% { transform: translateY(0); } 100% { transform: translateY(710px); } }

/* Nodos de ubicación */
.scan-node {
  position: absolute; left: var(--nx); top: var(--ny); translate: -50% -50%;
  width: 56px; height: 56px; display: grid; place-items: center;
}
.node-dot {
  position: relative; width: 12px; height: 12px; border-radius: 50%;
  background: var(--scan-accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--scan-accent) 80%, transparent);
}
.node-dot::before, .node-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid var(--scan-accent); opacity: 0;
}
.scan-node:hover .node-dot::before, .scan-node:focus-visible .node-dot::before,
.scan-node.live .node-dot::before { animation: nodePulse 1.6s ease-out infinite; }
.scan-node:hover .node-dot::after, .scan-node:focus-visible .node-dot::after,
.scan-node.live .node-dot::after { animation: nodePulse 1.6s ease-out 0.8s infinite; }
@keyframes nodePulse {
  0% { scale: 1; opacity: 0.9; }
  100% { scale: 4.5; opacity: 0; }
}
.node-label {
  position: absolute; top: 100%; left: 50%; translate: -50% 0;
  font-family: var(--font-display); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.2em;
  color: rgba(236, 232, 225, 0.7); transition: color 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}
.scan-node:hover .node-label { color: var(--scan-accent); }

/* Nodos satélite: más pequeños, etiqueta solo al hover/focus */
.scan-node.sm { width: 44px; height: 44px; }
.scan-node.sm .node-dot { width: 7px; height: 7px; opacity: 0.85; box-shadow: 0 0 8px color-mix(in srgb, var(--scan-accent) 60%, transparent); }
.scan-node.sm .node-label { opacity: 0; }
.scan-node.sm:hover .node-label, .scan-node.sm:focus-visible .node-label, .scan-node.sm.live .node-label { opacity: 1; }

/* Ficha sin fotografía aún: el wireframe ES el visual */
.scan-card.wire-only.open .scan-wire { animation: none; opacity: 1; }
.scan-card.wire-only .scan-img, .scan-card.wire-only .scan-view { display: none; }

/* Materialización: wireframe → foto */
.scan-card[hidden] { display: none; }
.scan-card {
  position: absolute; right: 0; top: 0; z-index: 5;
  width: min(380px, 88vw);
  background: rgba(10, 10, 10, 0.92); border: 1px solid rgba(236, 232, 225, 0.2);
  backdrop-filter: blur(8px);
  padding: 1.4rem; display: grid; gap: 0.5rem;
}
.scan-visual { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #0e0f11; }
.scan-wire { position: absolute; inset: 0; width: 100%; height: 100%; padding: 8%; z-index: 1; }
.scan-wire path { stroke: rgba(236, 232, 225, 0.7); stroke-width: 1.2; stroke-dasharray: 1; stroke-dashoffset: 1; }
.scan-card.open .scan-wire path { animation: wireDraw 1.1s ease forwards; }
.scan-card.open .scan-wire path:nth-child(2) { animation-delay: 0.12s; }
.scan-card.open .scan-wire path:nth-child(3) { animation-delay: 0.24s; }
.scan-card.open .scan-wire path:nth-child(4) { animation-delay: 0.3s; }
.scan-card.open .scan-wire path:nth-child(5) { animation-delay: 0.42s; }
.scan-card.open .scan-wire path:nth-child(6) { animation-delay: 0.5s; }
.scan-card.open .scan-wire path:nth-child(7) { animation-delay: 0.58s; }
.scan-card.open .scan-wire path:nth-child(8) { animation-delay: 0.66s; }
.scan-card.open .scan-wire path:nth-child(9) { animation-delay: 0.78s; }
@keyframes wireDraw { to { stroke-dashoffset: 0; } }
.scan-card.open .scan-wire { animation: wireFade 0.6s ease 2.1s forwards; }
@keyframes wireFade { to { opacity: 0.18; } }
.scan-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  clip-path: inset(0 0 100% 0);
}
.scan-card.open .scan-img { animation: imgReveal 0.9s cubic-bezier(0.3, 0.8, 0.25, 1) 1.5s forwards; }
@keyframes imgReveal { to { clip-path: inset(0 0 0 0); } }
.scan-title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.04em; text-transform: uppercase; }
.scan-meta { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--scan-accent); }
.scan-close { position: absolute; top: 0.3rem; right: 0.3rem; width: 44px; height: 44px; font-size: 1.5rem; color: rgba(236,232,225,0.7); z-index: 2; }
.scan-close:hover { color: var(--scan-accent); }
.scan-view { align-self: start; padding: 0.6rem 1.2rem; font-size: 0.85rem; border-color: rgba(236,232,225,0.4); color: #ece8e1; }
.scan-view:hover { background: var(--scan-accent); border-color: var(--scan-accent); color: #0a0a0a; }

@media (max-width: 760px) {
  .scan-card { position: relative; width: 100%; margin-top: 1.5rem; }
  .scan-node { width: 44px; height: 44px; }
}

/* ---------- Cifras ---------- */
.figures { border-block: 1px solid var(--line); background: var(--bg); }
.figures dl { display: grid; grid-template-columns: repeat(3, 1fr); }
.figures div { padding: clamp(2rem, 4vw, 3.5rem) var(--pad); border-right: 1px solid var(--line); display: flex; flex-direction: column-reverse; gap: 0.6rem; }
.figures div:last-child { border-right: 0; }
.figures dd { font-family: var(--font-display); font-weight: 600; font-size: clamp(3rem, 7vw, 5.5rem); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.figures dt { font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); max-width: 28ch; }

/* ---------- Contacto ---------- */
.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 6vw, 6rem); padding: var(--section) var(--pad); }
.contact-copy h2 { max-width: 16ch; }
.contact-copy > p { margin-top: 1.4rem; color: var(--ink-dim); max-width: 48ch; font-size: 1.05rem; }
.contact-direct { list-style: none; display: grid; gap: 0.7rem; margin: 1.8rem 0 1.6rem; padding: 0; }
.contact-direct a {
  display: inline-flex; align-items: center; gap: 0.7rem; min-height: 44px;
  font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; letter-spacing: 0.03em;
  color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); padding: 0.4rem 0.2rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.contact-direct a:hover { color: var(--accent); border-color: var(--accent); }
.contact-direct svg { width: 22px; height: 22px; flex: none; color: var(--accent); }

.contact-official { font-size: 0.88rem !important; letter-spacing: 0.04em; }
.contact-official strong { color: var(--ink); }

.contact-form { display: grid; gap: 1.1rem; border: 1px solid var(--line); padding: clamp(1.5rem, 3vw, 2.5rem); background: var(--bg-soft); }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-dim); }
.field input, .field select, .field textarea {
  font-family: var(--font-body); font-size: 1rem; font-weight: 300;
  padding: 0.8rem 0.9rem; min-height: 44px;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--petrol); outline-offset: -1px; }
.form-status { font-size: 0.92rem; min-height: 1.4em; color: var(--petrol); font-weight: 500; }
.form-status.error { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg); overflow: hidden; }
.footer-giant {
  font-family: var(--font-display); font-weight: 700; text-align: center;
  font-size: clamp(4rem, 17vw, 16rem); line-height: 0.95; letter-spacing: 0.01em;
  color: transparent; -webkit-text-stroke: 1.5px var(--ink-dim); padding: clamp(2rem, 5vw, 4rem) 0 0;
  opacity: 0.5; user-select: none;
}
.footer-giant sup { font-size: 0.25em; -webkit-text-stroke: 1px var(--ink-dim); }
.footer-top { display: flex; align-items: center; justify-content: space-between; padding: 2.5rem var(--pad); }
.footer-logo { width: 88px; height: auto; }
.footer-tag { font-family: var(--font-display); font-weight: 500; letter-spacing: 0.1em; color: var(--accent); }
.footer-bottom { padding: 0 var(--pad) 2.5rem; display: grid; gap: 0.7rem; }
.footer-bottom p, .footer-bottom a { font-size: 0.8rem; color: var(--ink-dim); }
.footer-bottom a { text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom a:hover { color: var(--ink); }
.footer-disclaimer { max-width: 95ch; opacity: 0.75; }

/* Logo en modo oscuro: las líneas grises se aclaran */
:root:not([data-theme="light"]) .brand-logo,
:root:not([data-theme="light"]) .footer-logo,
:root:not([data-theme="light"]) .studio-logo { filter: invert(0.85) brightness(1.1); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .brand-logo,
  :root:not([data-theme]) .footer-logo,
  :root:not([data-theme]) .studio-logo { filter: none; }
}

/* ---------- Lightbox + modo Rayos X ---------- */
.lightbox { border: 0; padding: 0; margin: auto; background: transparent; max-width: min(92vw, 1100px); }
.lightbox::backdrop { background: rgba(8, 9, 10, 0.88); backdrop-filter: blur(4px); }
.lb-stage { position: relative; overflow: hidden; }
.lightbox img { width: 100%; height: auto; max-height: 76vh; object-fit: contain; display: block; }
.lightbox p { color: #ece8e1; font-size: 0.9rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.9rem 0.2rem 0; }
.lightbox-close { position: absolute; top: -0.2rem; right: 0.2rem; z-index: 3; width: 44px; height: 44px; color: #ece8e1; font-size: 2rem; line-height: 1; }
.lightbox-close:hover { color: var(--accent); }

/* Lente de rayos X: máscara circular que sigue al cursor */
.lb-xray {
  position: absolute; inset: 0; z-index: 1; opacity: 0; pointer-events: none;
  clip-path: circle(0px at var(--lx, 50%) var(--ly, 50%));
  transition: clip-path 0.12s ease-out;
}
.lb-stage.xray-on .lb-xray { opacity: 1; clip-path: circle(120px at var(--lx, 50%) var(--ly, 50%)); }
.lb-stage.xray-on { cursor: crosshair; }
.lb-xray svg { width: 100%; height: 100%; display: block; }
.xr-flow path { stroke-dasharray: 0.06 0.045; animation: xrFlow 2.2s linear infinite; }
@keyframes xrFlow { to { stroke-dashoffset: -0.21; } }

/* Overlay de luz solar (controlado por el slider) */
.lb-sun { position: absolute; inset: 0; z-index: 0; pointer-events: none; mix-blend-mode: multiply; }

/* Controles */
.lb-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0.2rem 0; flex-wrap: wrap; }
.lb-xray-btn {
  font-family: monospace; font-size: 0.85rem; letter-spacing: 0.12em;
  color: #9fd8ff; border: 1px solid rgba(159, 216, 255, 0.4); padding: 0.55rem 1rem; min-height: 44px;
  transition: background 0.2s ease, color 0.2s ease;
}
.lb-xray-btn:hover { border-color: #9fd8ff; }
.lb-xray-btn[aria-pressed="true"] { background: #9fd8ff; color: #06101c; }
.lb-sun-ctl { display: flex; align-items: center; gap: 0.6rem; color: #ece8e1; }
.lb-sun-ctl input { accent-color: var(--accent); width: clamp(120px, 20vw, 220px); min-height: 44px; }

/* ---------- Fórmula 3D interactiva ---------- */
.formula-stage { perspective: 1000px; }
.formula-stage > * { transform-style: preserve-3d; }
.f-box { cursor: pointer; transition: box-shadow 0.3s ease, translate 0.4s ease; }
.motion .formula-stage:hover .f-box,
.motion .formula-stage:focus-within .f-box,
.motion .formula-stage:hover .f-wh,
.motion .formula-stage:hover .f-result { translate: 0 0 var(--z, 0); }
.f-box:hover { box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5); }
.f-box.glitch { animation: glitch 0.32s steps(2) 2; }
@keyframes glitch {
  0% { clip-path: inset(0 0 0 0); translate: 0 0; }
  25% { clip-path: inset(15% 0 55% 0); translate: -5px 2px; }
  50% { clip-path: inset(60% 0 10% 0); translate: 5px -2px; }
  75% { clip-path: inset(30% 0 35% 0); translate: -3px 0; }
  100% { clip-path: inset(0 0 0 0); translate: 0 0; }
}

/* ---------- Aparición ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* Reducción de movimiento: se quita el movimiento, no el diseño.
   html.motion = override (?motion=full) o sistema sin restricción. */
@media (prefers-reduced-motion: reduce) {
  html:not(.motion) { scroll-behavior: auto; }
  html:not(.motion) :is(.reveal, .hero h1 .line > span, .f-step, .f-caption) { opacity: 1; transform: none; translate: 0 0; transition: none; animation: none; }
  html:not(.motion) .marquee-track { animation: none; }
  html:not(.motion) .hero-badge svg { animation: none; }
  html:not(.motion) .scan-beam-wrap { animation: none; }
  html:not(.motion) .scan-node .node-dot::before, html:not(.motion) .scan-node .node-dot::after { animation: none; }
  html:not(.motion) .scan-card.open .scan-wire path { animation: none; stroke-dashoffset: 0; }
  html:not(.motion) .scan-card.open .scan-wire { animation: none; opacity: 0.18; }
  html:not(.motion) .scan-card.open .scan-img { animation: none; clip-path: inset(0 0 0 0); }
  html:not(.motion) :is(.cursor, .hero-scrollcue, .loader) { display: none; }
  html:not(.motion) .formula-captions .f-caption { position: static; }
  html:not(.motion) .formula-captions { min-height: auto; display: grid; gap: 1rem; }
  html:not(.motion) .formula-sticky { min-height: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .spaces-index { grid-template-columns: 1fr; }
  .spaces-preview { display: none; }
  .studio-inner { grid-template-columns: 1fr; }
  .contact-inner { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .main-nav { position: fixed; top: 64px; inset-inline: 0; background: var(--bg); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem var(--pad) 1.5rem; transform: translateY(-130%); transition: transform 0.3s ease; }
  .main-nav.open { transform: translateY(0); }
  .main-nav a { padding: 1rem 0; border-bottom: 1px solid var(--line); color: var(--ink); }
  .main-nav .nav-cta { border: 0; color: var(--accent); }
  .figures dl { grid-template-columns: 1fr; }
  .figures div { border-right: 0; border-bottom: 1px solid var(--line); }
  .figures div:last-child { border-bottom: 0; }
  .hero-actions .btn { width: 100%; }
  .hero { flex-wrap: wrap; }
  .hero-formula { position: static; flex-basis: 100%; padding: 0 var(--pad) 1.2rem; }
  .hero-scrollcue, .hero-badge { display: none; }
  .pi-head { display: none; }
  .pi-row { grid-template-columns: 2.5rem 1fr; grid-template-rows: auto auto; }
  .pi-row span:nth-child(3), .pi-row span:nth-child(4) { grid-column: 2; }
}
