/* SR Design · capa «estudio» (noviembre 2026): escena 3D de portada, servicios y movimiento.
   Va DESPUÉS de signature.css. Todo el movimiento usa solo transform/opacity, se pausa fuera de pantalla,
   se apaga con «reducir movimiento» y se simplifica en pantallas táctiles. Para quitarla basta sacar el <link> y el <script>. */

/* ---------- Portada ---------- */
.hero .wrap { grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); }
.hero h1 { font-size: clamp(52px, 6.4vw, 100px); }
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.hero h1 .w i { display: inline-block; font-style: normal; }
.js .hero h1 .w i { transform: translateY(115%); animation: sr-up .9s cubic-bezier(.2, .85, .2, 1) forwards; animation-delay: calc(var(--d, 0) * 80ms + 150ms); }
@keyframes sr-up { to { transform: none; } }
.js .hero .lead, .js .hero-ctas, .js .hero-meta, .js .hero .mono { opacity: 0; animation: sr-fade .9s ease forwards; }
.js .hero .mono { animation-delay: .05s; }
.js .hero .lead { animation-delay: .75s; }
.js .hero-ctas { animation-delay: .95s; }
.js .hero-meta { animation-delay: 1.1s; }
@keyframes sr-fade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.lab { position: relative; height: clamp(400px, 44vw, 580px); }
.lab-fit { position: absolute; left: 50%; top: 50%; width: 620px; height: 520px; margin: -260px 0 0 -310px; transform: scale(var(--s, 1)); perspective: 1700px; perspective-origin: 50% 38%; }
.lab-rig { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rx, 7deg)) rotateY(var(--ry, -18deg)); transition: transform .55s cubic-bezier(.2, .7, .2, 1); }
.lab-floor { position: absolute; left: -12%; right: -12%; bottom: 2%; height: 58%; transform: translateZ(-140px) rotateX(76deg); transform-origin: 50% 100%;
  background: linear-gradient(rgba(242, 194, 48, .28) 1px, transparent 1px) 0 0 / 52px 52px, linear-gradient(90deg, rgba(242, 194, 48, .28) 1px, transparent 1px) 0 0 / 52px 52px;
  -webkit-mask-image: radial-gradient(62% 80% at 50% 30%, #000, transparent 78%); mask-image: radial-gradient(62% 80% at 50% 30%, #000, transparent 78%); animation: sr-floor 5s linear infinite; }
@keyframes sr-floor { to { background-position: 0 52px, 52px 0; } }

.lab-scr { position: absolute; left: 0; top: 34px; width: 450px; height: 292px; border-radius: 14px; background: #0f1614; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--signal) 34%, var(--line)); box-shadow: 0 50px 90px -34px #000, 0 0 0 7px #0a0f0e, 0 0 0 8px var(--line), 0 0 70px -20px rgba(242, 194, 48, .35); }
.lab-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--line); font: 500 11px var(--f-m); color: #8fa39a; }
.lab-bar i { width: 8px; height: 8px; border-radius: 50%; background: #2c3935; }
.lab-bar span { margin-left: 8px; color: var(--fg); }
.lab-code { margin: 0; padding: 12px 0; font: 500 13.5px/1.62 var(--f-m); color: #d7e0db; white-space: pre-wrap; word-break: break-word; }
.lab-code .ln { display: block; padding: 0 14px; border-left: 3px solid transparent; min-height: 1.62em; transition: background .3s; }
.lab-code .ln.hl { background: rgba(242, 194, 48, .15); border-left-color: var(--signal); }
.lab-code .k { color: #ff8f6b; } .lab-code .s { color: #9fd98a; } .lab-code .n { color: #f2c230; } .lab-code .c { color: #6f857b; font-style: italic; } .lab-code .f { color: #7cc4ff; }
.lab-code .cur { display: inline-block; width: .6ch; height: 1.1em; background: var(--signal); vertical-align: -.15em; animation: sr-blink 1s steps(1) infinite; }
@keyframes sr-blink { 50% { opacity: 0; } }

.lab-ph { position: absolute; left: 414px; top: 104px; width: 200px; height: 396px; border-radius: 36px; background: #050707; padding: 8px; border: 2px solid #2d3935; transform: translateZ(120px);
  box-shadow: 0 50px 70px -30px #000, 0 0 0 5px #0e1413, 0 0 60px -18px rgba(242, 194, 48, .3); animation: sr-bob 6s ease-in-out infinite; }
.lab-ph::before { content: ""; position: absolute; left: 50%; top: 14px; width: 54px; height: 6px; margin-left: -27px; border-radius: 4px; background: #1b2422; z-index: 3; }
.lab-ph-s { height: 100%; border-radius: 28px; overflow: hidden; background: #f2f2ef; color: #101312; font: 500 11px/1.3 var(--f-b); display: flex; flex-direction: column; }
.lab-ph-h { background: #f2c230; padding: 30px 14px 14px; }
.lab-ph-h b { display: block; font: 900 18px/1.05 var(--f-d); text-transform: none; letter-spacing: -.03em; }
.lab-ph-h small { display: block; margin-top: 4px; font: 500 10px var(--f-b); opacity: .75; }
.lab-rows { padding: 8px 10px; display: grid; gap: 7px; flex: 1; align-content: start; }
.lab-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; background: #fff; border-radius: 10px; padding: 8px 8px 8px 10px; }
.lab-row b { font: 700 11.5px/1.2 var(--f-b); text-transform: none; letter-spacing: 0; display: block; }
.lab-row small { color: #59605d; font-size: 10px; }
.lab-row em { font: 700 10px var(--f-m); font-style: normal; min-width: 18px; text-align: center; color: #0d4f52; opacity: 0; transition: opacity .2s; }
.lab-row em.on { opacity: 1; }
.lab-add { all: unset; box-sizing: border-box; width: 26px; height: 26px; border-radius: 50%; background: #f2c230; color: #101312; display: grid; place-items: center; font: 800 16px/1 var(--f-b); cursor: pointer; transition: transform .15s; }
.lab-add:active, .lab-add.pr { transform: scale(.82); }
.lab-add:focus-visible { outline: 2px solid #0d4f52; outline-offset: 2px; }
.lab-foot { padding: 10px; display: grid; gap: 6px; }
.lab-tot { display: flex; justify-content: space-between; font: 700 12px var(--f-b); }
.lab-send { all: unset; box-sizing: border-box; text-align: center; background: #101312; color: #f2c230; border-radius: 10px; padding: 10px; font: 800 11px var(--f-b); cursor: pointer; }
.lab-send:focus-visible { outline: 2px solid #f2c230; outline-offset: 2px; }

.lab-chip { position: absolute; display: flex; align-items: center; gap: 9px; background: #121a18; border: 1px solid color-mix(in srgb, var(--signal) 30%, var(--line)); border-radius: 12px; padding: 10px 14px; font: 600 12.5px var(--f-b); color: #fff; box-shadow: 0 24px 40px -18px #000; white-space: nowrap; animation: sr-bob 5s ease-in-out infinite; }
.lab-chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #25d366; box-shadow: 0 0 0 4px rgba(37, 211, 102, .2); flex: none; }
.lab-c1 { left: 64px; top: 396px; transform: translateZ(190px); animation-delay: -1.5s; }
.lab-c2 { left: 360px; top: 40px; transform: translateZ(210px); animation-delay: -3s; opacity: 0; transition: opacity .4s; }
.lab-c2.on { opacity: 1; }
.lab-c2::before { background: var(--signal); box-shadow: 0 0 0 4px rgba(242, 194, 48, .22); }
@keyframes sr-bob { 50% { translate: 0 -9px; } }
.lab-paused *, .lab-paused { animation-play-state: paused !important; }
@keyframes sr-sway { 0%, 100% { transform: rotateX(7deg) rotateY(-24deg); } 50% { transform: rotateX(4deg) rotateY(-8deg); } }
.lab-sway .lab-rig { animation: sr-sway 11s ease-in-out infinite; transition: none; }
@supports (animation-timeline: view()) {
  .lab-fit { animation: sr-labscroll linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
  @keyframes sr-labscroll { to { transform: scale(var(--s, 1)) translateY(-70px); } }
}
@media (max-width: 860px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } .lab { height: 400px; } }

/* ---------- Servicios ---------- */
.svc-head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px 60px; align-items: end; }
.svc-head .lead { max-width: 46ch; }
@media (max-width: 860px) { .svc-head { grid-template-columns: minmax(0, 1fr); } }
.svc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 48px; }
.svc { position: relative; min-width: 0; }
.svc-in { height: 100%; position: relative; display: grid; gap: 12px; align-content: start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px 20px 20px;
  transform: perspective(900px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)); transform-style: preserve-3d; transition: transform .25s ease-out, border-color .25s, box-shadow .25s; overflow: hidden; }
.svc-in::before { content: attr(data-n); position: absolute; right: 14px; top: 8px; font: 900 62px/1 var(--f-d); color: color-mix(in srgb, var(--fg) 5%, transparent); pointer-events: none; }
.svc-in::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s; pointer-events: none; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(242, 194, 48, .14), transparent 70%); }
@media (hover: hover) and (pointer: fine) { .svc-in:hover { border-color: color-mix(in srgb, var(--signal) 65%, var(--line)); box-shadow: 0 30px 60px -34px rgba(242, 194, 48, .4); } .svc-in:hover::after { opacity: 1; } }
.svc-ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: var(--signal); background: color-mix(in srgb, var(--signal) 12%, #0b1110); border: 1px solid color-mix(in srgb, var(--signal) 38%, var(--line)); transform: translateZ(34px); }
.svc-ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.svc h3 { font: 800 25px/1 var(--f-d); text-transform: uppercase; letter-spacing: .01em; transform: translateZ(20px); }
.svc p { color: var(--muted); font-size: 15px; line-height: 1.5; }
.svc-b { justify-self: start; font: 600 10.5px var(--f-m); letter-spacing: .12em; text-transform: uppercase; padding: 4px 8px; border-radius: 3px; border: 1px solid color-mix(in srgb, var(--signal) 55%, var(--line)); color: var(--signal); }
.svc-b.wip { border-style: dashed; color: #c6d1cb; border-color: #6f857b; }
.svc-go { all: unset; box-sizing: border-box; cursor: pointer; justify-self: start; margin-top: 4px; min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border: 1.5px solid var(--signal); border-radius: 3px; font: 800 14px var(--f-d); letter-spacing: .08em; text-transform: uppercase; color: var(--signal); -webkit-tap-highlight-color: transparent; transition: background .2s, color .2s; position: relative; z-index: 2; }
.svc-go:hover, .svc-go:active { background: var(--signal); color: #14110a; }
.svc-in[data-open] { cursor: pointer; }
.svc-go:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
.svc-cta { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: center; justify-content: space-between; background: var(--signal); color: #14110a; border-radius: 12px; padding: clamp(22px, 3vw, 34px); }
.svc-cta h3 { font: 800 clamp(28px, 3.4vw, 44px)/1 var(--f-d); text-transform: uppercase; max-width: 22ch; }
.svc-cta p { margin-top: 8px; color: #3a3315; max-width: 56ch; }
.svc-cta .btn { background: #14110a; border-color: #14110a; color: var(--signal); }
@media (max-width: 1100px) { .svc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .svc-grid { grid-template-columns: minmax(0, 1fr); } .svc h3 { font-size: 27px; } }

/* ---------- Detalles de movimiento ---------- */
.glow { position: fixed; left: 0; top: 0; width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%; pointer-events: none; z-index: 0; opacity: 0; transition: opacity .4s;
  background: radial-gradient(circle, rgba(242, 194, 48, .09), transparent 65%); will-change: transform; }
.glow.on { opacity: 1; }
.h2 { background: linear-gradient(180deg, var(--fg) 55%, color-mix(in srgb, var(--fg) 72%, var(--bg))); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.crm .h2, .contacto .h2 { background: none; -webkit-text-fill-color: currentColor; }
.btn { will-change: transform; }

/* Pantallas táctiles: sin grano, sin aurora animada, suelo estático (menos trabajo para el teléfono) */
@media (pointer: coarse), (max-width: 700px) {
  body::before { display: none; }
  .hero::before { animation: none; filter: blur(24px); }
  .lab-floor { animation: none; }
  .svc-in::before { font-size: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .hero h1 .w i, .js .hero .lead, .js .hero-ctas, .js .hero-meta, .js .hero .mono { opacity: 1; transform: none; }
  .lab-fit { animation: none; }
}

/* Cartel de la demo «Panel de caja y cocina» */
.p-pan { background: #1b1a17; color: #f5b400; }
.p-pan .t { font: 800 clamp(22px, 2.3vw, 30px)/.98 "Bricolage Grotesque", sans-serif; letter-spacing: -.035em; margin-bottom: 12px; }
.p-pan .t em { font-style: normal; color: #fff; }
.p-pan .kb { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; flex: 1; min-height: 70px; }
.p-pan .kb i { display: block; background: #fff; border-radius: 6px; border-top: 6px solid var(--k, #c8321e); }
.p-pan .kb i:nth-child(2) { --k: #f5b400; height: 78%; } .p-pan .kb i:nth-child(3) { --k: #2e6b3a; height: 56%; } .p-pan .kb i:nth-child(4) { --k: #6b675e; height: 90%; }

/* ---------- Logo nuevo: chakana con SR + «SR Design» en Fraunces ---------- */
.brand { align-items: center; gap: 12px; }
.brand .bm { width: 44px; height: 44px; flex: none; display: block; }
.brand .word { padding-bottom: 0; }
.brand b { font: 700 26px/1 "Fraunces", Georgia, serif; letter-spacing: .005em; text-transform: none; }
.brand b .wsr { color: var(--signal); font-style: normal; }
.brand b em { font-style: italic; font-weight: 400; margin-left: .12em; }
.brand small { letter-spacing: .04em; margin-top: 4px; }
@media (max-width: 420px) { .brand small { display: none; } .brand b { font-size: 24px; } .brand .bm { width: 38px; height: 38px; } }

/* ---------- Entrada animada «Peldaños» (una vez por sesión; se salta con un toque o cualquier tecla) ---------- */
.intro { position: fixed; inset: 0; z-index: 200; background: #0b1110; display: grid; place-items: center; animation: in-out .5s ease 3s forwards; cursor: pointer; }
.intro::before { content: ""; position: absolute; inset: 0; background: radial-gradient(46% 52% at 50% 42%, rgba(242,194,48,.13), transparent 70%); }
.intro-in { position: relative; display: grid; justify-items: center; gap: 20px; padding: 24px; }
.im { width: clamp(120px, 24vw, 170px); height: auto; overflow: visible; display: block; }
.iw { font: 700 clamp(34px, 7vw, 52px)/1 "Fraunces", Georgia, serif; color: #f1efe8; white-space: nowrap; animation: in-rise .7s cubic-bezier(.2, .8, .2, 1) 1.8s both; }
.iw .wsr { color: #f2c230; font-style: normal; }
.iw em { font-style: italic; font-weight: 400; margin-left: .12em; }
.itag { font: 500 12px "Inter", sans-serif; letter-spacing: .24em; text-transform: uppercase; color: #a3b2ab; animation: in-fade .8s ease 2.4s both; }
.im .q0 { transform-origin: 50px 50px; animation: in-pop .45s cubic-bezier(.2, .9, .3, 1.2) .05s both; }
.im .q1 { --ty: 14px; animation: in-out-step .45s cubic-bezier(.2, .8, .2, 1) .35s both; }
.im .q2 { --ty: 12px; animation: in-out-step .45s cubic-bezier(.2, .8, .2, 1) .6s both; }
.im .d1, .im .d2 { stroke-dasharray: 1 1; }
.im .d1 { animation: in-draw .7s ease .95s both; }
.im .d2 { animation: in-draw .6s ease 1.45s both; }
@keyframes in-out { to { opacity: 0; visibility: hidden; } }
@keyframes in-rise { from { opacity: 0; transform: translateY(40%); } to { opacity: 1; transform: none; } }
@keyframes in-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes in-pop { 0% { transform: scale(.2); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes in-out-step { from { transform: translateY(var(--ty)); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes in-draw { 0% { stroke-dashoffset: 1; opacity: 0; } 2% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .intro { display: none; } }
/* Cuando hay entrada, la portada espera a que termine */
.con-intro .js .hero h1 .w i, .js.con-intro .hero h1 .w i { animation-delay: calc(3.1s + var(--d, 0) * 80ms); }
.js.con-intro .hero .mono { animation-delay: 3.05s; }
.js.con-intro .hero .lead { animation-delay: 3.7s; }
.js.con-intro .hero-ctas { animation-delay: 3.9s; }
.js.con-intro .hero-meta { animation-delay: 4.05s; }
