/* =========================================================
   COMPILA_ · Estudio digital — estilos
   Paleta y tipografías en :root. Grafito y marfil de fondo,
   azul y lima como acentos (documento de marca, sección 04).
   ========================================================= */

:root {
  --grafito: #0B0B0D;
  --grafito-2: #141418;
  --grafito-3: #1E1E24;
  --marfil: #F7F5EC;
  --marfil-2: #EDEADC;
  --azul: #0037FF;
  --lima: #C6FF00;

  --tinta-suave: rgba(247, 245, 236, .68);   /* texto secundario sobre grafito */
  --grafito-suave: rgba(11, 11, 13, .66);    /* texto secundario sobre marfil */
  --linea-oscura: rgba(247, 245, 236, .12);
  --linea-clara: rgba(11, 11, 13, .12);

  --f-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 48px);
  --header-h: 72px;
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

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

body {
  margin: 0;
  background: var(--grafito);
  color: var(--marfil);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -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: 600; }
p { margin: 0 0 1em; }

::selection { background: var(--lima); color: var(--grafito); }

:focus-visible {
  outline: 2px solid var(--lima);
  outline-offset: 3px;
  border-radius: 4px;
}
.light :focus-visible { outline-color: var(--azul); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--lima); color: var(--grafito);
  padding: 10px 16px; border-radius: 8px; font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

.mono { font-family: var(--f-mono); }

/* ---------- Encabezado ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--header-h);
  transition: background .3s var(--ease), border-color .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(11, 11, 13, .86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--linea-oscura);
}
.header-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand img { width: 176px; height: auto; margin-left: -5px; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; }
.nav a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 15px; font-weight: 600;
  color: var(--tinta-suave);
  transition: color .2s, background .2s;
}
.nav a:hover, .nav a.is-active { color: var(--marfil); }
.nav a.is-active:not(.nav-cta) { background: var(--grafito-3); }
.nav .nav-cta {
  margin-left: 8px;
  color: var(--grafito);
  background: var(--lima);
}
.nav .nav-cta:hover, .nav .nav-cta.is-active { color: var(--grafito); }
.nav .nav-cta:hover { background: var(--marfil); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--linea-oscura); border-radius: 12px;
  background: transparent; cursor: pointer;
  position: relative;
}
.nav-toggle span {
  position: absolute; left: 12px; right: 12px; height: 2px;
  background: var(--marfil); transition: transform .3s var(--ease), top .3s var(--ease);
}
.nav-toggle span:first-child { top: 16px; }
.nav-toggle span:last-child { top: 25px; right: 18px; background: var(--lima); }
.nav-toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 21px; right: 12px; transform: rotate(-45deg); }

@media (max-width: 820px) {
  .brand img { width: 146px; }
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: var(--grafito);
    border-bottom: 1px solid var(--linea-oscura);
    padding: 12px var(--gutter) 28px;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s .25s;
  }
  .nav.is-open {
    transform: none; opacity: 1; visibility: visible;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
  }
  .site-header:has(.nav.is-open) { background: var(--grafito); }
  .nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav a { display: block; padding: 14px 4px; font-size: 20px; border-radius: 0; border-bottom: 1px solid var(--linea-oscura); }
  .nav a.is-active:not(.nav-cta) { background: none; color: var(--lima); }
  .nav .nav-cta { margin: 16px 0 0; text-align: center; border-radius: 999px; border: 0; padding: 14px; font-size: 17px; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  border-radius: 999px;
  font-weight: 700; font-size: 16px; text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform .2s var(--ease), background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: none; }
.btn-lime { background: var(--lima); color: var(--grafito); }
.btn-lime:hover { background: var(--marfil); }
.btn-ghost { border-color: rgba(247, 245, 236, .4); color: var(--marfil); }
.btn-ghost:hover { border-color: var(--lima); color: var(--lima); }
.btn[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.btn[aria-disabled="true"]:hover { transform: none; }

/* ---------- Hero / cortina binaria ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--header-h) + 48px) 0 96px;
  overflow: hidden;
  isolation: isolate;
}
.binary {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: -2;
}
/* Sombra que protege la lectura del titular */
.hero-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, var(--grafito) 0%, rgba(11,11,13,.92) 30%, rgba(11,11,13,.35) 62%, rgba(11,11,13,0) 85%),
    linear-gradient(0deg, var(--grafito) 0%, rgba(11,11,13,0) 22%),
    linear-gradient(180deg, rgba(11,11,13,.7) 0%, rgba(11,11,13,0) 18%);
}
.hero-inner { position: relative; }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 14px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--tinta-suave);
  margin-bottom: 28px;
}
.eyebrow .br { color: var(--lima); }

.hero-title {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(36px, 11.5vw, 96px);
  line-height: 1.02;
  letter-spacing: -.035em;
  max-width: 12.5ch;
  text-wrap: balance;
}
.hero-title em, .contact h2 em { font-style: normal; color: var(--lima); }

.cursor {
  color: var(--azul);
  margin-left: .04em;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-lead {
  margin-top: 28px;
  max-width: 40ch;
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--tinta-suave);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

.hero-meta {
  position: absolute; left: 0; right: 0; bottom: 28px;
  display: flex; justify-content: space-between;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(247, 245, 236, .45);
}

@media (max-width: 720px) {
  .hero { padding-top: calc(var(--header-h) + 32px); padding-bottom: 88px; }
  /* En celular la cortina queda como una franja tenue al borde derecho */
  .hero-shade {
    background:
      linear-gradient(90deg, rgba(11,11,13,.92) 0%, rgba(11,11,13,.7) 45%, rgba(11,11,13,.15) 85%, rgba(11,11,13,0) 100%),
      linear-gradient(0deg, var(--grafito) 0%, rgba(11,11,13,0) 22%);
  }
  .hero-actions .btn { flex: 1 1 100%; }
}

/* ---------- Secciones ---------- */
.section { position: relative; padding: clamp(80px, 11vw, 140px) 0; }
.light { background: var(--marfil); color: var(--grafito); }
.dark { background: var(--grafito); color: var(--marfil); }

.section-head { margin-bottom: clamp(40px, 6vw, 72px); max-width: 760px; }
.label {
  font-family: var(--f-mono);
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  margin-bottom: 18px;
  color: var(--azul);
}
.dark .label { color: var(--lima); }
.section h2 {
  font-family: var(--f-display);
  font-size: clamp(32px, 4.6vw, 60px);
  line-height: 1.05;
  letter-spacing: -.03em;
}
.section-intro {
  margin-top: 22px;
  max-width: 52ch;
  font-size: 18px;
}
.light .section-intro { color: var(--grafito-suave); }
.dark .section-intro { color: var(--tinta-suave); }

/* ---------- Proyectos ---------- */
.case {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.case-media { position: relative; padding: 0 0 48px; }
.case + .case { margin-top: clamp(72px, 10vw, 128px); }
/* Caso alternado: imagen a la derecha y teléfono a la izquierda */
.case--flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); }
.case--flip .case-media { order: 2; }
.case--flip .frame-phone { right: auto; left: -2%; }

.frame-desktop {
  margin: 0;
  background: var(--grafito);
  border-radius: var(--radius);
  padding: 0 0 0;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(11, 11, 13, .45);
}
.frame-bar {
  display: flex; gap: 7px; padding: 12px 14px;
  background: var(--grafito-2);
}
.frame-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(247,245,236,.18); }
.frame-bar i:first-child { background: var(--lima); }
.frame-desktop .shot, .frame-desktop img { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; object-position: top; }

.frame-phone {
  position: absolute; right: -2%; bottom: 0;
  width: 26%; min-width: 108px;
  margin: 0;
  padding: 7px;
  background: var(--grafito);
  border-radius: 26px;
  box-shadow: 0 24px 50px -20px rgba(11, 11, 13, .55);
}
.frame-phone .shot, .frame-phone img {
  aspect-ratio: 9 / 19.5; width: 100%; object-fit: cover; object-position: top;
  border-radius: 20px;
}

/* Teaser vertical: segundo teléfono, a la izquierda */
.frame-teaser { right: auto; left: -3%; width: 24%; }
.frame-teaser video {
  display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover;
  border-radius: 20px; background: var(--grafito-3);
}
.teaser-tag {
  position: absolute; top: 16px; left: 16px;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(11, 11, 13, .75); color: var(--lima);
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  pointer-events: none;
}
.teaser-tag::before { content: "▶ "; font-size: 9px; }
.teaser-sound {
  position: absolute; right: 14px; bottom: 14px;
  width: 38px; height: 38px; padding: 9px;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(11, 11, 13, .75); color: var(--marfil);
  transition: background .2s, color .2s;
}
.teaser-sound:hover { background: var(--lima); color: var(--grafito); }
.teaser-sound svg { display: block; width: 100%; height: 100%; }
.teaser-sound .wave { display: none; }
.teaser-sound[aria-pressed="true"] .wave { display: block; }
.teaser-sound[aria-pressed="true"] .mute { display: none; }

.shot-pending {
  display: grid; place-items: center; text-align: center;
  background:
    repeating-linear-gradient(135deg, rgba(247,245,236,.04) 0 10px, transparent 10px 20px),
    var(--grafito-3);
  color: rgba(247, 245, 236, .5);
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  line-height: 1.6;
}
.shot-pending small { color: var(--lima); opacity: .8; text-transform: none; letter-spacing: 0; }

.case-index {
  font-family: var(--f-mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--grafito-suave); margin-bottom: 10px;
}
.case-info h3 {
  font-family: var(--f-display);
  font-size: clamp(34px, 4vw, 52px);
  letter-spacing: -.03em; line-height: 1;
}
.case-type {
  display: inline-block;
  margin: 16px 0 22px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--azul); color: var(--marfil);
  font-weight: 700; font-size: 14px;
}
.case-info > p:not(.case-index):not(.case-type) { color: var(--grafito-suave); max-width: 40ch; }

.case-facts { margin: 28px 0 0; border-top: 1px solid var(--linea-clara); }
.case-facts div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--linea-clara);
  font-size: 15px;
}
.case-facts dt { color: var(--grafito-suave); }
.case-facts dd { margin: 0; font-weight: 600; text-align: right; }

.case-link {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 28px;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px;
  background: var(--grafito); color: var(--marfil);
  font-weight: 700; font-size: 15px; text-decoration: none;
  transition: background .2s, color .2s, transform .2s var(--ease);
}
.case-link span[aria-hidden] { color: var(--lima); transition: transform .2s var(--ease); }
.case-link:hover { background: var(--azul); transform: translateY(-2px); }
.case-link:hover span[aria-hidden] { transform: translate(2px, -2px); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.case-next {
  margin-top: clamp(56px, 8vw, 96px);
  padding: 26px 28px;
  border: 1.5px dashed rgba(11, 11, 13, .25);
  border-radius: var(--radius);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
}
.case-next p { margin: 0; font-weight: 600; }
.case-next .mono { color: var(--azul); font-weight: 500; margin-right: 8px; font-size: 14px; }

.link-arrow {
  font-weight: 700; text-decoration: none;
  border-bottom: 2px solid currentColor; padding-bottom: 2px;
}
.light .link-arrow { color: var(--azul); }
.link-arrow span { display: inline-block; transition: transform .2s var(--ease); }
.link-arrow:hover span { transform: translateX(4px); }

@media (max-width: 900px) {
  .case, .case--flip { grid-template-columns: 1fr; }
  .case--flip .case-media { order: 0; }
  .frame-phone { right: 2%; width: 28%; }
  .case--flip .frame-phone { left: 2%; }
  .frame-teaser { left: 2%; width: 26%; }
  .teaser-tag { top: 10px; left: 10px; font-size: 9px; padding: 2px 7px; }
  .teaser-sound { right: 8px; bottom: 8px; width: 30px; height: 30px; padding: 7px; }
}

/* ---------- Servicios ---------- */
.services {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--linea-oscura);
}
.services li {
  padding: 32px 28px 40px 0;
  border-bottom: 1px solid var(--linea-oscura);
}
.services li + li { padding-left: 28px; border-left: 1px solid var(--linea-oscura); }
.services .num, .process .num {
  font-family: var(--f-mono); font-size: 13px; letter-spacing: .1em;
}
.services .num { color: var(--lima); }
.services h3 {
  font-family: var(--f-display);
  font-size: 22px; letter-spacing: -.02em; line-height: 1.15;
  margin: 48px 0 14px;
}
.services p { color: var(--tinta-suave); font-size: 16px; margin: 0; }
.services li { transition: background .3s var(--ease); }
.services li:hover h3 { color: var(--lima); }

@media (max-width: 980px) {
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .services li:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 560px) {
  .services { grid-template-columns: 1fr; }
  .services li, .services li + li { padding: 24px 0 28px; border-left: 0; }
  .services h3 { margin-top: 14px; }
}

/* ---------- Estudio ---------- */
.studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "head head" "body process";
  gap: 0 clamp(40px, 7vw, 110px);
}
.studio .section-head { grid-area: head; }
.studio-body { grid-area: body; }
.process { grid-area: process; }

.studio-lead {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(21px, 2.1vw, 27px);
  line-height: 1.35; letter-spacing: -.015em;
  margin-bottom: 22px;
}
.studio-lead strong { font-weight: 600; color: var(--azul); }
.studio-body > p:not(.studio-lead) { color: var(--grafito-suave); max-width: 46ch; }

.mini-title {
  font-family: var(--f-mono); font-weight: 500;
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--grafito-suave);
  margin: 40px 0 16px;
}
.process .mini-title { margin-top: 0; }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 8px 16px;
  border: 1.5px solid var(--grafito);
  border-radius: 999px;
  font-weight: 600; font-size: 15px;
}

.process ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--linea-clara); }
.process li {
  display: grid; grid-template-columns: 48px 1fr; gap: 8px;
  padding: 20px 0; border-bottom: 1px solid var(--linea-clara);
}
.process .num { color: var(--azul); padding-top: 3px; }
.process strong { font-size: 18px; }
.process li p { margin: 4px 0 0; color: var(--grafito-suave); font-size: 16px; }

@media (max-width: 860px) {
  .studio { grid-template-columns: 1fr; grid-template-areas: "head" "body" "process"; }
  .process { margin-top: 48px; }
}

/* ---------- Contacto ---------- */
.contact { overflow: hidden; isolation: isolate; }
.contact .binary { z-index: -1; }
.contact::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, var(--grafito) 0%, rgba(11,11,13,.92) 45%, rgba(11,11,13,.5) 100%);
}
.contact h2 { font-size: clamp(38px, 6vw, 82px); max-width: 14ch; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
@media (max-width: 560px) {
  .contact-actions .btn { flex: 1 1 100%; }
}

/* ---------- Pie ---------- */
.site-footer {
  border-top: 1px solid var(--linea-oscura);
  padding: 36px 0 40px;
  font-size: 14px;
  color: var(--tinta-suave);
}
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.footer-inner img { width: 143px; margin-left: -4px; }
.footer-inner p { margin: 0; flex: 1 1 auto; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-links a { text-decoration: none; border-bottom: 1px solid rgba(247,245,236,.3); }
.footer-links a:hover { color: var(--lima); border-color: var(--lima); }

/* ---------- Aparición suave al hacer scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
