/* ============================================================
   NEMARI — sitio web v2 (Manual de diseño web v1.0, 30-09-2026)
   Paleta: mostaza · carbón · cemento · gris claro · papel
   Tipos: Bebas Neue (títulos) · Inter (texto) · Space Mono (etiquetas)
   ============================================================ */

:root {
  --mustard: #E5AE2D;
  --carbon: #151515;
  --cement: #777977;
  --light: #D2D2CE;
  --paper: #F5F5F0;
  --text: #151515;
  --muted: #474842;

  --font-display: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --font-body: "Inter", Arial, sans-serif;
  --font-label: "Space Mono", ui-monospace, monospace;

  --wrap: 1200px;
  --gutter: 40px;
  --radius: 4px;
  --section: clamp(56px, 9vw, 112px);
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* Borde rasgado (04_texturas/borde_rasgado.svg) en carbón y papel */
  --edge-carbon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 90' preserveAspectRatio='none'%3E%3Cpath d='M0 30l30-6 25 9 35-12 45 5 20-8 45 10 50-5 35 9 45-8 35 7 55-13 40 8 50-6 45 11 55-8 40 5 55-11 45 8 50-4 40 5 50-8 49 7 85-3V90H0Z' fill='%23151515'/%3E%3C/svg%3E");
  --edge-paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 90' preserveAspectRatio='none'%3E%3Cpath d='M0 30l30-6 25 9 35-12 45 5 20-8 45 10 50-5 35 9 45-8 35 7 55-13 40 8 50-6 45 11 55-8 40 5 55-11 45 8 50-4 40 5 50-8 49 7 85-3V90H0Z' fill='%23F5F5F0'/%3E%3C/svg%3E");
  --edge-mustard: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 90' preserveAspectRatio='none'%3E%3Cpath d='M0 30l30-6 25 9 35-12 45 5 20-8 45 10 50-5 35 9 45-8 35 7 55-13 40 8 50-6 45 11 55-8 40 5 55-11 45 8 50-4 40 5 50-8 49 7 85-3V90H0Z' fill='%23E5AE2D'/%3E%3C/svg%3E");
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
section[id] { scroll-margin-top: 96px; }

.container { max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding-inline: var(--gutter); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--carbon); color: var(--paper); padding: 12px 18px;
  font-weight: 600; text-decoration: none; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--carbon); outline-offset: 4px; }
.dark :focus-visible { outline-color: var(--mustard); }

/* ── Tipografía ───────────────────────────────────────────── */
.display {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: .98;
}
.h1 { font-size: clamp(52px, 8.4vw, 104px); }
.h2 { font-size: clamp(34px, 4.6vw, 56px); line-height: 1; }
.h3 { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.05; }

.label {
  font-family: var(--font-label);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Resalte mostaza con borde irregular (pintura) */
.hl {
  display: inline-block;
  background: var(--mustard);
  color: var(--carbon);
  padding: .02em .16em 0;
  margin-left: -.12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  clip-path: polygon(0 6%, 4% 0, 30% 5%, 58% 0, 86% 4%, 100% 0, 99% 48%, 100% 100%, 70% 95%, 42% 100%, 14% 94%, 1% 100%, 0 55%);
}

.lead { font-size: clamp(19px, 1.9vw, 24px); line-height: 1.35; font-weight: 500; }
.muted { color: var(--muted); }
.dark .muted { color: #C9C9C3; }

/* ── Botones ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px; padding: 12px 22px;
  font-family: var(--font-body); font-size: 16px; font-weight: 600; line-height: 1.2;
  text-decoration: none; border: 2px solid var(--carbon); border-radius: var(--radius);
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
  cursor: pointer;
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow, .btn:focus-visible .arrow { transform: translateX(4px); }

.btn-primary { background: var(--carbon); color: var(--paper); }
.btn-primary svg { stroke: var(--mustard); }
.btn-primary:hover { background: #000; }

.btn-outline { background: transparent; color: var(--carbon); }
.btn-outline:hover { background: var(--carbon); color: var(--paper); }

.dark .btn-outline { border-color: var(--paper); color: var(--paper); }
.dark .btn-outline:hover { background: var(--paper); color: var(--carbon); }

.icon { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ── Encabezado ───────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(210, 210, 206, .94);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: rgba(21, 21, 21, .15); }
.header-inner { display: flex; align-items: center; gap: 32px; min-height: 80px; }
.logo { display: block; flex: none; padding: 8px 0; }
.logo img { width: 160px; height: auto; }

.nav { display: flex; align-items: center; gap: 32px; margin-left: auto; }
.nav-list { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; }
.nav-list a {
  display: inline-block; padding: 10px 0;
  font-weight: 500; font-size: 16px; text-decoration: none;
  background: linear-gradient(var(--carbon), var(--carbon)) no-repeat left bottom / 0 2px;
  transition: background-size .2s var(--ease);
}
.nav-list a:hover, .nav-list a:focus-visible, .nav-list a[aria-current="page"] { background-size: 100% 2px; }
.nav-toggle { display: none; }

/* ── Portada ──────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  background: var(--light) url("../img/tex-cemento-claro.webp") repeat;
  background-size: 512px;
  padding: clamp(40px, 6vw, 72px) 0 clamp(72px, 9vw, 120px);
}
.hero::before { /* bloque mostaza escalonado */
  content: ""; position: absolute; right: 0; top: 0;
  width: 42%; height: 78%;
  background: var(--mustard) url("../img/tex-mostaza.webp") repeat; background-size: 512px;
  clip-path: polygon(0 12%, 22% 12%, 22% 0, 100% 0, 100% 100%, 12% 100%, 12% 84%, 0 84%);
}
.hero .deco-num { right: 3%; top: -2%; }
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 5fr 7fr; gap: 32px; align-items: center;
}
.hero-copy { display: flex; flex-direction: column; gap: 24px; }
.hero-copy .h1 .hl { display: inline-block; margin-top: .06em; }
.hero-support { max-width: 44ch; font-size: 16px; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; }
.hero-art { margin: 0 -6% 0 -4%; }
.hero-art img { width: 100%; filter: drop-shadow(0 18px 30px rgba(0,0,0,.18)); }

.deco-num {
  position: absolute; z-index: 0; pointer-events: none; user-select: none;
  font-family: var(--font-display); line-height: .8;
  font-size: clamp(180px, 26vw, 400px);
  color: var(--cement); opacity: .28;
}

/* ── Secciones ────────────────────────────────────────────── */
.section { position: relative; padding: var(--section) 0; }
.dark { background: var(--carbon) url("../img/tex-carbon.webp") repeat; background-size: 512px; color: var(--paper); }
.paper { background: var(--paper); }
.mustard { background: var(--mustard) url("../img/tex-mostaza.webp") repeat; background-size: 512px; color: var(--carbon); }

/* bordes rasgados superiores */
.edge-top::before {
  content: ""; position: absolute; left: 0; right: 0; top: -38px; height: 40px;
  background-size: 100% 100%; background-repeat: no-repeat; pointer-events: none;
}
.dark.edge-top::before { background-image: var(--edge-carbon); }
.paper.edge-top::before { background-image: var(--edge-paper); }
.mustard.edge-top::before { background-image: var(--edge-mustard); }

.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head .h2 { max-width: 22ch; }

/* ── Servicios ────────────────────────────────────────────── */
.services-grid { display: grid; grid-template-columns: 3fr 9fr; gap: 48px; align-items: start; }
.services-title .h2 { font-size: clamp(40px, 5vw, 64px); }
.services-title .hl { display: inline-block; }
.services-list { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; list-style: none; }
.service { padding: 4px 28px 8px; border-left: 1px solid rgba(245,245,240,.25); display: flex; flex-direction: column; gap: 12px; }
.service-top { display: flex; align-items: center; gap: 16px; }
.service-num { font-family: var(--font-display); font-size: 44px; line-height: 1; color: var(--mustard); }
.service-top svg { width: 40px; height: 40px; color: var(--paper); }
.service p { font-size: 16px; }
.service .for { font-family: var(--font-label); font-size: 13px; line-height: 1.5; color: var(--mustard); margin-top: auto; padding-top: 8px; }
.services-extra {
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(245,245,240,.25);
  font-size: 16px;
}
.services-extra strong { color: var(--mustard); font-weight: 600; }

/* ── Proyectos ────────────────────────────────────────────── */
.projects { overflow-x: clip; }
.projects .deco-num { right: 2%; top: 2%; }
.projects .container { position: relative; z-index: 1; }
.portfolio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; margin: 0; padding: 0; list-style: none; }
.project { display: flex; flex-direction: column; }
/* 5.º proyecto: ocupa el ancho completo, imagen y texto lado a lado */
.project--wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.project--wide .project-body { padding-top: 0; }
.project-media {
  position: relative; margin: 0; overflow: hidden;
  border-radius: var(--radius); background: var(--light);
  box-shadow: 0 1px 0 rgba(21,21,21,.08);
}
.project-image { width: 100%; aspect-ratio: 8 / 5; object-fit: contain; transition: transform .25s var(--ease); }
.project:hover .project-image, .project:focus-within .project-image { transform: scale(1.02); }
.project-body { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: start; padding-top: 16px; }
.project-body .h3 { grid-column: 1; }
.project-meta { grid-column: 1; font-size: 15px; color: var(--muted); }
.project-link {
  grid-column: 2; grid-row: 1 / span 2; align-self: center;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px;
  font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
}
.project-link svg { width: 28px; height: 28px; color: #B07F12; transition: transform .2s var(--ease); }
.project-link:hover svg, .project-link:focus-visible svg { transform: translateX(4px); }
.project-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.status {
  display: inline-block; margin-left: 10px; padding: 3px 8px; vertical-align: middle;
  font-family: var(--font-label); font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  border: 1.5px solid var(--carbon); border-radius: 2px; line-height: 1.3;
}
.note { margin-top: 32px; font-size: 14px; color: var(--muted); }

/* ── Proceso ──────────────────────────────────────────────── */
.process { border-top: 1px solid rgba(21,21,21,.15); }
.process-grid { display: grid; grid-template-columns: 4fr 8fr; gap: 48px; align-items: start; }
.process-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.step { display: flex; flex-direction: column; gap: 12px; }
.step-top { display: flex; align-items: center; gap: 14px; }
.step-top svg { width: 44px; height: 44px; }
.step-num { font-family: var(--font-display); font-size: 40px; line-height: 1; color: #9A6E0B; }
.step p { font-size: 16px; color: var(--muted); }

/* ── Estudio ──────────────────────────────────────────────── */
.studio-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; align-items: center; }
.studio-copy { display: flex; flex-direction: column; gap: 24px; }
.studio-copy p { max-width: 50ch; }
.disciplines { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.disciplines li {
  font-family: var(--font-label); font-size: 13px; text-transform: uppercase; letter-spacing: .04em;
  padding: 6px 10px; border: 1px solid rgba(245,245,240,.35); border-radius: 2px;
}
.studio-link { color: var(--mustard); font-weight: 600; text-underline-offset: 4px; }
.studio-art img { width: 100%; }

/* ── Contacto ─────────────────────────────────────────────── */
.contact { overflow-x: clip; }
.contact .deco-num { right: 2%; bottom: 0; color: var(--carbon); opacity: .12; }
.contact-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 7fr 5fr; gap: 48px; align-items: end; }
.contact-copy { display: flex; flex-direction: column; gap: 20px; }
.contact-copy .h2 { font-size: clamp(44px, 6vw, 80px); max-width: 14ch; }
.contact-copy p { max-width: 52ch; font-size: 18px; }
.contact-actions { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.mail-link {
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px;
  font-weight: 600; font-size: 18px; user-select: all;
}
.mail-link svg { width: 28px; height: 28px; }
.hint { font-size: 14px; max-width: 40ch; }

/* ── Pie ──────────────────────────────────────────────────── */
.site-footer { padding: 40px 0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px; }
.footer-brand { display: flex; align-items: center; gap: 20px; }
.footer-brand img { width: 130px; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; }
.footer-nav a, .footer-contact a { text-decoration: none; font-size: 15px; display: inline-block; padding: 8px 0; }
.footer-nav a:hover, .footer-contact a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; font-size: 15px; }
.footer-contact span { padding: 8px 0; }
.copy { font-size: 14px; color: #C9C9C3; }

/* ── Portafolio (página) ──────────────────────────────────── */
.page-hero { position: relative; overflow: hidden; background: var(--light) url("../img/tex-cemento-claro.webp") repeat; background-size: 512px; padding: clamp(48px, 7vw, 96px) 0 clamp(64px, 8vw, 104px); }
.page-hero .deco-num { right: 3%; top: -6%; }
.page-hero .container { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 20px; }
.page-hero .h1 { font-size: clamp(48px, 7vw, 92px); max-width: 14ch; }
.page-hero .lead { max-width: 40ch; }

.case { display: grid; grid-template-columns: 7fr 5fr; gap: 40px; align-items: center; padding: 48px 0; border-top: 1px solid rgba(21,21,21,.15); }
.case:first-child { border-top: 0; padding-top: 0; }
.case-list { margin: 0; padding: 0; list-style: none; }
.case-body { display: flex; flex-direction: column; gap: 14px; }
.case-body dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 4px 0 0; font-size: 15px; }
.case-body dt { font-family: var(--font-label); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding-top: 3px; color: var(--muted); }
.case-body dd { margin: 0; }
.swatches { display: flex; gap: 6px; margin-top: 2px; }
.swatches span { width: 22px; height: 22px; border-radius: 2px; border: 1px solid rgba(21,21,21,.2); }

.others { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; }
.other { background: var(--paper); border: 1px solid rgba(21,21,21,.15); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.other .label { color: var(--muted); }
.other p { font-size: 16px; }
.other .project-link, .case-body .project-link { align-self: flex-start; padding: 0; }

/* ── Movimiento: mejora progresiva ────────────────────────── */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1199px) {
  :root { --gutter: 28px; }
  .services-grid, .process-grid { grid-template-columns: 1fr; gap: 32px; }
  .service:first-child { border-left: 0; padding-left: 0; }
}

@media (max-width: 899px) {
  .nav-list { gap: 20px; }
  .header-cta { display: none; }
  .hero-grid, .studio-grid, .contact-grid, .case { grid-template-columns: 1fr; }
  .hero::before { width: 70%; height: 30%; top: auto; bottom: 0; clip-path: polygon(0 16%, 30% 16%, 30% 0, 100% 0, 100% 100%, 0 100%); }
  .hero-art { margin: 8px -4% 0; max-width: 720px; }
  .services-list { grid-template-columns: 1fr; gap: 28px; }
  .service { border-left: 0; padding: 0 0 28px; border-bottom: 1px solid rgba(245,245,240,.25); }
  .process-steps { grid-template-columns: 1fr; gap: 28px; }
  .case .project-media { order: -1; }
}

@media (max-width: 767px) {
  :root { --gutter: 20px; }
  body { font-size: 16px; }
  .portfolio-grid, .others { grid-template-columns: 1fr; gap: 40px; }
  .project--wide { display: flex; flex-direction: column; gap: 0; }
  .project--wide .project-body { padding-top: 16px; }
  .header-inner { min-height: 68px; gap: 16px; }
  .logo img { width: 140px; }
  .hero .deco-num, .projects .deco-num { display: none; }
  .hero-actions .btn { width: 100%; }
  .contact-actions .btn { width: 100%; }
  .footer-inner { flex-direction: column; align-items: flex-start; }

  /* Menú móvil (solo con JS; sin JS la lista queda visible) */
  .js .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    margin-left: auto; min-width: 48px; min-height: 48px; padding: 0 12px;
    background: transparent; border: 2px solid var(--carbon); border-radius: var(--radius);
    font: 600 15px/1 var(--font-body); color: var(--carbon); cursor: pointer;
  }
  .nav-toggle svg { width: 22px; height: 22px; }
  .nav-toggle .i-close { display: none; }
  .nav-toggle[aria-expanded="true"] .i-open { display: none; }
  .nav-toggle[aria-expanded="true"] .i-close { display: block; }
  .js .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--light); border-bottom: 2px solid var(--carbon);
    padding: 8px var(--gutter) 20px;
  }
  .js .nav.is-open { display: flex; }
  .js .nav-list { flex-direction: column; gap: 0; }
  .js .nav-list a { display: block; padding: 14px 0; font-size: 18px; border-bottom: 1px solid rgba(21,21,21,.12); background: none; }
  .js .nav .header-cta { display: inline-flex; margin-top: 16px; }
  .header-inner { flex-wrap: wrap; }
  html:not(.js) .nav { width: 100%; margin: 0 0 8px; }
  html:not(.js) .nav-list { flex-wrap: wrap; gap: 4px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
