:root {
  --bg: #f4f2ec;      /* hueso */
  --ink: #111111;     /* negro */
  --yellow: #ffd52e;
  --blue: #2b59ff;
  --red: #ff3b30;   /* primario */
  --line: #111111;
  --max: 1200px;
  --gutter: clamp(20px, 5vw, 56px);
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand, .btn, .block b, .stat, .work b { font-family: var(--font-head); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 48px;
  padding: 20px clamp(20px, 5vw, 56px);
  background: var(--bg);
  border-bottom: 2px solid var(--line);
}
.brand { display: inline-flex; align-items: flex-start; font-weight: 700; font-size: 2.6rem; letter-spacing: -0.04em; text-decoration: none; color: var(--ink); line-height: 1; }
.brand sup { font-size: 0.5em; color: var(--ink); margin-left: 1px; }
/* Logo TAU: una letra por color primario, todas con borde negro */
.brand__l { display: inline-block; font-family: var(--font-head); font-weight: 700; -webkit-text-stroke: 1px var(--ink); transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.brand__l--red { color: var(--red); }
.brand__l--yellow { color: var(--yellow); }
.brand__l--blue { color: var(--blue); }
/* Las letras saltan escalonadas al pasar el ratón */
.brand:hover .brand__l { transform: translateY(-6px) rotate(-4deg); }
.brand:hover .brand__l--yellow { transition-delay: 0.06s; }
.brand:hover .brand__l--blue { transition-delay: 0.12s; }
.nav__links { display: flex; gap: 32px; }
.nav__links a { color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 500; position: relative; }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px; background: var(--ink); transition: width 0.25s; }
.nav__links a:hover::after { width: 100%; }

/* Selector de idioma */
.lang { display: flex; gap: 4px; align-items: center; }
.lang__btn {
  font-family: var(--font-head); font-weight: 600; font-size: 0.8rem;
  padding: 5px 9px; border: 2px solid var(--line); background: transparent; color: var(--ink);
  cursor: pointer; line-height: 1; transition: background 0.2s, color 0.2s;
}
.lang__btn:hover { background: var(--yellow); }
.lang__btn.is-active { background: var(--ink); color: var(--bg); }

/* Botón hamburguesa (oculto en escritorio) */
.nav__toggle {
  display: none; flex-direction: column; gap: 5px; justify-content: center;
  width: 44px; height: 44px; padding: 10px; margin: -10px;
  background: none; border: none; cursor: pointer; z-index: 60;
}
.nav__toggle span { display: block; width: 26px; height: 2px; background: var(--ink); transition: transform 0.3s, opacity 0.2s; }
body.nav-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav__toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ink); color: var(--bg);
  border: 2px solid var(--ink); border-radius: 0;
  padding: 11px 20px; font-size: 0.92rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.btn:hover { background: var(--yellow); color: var(--ink); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.btn--lg { padding: 15px 28px; font-size: 1rem; }

/* ---------- Hero ---------- */
.hero { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 9vw, 100px) var(--gutter); }
.hero__title { font-size: clamp(2.8rem, 11vw, 8rem); font-weight: 700; line-height: 0.95; letter-spacing: -0.04em; }
.mark { display: inline-block; padding: 0 0.12em; }
.mark--yellow { background: var(--yellow); }
.mark--blue { background: var(--blue); color: var(--bg); }
.mark--red { background: var(--red); color: var(--bg); }
.hero__row { display: flex; gap: 40px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-top: 44px; }
.hero__sub { max-width: 460px; font-size: 1.1rem; }

/* ---------- Secciones ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(64px, 10vw, 120px) var(--gutter); }
.section--tight { padding-top: 0; }
.section--line { border-top: 2px solid var(--line); }
.section__head { margin-bottom: 56px; }
.index { display: inline-block; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; font-weight: 500; }
.index--light { color: var(--bg); }
.section__head h2 { font-size: clamp(2rem, 6vw, 4rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.section__sub { max-width: 460px; margin-top: 20px; font-size: 1.05rem; }

/* ---------- Lista de servicios ---------- */
.list { list-style: none; border-top: 2px solid var(--line); }
.list__item {
  display: grid; grid-template-columns: 60px 1fr 2fr; gap: 24px; align-items: center;
  padding: 28px 0; border-bottom: 2px solid var(--line);
  transition: background 0.2s, color 0.2s, padding-left 0.2s;
}
.list__item:hover { background: var(--yellow); padding-left: 16px; }
.list__num { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; }
.list__item h3 { font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 600; letter-spacing: -0.02em; }
.list__item p { font-size: 1rem; max-width: 420px; }

/* ---------- Portfolio ---------- */
/* Columnas explícitas: así se decide qué tarjeta va en cada columna
   (el masonry automático las repartía solo por altura) */
.portfolio { display: flex; gap: 16px; align-items: flex-start; }
.portfolio__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.work {
  break-inside: avoid; -webkit-column-break-inside: avoid;
  display: flex; flex-direction: column;
  background: #fff;
  text-decoration: none; color: var(--ink); cursor: pointer;
  border: 2px solid var(--line);
  overflow: hidden;
}
.work__shot { display: block; overflow: hidden; }
.work__shot img { display: block; width: 100%; height: auto; }
/* Bloque de color inferior: nombre + descripción, letras blancas o negras */
.work__meta { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-top: 2px solid var(--line); }
/* Efecto de hover solo en el texto */
.work__tag, .work b { transition: transform 0.25s ease; }
.work:hover .work__tag, .work:hover b { transform: translateX(6px); }
.work b { font-size: clamp(1.05rem, 1.4vw, 1.35rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.work__tag { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.25; opacity: 0.85; }
.work--yellow .work__meta { background: var(--yellow); color: var(--ink); }
.work--blue .work__meta   { background: var(--blue);   color: var(--bg); }
.work--red .work__meta    { background: var(--red);    color: var(--bg); }

/* ---------- CTA ---------- */
/* El fondo va a todo el ancho, pero el contenido usa la misma caja que las secciones */
.cta { background: var(--ink); color: var(--bg); padding: clamp(64px, 10vw, 120px) 0; }
/* Misma caja que .section, para que 03 arranque alineado con 01 y 02 */
.cta__inner { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.cta h2 { font-size: clamp(2.2rem, 7.5vw, 5.2rem); font-weight: 700; line-height: 0.95; letter-spacing: -0.04em; margin: 18px 0 44px; }
.cta__mail { display: inline-flex; background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.cta__mail:hover { background: var(--bg); color: var(--ink); border-color: var(--bg); box-shadow: none; transform: translate(-2px, -2px); }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--max); margin: 0 auto;
  padding: 36px clamp(20px, 5vw, 56px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.footer__mail { color: var(--ink); text-decoration: none; font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; }
.footer__mail:hover { text-decoration: underline; }

/* ---------- Animaciones ---------- */
/* Entrada del hero al cargar */
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero__meta, .hero__title, .hero__row { animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.hero__title { animation-delay: 0.1s; }
.hero__row   { animation-delay: 0.25s; }

/* Reveal al hacer scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Escalonado para hijos directos (items de servicios) */
.list.is-visible .list__item { animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.list.is-visible .list__item:nth-child(2) { animation-delay: 0.08s; }
.list.is-visible .list__item:nth-child(3) { animation-delay: 0.16s; }
.list.is-visible .list__item:nth-child(4) { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  /* Ya no caben 3 columnas: se disuelven y las tarjetas se reparten solas */
  .portfolio { display: block; column-count: 2; column-gap: 16px; }
  .portfolio__col { display: contents; }
  .work { margin-bottom: 16px; }
}
@media (max-width: 640px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed; inset: 0; z-index: 55;
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px;
    padding: 0 clamp(20px, 8vw, 56px);
    background: var(--bg);
    transform: translateY(-100%); transition: transform 0.35s ease;
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav__links { transform: translateY(0); }
  .nav__links a { font-family: var(--font-head); font-size: 2.6rem; font-weight: 700; letter-spacing: -0.03em; }
  .nav__links a::after { display: none; }

  .list__item { grid-template-columns: 40px 1fr; }
  .list__item p { grid-column: 2; }
  .portfolio { column-count: 1; }
}
