@font-face { font-family: 'Geist'; src: url(/fonts/geist-latin.woff2) format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(/fonts/geist-mono-latin.woff2) format('woff2'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: 'Doto'; src: url(/fonts/doto-latin.woff2) format('woff2'); font-weight: 400 900; font-display: swap; }

:root {
  --bg: #0b0f15;
  --bg-2: #111720;
  --bg-3: #161d28;
  --line: #1f2733;
  --text: #edf0f4;
  --soft: #b4bcc8;
  --muted: #6f7a8a;
  --green: #00f16e;
  --green-d: #00b552;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --dots: 'Doto', var(--mono);
  --pad: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
canvas { image-rendering: pixelated; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.035em; line-height: 1.02; }
p { margin: 0; }
::selection { background: var(--green); color: var(--bg); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

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

/* Botón píldora con efecto imán */
.pill {
  display: inline-flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
  padding: 11px 20px; border-radius: 99px; background: var(--green); color: var(--bg);
  font-weight: 600; font-size: 15px; text-decoration: none; border: 0; cursor: pointer;
  transition: transform .25s var(--ease);
}
.pill span { position: relative; z-index: 1; }
.pill::before {
  content: ''; position: absolute; inset: 0; background: var(--text); border-radius: inherit;
  transform: translateY(101%); transition: transform .35s var(--ease);
}
.pill:hover::before { transform: none; }
.pill.ghost { background: transparent; color: var(--bg); box-shadow: inset 0 0 0 1.5px var(--bg); }
.pill.ghost::before { background: var(--bg); }
.pill.ghost:hover { color: var(--green); }

/* Cabecera */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  transition: background .3s, border-color .3s, transform .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.top.solid { background: rgba(11, 15, 21, .82); backdrop-filter: saturate(1.4) blur(14px); border-bottom-color: var(--line); }
.top.hide { transform: translateY(-100%); }
.top-in { display: flex; align-items: center; gap: 36px; height: 68px; }
.brand img { height: 36px; width: auto; }
.menu { display: flex; gap: 30px; margin-left: auto; }
.menu a { font-size: 15px; text-decoration: none; color: var(--soft); position: relative; transition: color .2s; }
.menu a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: var(--green); transform: scaleX(0); transform-origin: right; transition: transform .3s var(--ease); }
.menu a:hover { color: var(--text); }
.menu a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Portada */
.hero { padding-top: 92px; position: relative; --fh: clamp(240px, min(40vw, 46vh), 470px); }
.field { width: 100%; height: var(--fh); cursor: crosshair; touch-action: pan-y; }
.field-hint {
  position: absolute; right: var(--pad); top: calc(92px + var(--fh) - 26px);
  font: 12px var(--mono); color: var(--muted); letter-spacing: .04em; transition: opacity .6s;
}
.field-hint::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 8px; vertical-align: 1px; animation: blink 1.4s steps(2) infinite; }
.field-hint.gone { opacity: 0; }
@keyframes blink { 50% { opacity: .2; } }
.hero-row {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: end;
  padding-top: clamp(24px, 3.5vh, 44px); padding-bottom: clamp(56px, 8vw, 104px);
}
h1 { font-size: clamp(48px, min(6.6vw, 11vh), 100px); letter-spacing: -0.05em; }
.scramble .g { color: var(--green); }
.rot-line { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -0.02em; margin-bottom: 18px; color: var(--text); }
.rot { font-family: var(--dots); font-weight: 900; font-size: 1.12em; color: var(--green); letter-spacing: 0; white-space: nowrap; }
.hero-side p:last-child { color: var(--soft); max-width: 46ch; }

/* Cinta de servicios */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 18px 0; }
.marquee-track { display: flex; align-items: center; gap: 0; width: max-content; will-change: transform; }
.marquee-track span { font: 800 clamp(40px, 5.6vw, 80px)/1 var(--dots); color: var(--text); padding: 0 .35em; white-space: nowrap; }
.marquee-track span:nth-of-type(even) { color: var(--green); }
.marquee-track i { width: clamp(10px, 1.2vw, 16px); height: clamp(10px, 1.2vw, 16px); border-radius: 50%; background: var(--muted); flex: none; }

/* Encabezados de sección */
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: clamp(36px, 5vw, 64px); }
.sec-head h2 { font-size: clamp(40px, 4.6vw, 66px); }
.sec-head h2 sup { font: 700 .3em var(--dots); color: var(--green); vertical-align: top; margin-left: 6px; letter-spacing: 0; }
.sec-head p { color: var(--soft); max-width: 34ch; text-align: right; }

/* Proyectos: tarjetas que se apilan al hacer scroll */
.work { padding-top: clamp(80px, 10vw, 140px); }
.stack { padding-bottom: clamp(60px, 8vw, 120px); }
.case {
  position: sticky; top: 96px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: clamp(24px, 4vw, 56px); align-items: center;
  margin-bottom: 48px;
  padding: clamp(24px, 3.2vw, 44px); border-radius: 22px;
  background: var(--bg-2); border: 1px solid var(--line);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .45);
  transform-origin: 50% 0; transform: scale(var(--s, 1)); filter: brightness(var(--b, 1));
  overflow: hidden;
}
.case::after {
  content: ''; position: absolute; width: 60%; aspect-ratio: 1; right: -15%; bottom: -40%; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent); pointer-events: none;
}
.case-info { position: relative; z-index: 1; }
.case-n { font: 800 clamp(44px, 4.6vw, 68px)/1 var(--dots); color: var(--accent); margin-bottom: 18px; }
.case h3 { font-size: clamp(28px, 3vw, 42px); margin-bottom: 16px; }
.case-lead { color: var(--soft); margin-bottom: 24px; max-width: 46ch; }
.chips { list-style: none; padding: 0; margin: 0 0 30px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font: 12.5px var(--mono); padding: 5px 11px; border-radius: 99px; border: 1px solid #2c3543; color: var(--soft); }
.gos { display: flex; flex-wrap: wrap; gap: 14px 28px; }
.go { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; text-decoration: none; font-weight: 500; }
.go span { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--bg); transition: transform .3s var(--ease); }
.go:hover span { transform: rotate(45deg) scale(1.1); }
.case-shot { position: relative; z-index: 1; display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); transform: perspective(1000px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)); transition: transform .2s ease-out; box-shadow: 0 30px 60px rgba(0, 0, 0, .4); }
.case-shot img { width: 100%; height: auto; max-height: calc(100vh - 230px); object-fit: cover; object-position: top; }

/* Servicios: filas que se rellenan de verde */
.services { padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(80px, 10vw, 140px); }
.svc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.svc li {
  position: relative; display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1.1fr) 48px; align-items: center; gap: 24px;
  padding: 30px 12px; border-bottom: 1px solid var(--line); overflow: hidden; cursor: default; isolation: isolate;
  transition: color .35s var(--ease), opacity .8s var(--ease), transform .8s var(--ease);
}
.svc li::before { content: ''; position: absolute; inset: 0; background: var(--green); transform: scaleY(0); transform-origin: bottom; transition: transform .45s var(--ease); z-index: -1; }
.svc li:hover { color: var(--bg); }
.svc li:hover::before { transform: scaleY(1); }
.svc-n { font: 800 26px var(--dots); color: var(--green); transition: color .35s; }
.svc h3 { font-size: clamp(24px, 2.6vw, 36px); letter-spacing: -0.03em; }
.svc p { color: var(--soft); transition: color .35s; }
.svc-arrow { font-size: 26px; justify-self: end; transition: transform .45s var(--ease); }
.svc li:hover .svc-n, .svc li:hover p { color: var(--bg); }
.svc li:hover .svc-arrow { transform: translateX(6px) rotate(-45deg); }

/* Proceso con línea que se llena al bajar */
.process { padding-bottom: clamp(80px, 10vw, 140px); }
.steps { position: relative; }
.steps-line { height: 2px; background: var(--line); margin-bottom: 30px; position: relative; }
.steps-line i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%); background: var(--green); box-shadow: 0 0 14px var(--green); }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; counter-reset: st; }
.steps li { counter-increment: st; opacity: .35; transition: opacity .5s; }
.steps li.on { opacity: 1; }
.steps li::before { content: counter(st, decimal-leading-zero); display: block; font: 800 40px/1 var(--dots); color: var(--green); margin-bottom: 14px; }
.steps b { display: block; font-size: 21px; font-weight: 500; margin-bottom: 8px; }
.steps p { color: var(--soft); font-size: 15.5px; }

/* Quiénes somos */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(32px, 6vw, 96px); align-items: center; padding-bottom: clamp(80px, 10vw, 140px); }
.byte-stage {
  position: relative; border: 1px solid var(--line); border-radius: 22px; padding: 80px 20px 50px; cursor: pointer;
  background: radial-gradient(circle at 50% 70%, #16261d, var(--bg-2) 70%);
  display: flex; justify-content: center; -webkit-tap-highlight-color: transparent;
}
.byte-stage canvas { transition: transform .2s; }
.byte-stage:active canvas { transform: scale(.96); }
.studio-text h2 { font-size: clamp(40px, 4.4vw, 62px); margin-bottom: 26px; }
.studio-text p { color: var(--soft); margin-bottom: 16px; max-width: 56ch; font-size: 18px; }
.studio-text .strong { color: var(--text); }

/* Bocadillo */
.bubble {
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%) scale(.6); opacity: 0; transform-origin: 50% 100%;
  background: var(--text); color: var(--bg); font: 600 14px var(--sans); white-space: nowrap;
  padding: 8px 13px; border-radius: 10px; pointer-events: none;
  transition: transform .2s cubic-bezier(.3, 1.6, .6, 1), opacity .15s;
}
.bubble::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--text); }
.talking > .bubble { transform: translateX(-50%) scale(1); opacity: 1; }
.byte-stage .bubble { bottom: auto; top: 22px; font-size: 15px; }
.byte-stage .bubble::after { display: none; }

/* Contacto en bloque verde */
.contact { background: var(--green); color: var(--bg); padding: clamp(80px, 11vw, 160px) 0; }
.eyebrow { font-size: clamp(22px, 2.6vw, 34px); font-weight: 500; letter-spacing: -0.02em; margin-bottom: 18px; }
.mail {
  display: block; font-size: clamp(38px, 10vw, 160px); font-weight: 600; letter-spacing: -0.055em; line-height: 1;
  text-decoration: none; color: var(--bg); overflow-wrap: anywhere; margin-bottom: clamp(36px, 5vw, 64px);
}
.mail .ch { display: inline-block; transition: transform .35s var(--ease); }
.contact-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding-top: 28px; border-top: 1.5px solid rgba(11, 15, 21, .25); }
.contact-row p { max-width: 50ch; font-size: 18px; }

.contact-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.pill.dark { background: var(--bg); color: var(--green); }
.pill.dark::before { background: var(--text); }
.pill.dark:hover { color: var(--bg); }

/* Pie */
.foot { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; padding-top: 28px; padding-bottom: 120px; font-size: 14px; color: var(--muted); }
.foot img { height: 28px; width: auto; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--text); }

/* Byte paseando */
.walker {
  position: fixed; left: 0; bottom: 10px; z-index: 30;
  background: none; border: 0; padding: 0; cursor: pointer;
  will-change: transform; -webkit-tap-highlight-color: transparent;
}

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translate(-50%, 20px); opacity: 0;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 600; font-size: 15px;
  transition: opacity .25s, transform .25s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* En ordenador el contacto es una tarjeta oscura, con el verde sólo de acento */
@media (min-width: 901px) {
  .contact { background: none; color: var(--text); padding: clamp(40px, 6vw, 96px) 0 clamp(64px, 8vw, 120px); }
  .contact > .wrap {
    position: relative; overflow: hidden; border-radius: 22px; background: var(--bg-2); border: 1px solid var(--line);
    width: calc(100% - 2 * var(--pad)); max-width: calc(1320px - 2 * var(--pad));
    padding: clamp(48px, 5vw, 72px) clamp(28px, 3.2vw, 44px) clamp(40px, 4vw, 56px);
  }
  .contact > .wrap::after {
    content: ''; position: absolute; width: 50%; aspect-ratio: 1; right: -12%; bottom: -55%; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0, 241, 110, .14), transparent); pointer-events: none;
  }
  .eyebrow { font-size: clamp(20px, 2vw, 26px); color: var(--soft); }
  .mail { font-size: clamp(40px, 5.6vw, 84px); color: var(--green); margin-bottom: clamp(28px, 3.5vw, 44px); }
  .contact-row { border-top-color: var(--line); position: relative; z-index: 1; }
  .contact-row p { color: var(--soft); font-size: 17px; }
  .pill.ghost { color: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }
  .pill.ghost::before { background: var(--green); }
  .pill.ghost:hover { color: var(--bg); }
  .pill.dark { background: var(--green); color: var(--bg); }
}

@media (max-width: 900px) {
  .menu { display: none; }
  .pill { margin-left: auto; }
  .hero-row, .case, .studio { grid-template-columns: 1fr; }
  .hero-row { gap: 20px; }
  .sec-head { flex-direction: column; align-items: start; }
  .sec-head p { text-align: left; }
  .case { top: 80px; min-height: 0; gap: 22px; }
  .case-shot { order: -1; }
  .case-n { font-size: 44px; margin-bottom: 8px; }
  .chips { margin-bottom: 20px; }
  .svc li { grid-template-columns: 44px minmax(0, 1fr) 30px; row-gap: 6px; padding: 24px 6px; }
  .svc p { grid-column: 2 / 3; grid-row: 2; }
  .svc-arrow { grid-column: 3; grid-row: 1; }
  .steps-line { display: none; }
  .steps ol { grid-template-columns: 1fr 1fr; row-gap: 32px; }
  .steps li { opacity: 1; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .steps ol { grid-template-columns: 1fr; }
  .contact-row p { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .case { position: relative; top: 0; }
}
