/* ============================================================
   GNG New Tech · portada
   Paleta e iconos tomados de gngnewtech.com (sitio actual):
   azul #0084ff, naranja #ff9900, fondo #111.
   ============================================================ */

:root {
  --ink-900: #111111;
  --ink-800: #0b0b0b;
  --paper: #ffffff;
  --solar: #0084ff;
  --build: #ff9900;
  --text-inv: #ffffff;
  --text-soft: #dddddd;

  --font-display: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --edge: clamp(1.25rem, 4vw, 3.25rem);
  --topbar-h: 72px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 140ms;
  --base: 240ms;
  --slow: 420ms;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  background: var(--ink-900);
  color: var(--text-inv);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
picture { display: contents; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: 0; left: 50%; z-index: 300;
  transform: translate(-50%, -120%);
  padding: 0.7rem 1.2rem;
  background: #fff; color: #111;
  border-radius: 0 0 12px 12px; font-weight: 600;
  transition: transform var(--base) var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

:where(a, button):focus-visible {
  outline: 2px solid var(--solar);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ══════════ 1 · Intro ══════════ */

.intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 700ms var(--ease), visibility 700ms;
}
.intro.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.intro__bg {
  position: absolute;
  inset: -8%;
  background-image: url('assets/poster.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(46px) brightness(0.35) saturate(1.2);
  transform: scale(1.08);
  pointer-events: none;
}

.intro__video {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;   /* el vídeo se ve entero, nunca recortado */
}

.intro__hint {
  position: absolute;
  left: 50%;
  bottom: clamp(2rem, 6vh, 3.5rem);
  margin: 0;
  transform: translateX(-50%);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  animation: hintfade 5s var(--ease) forwards;
  pointer-events: none;
}
@keyframes hintfade {
  0%, 55% { opacity: 1; }
  100% { opacity: 0; }
}

.intro__progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.14);
}
.intro__progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--solar);
  transition: width 260ms linear;
}

/* ══════════ 2 · Portada ══════════ */

.gate {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-inline: var(--edge);
  background: var(--ink-900);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand { display: inline-flex; align-items: center; }
.brand img { height: 46px; width: auto; }

.topbar__loc {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.topbar__phone {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #fff;
}
.topbar__phone svg { opacity: 0.7; }
.topbar__phone:hover { color: var(--solar); }
.topbar__phone:hover svg { opacity: 1; }

/* --- los dos bloques --- */

.split {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
  background: var(--ink-900);
}

.split::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.18);
  transform: translateX(-0.5px);
  pointer-events: none;
  z-index: 3;
}

.panel {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
  min-height: 0;
}

.panel__media { position: absolute; inset: 0; z-index: -2; }
.panel__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1400ms var(--ease);
}
.panel__media img.is-live { opacity: 1; }

.panel:hover .panel__media img.is-live,
.panel:focus-visible .panel__media img.is-live { animation: kenburns 18s ease-out forwards; }

@keyframes kenburns {
  from { transform: scale(1.005); }
  to   { transform: scale(1.062); }
}

/* el degradado es el del sitio actual: negro 0.8 / 0.5 / 0.8 */
.panel__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.34) 52%, rgba(0, 0, 0, 0.88));
  transition: opacity var(--slow) var(--ease);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  background: radial-gradient(120% 90% at 50% 110%, rgba(0, 132, 255, 0.22), transparent 62%);
  transition: opacity var(--slow) var(--ease);
  pointer-events: none;
}
.panel--build::after { background: radial-gradient(120% 90% at 50% 110%, rgba(255, 153, 0, 0.2), transparent 62%); }
@media (hover: hover) and (pointer: fine) {
  .panel:hover::after { opacity: 1; }
}

.panel__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  padding: clamp(1.5rem, 4vw, 3rem) var(--edge) clamp(2.5rem, 6vw, 4rem);
}

/* icono original del sitio: círculo de 80px con borde del color de la división */
.panel__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin-bottom: 0.5rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  color: var(--solar);
  transition: background var(--slow) var(--ease), transform var(--slow) var(--ease);
}
.panel--build .panel__icon { color: var(--build); }
.panel__icon svg { width: 40px; height: 40px; }

.panel:hover .panel__icon { transform: translateY(-5px); }
.panel:not(.panel--build):hover .panel__icon { background: rgba(0, 132, 255, 0.2); }
.panel--build:hover .panel__icon { background: rgba(255, 153, 0, 0.2); }

.sun-rays { transform-origin: 12px 12px; animation: sunspin 26s linear infinite; }
@keyframes sunspin { to { transform: rotate(360deg); } }

.panel__kicker {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.panel__title {
  margin: 0;
  max-width: 12ch;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.4vw, 3.75rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.panel__copy {
  max-width: 34ch;
  font-size: clamp(0.9375rem, 0.35vw + 0.85rem, 1.0625rem);
  color: var(--text-soft);
}

/* botón como en el sitio actual: relleno, esquina 4px, mayúsculas */
.panel__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.9rem;
  padding: 0.8rem 2.2rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #fff;
  background: var(--solar);
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 132, 255, 0.3);
  transition: transform var(--base) var(--ease), box-shadow var(--base) var(--ease), background var(--base) var(--ease);
}
.panel--build .panel__cta {
  color: #111;
  background: var(--build);
  box-shadow: 0 4px 15px rgba(255, 153, 0, 0.3);
}
.panel:hover .panel__cta { transform: scale(1.04); }
.panel:not(.panel--build):hover .panel__cta { box-shadow: 0 6px 20px rgba(0, 132, 255, 0.6); }
.panel--build:hover .panel__cta { box-shadow: 0 6px 20px rgba(255, 153, 0, 0.6); }

/* ══════════ botón de llamada, flotante ══════════ */

.callbtn {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  transform: translateX(-50%);
  color: #fff;
  background: var(--solar);
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(0, 132, 255, 0.45), 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform var(--base) var(--ease), box-shadow var(--base) var(--ease);
}
.callbtn:hover { transform: translateX(-50%) scale(1.06); }
.callbtn:active { transform: translateX(-50%) scale(0.97); }

.callbtn__ring {
  position: absolute;
  inset: -7px;
  border-radius: 999px;
  border: 1.5px solid rgba(0, 132, 255, 0.6);
  animation: pulsering 3.4s var(--ease) infinite;
  pointer-events: none;
}
@keyframes pulsering {
  0%   { transform: scale(0.95); opacity: 0.75; }
  70%  { transform: scale(1.22); opacity: 0; }
  100% { transform: scale(1.22); opacity: 0; }
}

/* ══════════ entrada escalonada ══════════ */

html.js-pre .panel__body > *,
html.js-pre .topbar > * { opacity: 0; transform: translateY(14px); }

html.js-ready .panel__body > *,
html.js-ready .topbar > * {
  opacity: 1;
  transform: none;
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
}

html.js-ready .panel:first-child .panel__body > *:nth-child(1) { transition-delay: 60ms; }
html.js-ready .panel:first-child .panel__body > *:nth-child(2) { transition-delay: 140ms; }
html.js-ready .panel:first-child .panel__body > *:nth-child(3) { transition-delay: 220ms; }
html.js-ready .panel:first-child .panel__body > *:nth-child(4) { transition-delay: 300ms; }
html.js-ready .panel:first-child .panel__body > *:nth-child(5) { transition-delay: 380ms; }

html.js-ready .panel--build .panel__body > *:nth-child(1) { transition-delay: 120ms; }
html.js-ready .panel--build .panel__body > *:nth-child(2) { transition-delay: 200ms; }
html.js-ready .panel--build .panel__body > *:nth-child(3) { transition-delay: 280ms; }
html.js-ready .panel--build .panel__body > *:nth-child(4) { transition-delay: 360ms; }
html.js-ready .panel--build .panel__body > *:nth-child(5) { transition-delay: 440ms; }

html.js-ready .callbtn { animation: callin 620ms var(--ease) 520ms both; }
@keyframes callin {
  from { opacity: 0; transform: translateX(-50%) scale(0.86); }
  to   { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* ══════════ responsive ══════════ */

@media (max-width: 900px) {
  :root { --topbar-h: 62px; }

  .topbar__loc { display: none; }
  .brand img { height: 34px; }
  .topbar__phone span { display: none; }
  .topbar__phone { padding: 0 0.4rem; }

  .split { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .split::after {
    top: 50%; bottom: auto; left: 0; right: 0;
    width: auto; height: 1px;
    transform: translateY(-0.5px);
  }

  .panel__body { padding: 1.1rem var(--edge) 3.6rem; gap: 0.45rem; }
  .panel__icon { width: 56px; height: 56px; }
  .panel__icon svg { width: 28px; height: 28px; }
  .panel__title { font-size: clamp(1.6rem, 7vw, 2.35rem); }
  .panel__copy { font-size: 0.875rem; max-width: 42ch; }
  .panel__cta { padding: 0.65rem 1.5rem; font-size: 0.75rem; }
  /* en móvil el botón baja a la esquina para no tapar los CTA de los bloques */
  .callbtn {
    left: auto;
    right: 14px;
    bottom: 14px;
    width: 58px;
    height: 58px;
    transform: none;
  }
  .callbtn:hover { transform: scale(1.05); }
  .callbtn:active { transform: scale(0.97); }
  .callbtn svg { width: 21px; height: 21px; }
}

@media (max-width: 900px) and (max-height: 720px) {
  .panel__icon { width: 46px; height: 46px; }
  .panel__icon svg { width: 24px; height: 24px; }
  .panel__copy {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; font-size: 0.8125rem;
  }
  .panel__title { font-size: clamp(1.4rem, 6.2vw, 1.9rem); }
}

/* ══════════ movimiento reducido ══════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .panel:hover .panel__media img.is-live { animation: none; }
  .sun-rays { animation: none; }
  .callbtn__ring { display: none; }
  html.js-pre .panel__body > *,
  html.js-pre .topbar > * { opacity: 1; transform: none; }
}

/* En escritorio el vídeo de apertura es vertical: con "contain" quedaba una tira
   en el centro y dos franjas negras enormes. Con "cover" llena la pantalla y el
   logo (que va centrado) queda completo; en móvil se mantiene "contain". */
@media (min-width: 900px) {
  .intro__video { object-fit: cover; object-position: 50% 55%; }
}
