/* ==========================================================================
   fraMesh — Studio landing
   ========================================================================== */


:root {
  --blue: #0055ff;          /* azul del logo */
  --blue-hi: #3b7bff;       /* azul legible sobre negro */
  --cyan: #00d2ff;
  --ink: #07080b;
  --ink-2: #0e1015;
  --ink-3: #161922;
  --paper: #f2f2ee;
  --paper-2: #e8e8e3;
  --white: #ffffff;
  --text: #0b0c0f;
  --text-2: #4b4f58;
  --text-inv: #eef0f5;
  --text-inv-2: #8d93a3;
  --line: rgba(11, 12, 15, .14);
  --line-inv: rgba(255, 255, 255, .12);

  --f-logo: 'Tomorrow', sans-serif;
  --f-display: 'Tomorrow', 'Inter Tight', system-ui, sans-serif; /* títulos y cifras */
  --f-sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1440px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-io: cubic-bezier(.7, 0, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.blue { color: var(--blue); }
.section--ink .blue, .hero .blue { color: var(--blue-hi); }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Logo ---------- */
.logo { font-family: var(--f-logo); color: var(--blue); font-size: 26px; letter-spacing: -.02em; line-height: 1; display: inline-flex; align-items: baseline; }
.logo-fra { font-weight: 400; }
.logo-mesh { font-weight: 600; }
.logo--xl { font-size: clamp(48px, 9vw, 96px); }

/* ---------- Loader ---------- */
.loader { position: fixed; inset: 0; z-index: 100; background: var(--ink); display: grid; place-items: center; transition: clip-path .9s var(--ease-io); clip-path: inset(0 0 0 0); }
.loader.is-done { clip-path: inset(0 0 100% 0); }
.loader-inner { width: min(420px, 80vw); }
.loader-bar { height: 1px; background: var(--line-inv); margin: 28px 0 12px; overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .15s linear; }
.loader-meta { display: flex; justify-content: space-between; color: var(--text-inv-2); font-size: 11px; }

/* ---------- Header ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px var(--gutter);
  color: var(--text-inv);
  transition: background .4s, color .4s, border-color .4s, padding .4s;
  border-bottom: 1px solid transparent;
}
.header.is-scrolled { background: rgba(7, 8, 11, .72); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border-color: var(--line-inv); padding-top: 12px; padding-bottom: 12px; }
.header.is-light { background: rgba(242, 242, 238, .8); color: var(--text); border-color: var(--line); }
.nav { display: flex; gap: 30px; font-size: 15px; }
.nav a { position: relative; opacity: .82; transition: opacity .2s; }
.nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: var(--blue); transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease); }
.nav a:hover, .nav a.is-active { opacity: 1; }
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); transform-origin: left; }
.header-right { display: flex; align-items: center; gap: 20px; }
.coords { font-size: 11px; opacity: .6; white-space: nowrap; }
.coords b { font-weight: 500; color: var(--blue-hi); display: inline-block; min-width: 4ch; text-align: right; }
.header.is-light .coords b { color: var(--blue); }

.burger { display: none; width: 40px; height: 40px; position: relative; }
.burger span { position: absolute; left: 10px; right: 10px; height: 1.5px; background: currentColor; transition: transform .35s var(--ease); }
.burger span:first-child { top: 16px; } .burger span:last-child { top: 23px; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.drawer { position: fixed; inset: 0; z-index: 40; background: var(--ink); color: var(--text-inv); padding: 110px var(--gutter) 32px; display: flex; flex-direction: column; justify-content: space-between; clip-path: inset(0 0 100% 0); transition: clip-path .6s var(--ease-io); }
.drawer.is-open { clip-path: inset(0 0 0 0); }
.drawer nav { display: flex; flex-direction: column; }
.drawer nav a { font-size: clamp(34px, 9vw, 56px); font-weight: 500; letter-spacing: -.03em; padding: 6px 0; border-bottom: 1px solid var(--line-inv); display: flex; align-items: baseline; gap: 16px; }
.drawer nav a i { font-style: normal; font-family: var(--f-mono); font-size: 12px; color: var(--blue-hi); }
.drawer p { color: var(--text-inv-2); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 26px; font-size: 15px; font-weight: 500; border-radius: 999px; transition: background .25s, color .25s, border-color .25s, transform .25s var(--ease); white-space: nowrap; }
.btn .arr { display: inline-block; transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn--sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn--blue { background: var(--blue); color: #fff; }
.btn--blue:hover { background: #1a66ff; }
.btn--white { background: #fff; color: var(--blue); }
.btn--white:hover { background: var(--ink); color: #fff; }
.btn--ghost-light { border: 1px solid rgba(255, 255, 255, .35); color: #fff; }
.btn--ghost-light:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: max(100svh, 640px); background: var(--ink); color: var(--text-inv); overflow: hidden; display: flex; align-items: flex-end; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-vignette { position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 70% 40%, transparent 30%, rgba(7, 8, 11, .75) 85%),
    linear-gradient(to top, var(--ink) 0%, rgba(7, 8, 11, .6) 30%, transparent 60%); }
.hero::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--line-inv) 1px, transparent 1px), linear-gradient(90deg, var(--line-inv) 1px, transparent 1px);
  background-size: 80px 80px; mask-image: radial-gradient(ellipse at 30% 60%, #000 0%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 30% 60%, #000 0%, transparent 70%); }

.hud { position: absolute; z-index: 2; text-transform: none; font-size: 11px; line-height: 1.9; color: var(--text-inv); pointer-events: none; }
.hud b { font-weight: 500; color: var(--blue-hi); }
.hud .muted { color: var(--text-inv-2); }
.hud--tr { top: 100px; right: var(--gutter); text-align: right; }
.hud-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); margin-right: 6px; box-shadow: 0 0 10px var(--cyan); animation: blink 1.6s infinite; vertical-align: 1px; }
@keyframes blink { 50% { opacity: .25; } }

.hero-content { position: relative; z-index: 2; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 130px var(--gutter) clamp(90px, 12vh, 140px); pointer-events: none; }
.hero-content a { pointer-events: auto; }
.eyebrow { color: var(--text-inv-2); display: flex; align-items: center; gap: 12px; margin: 0 0 28px; }
.eyebrow .nw { white-space: nowrap; } /* en pantallas angostas corta solo en los "·" */
.tick { width: 28px; height: 1px; background: var(--blue-hi); }
.hero-title { font-weight: 500; font-size: clamp(44px, min(9.4vw, 13.5vh), 152px); line-height: .92; letter-spacing: -.035em; margin: 0; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .line > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease); }
.hero-title em { font-style: normal; color: var(--blue-hi); }
body.is-ready .hero-title .line > span { transform: none; }
body.is-ready .hero-title .line:nth-child(2) > span { transition-delay: .08s; }
body.is-ready .hero-title .line:nth-child(3) > span { transition-delay: .16s; }
.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; margin-top: 44px; flex-wrap: wrap; }
.hero-lead { max-width: 520px; margin: 0; color: #c3c8d4; font-size: 18px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-scale { position: absolute; z-index: 2; right: var(--gutter); bottom: 40px; width: 240px; font-size: 10px; color: var(--text-inv-2); }
.legend-bar { height: 6px; background: linear-gradient(90deg, #0a2a8a, var(--blue), #3fa0ff, var(--cyan), #fff); margin-bottom: 8px; }
.legend-labels { display: flex; justify-content: space-between; }
.scroll-cue { position: absolute; z-index: 2; left: var(--gutter); bottom: 40px; font-size: 10px; color: var(--text-inv-2); display: flex; align-items: center; gap: 10px; }
.scroll-cue span { width: 40px; height: 1px; background: var(--line-inv); position: relative; overflow: hidden; }
.scroll-cue span::after { content: ''; position: absolute; inset: 0; background: var(--blue-hi); animation: cue 2s var(--ease-io) infinite; }
@keyframes cue { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ---------- Ticker ---------- */
.ticker { background: var(--blue); color: #fff; overflow: hidden; border-block: 1px solid rgba(255, 255, 255, .2); }
.ticker-track { display: flex; width: max-content; animation: marquee 40s linear infinite; padding: 18px 0; }
.ticker span { font-size: clamp(20px, 2.6vw, 34px); font-weight: 500; letter-spacing: -.02em; padding: 0 28px; white-space: nowrap; }
.ticker i { font-style: normal; opacity: .5; align-self: center; font-size: 14px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(72px, 9vw, 140px) 0; }
.section--paper { background: var(--paper); color: var(--text); }
.section--line { border-top: 1px solid var(--line); }
.section--ink { background: var(--ink); color: var(--text-inv); }
.section--blue { background: var(--blue); color: #fff; }

.sec-head { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: clamp(40px, 6vw, 80px); color: var(--text-2); }
.sec-head--dark { border-color: var(--line-inv); color: var(--text-inv-2); }
.section--blue .sec-head { border-color: rgba(255, 255, 255, .25); color: rgba(255, 255, 255, .75); }
.sec-index { color: var(--blue); }
.section--ink .sec-index { color: var(--blue-hi); }
.section--blue .sec-index { color: #fff; }

.sec-intro { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: end; margin-bottom: clamp(48px, 7vw, 96px); }
.sec-intro p { margin: 0; color: var(--text-2); max-width: 460px; justify-self: end; }
.sec-intro--dark p { color: var(--text-inv-2); }
.sec-intro--row { align-items: end; }
.h2 { font-size: clamp(38px, 5.6vw, 84px); line-height: 1; letter-spacing: -.032em; font-weight: 500; margin: 0; }

/* reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Estudio ---------- */
.studio-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(40px, 6vw, 100px); align-items: start; }
.display { font-size: clamp(44px, 6.4vw, 104px); line-height: .95; letter-spacing: -.035em; font-weight: 500; margin: 0 0 40px; }
.display .op { color: var(--text-2); font-weight: 300; }
.display .w--brand { font-family: var(--f-logo); color: var(--blue); letter-spacing: -.03em; font-weight: 600; }
.big-text { font-size: clamp(20px, 1.8vw, 26px); line-height: 1.4; letter-spacing: -.01em; margin: 0 0 24px; }
.big-text em, .studio-statement em { font-style: italic; }
.studio-statement p { max-width: 620px; }
/* Columna derecha: texto de presentación arriba y la viga mallada debajo */
.studio-note { margin: 0 0 28px; color: var(--text-2); }

.fem-figure { margin: 0; background: var(--white); border: 1px solid var(--line); padding: 20px; }
.fem-head, .fem-foot { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-2); }
.fem-head span:first-child, .res span, .ctl-top b { text-transform: none; }
.fem-head { padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.fem-foot { padding-top: 14px; border-top: 1px dashed var(--line); gap: 16px; flex-wrap: wrap; }
#fem-svg { width: 100%; height: auto; display: block; margin: 12px 0; }
#fem-svg .cell { stroke: rgba(255, 255, 255, .55); stroke-width: .5; opacity: 0; transition: opacity .5s; }
#fem-svg .cell.on { opacity: 1; }
#fem-svg .dim { stroke: var(--text-2); stroke-width: .8; fill: none; }
#fem-svg text { font-family: var(--f-mono); font-size: 9px; fill: var(--text-2); letter-spacing: .04em; }
#fem-svg .support { fill: none; stroke: var(--text); stroke-width: 1; }
#fem-svg .load { stroke: var(--blue); stroke-width: 1.2; fill: var(--blue); }
.fem-legend { display: inline-flex; align-items: center; gap: 8px; }
.fem-legend i { width: 14px; height: 8px; background: #0a2a8a; }
.fem-legend--t i { background: #00d2ff; }
.fem-btn { border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; font-size: 11px; transition: border-color .2s, color .2s; margin-left: auto; }
.fem-btn:hover { border-color: var(--blue); color: var(--blue); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(64px, 9vw, 130px); border-top: 1px solid var(--line); }
.stat { padding: 28px 24px 0 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.stat + .stat { padding-left: 24px; }
.stat:last-child { border-right: 0; }
.stat-n { font-size: clamp(44px, 5vw, 76px); letter-spacing: -.04em; text-transform: none; line-height: 1; color: var(--blue); }
.stat-n b { font-weight: 400; }
.stat-l { color: var(--text-2); font-size: 15px; max-width: 220px; }

/* ---------- Servicios ---------- */


/* ---------- Método ---------- */

/* ---------- Proyectos ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-self: end; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; font-size: 11px; transition: background .25s, color .25s, border-color .25s; }
.chip:hover { border-color: var(--text); }
.chip.is-on { background: var(--text); color: var(--paper); border-color: var(--text); }

.projects { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(20px, 2.4vw, 36px); }
.project { grid-column: span 6; display: flex; flex-direction: column; transition: opacity .4s, transform .5s var(--ease); }
.project:nth-child(3n + 1) { grid-column: span 7; }
.project:nth-child(3n + 2) { grid-column: span 5; }
.project:nth-child(3n) { grid-column: 3 / span 8; }
.project.is-hidden { display: none; }
/* Tarjetas iguales en 3:2 (inicio y portafolio; en el portafolio los filtros romperían el patrón de tamaños) */
.projects--grid { grid-template-columns: repeat(2, 1fr); }
.projects--grid .project:nth-child(n) { grid-column: auto; }
.projects--grid .project:nth-child(n) .project-media { aspect-ratio: 3 / 2; }
.project-media { position: relative; overflow: hidden; aspect-ratio: 16 / 11; background: var(--paper-2); }
.project:nth-child(3n) .project-media { aspect-ratio: 16 / 8; }
.project-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 1.2s var(--ease), filter .6s; filter: grayscale(.35) contrast(1.05); }
.project-media::after { content: ''; position: absolute; inset: 0; background: var(--blue); mix-blend-mode: multiply; opacity: 0; transition: opacity .5s; }
.project-media .grid-ov { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity .5s;
  background-image: linear-gradient(rgba(255, 255, 255, .35) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .35) 1px, transparent 1px); background-size: 40px 40px; }
.project:hover .project-media img { transform: scale(1); filter: grayscale(1) contrast(1.15); }
.project:hover .project-media::after { opacity: .75; }
.project:hover .project-media .grid-ov { opacity: 1; }
/* Ficha técnica sobre la foto al pasar el mouse */
.project-data { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 16px; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 14px 20px; padding-top: 14px; color: #fff; pointer-events: none; }
.project-data::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: rgba(255, 255, 255, .6); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.project-data > div { opacity: 0; transform: translateY(10px); transition: opacity .4s, transform .5s var(--ease); min-width: 0; }
.project-data dt { font-size: 9.5px; opacity: .75; margin-bottom: 4px; }
.project-data dd { margin: 0; font-family: var(--f-display); font-size: clamp(14px, 1.25vw, 18px); font-weight: 500; text-transform: none; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; }
.project:hover .project-data::before { transform: scaleX(1); }
.project:hover .project-data > div { opacity: 1; transform: none; }
.project:hover .project-data > div:nth-child(2) { transition-delay: .05s; }
.project:hover .project-data > div:nth-child(3) { transition-delay: .1s; }
.project:hover .project-data > div:nth-child(4) { transition-delay: .15s; }
.project:hover .project-data > div:nth-child(5) { transition-delay: .2s; }
@media (hover: none) { .project-data { display: none; } }
.project-info { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; padding-top: 18px; }
.project-info h3 { margin: 0; font-size: clamp(20px, 1.8vw, 26px); letter-spacing: -.02em; font-weight: 500; line-height: 1.15; }
.project-info .n { color: var(--blue); font-size: 11px; padding-top: 6px; }
.project-info p { grid-column: 1 / -1; margin: 0; color: var(--text-2); font-size: 15px; max-width: 560px; }
.project-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--text-2); font-size: 10.5px; margin-top: 8px; }
.project-meta b { color: var(--text); font-weight: 500; }

/* ---------- Lab (adelanto) ---------- */

/* ---------- Clientes ---------- */
.clients { background: var(--ink); padding: 0 0 clamp(70px, 9vw, 120px); overflow: hidden; }
.clients-head { display: flex; justify-content: space-between; color: var(--text-inv-2); padding-top: 28px; padding-bottom: 36px; border-top: 1px solid var(--line-inv); max-width: calc(var(--maxw) - 2 * var(--gutter)); margin: 0 auto; padding-left: 0; padding-right: 0; width: calc(100% - 2 * var(--gutter)); }
.clients-track { display: flex; gap: clamp(48px, 7vw, 110px); width: max-content; animation: marquee 45s linear infinite; align-items: center; }
/* Todos en una sola tinta blanca (vengan del color que vengan); el alto (--h) lo calcula el panel según la proporción */
.clients-track img { height: var(--h, 40px); width: auto; filter: brightness(0) invert(1); }
.clients-track img, .client-name { opacity: .55; transition: opacity .3s; }
.clients-track img:hover, .client-name:hover { opacity: 1; }
.client-name { font-family: var(--f-display); font-size: clamp(16px, 1.35vw, 20px); font-weight: 500; letter-spacing: -.01em; color: #fff; white-space: nowrap; }
@media (max-width: 820px) { .clients-track img { height: calc(var(--h, 40px) * .8); } }
.clients:hover .clients-track { animation-play-state: paused; }

/* ---------- Sedes ---------- */
.sites { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.sites-link { position: absolute; top: 0; left: 0; width: 100%; height: 40px; overflow: visible; }
.sites-link line { stroke: var(--text); stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-dasharray: 6 5; }
.site { padding: 0 clamp(16px, 2.5vw, 40px); text-align: center; display: flex; flex-direction: column; align-items: center; }
.site-node { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 36px; position: relative; z-index: 1; }
.site-node span { width: 18px; height: 18px; background: var(--paper); border: 1.5px solid var(--blue); transform: rotate(45deg); transition: background .3s; }
.site-node::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 26px; background: var(--line); }
.site:hover .site-node span { background: var(--blue); }
.site-k { color: var(--blue); font-size: 11px; }
.site h3 { font-size: clamp(22px, 2.2vw, 32px); letter-spacing: -.025em; font-weight: 500; margin: 12px 0 10px; line-height: 1.1; }
.site p { color: var(--text-2); margin: 0 0 20px; font-size: 15px; max-width: 300px; }
.site-a { font-size: 11px; border-bottom: 1px solid var(--text); padding-bottom: 2px; transition: color .2s, border-color .2s; }
.site-a:hover { color: var(--blue); border-color: var(--blue); }

/* ---------- Contacto ---------- */
.section--blue { overflow: hidden; }
.section--blue::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .09) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: linear-gradient(to right, #000, transparent 75%); -webkit-mask-image: linear-gradient(to right, #000, transparent 75%); }
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 110px); position: relative; }
.contact-title { font-size: clamp(42px, 5.6vw, 88px); line-height: .98; letter-spacing: -.035em; font-weight: 500; margin: 0 0 28px; }
.contact-left > p { color: rgba(255, 255, 255, .8); max-width: 440px; margin: 0 0 48px; font-size: 18px; }
.contact-direct { border-top: 1px solid rgba(255, 255, 255, .3); }
.social { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; }
.social > .mono { font-size: 11px; opacity: .7; margin-right: 8px; }
.social a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px 9px 12px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; font-size: 14px; transition: background .3s, color .3s, border-color .3s; }
.social a:hover { background: #fff; color: var(--blue); border-color: #fff; }
.social svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.social svg .fill { fill: currentColor; stroke: none; }
.direct { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; padding: 22px 0; border-bottom: 1px solid rgba(255, 255, 255, .3); transition: padding .4s var(--ease); }
.direct span { font-size: 11px; opacity: .7; }
.direct b { font-size: clamp(20px, 2vw, 28px); font-weight: 500; letter-spacing: -.02em; }
.direct i { font-style: normal; font-size: 22px; transition: transform .4s var(--ease); }
.direct:hover { padding-left: 12px; }
.direct:hover i { transform: translate(4px, -4px); }

.brief { background: var(--white); color: var(--text); padding: clamp(22px, 3vw, 36px); display: flex; flex-direction: column; gap: 22px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .35); }
.brief-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-2); padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field legend { font-size: 10.5px; color: var(--text-2); padding: 0; margin-bottom: 8px; }
.field > span { margin-bottom: 0; }
.field input, .field textarea { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--text); font: inherit; font-size: 17px; padding: 8px 0 10px; outline: none; transition: border-color .25s; resize: vertical; border-radius: 0; }
.field input::placeholder, .field textarea::placeholder { color: #8a8f99; }
.field input:focus, .field textarea:focus { border-color: var(--blue); }
.field .invalid { border-color: #d92d2d; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick label { cursor: pointer; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick span { display: inline-block; border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; font-size: 14px; transition: background .2s, border-color .2s, color .2s; }
.pick label:hover span { border-color: rgba(11, 12, 15, .4); }
.pick input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.pick input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.brief-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.brief .btn--white { background: var(--blue); color: #fff; }
.brief .btn--white:hover { background: var(--ink); color: #fff; }
.brief .btn--ghost-light { border-color: var(--line); color: var(--text); }
.brief .btn--ghost-light:hover { border-color: var(--text); background: rgba(11, 12, 15, .04); }
.brief-msg { margin: 0; font-size: 11px; color: var(--text-2); min-height: 1em; text-transform: none; letter-spacing: .02em; }
.brief-msg.err { color: #d92d2d; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--text-inv-2); padding-top: clamp(70px, 8vw, 110px); overflow: hidden; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 32px; font-size: 15px; }
.footer-grid p { margin: 0; }
.footer-k { color: var(--text-inv); margin-bottom: 16px !important; font-size: 11px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { padding: 3px 0; }
.footer a:hover { color: var(--blue-hi); }
.footer-top { text-align: right; }
.footer-top a { font-size: 11px; }
.footer-mark { font-family: var(--f-logo); color: var(--blue); font-size: 23.5vw; line-height: .78; letter-spacing: -.04em; text-align: center; margin: clamp(50px, 6vw, 90px) 0 0; white-space: nowrap; user-select: none; }
.footer-sub { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 26px; border-top: 1px solid var(--line-inv); font-size: 10.5px; }

/* Sedes sobre fondo oscuro (bloque de tecnología) */
.section--ink .sites-link line { stroke: rgba(255, 255, 255, .45); }
.section--ink .site-node span { background: var(--ink); border-color: var(--blue-hi); }
.section--ink .site:hover .site-node span { background: var(--blue-hi); }
.section--ink .site-node::after { background: var(--line-inv); }
.section--ink .site-k { color: var(--blue-hi); }
.section--ink .site p { color: var(--text-inv-2); }
.section--ink .site-a { border-color: var(--text-inv); }
.section--ink .site-a:hover { color: var(--blue-hi); border-color: var(--blue-hi); }

/* ---------- Transición suave entre bloques de color ----------
   Una banda al inicio de la sección funde el color de la sección anterior
   con el propio (de claro a oscuro, de oscuro a azul, de azul al pie). */
:root { --fade: clamp(110px, 14vw, 200px); }
.section > .wrap, .footer > * { position: relative; z-index: 1; }
.footer { position: relative; }
.section--paper + .section--ink::after,
.section--ink + .section--blue::after,
.clients + .section--blue::after,
.section--paper + .section--blue::after,
.section--ink + .section--paper::after,
.clients + .section--paper::after,
.section--paper + .clients::after,
main:has(> .section--blue:last-child) + .footer::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: var(--fade); pointer-events: none; z-index: 0;
  background: linear-gradient(to bottom, var(--from) 0%, color-mix(in srgb, var(--from) 74%, transparent) 19%, color-mix(in srgb, var(--from) 54%, transparent) 34%, color-mix(in srgb, var(--from) 38%, transparent) 47%, color-mix(in srgb, var(--from) 19%, transparent) 65%, color-mix(in srgb, var(--from) 8%, transparent) 80%, color-mix(in srgb, var(--from) 2%, transparent) 91%, transparent 100%);
}
.section--paper + .section--ink::after, .section--paper + .section--blue::after { --from: #f2f2ee; }
.section--ink + .section--blue::after, .clients + .section--blue::after { --from: #07080b; }
.section--paper + .clients::after { --from: #f2f2ee; }
.section--ink + .section--paper::after, .clients + .section--paper::after { --from: #07080b; }
/* Clientes entre dos secciones claras: aire arriba para el fundido y contenido encima de él */
.clients { position: relative; }
.clients > * { position: relative; z-index: 1; }
.section--paper + .clients { padding-top: var(--fade); }
/* Cifras dentro del bloque oscuro de clientes */
.clients-stats { margin-bottom: clamp(48px, 6vw, 80px); }
.clients .stats { margin-top: 0; border-top: 0; }
.clients .stat, .clients .stat:nth-child(n) { border-color: var(--line-inv); }
.clients .stat-n { color: var(--blue-hi); }
.clients .stat-l { color: var(--text-inv-2); }
main:has(> .section--blue:last-child) + .footer::after { --from: #0055ff; }

/* ---------- Servicios: filas horizontales (todo visible de un vistazo, con acceso directo al formulario) ---------- */
.svc-grid { display: grid; gap: clamp(14px, 1.6vw, 20px); border-top: 1px solid var(--text); padding-top: clamp(24px, 3vw, 40px); }
/* Cada servicio: ícono chico | título, texto y botón | lista */
.svc { display: grid; grid-template-columns: clamp(170px, 17vw, 240px) 1fr; background: var(--white); }
/* Ícono de línea sobre papel milimetrado; al pasar el mouse, fondo azul e ícono blanco */
.svc-media { --bg: var(--paper); --ink: var(--text); --acc: var(--blue); --grid: rgba(11, 12, 15, .06);
  position: relative; display: grid; place-items: center; min-height: 100%; background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 20px 20px; background-position: center; transition: background-color .5s; }
.svc:hover .svc-media { --bg: var(--blue); --ink: #fff; --acc: #fff; --grid: rgba(255, 255, 255, .14); }
.svc-icon { width: 82%; max-width: 210px; height: auto; transition: transform .6s var(--ease); }
.svc:hover .svc-icon { transform: scale(1.05); }
.svc-icon * { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: stroke .5s, fill .5s; }
.svc-icon .fill { fill: var(--bg); }
.svc-icon .acc { stroke: var(--acc); }
.svc-icon .solid { fill: var(--acc); }
.svc-icon .dim { stroke-dasharray: 3 3; opacity: .55; }
.svc-body { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "top top" "t ul" "p ul" "go ul";
  grid-template-rows: auto auto auto 1fr; column-gap: clamp(28px, 4vw, 64px); row-gap: 12px; padding: clamp(20px, 2.2vw, 32px); }
.svc-top { grid-area: top; display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); font-size: 11px; margin-bottom: 4px; }
.svc-t { grid-area: t; margin: 0; font-size: clamp(22px, 2vw, 30px); line-height: 1.08; transition: color .3s; }
.svc:hover .svc-t { color: var(--blue); }
.svc-body > p { grid-area: p; margin: 0; color: var(--text-2); font-size: 15.5px; }
.svc ul { grid-area: ul; align-self: start; list-style: none; margin: 0; padding: 0; }
.svc li { position: relative; padding: 9px 0 9px 22px; border-top: 1px solid var(--line); font-size: 14.5px; }
.svc li::before { content: ''; position: absolute; left: 0; top: 18px; width: 12px; height: 1px; background: var(--blue); }
.svc-go { grid-area: go; align-self: end; display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--text); font-weight: 500; color: var(--text); text-decoration: none; transition: color .3s; }
.svc-go .arr { display: inline-block; transition: transform .3s var(--ease); }
.svc-go:hover, .svc-go:focus-visible { color: var(--blue); }
.svc-go:hover .arr { transform: translateX(6px); }
/* Tableta: la lista baja debajo del texto */
@media (max-width: 980px) {
  .svc-body { grid-template-columns: 1fr; grid-template-areas: "top" "t" "p" "ul" "go"; grid-template-rows: none; }
}
/* Celular: el ícono pasa a ser una franja arriba */
@media (max-width: 560px) {
  .svc { grid-template-columns: 1fr; }
  .svc-media { min-height: 0; aspect-ratio: 5 / 2; }
  .svc-icon { width: 58%; }
}
/* La casilla que se marca al venir desde "Cotizar este servicio" parpadea una vez */
.pick input:checked + span.is-flash { animation: pick-flash .9s var(--ease) 2; }
@keyframes pick-flash { 50% { box-shadow: 0 0 0 6px rgba(0, 85, 255, .25); } }

/* ---------- Servicios · "Cómo trabajamos": los 4 pasos del método en una franja ---------- */
.flow { margin-top: clamp(40px, 5vw, 64px); }
.flow-k { color: var(--text-2); font-size: 11px; margin: 0 0 18px; }
.flow-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--text); }
.flow-step { position: relative; padding: 22px 24px 0 0; }
.flow-step + .flow-step { padding-left: 24px; border-left: 1px solid var(--line); }
.flow-step::before { content: ''; position: absolute; top: -4px; left: 0; width: 7px; height: 7px; background: var(--blue); transform: rotate(45deg); }
.flow-step + .flow-step::before { left: -4px; }
.flow-ico { display: block; width: 72px; height: auto; margin-bottom: 14px; }
.flow-ico line, .flow-ico path, .flow-ico rect, .flow-ico polygon { stroke: var(--text); stroke-width: 1.2; fill: none; vector-effect: non-scaling-stroke; transition: stroke .3s; }
.flow-ico .dim { stroke: var(--text-2); stroke-dasharray: 3 3; }
.flow-ico .fill { fill: var(--blue); stroke: none; }
.flow-ico polygon.hot { fill: rgba(0, 85, 255, .18); }
.flow-step:hover .flow-ico line, .flow-step:hover .flow-ico path, .flow-step:hover .flow-ico rect, .flow-step:hover .flow-ico polygon { stroke: var(--blue); }
.flow-n { color: var(--blue); font-size: 10.5px; }
.flow-step h3 { font-size: 20px; margin: 6px 0 6px; letter-spacing: -.02em; }
.flow-step p { margin: 0; color: var(--text-2); font-size: 14.5px; }

/* ---------- Lab: banda compacta (título, texto y accesos directos a las 4 calculadoras) ---------- */
.lab-band { padding-bottom: clamp(56px, 6vw, 90px); }
.lab-band-head { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: end; margin-bottom: clamp(28px, 3.5vw, 44px); }
.lab-band-side { justify-self: end; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; max-width: 460px; }
.lab-band-side p { margin: 0; color: var(--text-inv-2); }
/* Aviso "En desarrollo" del Lab */
.lab-beta { font-size: 14px; line-height: 1.6; }
.lab-beta .mono { display: inline-flex; align-items: center; gap: 7px; margin-right: 8px; padding: 3px 10px; border: 1px solid rgba(255, 176, 32, .45); border-radius: 999px; color: #ffb020; font-size: 10.5px; white-space: nowrap; vertical-align: 1px; }
.lab-beta .mono::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #ffb020; animation: beta-pulse 2s ease-in-out infinite; }
@keyframes beta-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .lab-beta .mono::before { animation: none; } }
.lab-tools { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-inv); }
.lab-tool { display: flex; align-items: center; gap: 16px; padding: 22px 20px 6px 0; color: var(--text-inv); text-decoration: none; }
.lab-tool + .lab-tool { padding-left: 20px; border-left: 1px solid var(--line-inv); }
.lab-tool svg { flex: none; width: 64px; height: auto; }
.lab-tool svg * { stroke: var(--text-inv); stroke-width: 1.2; fill: none; vector-effect: non-scaling-stroke; transition: stroke .3s; }
.lab-tool svg .acc { stroke: var(--blue-hi); }
.lab-tool svg .dim { stroke: var(--text-inv-2); stroke-dasharray: 3 3; }
.lab-tool > span { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.lab-tool-n { color: var(--blue-hi); font-size: 10.5px; }
.lab-tool b { font-size: 18px; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; transition: color .3s; }
.lab-tool i { font-style: normal; color: var(--text-inv-2); transition: color .3s, transform .3s var(--ease); }
.lab-tool:hover b, .lab-tool:hover i { color: var(--blue-hi); }
.lab-tool:hover i { transform: translate(3px, -3px); }
.lab-tool:hover svg * { stroke: var(--blue-hi); }
@media (max-width: 980px) {
  .flow-steps, .lab-tools { grid-template-columns: 1fr 1fr; }
  .flow-step:nth-child(3), .lab-tool:nth-child(3) { padding-left: 0; border-left: 0; }
  .flow-step:nth-child(3)::before { left: 0; }
  .flow-step:nth-child(n + 3) { padding-top: 26px; margin-top: 22px; border-top: 1px solid var(--line); }
  .lab-tool:nth-child(n + 3) { border-top: 1px solid var(--line-inv); padding-top: 16px; }
  .lab-band-head { grid-template-columns: 1fr; gap: 20px; }
  .lab-band-side { justify-self: start; }
}
@media (max-width: 560px) {
  .flow-steps, .lab-tools { grid-template-columns: 1fr; }
  .flow-step, .flow-step + .flow-step, .flow-step:nth-child(n) { padding: 18px 0 16px; margin: 0; border-left: 0; border-top: 1px solid var(--line); }
  .flow-step:first-child { border-top: 0; }
  .flow-step::before, .flow-step + .flow-step::before { left: 0; }
  .flow-ico { display: none; }
  .lab-tool, .lab-tool + .lab-tool, .lab-tool:nth-child(n) { padding: 14px 0; border-left: 0; border-top: 1px solid var(--line-inv); }
  .lab-tool:first-child { border-top: 0; }
}

/* ---------- Tipografía: Tomorrow para lo que se mira, Inter Tight para lo que se lee ---------- */
.hero-title, .h2, .display, .svc-t, .flow-step h3, .project-info h3, .site h3, .contact-title, .direct b,
.case-title, .case-facts dd, .case-nav b, .stat-n, .drawer nav a, .ticker span, .lab-tool b {
  font-family: var(--f-display);
  font-weight: 500;
  letter-spacing: -.025em;
}
.hero-title { font-size: clamp(40px, min(8.4vw, 12vh), 136px); line-height: .95; }
.h2, .contact-title { line-height: 1.02; }
.stat-n { letter-spacing: -.03em; }
.stat-n b { font-weight: 500; }
.case-title { max-width: 16ch; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .nav { display: none; }
  .burger { display: block; }
  .coords { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(3) { padding-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); margin-top: 28px; }
}

@media (max-width: 820px) {
  body { font-size: 16px; }
  .hud--tr { top: 76px; font-size: 10px; line-height: 1.7; }
  .hero-scale { display: none; }
  .sec-intro { grid-template-columns: 1fr; gap: 24px; }
  .sec-intro p, .filters { justify-self: start; }
  .studio-grid { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
  .project, .project:nth-child(n) { grid-column: 1 / -1; }
  .project:nth-child(3n) .project-media { aspect-ratio: 16 / 11; }
  .sites { grid-template-columns: 1fr; gap: 48px; }
  .sites-link { display: none; }
  .site { text-align: left; align-items: flex-start; padding: 0; }
  .site-node { margin-bottom: 18px; justify-content: start; }
  .site-node::after { display: none; }
  .contact { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-top { text-align: left; }
}

@media (max-width: 560px) {
  .hero-title { font-size: clamp(36px, 11.2vw, 56px); }
  .hero-actions .btn { flex: 1; justify-content: center; }
  .hud--tr { display: none; }
  .header .btn--sm { display: none; }
  .stats { grid-template-columns: 1fr; }
  .stat, .stat + .stat, .stat:nth-child(n) { padding-left: 0; border-right: 0; }
  .stat:nth-child(n + 2) { border-top: 1px solid var(--line); margin-top: 28px; }
  .row2 { grid-template-columns: 1fr; }
  .direct { grid-template-columns: 1fr auto; }
  .direct span { grid-column: 1 / -1; margin-bottom: 4px; }
  .footer-grid { grid-template-columns: 1fr; }
  .clients-head span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Sitio dinámico (PHP): portafolio, páginas de proyecto y piezas nuevas
   ========================================================================== */
.section--line-dark { border-top: 1px solid var(--line-inv); }
.btn--dark { background: var(--text); color: var(--paper); }
.btn--dark:hover { background: var(--blue); color: #fff; }
.sec-intro-side { justify-self: end; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; max-width: 460px; }
.sec-intro-side p { justify-self: auto; }
.empty { color: var(--text-2); padding: 40px 0; }

/* Tarjeta de proyecto como enlace */
a.project { color: inherit; }
.project-media .project-go { position: absolute; z-index: 2; top: 20px; right: 16px; color: #fff; font-size: 11px; opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .5s var(--ease); }
.project:hover .project-go { opacity: 1; transform: none; }
.project:hover .project-info h3 { color: var(--blue); }
.project-info h3 { transition: color .3s; }
/* Tarjeta compacta (inicio): el botón es una píldora blanca; también se revela con el teclado */
.project--compact .project-go { background: #fff; color: var(--blue); padding: 10px 16px; border-radius: 999px; top: 16px; }
.project--compact:focus-visible .project-go { opacity: 1; transform: none; }
.project--compact:focus-visible .project-data::before { transform: scaleX(1); }
.project--compact:focus-visible .project-data > div { opacity: 1; transform: none; }
.project--compact:focus-visible .project-media::after { opacity: .75; }

/* Páginas internas */
.page-top { padding-top: clamp(130px, 14vw, 190px); }
.page-inner .header { background: rgba(242, 242, 238, .8); color: var(--text); border-color: var(--line); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); }
.page-inner .header .coords b { color: var(--blue); }
.page-inner .header:not(.is-light) { background: rgba(7, 8, 11, .72); color: var(--text-inv); border-color: var(--line-inv); }
.page-inner .header:not(.is-light) .coords b { color: var(--blue-hi); }
a.sec-index:hover { text-decoration: underline; }

.preview-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: #ffcc00; color: #111; padding: 10px var(--gutter); font-size: 11px; text-align: center; }
.preview-bar a { text-decoration: underline; }

/* Caso de estudio */
.case-title { font-size: clamp(40px, 6.4vw, 104px); line-height: .95; letter-spacing: -.035em; font-weight: 500; margin: 0 0 28px; max-width: 14ch; }
.case-lead { max-width: 760px; color: var(--text); }
.case-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: clamp(36px, 5vw, 64px) 0 0; border-top: 1px solid var(--text); }
.case-facts > div { padding: 16px 20px 18px 0; border-bottom: 1px solid var(--line); }
.case-facts dt { color: var(--text-2); font-size: 10.5px; margin-bottom: 6px; }
.case-facts dd { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: -.01em; }
.case-cover { margin: clamp(40px, 6vw, 80px) 0 0; padding: 0 var(--gutter); max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.case-cover img { width: 100%; height: auto; max-height: 86vh; object-fit: cover; background: var(--paper-2); }
.case-body { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; padding: clamp(48px, 7vw, 100px) 0 clamp(32px, 4vw, 56px); }
.case-k { color: var(--blue); padding-top: 8px; }
.case-text { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.6; max-width: 720px; }
.case-text p { margin: 0 0 1.1em; }
.case-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 24px); grid-auto-flow: dense; }
.case-gallery a { display: block; overflow: hidden; background: var(--paper-2); aspect-ratio: 4 / 3; }
.case-gallery a.is-tall { grid-row: span 2; aspect-ratio: auto; }
.case-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.case-gallery a:hover img { transform: scale(1.04); }
.case-nav { display: flex; justify-content: space-between; gap: 24px; margin-top: clamp(56px, 8vw, 110px); padding-top: 24px; border-top: 1px solid var(--text); }
.case-nav a { display: flex; flex-direction: column; gap: 6px; max-width: 46%; }
.case-nav a.next { text-align: right; margin-left: auto; }
.case-nav span { color: var(--text-2); font-size: 11px; }
.case-nav b { font-family: var(--f-sans); text-transform: none; letter-spacing: -.02em; font-size: clamp(18px, 2vw, 28px); font-weight: 500; transition: color .3s; }
.case-nav a:hover b { color: var(--blue); }

.cta-band { padding: clamp(56px, 7vw, 100px) 0; }
.cta-band-inner { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; position: relative; }
.cta-band .contact-title { margin: 0; }

/* Visor de fotos */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(7, 8, 11, .96); display: grid; place-items: center; padding: 60px 70px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; }
.lightbox button { position: absolute; color: #fff; }
.lb-close { top: 20px; right: 24px; font-size: 11px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 28px; width: 56px; height: 56px; border: 1px solid var(--line-inv); border-radius: 50%; }
.lb-prev { left: 12px; } .lb-next { right: 12px; }
.lb-prev:hover, .lb-next:hover { background: var(--blue); border-color: var(--blue); }
.lb-count { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: var(--text-inv-2); font-size: 11px; }

.page-404 { min-height: 80vh; display: flex; align-items: center; }
.page-404 .h2 { margin: 20px 0; }
.muted-404 { color: var(--text-inv-2); margin: 0 0 36px; }

@media (max-width: 820px) {
  .sec-intro-side { justify-self: start; }
  .case-body { grid-template-columns: 1fr; gap: 16px; }
  .case-gallery { grid-template-columns: 1fr 1fr; }
  .case-cover { padding: 0; }
  .lightbox { padding: 60px 8px; }
  .lb-prev, .lb-next { top: auto; bottom: 12px; transform: none; }
}
@media (max-width: 560px) {
  .case-gallery { grid-template-columns: 1fr; }
  .case-gallery a.is-tall { grid-row: auto; aspect-ratio: 3 / 4; }
  .case-nav { flex-direction: column; }
  .case-nav a { max-width: none; }
}

/* Fotos de proyectos: sin arrastrar ni menú de "guardar imagen" en móviles (disuade, no impide) */
.project-media img, .case-cover img, .case-gallery img, .lightbox img { -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }

/* Aviso legal y privacidad (/legal/) */
.legal { padding-bottom: clamp(64px, 8vw, 120px); }
.legal-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; margin-top: clamp(40px, 6vw, 80px); border-top: 1px solid var(--text); }
.legal-toc { position: sticky; top: 110px; align-self: start; display: flex; flex-direction: column; gap: 12px; padding-top: 32px; font-size: 11px; }
.legal-toc a { color: var(--text-2); transition: color .3s; }
.legal-toc a:hover { color: var(--blue); }
.legal-text { max-width: 720px; }
.legal-text section { padding: 32px 0 12px; border-bottom: 1px solid var(--line); scroll-margin-top: 100px; }
.legal-text section:last-child { border-bottom: 0; }
.legal-text h2 { font-size: clamp(22px, 2.2vw, 30px); font-weight: 500; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 18px; }
.legal-text h3 { font-size: 17px; font-weight: 600; margin: 26px 0 8px; }
.legal-text p, .legal-text li { font-size: 17px; line-height: 1.65; }
.legal-text p { margin: 0 0 1em; }
.legal-text ul { margin: 0 0 1.2em; padding-left: 1.2em; }
.legal-text li { margin-bottom: .5em; }
.legal-text li::marker { color: var(--blue); }
.legal-text a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.brief-legal { margin: -10px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-2); }
.brief-legal a { text-decoration: underline; text-underline-offset: 2px; }
.footer-sub a:hover { text-decoration: underline; }
@media (max-width: 820px) {
  .legal-grid { grid-template-columns: 1fr; gap: 0; }
  .legal-toc { position: static; padding: 24px 0 8px; }
}
