/* Píxel y Código — páginas internas (papel claro) */
:root {
  --paper: #F4F3EE;
  --ink: #111112;
  --ink-2: #3A3A3F;
  --grey: #5E5E63;
  --rule: #DCDAD3;
  --soft: #E6E4DC;
  --faint: #ECEAE3;
  --lime: #C8F53C;
  --sw: #7FA61A;
  --av: #D9442A;
  --error: #B3321A;
  --display: 'Archivo', system-ui, sans-serif;
  --text: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --pixel: 'Silkscreen', var(--mono);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: clamp(20px, 4vw, 48px);
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 100px; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); font-family: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }
input, textarea, button { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -80px; z-index: 30; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 13px var(--mono); }
.skip-link:focus { top: 12px; }
.cursor { animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.load-bar { position: fixed; top: 0; left: 0; z-index: 20; width: 100%; height: 3px; background: var(--ink); transform: scaleX(0); transform-origin: left; pointer-events: none; }
.is-leaving .load-bar { transform: scaleX(.7); transition: transform .35s ease; }

/* ---------- Cabecera y pie ---------- */
.header { position: sticky; top: 0; z-index: 10; background: rgba(244,243,238,.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); view-transition-name: header; }
.header__inner { position: relative; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; max-width: 1280px; margin: 0 auto; padding: 20px var(--gutter); }
.logo { display: flex; align-items: baseline; gap: 8px; }
.logo:hover { text-decoration: none; }
.logo__pixel { font-family: var(--pixel); font-size: 20px; }
.logo__code { font-family: var(--mono); font-size: 14px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; font-family: var(--mono); font-size: 13px; }
.nav a { padding: 9px 14px; border-radius: 999px; }
.nav a:hover { text-decoration: none; }
.nav__link { transition: background .2s; }
.nav__link:hover { background: var(--soft); }
.nav__link[aria-current] { background: var(--ink); color: var(--paper); }
.nav .nav__cta { margin-left: 8px; padding-inline: 16px; background: var(--lime); }
.nav .nav__cta:hover { background: var(--ink); color: var(--lime); }
.menu-toggle { display: none; }
.footer { margin-top: auto; border-top: 1px solid var(--rule); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; max-width: 1280px; margin: 0 auto; padding: 28px var(--gutter); font-family: var(--mono); font-size: 12px; color: var(--grey); }
.footer a { color: var(--grey); }
.footer__logo { display: flex; align-items: baseline; gap: 8px; color: var(--ink); }
.footer__pixel { font-family: var(--pixel); font-size: 15px; }

/* ---------- Comunes ---------- */
.main { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter) 120px; view-transition-name: contenido; }
.page { padding-top: 88px; }
.page--case { padding-top: 56px; }
.eyebrow { margin-bottom: 20px; font-family: var(--mono); font-size: 13px; color: var(--grey); }
.h1 { font-family: var(--display); font-variation-settings: 'wdth' 110; font-weight: 800; font-size: clamp(44px, 6vw, 88px); line-height: .95; letter-spacing: -.04em; overflow-wrap: break-word; }
.h1--wide { max-width: 900px; }
.label { padding: 0; font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--grey); }
.muted { font-size: 15px; color: var(--grey); }
.btn { display: inline-block; padding: 14px 22px; border: 1px solid transparent; border-radius: 999px; font-family: var(--mono); font-size: 13px; text-align: center; transition: background .2s, color .2s; }
.btn:hover { text-decoration: none; }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--lime); color: var(--ink); }
.btn--line { border-color: var(--ink); background: transparent; }
.btn--line:hover { background: var(--ink); color: var(--paper); }
.btn--lime { padding: 18px 28px; background: var(--lime); font-size: 14px; }
.btn--lime:hover { background: var(--paper); }
.btn--block { display: block; width: 100%; padding: 18px; font-size: 14px; }
.pixel-layer { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { padding: 5px 10px; border: 1px solid var(--rule); border-radius: 999px; background: #FFF; font-family: var(--mono); font-size: 12px; }

/* ---------- Servicios ---------- */
.jumps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; font-family: var(--mono); font-size: 13px; }
.jumps a { padding: 8px 14px; border: 1px solid var(--rule); border-radius: 999px; }
.jumps a:first-child { border-color: var(--ink); }
.jumps a:hover { border-color: var(--ink); text-decoration: none; }
.line { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 48px; align-items: start; margin-top: 96px; }
.line--first { margin-top: 72px; }
.line__intro { position: sticky; top: 110px; }
.line__intro p { margin-top: 12px; font-size: 16px; line-height: 1.55; color: var(--grey); }
.line__code { font-family: var(--mono); font-size: 28px; font-weight: 500; }
.line__pixel { font-family: var(--pixel); font-size: 30px; font-weight: 400; color: var(--av); }
.line__list { border-top: 1px solid var(--ink); }
.service { border-bottom: 1px solid var(--rule); }
.service__head { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 28px 0; list-style: none; cursor: pointer; }
.service__head::-webkit-details-marker { display: none; }
.service__head:hover { color: var(--ink-2); }
.service__n { font-family: var(--mono); font-size: 13px; color: var(--grey); }
.service__name { font-family: var(--display); font-variation-settings: 'wdth' 106; font-weight: 700; font-size: clamp(22px, 2.4vw, 32px); letter-spacing: -.02em; }
.service__plus { font-family: var(--mono); font-size: 18px; transition: transform .3s; }
.service[open] .service__plus { transform: rotate(45deg); }
.service__body { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 32px; padding: 0 0 36px 64px; animation: unfold .3s var(--ease); }
@keyframes unfold { from { opacity: 0; transform: translateY(-8px); } }
.service__body .label { margin-bottom: 10px; }
.service__body p { font-size: 16px; line-height: 1.6; }
.service__action { display: flex; align-items: flex-end; }
.combo { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 32px; margin-top: 96px; padding: clamp(32px, 5vw, 64px); border-radius: 4px; background: var(--ink); color: var(--paper); }
.combo__tag { margin-bottom: 16px; font-family: var(--mono); font-size: 13px; color: var(--lime); }
.combo__title { max-width: 700px; font-family: var(--display); font-variation-settings: 'wdth' 110; font-weight: 800; font-size: clamp(32px, 4vw, 56px); line-height: .98; letter-spacing: -.035em; }
.combo :focus-visible { outline-color: var(--lime); }

/* ---------- Proyectos ---------- */
.page__head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 32px; }
.filter { display: none; flex-wrap: wrap; gap: 4px; max-width: 100%; padding: 4px; border-radius: 24px; background: var(--soft); font-family: var(--mono); font-size: 13px; }
.js .filter { display: flex; }
.filter button { display: flex; gap: 8px; padding: 10px 16px; border: 0; border-radius: 999px; background: transparent; transition: background .25s, color .25s; }
.filter button span { color: var(--grey); }
.filter button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.filter button[aria-pressed="true"] span { color: var(--lime); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 20px; margin-top: 48px; }
.pcard-item { display: flex; min-width: 0; }
.pcard { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: #FFF; border: 1px solid var(--rule); border-radius: 4px; transition: transform .35s var(--ease), box-shadow .35s; }
.pcard:hover, .pcard:focus-visible { transform: translateY(-4px); box-shadow: 0 18px 40px -20px rgba(17,17,18,.35); text-decoration: none; }
.pcard__media { position: relative; height: 220px; background: repeating-linear-gradient(135deg, #ECEAE3 0 10px, #E4E2DA 10px 20px); }
.pcard__media img, .case__hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pcard__body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 22px; }
.type { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.type::before { content: ''; width: 8px; height: 8px; background: var(--sw); }
.type--audiovisual::before { background: var(--av); }
.pcard__name { font-family: var(--display); font-variation-settings: 'wdth' 104; font-weight: 700; font-size: 22px; letter-spacing: -.015em; line-height: 1.15; }
.pcard__desc { font-size: 15px; line-height: 1.5; color: var(--grey); text-wrap: pretty; }
.pcard__foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--faint); font-family: var(--mono); font-size: 12px; color: var(--grey); }
.pcard__foot span { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Plantilla de proyecto ---------- */
.back { font-family: var(--mono); font-size: 13px; color: var(--grey); }
.back:hover { color: var(--ink); text-decoration: none; }
.type--case { margin-top: 48px; font-size: 13px; color: var(--ink); }
.h1--case { max-width: 1000px; margin-top: 16px; font-size: clamp(40px, 5.6vw, 84px); }
.case__lead { max-width: 720px; margin-top: 24px; font-size: 20px; line-height: 1.5; color: var(--ink-2); }
.case__hero { position: relative; height: clamp(280px, 46vw, 620px); margin-top: 48px; overflow: hidden; border-radius: 4px; }
.case { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 64px; align-items: start; margin-top: 72px; }
.case__story { display: flex; flex-direction: column; gap: 56px; }
.case__label { margin-bottom: 14px; font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--grey); }
.case__story p { max-width: 680px; font-size: 20px; line-height: 1.6; text-wrap: pretty; }
.aside { position: sticky; top: 110px; display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.aside__block { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.aside__block .label { margin-bottom: 10px; }
.live { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: 24px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.live span:first-child { min-width: 0; }
.live:hover { background: var(--lime); color: var(--ink); text-decoration: none; }
.aside__pager { display: flex; justify-content: space-between; gap: 12px; padding: 20px 0; font-family: var(--mono); font-size: 13px; }

/* ---------- Nosotros y contacto ---------- */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: clamp(32px, 6vw, 96px); align-items: start; }
.about__lead { max-width: 560px; margin-top: 28px; font-size: 21px; line-height: 1.55; text-wrap: pretty; }
.about__text { max-width: 560px; margin-top: 20px; font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.rows { border-top: 1px solid var(--ink); }
.rows--about { margin-top: 48px; }
.rows--about > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.rows--about dt { font-family: var(--mono); font-size: 12px; color: var(--grey); }
.portrait { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 4px; background: #E4E2DA; }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 30% 55%; }
.portrait figcaption { position: absolute; left: 16px; bottom: 16px; z-index: 1; padding: 6px 10px; background: var(--paper); font-family: var(--mono); font-size: 12px; }
.tools { margin-top: 96px; }
.tools .case__label { margin-bottom: 24px; }
.tools__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.tool { padding: 28px; background: #FFF; border: 1px solid var(--rule); border-radius: 4px; }
.tool__code { margin-bottom: 20px; font-family: var(--mono); font-size: 20px; font-weight: 500; }
.tool__pixel { margin-bottom: 20px; font-family: var(--pixel); font-size: 20px; font-weight: 400; color: var(--av); }
.tool .tags { gap: 8px; }
.tool .tags li { padding: 7px 12px; font-size: 13px; transition: background .2s; }
.tags--code li:hover { background: var(--lime); border-color: var(--lime); }
.tags--pixel li:hover { background: #FFD9CF; border-color: #FFD9CF; }

.contact__lead { max-width: 460px; margin-top: 24px; font-size: 18px; line-height: 1.55; color: var(--ink-2); }
.rows--contact { margin-top: 40px; }
.rows--contact li > * { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; padding: 20px 0; border-bottom: 1px solid var(--rule); transition: padding .2s; }
.rows--contact a:hover { padding-left: 8px; text-decoration: none; }
.rows--contact span:first-child { font-family: var(--mono); font-size: 12px; color: var(--grey); }
.rows--contact span:last-child { font-size: 18px; overflow-wrap: anywhere; }
.panel { min-width: 0; padding: clamp(24px, 3vw, 40px); background: #FFF; border: 1px solid var(--rule); border-radius: 4px; }
html:not(.js) .form { display: none; }
.form { display: flex; flex-direction: column; gap: 28px; }
.field { display: flex; flex-direction: column; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field legend { margin-bottom: 10px; }
.field input[type="text"] { width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: transparent; font-size: 18px; }
.field textarea { width: 100%; padding: 14px; border: 1px solid var(--rule); border-radius: 4px; background: #FAFAF7; font-size: 16px; line-height: 1.5; resize: vertical; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--error); }
.field ::placeholder { color: #77777C; }
.needs { display: flex; flex-wrap: wrap; gap: 8px; }
.need { position: relative; cursor: pointer; }
.need input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.need span { display: block; padding: 12px 18px; border: 1px solid var(--rule); border-radius: 999px; background: #FFF; font-size: 15px; transition: background .2s, color .2s, border-color .2s; }
.need input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.need input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.form__error { font-family: var(--mono); font-size: 12px; color: var(--error); }
.form__note { font-size: 14px; line-height: 1.5; color: var(--grey); }
.form__actions { display: flex; flex-direction: column; gap: 10px; }
.done { display: flex; flex-direction: column; gap: 16px; padding: 40px 0; }
.done__mark { width: 48px; height: 48px; background: var(--lime); }
.done__title { font-family: var(--display); font-variation-settings: 'wdth' 106; font-weight: 800; font-size: 34px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.done p { font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.done__reset { align-self: flex-start; margin-top: 12px; padding: 0; border: 0; background: none; font-family: var(--mono); font-size: 13px; color: var(--grey); }
.done__reset:hover { color: var(--ink); }

/* ---------- Angosto ---------- */
@media (max-width: 800px) {
  .line { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 64px; }
  .line__intro, .aside { position: static; }
  .case { grid-template-columns: minmax(0, 1fr); gap: 48px; margin-top: 48px; }
}
@media (max-width: 720px) {
  .header__inner { padding: 14px 20px; gap: 12px; flex-wrap: nowrap; }
  .js .menu-toggle { display: flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--rule); border-radius: 50%; background: #FFF; font: 14px var(--mono); }
  .js .nav { display: none; position: absolute; top: calc(100% + 1px); left: 12px; right: 12px; flex-direction: column; padding: 12px; background: #FFF; border: 1px solid var(--rule); border-radius: 4px; box-shadow: 0 18px 40px -20px rgba(17,17,18,.35); }
  .js .nav.is-open { display: flex; }
  .js .nav a { padding: 12px 16px; }
  .js .nav .nav__cta { margin: 4px 0 0; text-align: center; }
  html:not(.js) .header__inner { flex-wrap: wrap; }
  .main { padding-bottom: 72px; }
  .page { padding-top: 48px; }
  .page--case { padding-top: 32px; }
  .h1 { font-size: clamp(34px, 11vw, 56px); }
  .service__head { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; padding: 22px 0; }
  .service__body { gap: 24px; padding: 0 0 28px 40px; }
  .combo { margin-top: 64px; }
  .about__lead, .case__story p, .case__lead { font-size: 18px; }
  .tools { margin-top: 64px; }
  .rows--about > div { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

/* ---------- Transición entre páginas (220 ms salida, 450 ms entrada desde 12 px) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(contenido) { animation: page-out .22s ease both; }
  ::view-transition-new(contenido) { animation: page-in .45s .22s cubic-bezier(.2,.7,.2,1) both; }
}
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Reducir movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  .cursor, .service__body { animation: none; }
  *, *::before, *::after { transition: none !important; }
  .pcard:hover, .pcard:focus-visible { transform: none; }
}

/* Vista previa del sitio en vivo en la página del proyecto */
.case__live { position: absolute; inset: 0; display: block; color: inherit; }
.case__live img { object-position: top center; transition: transform .6s cubic-bezier(.2,.7,.2,1), filter .4s; }
.case__badge { position: absolute; left: 20px; bottom: 20px; display: inline-flex; gap: 8px; align-items: center; padding: 10px 16px; border-radius: 999px; background: #0C0C0D; color: #F4F2EC; font: 500 14px/1 'JetBrains Mono', monospace; box-shadow: 0 6px 24px rgba(0,0,0,.25); transition: background .3s, color .3s, transform .3s; }
.case__live:hover img, .case__live:focus-visible img { transform: scale(1.025); filter: saturate(1.08); }
.case__live:hover .case__badge, .case__live:focus-visible .case__badge { background: #C8F53C; color: #0C0C0D; transform: translateY(-2px); }
.case__live:focus-visible { outline: 3px solid #C8F53C; outline-offset: 4px; }
.pcard__media img { object-position: top center; }
@media (prefers-reduced-motion: reduce) { .case__live img, .case__badge { transition: none; } .case__live:hover img { transform: none; } }

/* Documental embebido */
.case__hero--video { aspect-ratio: 16 / 9; height: auto; background: #0C0C0D; }
.yt { position: absolute; inset: 0; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; }
.yt img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1), filter .4s; }
.yt__play { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; display: grid; place-items: center; border-radius: 50%; background: #C8F53C; color: #0C0C0D; box-shadow: 0 10px 40px rgba(0,0,0,.45); transition: transform .3s; }
.yt:hover img, .yt:focus-visible img { transform: scale(1.02); filter: brightness(.85); }
.yt:hover .yt__play, .yt:focus-visible .yt__play { transform: scale(1.08); }
.yt:hover .case__badge, .yt:focus-visible .case__badge { background: #C8F53C; color: #0C0C0D; }
.yt:focus-visible { outline: 3px solid #C8F53C; outline-offset: 4px; }
.yt__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (prefers-reduced-motion: reduce) { .yt img, .yt__play { transition: none; } }
