/* ==========================================================================
   DPL Group — digitalpolicylaw.com
   Concepto: "Circuitos vivos" (diseño ganador)
   ========================================================================== */

:root {
  --bg:          #0a0e14;
  --teal:        #00bbc2;
  --teal-bright: #3ee0e6;
  --ink:         #e8eef5;
  --ink-soft:    #b3c0ce;
  --ink-faint:   #7b8b9d;
  --line:        rgba(0, 187, 194, 0.14);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

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

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 50% 46%, rgba(0, 187, 194, 0.09), transparent 62%),
    radial-gradient(900px 520px at 12% 88%, rgba(0, 187, 194, 0.05), transparent 70%),
    linear-gradient(180deg, #070a10 0%, var(--bg) 42%, #070a10 100%);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 76px;
}

/* --------------------------------------------------------------------------
   Fondo tecnológico
   -------------------------------------------------------------------------- */

.board {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Rejilla técnica sutil (doble escala) */
.board__grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(to right, rgba(0, 187, 194, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 187, 194, 0.055) 1px, transparent 1px),
    linear-gradient(to right, rgba(0, 187, 194, 0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 187, 194, 0.028) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px;
  background-position: center center;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 48%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 48%, #000 35%, transparent 100%);
}

/* Trazos de circuito SVG */
.traces {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

/* Trazo que se "dibuja" de izquierda a derecha */
.trace {
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  animation: trace-draw var(--dur) cubic-bezier(0.5, 0.05, 0.35, 1) var(--delay) infinite;
}

@keyframes trace-draw {
  0%   { stroke-dashoffset: var(--len); opacity: 0; }
  8%   { opacity: 1; }
  55%  { stroke-dashoffset: 0; opacity: 1; }
  78%  { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/* Nodos que pulsan */
.node {
  fill: var(--teal-bright);
  transform-box: fill-box;
  transform-origin: center;
  animation: node-pulse 3.2s ease-in-out var(--pd) infinite;
}

@keyframes node-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50%      { opacity: 1;    transform: scale(1.45); }
}

/* Partículas muy lentas subiendo */
.motes {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.motes span {
  position: absolute;
  bottom: -12px;
  left: var(--x);
  width: var(--sz);
  height: var(--sz);
  border-radius: 50%;
  background: var(--teal-bright);
  opacity: 0;
  box-shadow: 0 0 6px rgba(62, 224, 230, 0.55);
  animation: mote-rise var(--d) linear var(--delay) infinite;
}

@keyframes mote-rise {
  0%   { transform: translate3d(0, 0, 0);          opacity: 0; }
  12%  { opacity: var(--o); }
  85%  { opacity: var(--o); }
  100% { transform: translate3d(14px, -104vh, 0);  opacity: 0; }
}

/* Viñeta para asentar el contenido */
.board__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 50% 46%, rgba(7, 10, 16, 0.82), rgba(7, 10, 16, 0) 70%),
    radial-gradient(ellipse 120% 110% at 50% 50%, rgba(7, 10, 16, 0) 42%, rgba(5, 7, 12, 0.72) 100%);
}

/* --------------------------------------------------------------------------
   Contenido
   -------------------------------------------------------------------------- */

.stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: stage-in 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes stage-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Chip con el logo --- */

.chip {
  position: relative;
  display: inline-grid;
  place-items: center;
  padding: 26px 34px;
  margin-bottom: 34px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(13, 19, 28, 0.92), rgba(9, 13, 20, 0.88));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 18px 50px -28px rgba(0, 187, 194, 0.55);
  animation: chip-float 7s ease-in-out infinite;
}

@keyframes chip-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* Patillas del encapsulado */
.chip__pin {
  position: absolute;
  width: 16px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(0, 187, 194, 0.25), var(--teal));
  box-shadow: 0 0 8px rgba(0, 187, 194, 0.35);
  opacity: 0.8;
}

.chip__pin--tl { top: -4px; left: 34px; }
.chip__pin--tr { top: -4px; right: 34px; }
.chip__pin--bl { bottom: -4px; left: 34px; }
.chip__pin--br { bottom: -4px; right: 34px; }

.chip__core {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 10px;
  background: radial-gradient(ellipse 70% 120% at 50% 50%, rgba(0, 187, 194, 0.09), transparent 70%);
}

.logo {
  display: block;
  width: 323px;
  max-width: 100%;
  height: auto;
}

/* Fondo oscuro -> logo oscuro (DPL teal + Group blanco) */
.logo--dark { filter: drop-shadow(0 0 14px rgba(0, 187, 194, 0.28)); }

/* --- Textos --- */

.eyebrow {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: clamp(0.68rem, 0.55rem + 0.32vw, 0.8rem);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--teal);
  text-shadow: 0 0 16px rgba(0, 187, 194, 0.45);
}

/* Titular: tipografía condensada de sistema con tracking agresivo.
   Se evita la muestra "system-ui" genérica del titular. */
.title {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(2rem, 6.4vw, 3.35rem);
  line-height: 1.06;
  font-weight: 600;
  font-stretch: condensed;
  letter-spacing: -0.045em;
  text-transform: none;
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 52%, #a9f4f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

/* Fallback si el navegador no soporta background-clip:text */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .title {
    color: #f4f9fc;
    -webkit-text-fill-color: currentColor;
    text-shadow: 0 2px 34px rgba(62, 224, 230, 0.16);
  }
}

.lead {
  margin: 20px auto 0;
  max-width: 30rem;
  font-size: clamp(0.95rem, 2.4vw, 1.06rem);
  color: var(--ink-soft);
  text-wrap: balance;
  text-shadow: 0 1px 3px rgba(7, 10, 16, 0.9), 0 0 14px rgba(7, 10, 16, 0.7);
}

/* Separador con pulso */
.rule {
  position: relative;
  width: min(260px, 60%);
  height: 1px;
  margin: 30px 0 20px;
  background: linear-gradient(90deg, transparent, rgba(0, 187, 194, 0.42), transparent);
}

.rule span {
  position: absolute;
  top: 50%;
  left: 0;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--teal-bright);
  box-shadow: 0 0 10px rgba(62, 224, 230, 0.85);
  animation: rule-travel 4.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes rule-travel {
  0%        { left: 0;      opacity: 0; }
  12%       { opacity: 1; }
  88%       { opacity: 1; }
  100%      { left: calc(100% - 6px); opacity: 0; }
}

.micro {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* --------------------------------------------------------------------------
   Barra de estado (pie) — ancla la franja inferior
   -------------------------------------------------------------------------- */

.statusbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 22px;
  border-top: 1px solid rgba(0, 187, 194, 0.16);
  background: linear-gradient(180deg, rgba(8, 12, 18, 0.55), rgba(6, 9, 14, 0.9));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  overflow: hidden;
}

.statusbar__group {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.statusbar__group--right {
  justify-content: flex-end;
}

.statusbar__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.statusbar__key { color: rgba(123, 139, 157, 0.72); }
.statusbar__val { color: var(--ink-soft); }

.statusbar__val--ok { color: var(--teal); }

/* LED de pulso del nodo */
.statusbar__led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-bright);
  box-shadow: 0 0 8px rgba(62, 224, 230, 0.9);
  animation: led-blink 2.6s ease-in-out infinite;
}

@keyframes led-blink {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

.statusbar__sep {
  width: 1px;
  height: 11px;
  background: rgba(0, 187, 194, 0.22);
  flex: none;
}

/* --------------------------------------------------------------------------
   Foco visible (navegación por teclado)
   -------------------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--teal-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .statusbar__group--right { display: none; }
}

@media (max-width: 560px) {
  body { padding: 18px 16px 68px; }

  .chip {
    padding: 20px 22px;
    margin-bottom: 26px;
    border-radius: 14px;
  }

  .chip__pin--tl,
  .chip__pin--tr { left: 22px; right: 22px; }
  .chip__pin--tl,
  .chip__pin--bl { left: 22px; }
  .chip__pin--tr,
  .chip__pin--br { right: 22px; }

  .logo { width: 250px; }

  .eyebrow { letter-spacing: 0.26em; margin-bottom: 12px; }

  .lead { margin-top: 16px; }

  .rule { margin: 24px 0 16px; }

  .statusbar {
    padding: 8px 14px;
    font-size: 0.58rem;
    letter-spacing: 0.1em;
  }

  .statusbar__group { gap: 9px; }
}

@media (max-width: 380px) {
  .logo { width: 210px; }
  .chip { padding: 16px 18px; }
  .title { letter-spacing: -0.03em; }
  .statusbar__sep { display: none; }
}

/* Escalado del titular en pantallas grandes: el título crece con el viewport
   (subiendo el techo de 3.35rem a 4.6rem) para no quedarse congelado frente
   al chip, que ya escala a 380px. */
@media (min-width: 1600px) {
  .stage { max-width: 860px; }

  .title {
    font-size: clamp(3.35rem, 4.2vw, 4.6rem);
    letter-spacing: -0.05em;
  }

  .lead {
    font-size: clamp(1.06rem, 1.05vw, 1.28rem);
    max-width: 36rem;
  }

  .eyebrow {
    font-size: 0.86rem;
    margin-bottom: 16px;
  }

  .rule { width: min(340px, 55%); }
}

@media (min-width: 2000px) {
  .title { font-size: 4.6rem; }
  .logo { width: 380px; }
  .stage { max-width: 960px; }
  .lead { font-size: 1.34rem; }
  .eyebrow { font-size: 0.94rem; }
}

@media (max-height: 620px) {
  .chip { margin-bottom: 18px; padding: 14px 20px; }
  .logo { width: 190px; }
  .lead { margin-top: 12px; }
  .rule { margin: 18px 0 12px; }
  .title { font-size: clamp(1.6rem, 5vw, 2.2rem); }
  body { padding-bottom: 52px; }
  .statusbar { padding: 6px 16px; font-size: 0.58rem; }
}

/* --------------------------------------------------------------------------
   prefers-reduced-motion: se desactivan todas las animaciones
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  /* Trazos dibujados quedan completos y estáticos */
  .trace {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    opacity: 0.75;
  }

  /* Nodos fijos, sin pulso */
  .node {
    opacity: 0.85;
    transform: none;
  }

  /* Partículas ocultas */
  .motes { display: none; }

  /* Indicador de travelling estático */
  .rule span {
    left: calc(50% - 3px);
    animation: none;
    opacity: 0.9;
  }

  .stage,
  .chip {
    animation: none;
    opacity: 1;
    transform: none;
  }

  /* LED fijo */
  .statusbar__led {
    animation: none;
    opacity: 1;
  }
}
