/* ============================================================
   Hub — Giga Studio (giga109.es/hub)
   Pantalla dividida en 3 con estética editorial de estudio:
   sobria, tipográfica, acento con cuentagotas. Mobile-first.
   Sin build. Reutiliza ../styles/tokens.css.
   ============================================================ */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body, "Inter Tight", system-ui, sans-serif);
  color: #f3f2ec; /* off-white cálido */
  background: #0a0a0a;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
  overflow: hidden; /* una sola pantalla */
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* etiqueta tracking-uppercase reutilizable */
.mast__label,
.mast__btn,
.panel__tag,
.panel__cta {
  font-size: clamp(0.66rem, 2vw, 0.74rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ---------- Masthead ---------- */
.mast {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(0.95rem, 3vw, 1.5rem) clamp(1.1rem, 5vw, 3.2rem);
  border-bottom: 1px solid rgba(243, 242, 236, 0.14);
}

.mast__label {
  color: rgba(243, 242, 236, 0.7);
}

.mast__btn {
  color: #f3f2ec;
  border: 1px solid rgba(243, 242, 236, 0.28);
  border-radius: 999px;
  padding: 0.6em 1.15em;
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease;
}

@media (hover: hover) and (pointer: fine) {
  .mast__btn:hover {
    background: #f3f2ec;
    color: #0a0a0a;
    border-color: #f3f2ec;
  }
}

.mast__btn:focus-visible {
  outline: 2px solid var(--brand-lime, #b6ee69);
  outline-offset: 3px;
}

/* ---------- Pantalla dividida ---------- */
.hub {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.panel {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.8rem;
  padding: clamp(1.1rem, 3.2vh, 2rem) clamp(1.2rem, 5vw, 3.2rem);
  overflow: hidden;
  transition:
    flex-grow 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    padding-left 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: flex-grow;
}

.panel + .panel {
  border-top: 1px solid rgba(243, 242, 236, 0.14);
}

/* línea de acento que crece desde arriba al pasar */
.panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--acc);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1;
}

/* círculo muy difuminado del color de marca que sigue al cursor
   (la posición --mx/--my la mueve hub.js) */
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(
    circle 26vmax at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--acc) 55%, transparent) 0%,
    color-mix(in srgb, var(--acc) 22%, transparent) 24%,
    transparent 55%
  );
  filter: blur(40px);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* fila superior: índice + categoría */
.panel__top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.panel__square {
  width: 8px;
  height: 8px;
  flex: none;
  background: var(--acc);
  border-radius: 2px;
  transition: opacity 0.2s ease;
}

/* Con el cursor custom activo, al entrar en el panel su cuadrado-tag
   "se convierte" en el cursor: lo ocultamos mientras pasas por encima. */
html.is-cursor-on .panel:hover .panel__square {
  opacity: 0;
}

.panel__tag {
  color: rgba(243, 242, 236, 0.55);
  border: 1px solid rgba(243, 242, 236, 0.2);
  border-radius: 999px;
  padding: 0.34em 0.85em;
  transition:
    color 0.35s ease,
    border-color 0.35s ease;
}

/* bloque central: nombre + descripción */
.panel__main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.panel__name {
  margin: 0;
  line-height: 0;
}

/* logos: vienen en negro → los pasamos a off-white.
   --logo-scale iguala la ALTURA VISIBLE del texto (no la de la caja),
   compensando que cada logo tiene distinto cuerpo respecto a su lienzo. */
.panel__logo {
  --logo-scale: 1;
  display: block;
  height: calc(clamp(1.7rem, 6.5vw, 2.5rem) * var(--logo-scale));
  width: auto;
  max-width: 100%;
  filter: invert(1);
  opacity: 0.95;
}

.panel__logo--giga {
  --logo-scale: 1.2;
}
.panel__logo--menu {
  --logo-scale: 0.9;
}
.panel__logo--tab {
  --logo-scale: 1.07;
}

.panel__desc {
  font-size: clamp(0.92rem, 3vw, 1.05rem);
  color: rgba(243, 242, 236, 0.55);
  margin: 0;
}

/* CTA inferior */
.panel__cta {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  color: rgba(243, 242, 236, 0.7);
  transition: color 0.35s ease;
}

.panel__arrow {
  width: 1.5em;
  height: 1.5em;
  color: var(--acc);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* enlace que cubre todo el panel */
.panel__link {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.panel__link:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: -6px;
}

/* ---------- Hover (escritorio) ---------- */
@media (hover: hover) and (pointer: fine) {
  .panel:hover {
    flex-grow: 1.9;
    padding-left: clamp(1.6rem, 4vw, 4rem);
  }
  .panel:hover::before {
    transform: scaleY(1);
  }
  .panel:hover::after {
    opacity: 1;
  }
  .panel:hover .panel__cta {
    color: #f3f2ec;
  }
  .panel:hover .panel__tag {
    color: var(--acc);
    border-color: color-mix(in srgb, var(--acc) 55%, transparent);
  }
  .panel:hover .panel__arrow {
    transform: translateX(7px);
  }
}

/* ---------- Escritorio: tres columnas ---------- */
@media (min-width: 860px) {
  .hub {
    flex-direction: row;
  }
  .panel {
    justify-content: space-between;
  }
  .panel + .panel {
    border-top: 0;
    border-left: 1px solid rgba(243, 242, 236, 0.14);
  }
  .panel__name {
    font-size: clamp(2.2rem, 3.6vw, 3.4rem);
  }
  /* en columnas, la línea de acento crece desde la izquierda en horizontal */
  .panel::before {
    width: 100%;
    height: 2px;
    transform: scaleX(0);
    transform-origin: left;
  }
  @media (hover: hover) and (pointer: fine) {
    .panel:hover::before {
      transform: scaleX(1);
    }
  }
}

/* En apilado (móvil/tablet) ocultamos el rótulo central del masthead */
@media (max-width: 859px) {
  .mast__center {
    display: none;
  }
}

/* ---------- Cursor personalizado ----------
   Cuadrado de esquinas redondeadas que sigue al puntero. El color
   (--cursor-acc) lo fija hub.js según el panel sobre el que esté. */
.cursor {
  --dot-x: -100px;
  --dot-y: -100px;
  --cursor-acc: #f3f2ec;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  display: none;
}

/* Solo cuando hay puntero fino (lo activa hub.js): ocultamos el del sistema. */
html.is-cursor-on .cursor {
  display: block;
}

html.is-cursor-on,
html.is-cursor-on * {
  cursor: none !important;
}

.cursor__dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--cursor-acc);
  opacity: 0;
  pointer-events: none;
  will-change: transform;
  transform: translate3d(var(--dot-x), var(--dot-y), 0);
  transition:
    opacity 0.3s ease,
    background-color 0.35s ease;
}

.cursor.is-active .cursor__dot {
  opacity: 1;
}

/* ---------- Accesibilidad ---------- */
@media (prefers-reduced-motion: reduce) {
  .panel,
  .panel::before,
  .panel::after,
  .panel__name,
  .panel__arrow {
    transition: none !important;
  }
}
