/* ============================================================
   TAB_ — ESTILOS PRINCIPALES
   ------------------------------------------------------------
   GUÍA RÁPIDA DE MODIFICACIÓN
   1. Colores generales       -> :root
   2. Hero / red              -> HERO + NETWORK
   3. Tarjetas inferiores     -> PROJECTS / PANELS
   4. Fondos de webs          -> project-backgrounds.css
   5. Responsive              -> MEDIA QUERIES al final
   ============================================================ */

:root {
  --ink: #101011;
  --paper: #f0eee7;
  --white: #ffffff;
  --lime: #c8ff7a;
  --lime-rgb: 200,255,122;
  --muted: #85858b;

  --display: "Space Grotesk", Arial, sans-serif;
  --mono: "DM Mono", monospace;

  --page-pad: clamp(22px, 5vw, 72px);
  --panel-radius: 8px;
  --panel-height: 255px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
}

body.is-dragging { user-select: none; }
a { color: inherit; }


/* ============================================================
   01. HERO
   ============================================================ */

.hero {
  min-height: max(760px, 100svh);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 22px var(--page-pad) 38px;

  background:
    radial-gradient(circle at 75% 52%, rgba(73,95,220,.11), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(var(--lime-rgb),.07), transparent 22%),
    var(--ink);

  color: var(--white);
}

.nav,
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 20;

  font: 12px var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.nav-projects {
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,.65);
  text-decoration: none;
  transition: .2s;
}

.nav-projects:hover,
.nav-projects:focus-visible {
  color: var(--lime);
  border-color: var(--lime);
  transform: translateY(-1px);
}

.wordmark {
  font: 700 30px var(--display);
  letter-spacing: -.11em;
  text-decoration: none;
}

.wordmark .brand-name,
.core .brand-name { color: var(--white); }

.wordmark,
.core > span { text-transform: lowercase; }

.blink {
  color: var(--lime);
  animation: tab-cursor-blink 1.05s step-end infinite;
}


/* ============================================================
   02. HERO COPY
   ============================================================ */

.hero-copy {
  position: relative;
  z-index: 8;
  max-width: 620px;
  margin-top: clamp(75px, 13vh, 150px);
  pointer-events: none;
}

.hero-copy a { pointer-events: auto; }

.eyebrow {
  margin: 0 0 18px;
  color: inherit;
  opacity: .72;
  font: 11px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero h1,
.projects h2 {
  margin: 0;
  font-size: clamp(56px, 8vw, 125px);
  line-height: .82;
  letter-spacing: -.09em;
}

.hero h1 em {
  color: var(--lime);
  font-weight: 400;
}

.round-link {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  margin-top: 30px;
  padding: 11px 13px 11px 17px;

  border: 1px solid #555;
  border-radius: 99px;

  color: var(--white);
  text-decoration: none;
  font-size: 13px;
  transition: .25s;
}

.round-link:hover,
.round-link:focus-visible {
  border-color: var(--lime);
  background: rgba(var(--lime-rgb),.06);
  transform: translateY(-2px);
}

.round-link span {
  color: var(--lime);
  font-size: 18px;
}


/* ============================================================
   03. RED INTERACTIVA
   ============================================================ */

.network {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  touch-action: none;
  contain: layout paint;
}

.network::before,
.network::after {
  content: "";
  position: absolute;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(75px);
  opacity: .09;
  pointer-events: none;
}

.network::before {
  left: 55%;
  top: 26%;
  background: #5168ff;
}

.network::after {
  left: 76%;
  top: 62%;
  background: var(--lime);
  opacity: .055;
}

.network-glow {
  position: absolute;
  left: 69%;
  top: 48%;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: var(--lime);
  filter: blur(100px);
  opacity: .035;
  pointer-events: none;
  transition: .25s;
}

.network.is-dragging .network-glow {
  opacity: .1;
  transform: scale(1.35);
}

.connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.connection {
  stroke: rgba(125,146,255,.36);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.connection.is-near {
  stroke: rgba(var(--lime-rgb),.9);
  stroke-width: 1.8;
}

.connection.is-dragged {
  stroke: rgba(var(--lime-rgb),.75);
}

.orbit {
  position: absolute;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 50%;
  pointer-events: none;
  transform: rotate(-18deg);
}

.orbit-a {
  left: 56%;
  top: 19%;
  width: min(470px,42vw);
  aspect-ratio: 1;
}

.orbit-b {
  left: 50%;
  top: 35%;
  width: min(350px,32vw);
  aspect-ratio: 1;
  border-color: rgba(var(--lime-rgb),.1);
}


/* ============================================================
   04. NODOS
   ============================================================ */

.node {
  position: absolute;
  z-index: 5;
  border: 1px solid rgba(111,128,224,.7);
  border-radius: 999px;
  background: rgba(20,20,25,.9);
  color: #e8e9fa;
  box-shadow: 0 0 24px rgba(75,95,220,.08);
  font: 10px var(--mono);
  will-change: transform,left,top;
}

.core {
  left: 68%;
  top: 45%;
  width: 155px;
  height: 155px;

  display: grid;
  place-items: center;
  text-align: center;

  border-color: var(--lime);
  border-radius: 50%;
  background: rgba(25,28,37,.94);

  box-shadow:
    0 0 0 12px rgba(22,22,27,.75),
    0 0 65px rgba(108,134,255,.22),
    inset 0 0 35px rgba(var(--lime-rgb),.04);

  cursor: default;
  transition: box-shadow .3s,border-color .3s;
}

.core.is-attracted {
  box-shadow:
    0 0 0 12px rgba(22,22,27,.72),
    0 0 22px rgba(var(--lime-rgb),.7),
    0 0 85px rgba(var(--lime-rgb),.24),
    inset 0 0 42px rgba(var(--lime-rgb),.08);
}

.core-default {
  display: grid;
  place-items: center;
  transition: opacity .2s,transform .25s;
}

.core-brand {
  font-size: 35px;
  font-weight: 700;
  letter-spacing: -.12em;
}

.core-default small {
  margin-top: 4px;
  color: var(--lime);
  font: 9px var(--mono);
}

.core-preview {
  position: absolute;
  inset: 10px;

  display: grid;
  grid-template-rows: 1fr auto;

  overflow: hidden;
  border-radius: 50%;
  opacity: 0;
  transform: scale(.82);
  pointer-events: none;

  transition:
    opacity .2s,
    transform .28s cubic-bezier(.2,.8,.2,1);
}

.core.show-preview .core-default {
  opacity: 0;
  transform: scale(.82);
}

.core.show-preview .core-preview {
  opacity: 1;
  transform: scale(1);
}

.preview-image {
  min-height: 0;
  background: center/cover no-repeat;
  filter: saturate(.95) contrast(1.04);
}

.preview-info {
  display: grid;
  gap: 1px;
  padding: 7px 9px 10px;
  background: rgba(10,10,12,.78);
  text-align: left;
}

.preview-kicker,
.preview-action {
  color: rgba(255,255,255,.5);
  font: 7px var(--mono);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.preview-info strong {
  color: var(--lime);
  font: 700 11px var(--display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-nodes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.project-node {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;

  text-decoration: none;
  cursor: grab;
  pointer-events: auto;

  transition:
    border-color .2s,
    box-shadow .2s,
    background .2s,
    transform .15s;
}

.project-node:active,
.project-node.is-dragging { cursor: grabbing; }

.project-node:hover,
.project-node:focus-visible {
  border-color: var(--lime);
  box-shadow:
    0 0 24px rgba(var(--lime-rgb),.18),
    0 0 4px rgba(var(--lime-rgb),.28);
  background: rgba(22,27,25,.96);
}

.project-node.is-dragging {
  z-index: 30;
  border-color: var(--lime);
  box-shadow:
    0 0 0 1px rgba(var(--lime-rgb),.2),
    0 0 18px rgba(var(--lime-rgb),.55),
    0 0 60px rgba(var(--lime-rgb),.15);
}

.node-code { color: var(--lime); }
.node-name { color: #e8e9fa; }


/* ============================================================
   05. ESTADO DE LA RED
   ============================================================ */

.network-status {
  position: absolute;
  left: 50%;
  bottom: clamp(28px,5vh,55px);
  z-index: 8;

  display: flex;
  align-items: center;
  gap: 8px;

  transform: translateX(-50%);
  color: rgba(255,255,255,.42);
  font: 9px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
}

.network.is-dragging .status-dot {
  animation: status-pulse .7s ease-in-out infinite alternate;
}

.hero-footer {
  position: absolute;
  right: var(--page-pad);
  bottom: 38px;
  z-index: 8;

  margin: 0;
  color: var(--muted);
  text-align: right;
  font-size: 12px;
  line-height: 1.3;
  pointer-events: none;
}


/* ============================================================
   06. PROYECTOS — SECCIÓN INFERIOR
   ============================================================

   Acá está el cambio visual que pediste:
   la sección deja de ser un bloque gris plano.
   Cada fila tiene una "web de fondo" que ocupa todo el ancho,
   con color + blur + transparencia.
   La tarjeta activa se superpone sobre ese universo.
   ============================================================ */

.projects {
  position: relative;
  overflow: hidden;
  padding: 110px var(--page-pad);
  background: var(--paper);
}

/* Fondo ambiental de la sección */
.projects::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 18%;
  right: -8%;
  width: 58%;
  height: 65%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(90,105,255,.16), transparent 60%);
  filter: blur(60px);
  pointer-events: none;
}

.section-heading,
.tabs-container {
  position: relative;
  z-index: 2;
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: end;
  gap: 30px;
  margin-bottom: 60px;
}

.projects h2 {
  font-size: clamp(48px,7vw,98px);
}

.section-heading > p:last-child {
  max-width: 250px;
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.45;
}


/* ============================================================
   07. FILAS Y PANELES
   ============================================================ */

.tabs-container {
  max-width: 1280px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.tab-row {
  position: relative;
  height: var(--panel-height);
  display: flex;
  gap: 9px;
  overflow: hidden;
  isolation: isolate;
}

/* Fondo visual de cada fila */
.tab-row::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: -35px -8%;
  background-image: var(--row-bg);
  background-size: cover;
  background-position: center;
  filter: blur(22px) saturate(1.35);
  opacity: .58;
  transform: scale(1.06);
}

/* Color ambiental */
.tab-row::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(16,16,17,.28),
      rgba(255,255,255,.05),
      rgba(16,16,17,.18)
    );
  pointer-events: none;
}

.panel {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;

  cursor: pointer;
  border-radius: var(--panel-radius);
  isolation: isolate;

  transition:
    flex .75s cubic-bezier(.77,0,.18,1),
    filter .4s,
    border-color .3s,
    box-shadow .3s;
}

.panel:hover {
  filter: brightness(1.06);
}

.panel.active {
  flex: 14;
  cursor: default;
}

.panel:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;

  background-image: var(--thumb);
  background-size: cover;
  background-position: var(--pos,center);

  filter: saturate(.95);
  transition: transform .8s;
}

.panel.active::before {
  transform: scale(1.06);
}

.panel-shade {
  position: absolute;
  inset: 0;
  z-index: -1;

  background:
    linear-gradient(
      90deg,
      rgba(16,16,17,.92) 0%,
      rgba(16,16,17,.62) 47%,
      rgba(16,16,17,.08) 100%
    );
}

.panel:not(.active) .panel-shade {
  background: rgba(16,16,17,.38);
}

.tab-label {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 18px;

  transform: translateX(-50%);
  color: var(--white);
  white-space: nowrap;

  font: 500 10px var(--mono);
  letter-spacing: .12em;
  writing-mode: vertical-rl;
}

.panel.active .tab-label {
  left: auto;
  right: 19px;
  transform: none;
  color: var(--lime);
  writing-mode: initial;
}

.panel-content {
  position: absolute;
  z-index: 2;
  left: clamp(22px,4vw,55px);
  top: 50%;
  right: 42%;

  color: var(--white);
  opacity: 0;
  transform: translateY(-50%);

  transition: opacity .38s ease .18s;
}

.panel.active .panel-content {
  opacity: 1;
}

.project-number {
  margin: 0 0 13px;
  color: var(--lime);
  font: 10px var(--mono);
  letter-spacing: .09em;
}

.panel h3 {
  margin: 0 0 9px;
  font-size: clamp(31px,4vw,58px);
  line-height: .9;
  letter-spacing: -.07em;
}

.project-type {
  margin: 0 0 22px;
  font-size: 15px;
}

.description {
  max-width: 400px;
  margin: 0 0 21px;
  color: #f3f3f3;
  font-size: 13px;
  line-height: 1.45;
}

.panel-content a {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--lime);
  text-decoration: none;
  font: 11px var(--mono);
  transition: .2s;
}

.panel-content a:hover,
.panel-content a:focus-visible {
  color: var(--lime);
  border-color: var(--white);
}

.panel-content a span {
  color: var(--lime);
  font-size: 15px;
}


/* ============================================================
   08. FOOTER
   ============================================================ */

footer {
  padding: 30px var(--page-pad);
  background: var(--ink);
  color: var(--white);
}

footer p { opacity: .65; }
footer > a:last-child { color: var(--lime); }


/* ============================================================
   09. ANIMACIONES
   ============================================================ */

@keyframes tab-cursor-blink {
  50% { opacity: 0; }
}

@keyframes status-pulse {
  to {
    transform: scale(1.8);
    opacity: .45;
  }
}


/* ============================================================
   10. RESPONSIVE
   ============================================================ */

@media (max-width:1000px) {
  .hero { min-height: 720px; }
  .hero-copy { max-width: 500px; }
  .core { left: 68%; top: 47%; }
  .orbit-a { left: 51%; }
  .orbit-b { left: 46%; }
}

@media (max-width:800px) {
  .hero { min-height: 760px; }
  .hero-copy { margin-top: 82px; }

  .hero h1 {
    font-size: clamp(54px,10vw,78px);
  }

  .core {
    left: 50%;
    top: 52%;
    width: 132px;
    height: 132px;
    transform: translate(-50%,-50%);
  }

  .core-brand { font-size: 30px; }

  .orbit-a {
    left: 50%;
    top: 34%;
    width: 430px;
    transform: translateX(-50%) rotate(-18deg);
  }

  .orbit-b {
    left: 50%;
    top: 42%;
    width: 300px;
    transform: translateX(-50%) rotate(14deg);
  }

  .network-status { bottom: 72px; }
  .hero-footer { bottom: 28px; }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .section-heading > p:last-child { margin: 0; }

  .tab-row { height: 310px; }
  .panel.active { flex: 12; }
  .panel-content { right: 14px; }
  .description { max-width: 310px; }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width:560px) {
  .hero {
    min-height: 760px;
    padding-top: 19px;
  }

  .nav-projects { font-size: 9px; }

  .hero-copy {
    max-width: 100%;
    margin-top: 72px;
  }

  .hero h1 {
    font-size: clamp(48px,15vw,65px);
  }

  .round-link { margin-top: 24px; }

  .core {
    top: 55%;
    width: 116px;
    height: 116px;
  }

  .core-brand { font-size: 26px; }

  .orbit-a { top: 39%; width: 340px; }
  .orbit-b { top: 47%; width: 245px; }

  .project-node {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 9px;
  }

  .project-node .node-name { display: none; }

  .network-status { bottom: 78px; }

  .hero-footer {
    right: 18px;
    bottom: 28px;
    font-size: 10px;
  }

  .projects { padding-block: 75px; }

  .tabs-container,
  .tab-row { gap: 5px; }

  .tabs-container { gap: 22px; }

  .tab-row { height: 300px; }
  .panel.active { flex: 10; }
  .panel:not(.active) { flex: .45; }

  .panel-content { left: 20px; }
  .panel h3 { font-size: 34px; }

  .project-type {
    margin-bottom: 13px;
    font-size: 13px;
  }

  .description {
    margin-bottom: 15px;
    font-size: 12px;
  }

  .tab-label { top: 12px; }

  .core-preview { inset: 7px; }

  .preview-info {
    padding: 5px 7px 8px;
  }

  .preview-info strong { font-size: 9px; }

  .preview-kicker,
  .preview-action { font-size: 6px; }
}

@media (max-width:380px) {
  .hero { min-height: 720px; }
  .hero h1 { font-size: 46px; }
  .core { top: 54%; width: 106px; height: 106px; }
  .orbit-a { width: 300px; }
  .orbit-b { width: 220px; }
}

@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (pointer:coarse) {
  .project-node {
    min-height: 38px;
    padding-inline: 11px;
  }
}
