@import url('/fonts/archivo/archivo.css');
@import url('/fonts/geist-mono/geist-mono.css');

/* Portafolio Hilo — negro y crema que se alternan, un hilo rojo que cruza todo. Archivo (titulares) + Geist Mono (detalles). */
:root {
  --ink: #0b0a09;
  --paper: #efebe2;
  --acc: #f04a23;
  --on-dark: #efebe2;
  --on-dark-2: rgba(239, 235, 226, .72);
  --on-light: #141210;
  --on-light-2: rgba(20, 18, 16, .7);
  --line-d: rgba(239, 235, 226, .2);
  --line-l: rgba(20, 18, 16, .18);
  --card-d: #151412;
  --ease: cubic-bezier(.215, .61, .355, 1);
  --pad: clamp(18px, 3.2vw, 44px);
  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--on-dark); font-family: var(--display); font-size: 17px; line-height: 1.5; overflow-x: hidden; position: relative; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
figure { margin: 0; }
p, h1, h2, h3, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; line-height: 1.55; }
.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--pad); }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--acc); color: #fff; padding: 10px 14px; border-radius: 6px; font: 600 14px var(--mono); }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }

/* temas de sección */
.sd { background: var(--ink); color: var(--on-dark); }
.sl { background: var(--paper); color: var(--on-light); }
section { position: relative; }

/* ─── titulares ─── */
.big, .hero-title { font-family: var(--display); font-weight: 860; text-transform: uppercase; letter-spacing: -.045em; line-height: .88; font-stretch: 100%; }
.big .ln, .hero-title .hl { display: block; width: fit-content; max-width: 100%; }
.big .ln:nth-child(even) { margin-left: .32em; }
.big { font-size: clamp(40px, 7.4vw, 118px); }
.acc { color: var(--acc); }
.label { text-transform: uppercase; letter-spacing: .14em; color: var(--on-dark-2); font-size: 12px; }

/* ─── cabecera ─── */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; mix-blend-mode: difference; color: #efebe2; }
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1440px; margin: 0 auto; padding: 18px var(--pad); }
.logo { font: 900 22px/1 var(--display); letter-spacing: -.05em; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: clamp(18px, 3vw, 48px); }
.nl { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .14em; text-decoration: none; padding: 10px 0; position: relative; display: inline-flex; align-items: center; gap: 6px; }
.nl::after { content: ''; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease); }
.nl:hover::after { transform: scaleX(1); transform-origin: left; }
.nl-cta { border: 1px solid currentColor; border-radius: 999px; padding: 9px 16px; }
.nl-cta::after { display: none; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: none; color: inherit; cursor: pointer; position: relative; }
.nav-toggle i { position: absolute; left: 11px; right: 11px; height: 2px; background: currentColor; transition: transform .3s var(--ease); }
.nav-toggle i:first-of-type { top: 17px; } .nav-toggle i:last-of-type { top: 25px; }
.nav.open .nav-toggle i:first-of-type { transform: translateY(4px) rotate(45deg); }
.nav.open .nav-toggle i:last-of-type { transform: translateY(-4px) rotate(-45deg); }

/* ─── capa del hilo ─── */
.th-layer { position: absolute; left: 0; top: 0; width: 100%; height: 0; z-index: 2; pointer-events: none; overflow: visible; }
.th-layer svg { position: absolute; left: 0; top: 0; overflow: visible; }
.th-path { fill: none; stroke: var(--acc); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.th-head { fill: var(--acc); }
.th-ring { fill: none; stroke: var(--acc); stroke-width: 1.5; }
html.is-ed .th-layer, html.is-ed .rope-live { display: none; }

/* ─── portada ─── */
.hero { min-height: 100svh; display: flex; align-items: stretch; }
.hero-in { display: flex; flex-direction: column; justify-content: space-between; padding-top: clamp(110px, 16vh, 170px); padding-bottom: 28px; min-height: 100svh; }
.hero-title { font-size: clamp(50px, 11vw, 164px); line-height: .86; }
@media (min-width: 761px) { .hero-title .hl { white-space: nowrap; } }
.hero-title .hl:nth-child(2) { margin-left: .5em; }
.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: 48px; }
.hero-lead { max-width: 380px; color: var(--on-dark-2); }
.hint { display: inline-flex; align-items: center; gap: 10px; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; text-decoration: none; color: var(--on-dark-2); }
.hint-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); }

/* ─── proceso ─── */
.proc-in { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(30px, 5vw, 80px); padding-top: clamp(110px, 14vw, 200px); padding-bottom: clamp(110px, 14vw, 200px); align-items: center; }
.proc-head .lead { margin-top: 34px; max-width: 420px; color: var(--on-light-2); }
.proc-art { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 44px; padding-left: clamp(0px, 4vw, 60px); }
.lupa { display: grid; place-items: center; width: clamp(130px, 12vw, 180px); aspect-ratio: 1; margin-left: clamp(40px, 5vw, 70px); text-align: center; }
.lupa-t { max-width: 70%; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; color: var(--on-light-2); }
.steps { display: flex; flex-direction: column; gap: 54px; counter-reset: st; width: min(100%, 320px); }
.step { display: flex; align-items: center; gap: 22px; counter-increment: st; }
.step-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--acc); background: var(--paper); position: relative; z-index: 3; }
.step-t { display: block; text-transform: uppercase; letter-spacing: .14em; font-weight: 500; }
.step-t::before { content: counter(st, decimal-leading-zero) ' · '; color: var(--acc); }
.step-d { display: block; font-size: 15px; color: var(--on-light-2); }

/* ─── manifiesto ─── */
.mani { padding: clamp(120px, 16vw, 230px) 0 clamp(70px, 8vw, 120px); }
.big-mani { font-size: clamp(38px, 6.6vw, 108px); }
.big-mani .ln:nth-child(even) { margin-left: 0; }
.big-mani .acc { margin-top: .12em; padding-bottom: .22em; }

/* ─── servicios: columna central con el hilo ─── */
.serv { padding: clamp(40px, 5vw, 70px) 0 clamp(120px, 14vw, 200px); }
.serv .label { text-align: center; margin-bottom: 60px; }
.sv-groups { display: flex; flex-direction: column; gap: 90px; }
.sv-gt { text-align: center; text-transform: uppercase; letter-spacing: .16em; color: var(--acc); margin-bottom: 36px; font-weight: 500; }
.sv-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 64px; row-gap: 6px; max-width: 980px; margin: 0 auto; }
.sv { display: flex; align-items: center; gap: 18px; padding: 16px 0; position: relative; }
.sv:nth-child(odd) { grid-column: 1; flex-direction: row-reverse; text-align: right; }
.sv:nth-child(even) { grid-column: 2; transform: translateY(46px); }
.sv-dot { flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--ink); border: 2px solid var(--acc); position: relative; z-index: 3; }
.sv:nth-child(odd) .sv-dot { margin-right: -38px; }
.sv:nth-child(even) .sv-dot { margin-left: -38px; }
.sv-b { display: flex; flex-direction: column; gap: 4px; }
.sv-t { font-size: clamp(20px, 2vw, 28px); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.sv-d { font: 13px/1.5 var(--mono); color: var(--on-dark-2); }

/* ─── proyectos ─── */
.pj-list { counter-reset: pj; }
.pj { counter-increment: pj; position: relative; padding: clamp(80px, 9vw, 130px) 0 clamp(60px, 7vw, 100px); background: var(--paper); color: var(--on-light); }
.pj:nth-child(even) { background: var(--ink); color: var(--on-dark); }
.pj-top { display: flex; justify-content: space-between; gap: 30px; align-items: flex-start; }
.pj-idx { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; display: flex; gap: 8px; }
.pj-n::before { content: counter(pj, decimal-leading-zero) ' /'; }
.pj-desc { max-width: 360px; text-align: right; opacity: .78; }
.pj-stage { position: relative; margin-top: clamp(20px, 3vw, 40px); min-height: clamp(380px, 52vw, 760px); display: grid; place-items: center; }
.wm { position: absolute; left: 0; right: 0; top: 4%; text-align: center; font: 900 clamp(64px, 18vw, 300px)/.8 var(--display); letter-spacing: -.055em; text-transform: uppercase; white-space: nowrap; z-index: 1; }
.pj-fig { position: relative; z-index: 3; width: min(78%, 900px); margin-top: clamp(80px, 12vw, 200px); }
.pj-img { width: 100%; }
.cards { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.cd { position: absolute; pointer-events: auto; display: flex; flex-direction: column; gap: 6px; min-width: 180px; max-width: 250px; padding: 14px 16px; border-radius: 10px; background: var(--paper); color: var(--on-light); border: 1px solid var(--line-l); box-shadow: 0 10px 30px rgba(0, 0, 0, .12); transition: opacity .6s var(--ease), transform .6s var(--ease), filter .6s var(--ease); }
.pj:nth-child(odd) .cd-2 { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.pj:nth-child(even) .cd { background: var(--card-d); color: var(--on-dark); border-color: var(--line-d); }
.pj:nth-child(even) .cd-2 { background: var(--paper); color: var(--on-light); }
.cd-k { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; opacity: .7; }
.cd-v { font-size: 16px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.cd-3 .cd-v { color: var(--acc); font-size: 20px; }
.cd-1 { left: 2%; top: 30%; }
.cd-2 { right: 3%; top: 44%; }
.cd-3 { left: 12%; bottom: 4%; }
.pj:nth-child(even) .cd-1 { left: auto; right: 4%; top: 38%; }
.pj:nth-child(even) .cd-2 { right: auto; left: 3%; top: 52%; }
.pj:nth-child(even) .cd-3 { left: auto; right: 14%; }
.pj-link { display: flex; width: fit-content; margin: 34px 0 0 auto; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .14em; font-size: 12px; text-decoration: none; padding: 10px 0; border-bottom: 1px solid currentColor; }

/* ─── sobre mí ─── */
.about-in { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(30px, 6vw, 100px); align-items: center; padding-top: clamp(110px, 13vw, 190px); padding-bottom: clamp(110px, 13vw, 190px); }
.big-about { font-size: clamp(38px, 6vw, 96px); }
.about-p { margin-top: 34px; max-width: 520px; font-size: 18px; color: var(--on-light-2); }
.about-sign { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line-l); max-width: 520px; }
.sign { font-weight: 860; text-transform: uppercase; letter-spacing: -.02em; font-size: 20px; }
.role { color: var(--on-light-2); margin-top: 2px; }
.facts { display: flex; flex-wrap: wrap; gap: 14px 40px; margin-top: 30px; }
.fact { display: flex; flex-direction: column; }
.fact-v { font-weight: 860; font-size: 40px; letter-spacing: -.04em; line-height: 1; }
.fact-l { color: var(--on-light-2); }
.about-fig { justify-self: center; width: min(100%, 420px); position: relative; z-index: 1; }
.about-img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; filter: grayscale(1) contrast(1.05); }

/* ─── contacto ─── */
.contact { overflow: hidden; }
.ct-in { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; padding-top: clamp(120px, 14vw, 200px); padding-bottom: clamp(90px, 10vw, 140px); min-height: 100svh; align-items: center; }
.big-ct { font-size: clamp(38px, 6.8vw, 112px); }
.ct-txt .lead { margin-top: 30px; color: var(--on-dark-2); max-width: 420px; }
.ct-actions { margin-top: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 24px; border-radius: 999px; background: var(--acc); color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -.01em; transition: background .25s, transform .25s var(--ease); }
.btn:hover { background: #ff5a33; transform: translateY(-2px); }
.ct-mail { color: var(--on-dark-2); }
.mail-link { color: var(--on-dark); text-underline-offset: 4px; }
.rope { position: relative; align-self: stretch; min-height: 420px; }
.rope-top { position: absolute; left: 50%; top: 0; width: 2px; height: 2px; }
.rope-live { position: absolute; inset: 0; }
.rope-live svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rope-live .ring { pointer-events: auto; cursor: grab; touch-action: none; }
.rope-live .ring:active { cursor: grabbing; }
.rope-hint { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; text-transform: uppercase; letter-spacing: .16em; font-size: 11px; color: var(--on-dark-2); opacity: 0; transition: opacity .6s; }
.rope.is-on .rope-hint { opacity: 1; }

/* ─── pie ─── */
.foot { border-top: 1px solid var(--line-d); }
.foot-in { display: grid; grid-template-columns: 1fr auto; gap: 18px 30px; padding-top: 30px; padding-bottom: 30px; align-items: center; }
.socials { display: flex; flex-wrap: wrap; gap: 6px 26px; }
.socials a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; padding: 10px 0; }
.to-top { justify-self: end; display: inline-flex; gap: 8px; text-decoration: none; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; padding: 10px 0; }
.foot-copy, .foot-credit { color: var(--on-dark-2); font-size: 12px; }
.foot-credit { justify-self: end; }

/* ─── movimiento (solo fuera del editor) ─── */
/* La portada no espera al script: entra con CSS */
html:not(.is-ed) .hero-title .hl { animation: hl-in .9s var(--ease) both; animation-delay: calc(.08s + var(--i) * .1s); }
html:not(.is-ed) .hero-foot { animation: fade-in .9s var(--ease) .5s both; }
@keyframes hl-in { from { opacity: 0; filter: blur(10px); transform: translateY(.18em); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(12px); } }
html.fx:not(.still) .rv { transition: opacity .6s var(--ease), filter .6s var(--ease), transform .6s var(--ease); will-change: auto; transition-delay: calc(var(--i, 0) * .08s); }
html.fx:not(.still) .rv:not(.on) { opacity: 0; transform: translateY(22px); }
/* el desenfoque de entrada solo con mouse en pantallas grandes: en el celular cuesta mucho pintar texto grande desenfocado */
@media (hover: hover) and (min-width: 1024px) { html.fx:not(.still) .rv:not(.on) { filter: blur(6px); } }
html.fx:not(.still) .sv.rv:nth-child(even):not(.on) { transform: translateY(68px); }
html.th-measure .rv, html.th-measure [data-th-card] { transform: none !important; transition: none !important; }
html.th-on [data-th-card]:not(.on) { opacity: 0; transform: translateY(16px) scale(.94); }
@media (prefers-reduced-motion: reduce) {
  html:not(.is-ed) .hero-title .hl, html:not(.is-ed) .hero-foot { animation: none; }
  html { scroll-behavior: auto; }
}

/* ─── editor: todo quieto y en su lugar ─── */
html.is-ed .wm { white-space: normal; overflow-wrap: anywhere; position: relative; top: 0; }
html.is-ed .pj-fig { margin-top: 30px; }
html.is-ed .pj-stage { display: block; min-height: 0; }
html.is-ed .cards { position: static; display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
html.is-ed .cd { position: static; }
html.is-ed .pj-list, html.is-ed .sv-groups, html.is-ed .steps { display: flex; flex-direction: column; }

/* ─── tablet ─── */
@media (max-width: 1023px) {
  .cd { min-width: 150px; padding: 11px 13px; }
  .cd-v { font-size: 14px; }
  .cd-3 .cd-v { font-size: 17px; }
}

/* ─── celular ─── */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav { mix-blend-mode: normal; background: var(--ink); }
  .nav-toggle { display: block; }
  .nav-links { position: fixed; inset: 0; top: 0; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; padding: 80px 24px 40px; background: var(--ink); transform: translateY(-100%); visibility: hidden; transition: transform .45s var(--ease), visibility 0s .45s; z-index: -1; }
  .nav.open .nav-links { transform: none; visibility: visible; transition: transform .45s var(--ease); }
  .nl { font: 860 38px/1.05 var(--display); text-transform: uppercase; letter-spacing: -.04em; }
  .nl-cta { margin-top: 18px; font: 600 14px var(--mono); letter-spacing: .12em; padding: 14px 22px; }
  .hero-title { font-size: 14.6vw; }
  .hero-title .hl:nth-child(2) { margin-left: .3em; }
  .big { font-size: 12vw; }
  .hero-foot { flex-direction: column; align-items: flex-start; }
  .proc-in, .about-in, .ct-in { grid-template-columns: 1fr; }
  .proc-art { align-items: flex-start; padding-left: 8px; }
  .steps { gap: 40px; }
  .sv-list { grid-template-columns: 1fr; padding-left: 34px; }
  .sv:nth-child(odd), .sv:nth-child(even) { grid-column: 1; flex-direction: row; text-align: left; transform: none; }
  html.fx:not(.still) .sv.rv:nth-child(even):not(.on) { transform: translateY(22px); }
  .sv:nth-child(odd) .sv-dot, .sv:nth-child(even) .sv-dot { margin: 0 0 0 -34px; }
  .sv-gt, .serv .label { text-align: left; }
  .pj-top { flex-direction: column; gap: 14px; }
  .pj-desc { text-align: left; }
  .pj-stage { display: flex; flex-direction: column; min-height: 0; }
  .wm { position: relative; top: 0; }
  .pj-fig { width: 100%; margin-top: 18px; }
  .cards { position: static; display: flex; flex-direction: column; gap: 12px; margin-top: 18px; width: 100%; }
  .cd, .pj:nth-child(n) .cd-1, .pj:nth-child(n) .cd-2, .pj:nth-child(n) .cd-3 { position: relative; inset: auto; max-width: none; width: 100%; }
  .pj-link { margin-left: 0; }
  .about-fig { width: 100%; max-width: 360px; justify-self: start; }
  .rope { min-height: 340px; }
  .foot-in { grid-template-columns: 1fr; }
  .to-top, .foot-credit { justify-self: start; }
}
