/* EchavarriaStudio: black and white like the studio logo; each app brings its own accent. */
@font-face {
  font-family: 'Archivo Black';
  src: url('/assets/fonts/ArchivoBlack-Regular.ttf') format('truetype');
  font-display: swap;
}

:root {
  --negro: #050505;
  --tinta: #0d0e0f;
  --linea: #26282a;
  --gris: #8b9095;
  --suave: #c9cdd0;
  --blanco: #f2f2f0;
  --afinorte: #d1f487;
  --afinorte-tinta: #16230c;
  --titulo: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  --texto: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --margen: clamp(16px, 5vw, 64px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--negro);
  color: var(--blanco);
  font-family: var(--texto);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img, video { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }

.saltar { position: absolute; left: -999px; top: 8px; background: var(--blanco); color: var(--negro); padding: 8px 12px; z-index: 50; }
.saltar:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--blanco); outline-offset: 4px; }

/* ---------- Top bar ---------- */
.barra {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--margen);
  background: linear-gradient(var(--negro) 30%, transparent);
}
.barra-marca { font-family: var(--titulo); font-size: 14px; letter-spacing: -0.02em; text-decoration: none; }
.barra-nav { display: flex; gap: clamp(14px, 3vw, 32px); font-size: 14px; }
.barra-nav a, .barra-volver { text-decoration: none; color: var(--suave); }
.barra-nav a:hover, .barra-volver:hover { color: var(--blanco); }
@media (max-width: 640px) { .barra-nav a:not(:last-child) { display: none; } }

/* ---------- Hero ---------- */
.portada {
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(18px, 3vw, 28px);
  /* The text sits above the logo and the content rides high, leaving room below for the
     cable that hangs from the logo. */
  padding: 96px var(--margen) 38svh;
  position: relative;
  text-align: center;
}
.logo { position: relative; width: min(100%, 1100px); }
.logo svg { width: 100%; height: auto; display: block; color: var(--blanco); overflow: visible; }
/* Animate the whole logo: a CSS transform on the inner groups would replace their own
   transform attribute and throw the letters out of place. */
.logo svg { animation: aparece 1s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes aparece { from { opacity: 0; transform: translateY(24px); } }
/* As in the original logo: the cable is carved into the letters in black. */
.logo-cable { color: var(--negro); }
/* The line under STUDIO opens from the center, then the long cable drops from it. */
.logo-linea { transform-box: fill-box; transform-origin: center; animation: abre-linea .7s .6s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes abre-linea { from { transform: scaleX(0); } }

.portada-etiqueta { font-size: 13px; letter-spacing: .32em; color: var(--gris); animation: aparece 1s .9s both; }
.portada-texto { font-size: clamp(18px, 2.4vw, 22px); color: var(--suave); max-width: 28ch; margin-bottom: clamp(8px, 2vw, 20px); animation: aparece 1s 1s both; }

/* ---------- Long cable ---------- */
/* Behind the sections: the cable starts hidden inside STUDIO's "D" and comes out from
   under the logo; at the end the app's input covers the plug tip, as if plugged in. */
.cable-largo { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; z-index: 1; overflow: visible; }
section { scroll-margin-top: 64px; }
#cable-ruta { fill: none; stroke: var(--blanco); stroke-linecap: round; }
#cable-plug rect { fill: var(--blanco); }

/* ---------- Sections ---------- */
section { position: relative; z-index: 2; }
.seccion-titulo { font-family: var(--titulo); font-size: clamp(34px, 6vw, 64px); line-height: 1; letter-spacing: -0.04em; }

.apps { padding: clamp(120px, 18vw, 220px) var(--margen) clamp(80px, 10vw, 140px); display: grid; gap: 28px; justify-items: center; }
/* The cable drops down the page's center: the title keeps to the left half, wrapping to two
   lines when it has to, and shrinks on narrow phones so "Nuestras" still fits (≈4.6em). */
.apps .seccion-titulo {
  justify-self: start; width: min(100%, 1100px); margin: 0 auto 24px;
  padding-right: calc(min(100%, 1100px) / 2 + 14px);
  font-size: min(clamp(34px, 6vw, 64px), calc((50vw - var(--margen) - 14px) / 4.7));
}
.app {
  position: relative; width: min(100%, 680px);
  background: var(--tinta); border: 1px solid var(--linea); border-radius: 14px;
  padding: clamp(22px, 4vw, 36px); padding-top: clamp(40px, 6vw, 52px);
  transition: border-color .5s, box-shadow .5s;
}
.app-entrada { position: absolute; top: -9px; left: 50%; width: 30px; height: 18px; margin-left: -15px; background: var(--negro); border: 1px solid var(--linea); border-radius: 5px; display: grid; place-items: center; }
.app-entrada i { width: 10px; height: 10px; border-radius: 50%; background: #1a1c1d; border: 2px solid var(--linea); transition: border-color .4s, background .4s; }
.app-estado { position: absolute; top: 16px; right: 18px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--gris); display: flex; align-items: center; gap: 8px; }
.app-estado::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--linea); transition: background .4s, box-shadow .4s; }
.app-afinorte.conectada { border-color: color-mix(in srgb, var(--afinorte) 55%, var(--linea)); box-shadow: 0 0 60px -20px color-mix(in srgb, var(--afinorte) 40%, transparent); }
.app-afinorte.conectada .app-entrada i { border-color: var(--afinorte); background: var(--afinorte-tinta); }
.app-afinorte.conectada .app-estado { color: var(--afinorte); }
.app-afinorte.conectada .app-estado::before { background: var(--afinorte); box-shadow: 0 0 10px var(--afinorte); }
.app-cabeza { display: flex; align-items: center; gap: 18px; }
.app-icono { width: 72px; height: 72px; border-radius: 17px; box-shadow: 0 0 0 1px var(--linea); }
.app-nombre { font-family: var(--titulo); font-size: clamp(28px, 5vw, 40px); line-height: 1; letter-spacing: -0.05em; }
.app-nombre b { color: var(--afinorte); font-weight: inherit; }
.app-lema { color: var(--suave); margin-top: 6px; }
.app-lista { margin: 22px 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--suave); }
.app-lista li { padding-left: 22px; position: relative; }
.app-lista li::before { content: ''; position: absolute; left: 0; top: .72em; width: 10px; height: 2px; background: var(--afinorte); }
.app-tiendas { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.tienda { display: flex; flex-direction: column; padding: 10px 18px; border: 1px solid var(--linea); border-radius: 10px; text-decoration: none; font-weight: 600; line-height: 1.2; color: var(--blanco); }
.tienda small { font-weight: 400; font-size: 11px; color: var(--gris); }
.tienda[aria-disabled="true"] { cursor: default; }
.app-video { width: 100%; border-radius: 10px; border: 1px solid var(--linea); aspect-ratio: 16 / 9; background: #000; }
.app-pronto { display: grid; place-items: center; min-height: 160px; border-style: dashed; background: transparent; }
.app-pronto-texto { font-family: var(--titulo); font-size: 22px; letter-spacing: -0.03em; text-align: center; color: var(--gris); }
.app-pronto-texto span { font-family: var(--texto); font-size: 15px; letter-spacing: 0; }

/* ---------- Strings ---------- */
.cuerdas { padding: clamp(60px, 10vw, 120px) var(--margen); width: min(100%, 1228px); margin: 0 auto; }
.cuerdas-texto { color: var(--suave); margin: 16px 0 28px; max-width: 46ch; }
/* Strumming is a vertical gesture, so the instrument keeps touches to itself. */
.cuerdas-instrumento { position: relative; height: clamp(300px, 42vw, 420px); border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); touch-action: none; cursor: crosshair; user-select: none; }
#cuerdas-lienzo { position: absolute; inset: 0; width: 100%; height: 100%; }
.cuerdas-botones { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-around; }
.cuerda-boton {
  flex: 1; display: flex; align-items: center; padding: 0; border: 0; background: transparent; color: var(--gris);
  font: 600 12px var(--texto); letter-spacing: .14em; text-transform: uppercase; cursor: inherit;
}
.cuerda-boton span { background: var(--negro); padding: 4px 10px 4px 0; position: relative; z-index: 1; }
.cuerda-boton:focus-visible { outline-offset: -2px; }
.cuerdas-acciones { display: flex; align-items: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.cuerdas-aviso { font-size: 14px; color: var(--gris); }
.boton { display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border: 1px solid var(--blanco); border-radius: 999px; background: transparent; color: var(--blanco); font: 600 15px var(--texto); text-decoration: none; cursor: pointer; }
.boton:hover { background: var(--blanco); color: var(--negro); }

/* ---------- Studio and contact ---------- */
.estudio { padding: clamp(80px, 12vw, 160px) var(--margen); width: min(100%, 1228px); margin: 0 auto; }
.estudio-frase { font-family: var(--titulo); font-size: clamp(38px, 7.4vw, 92px); line-height: .98; letter-spacing: -0.05em; max-width: 14ch; }
.estudio-frase b { font-weight: inherit; color: var(--gris); }
.estudio-texto { margin-top: 28px; max-width: 52ch; color: var(--suave); font-size: clamp(17px, 2vw, 20px); }
.contacto { padding: clamp(60px, 10vw, 120px) var(--margen); width: min(100%, 1228px); margin: 0 auto; border-top: 1px solid var(--linea); }
.contacto-correo { display: inline-block; margin: 24px 0; font-family: var(--titulo); font-size: clamp(20px, 4.4vw, 46px); letter-spacing: -0.04em; text-decoration: none; overflow-wrap: anywhere; border-bottom: 3px solid var(--blanco); }
.contacto-redes { display: flex; gap: 12px; flex-wrap: wrap; }

.pie { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding: 28px var(--margen) 40px; border-top: 1px solid var(--linea); font-size: 14px; color: var(--gris); }
.pie nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.pie a { text-decoration: none; }
.pie a:hover { color: var(--blanco); }

/* ---------- Legal pages ---------- */
.pagina-legal .barra { position: sticky; background: var(--negro); border-bottom: 1px solid var(--linea); }
.legal { width: min(100%, 760px); margin: 0 auto; padding: 48px var(--margen) 80px; }
.legal h1 { font-family: var(--titulo); font-size: clamp(30px, 6vw, 46px); line-height: 1.05; letter-spacing: -0.04em; margin-bottom: 28px; }
.legal h2 { font-size: 20px; margin: 36px 0 10px; }
.legal p, .legal li { color: var(--suave); }
.legal p + p { margin-top: 12px; }
.legal strong { color: var(--blanco); }
.legal ul { padding-left: 22px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
