/* ==========================================================
   TAB_ / SISTEMA VISUAL
   Responsive, accesible y sin dependencias de JS para layout.
   ========================================================== */

:root {
  --ink: #101011;
  --ink-soft: #16171b;
  --paper: #f0eee7;
  --white: #f7f6f2;
  --muted: #aeb0b7;
  --lime: #c8ff7a;
  --blue: #6675db;
  --line: rgba(255,255,255,.13);
  --ease: cubic-bezier(.77,0,.18,1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Space Grotesk", Arial, sans-serif;
  overflow-x: hidden;
}

body,
button,
a { -webkit-tap-highlight-color: transparent; }

button,
a { font: inherit; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}

/* ---------- Shared ---------- */

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  color: #fff;
  font: 700 30px/1 "Space Grotesk", sans-serif;
  letter-spacing: -.11em;
  text-decoration: none;
  text-transform: lowercase;
}

.wordmark .brand-name,
.core .brand-name { color: #fff; }

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

.eyebrow {
  margin: 0 0 18px;
  color: currentColor;
  font: 11px/1 "DM Mono", monospace;
  letter-spacing: .08em;
  opacity: .72;
  text-transform: uppercase;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: max(760px, 100svh);
  isolation: isolate;
  overflow: hidden;
  padding: 22px clamp(22px, 5vw, 72px) 38px;
  color: #fff;
  background:
    radial-gradient(circle at 72% 47%, rgba(200,255,122,.08), transparent 22rem),
    radial-gradient(circle at 95% 12%, rgba(102,117,219,.10), transparent 25rem),
    var(--ink);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -2;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .24;
}

.hero::before {
  width: 26rem;
  height: 26rem;
  right: -9rem;
  top: 10%;
  background: var(--blue);
}

.hero::after {
  width: 18rem;
  height: 18rem;
  left: 48%;
  bottom: -9rem;
  background: var(--lime);
}

.nav {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 12px/1 "DM Mono", monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.nav a:not(.wordmark) {
  padding-bottom: 4px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.8);
}

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

.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;
  font-style: normal;
}

.intro {
  max-width: 370px;
  margin: 38px 0 25px;
  color: #dedede;
  font-size: 16px;
  line-height: 1.45;
}

.round-link {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  padding: 11px 13px 11px 17px;
  border: 1px solid #555;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  text-decoration: none;
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

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

.round-link:hover {
  border-color: var(--lime);
  box-shadow: 0 0 22px rgba(200,255,122,.13);
  transform: translateY(-2px);
}

/* ---------- Interactive network ---------- */

.network {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.network-glow {
  position: absolute;
  width: 34rem;
  height: 34rem;
  left: 71%;
  top: 48%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,255,122,.07), transparent 67%);
  filter: blur(4px);
  pointer-events: none;
}

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

.connection {
  fill: none;
  stroke: rgba(102,117,219,.42);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: stroke .18s ease, stroke-width .18s ease, opacity .18s ease;
}

.connection.is-near {
  stroke: rgba(200,255,122,.8);
  stroke-width: 1.8;
}

.core {
  position: absolute;
  z-index: 5;
  left: 70%;
  top: 50%;
  width: 155px;
  height: 155px;
  display: grid;
  place-content: center;
  text-align: center;
  border: 1px solid var(--lime);
  border-radius: 50%;
  background: rgba(25,28,37,.92);
  box-shadow:
    0 0 0 12px rgba(22,22,27,.82),
    0 0 65px rgba(108,134,255,.33),
    inset 0 0 35px rgba(200,255,122,.05);
  transform: translate(-50%, -50%);
  transition: box-shadow .25s ease, transform .25s ease;
}

.core > span { font-size: 35px; font-weight: 700; letter-spacing: -.12em; }
.core small { margin-top: 4px; color: var(--lime); font: 9px/1 "DM Mono", monospace; }

.core.is-charged {
  box-shadow:
    0 0 0 12px rgba(22,22,27,.82),
    0 0 90px rgba(200,255,122,.5),
    0 0 22px rgba(200,255,122,.7),
    inset 0 0 45px rgba(200,255,122,.12);
}

.core-pulse {
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(200,255,122,.25);
  border-radius: 50%;
  animation: pulse 3s ease-out infinite;
  pointer-events: none;
}

.node {
  position: absolute;
  z-index: 6;
  left: var(--x);
  top: var(--y);
  min-width: 82px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid rgba(102,117,219,.72);
  border-radius: 999px;
  color: #e8e9fa;
  background: rgba(20,20,25,.92);
  box-shadow: 0 0 0 rgba(200,255,122,0);
  font: 10px/1 "DM Mono", monospace;
  cursor: grab;
  transform: translate(-50%, -50%);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  will-change: left, top, transform;
}

.node span {
  color: var(--lime);
  font-size: 9px;
  opacity: .9;
}

.node strong { font-weight: 500; }

.node:hover,
.node:focus-visible {
  border-color: var(--lime);
  box-shadow: 0 0 20px rgba(200,255,122,.16);
}

.node.is-dragging {
  cursor: grabbing;
  border-color: var(--lime);
  background: rgba(200,255,122,.08);
  box-shadow:
    0 0 12px rgba(200,255,122,.35),
    0 0 45px rgba(200,255,122,.18);
  z-index: 12;
}

.node.is-near-core {
  border-color: var(--lime);
  box-shadow: 0 0 30px rgba(200,255,122,.3);
}

.network-hint {
  position: absolute;
  z-index: 4;
  right: clamp(22px, 5vw, 72px);
  bottom: 34px;
  margin: 0;
  color: #999ba4;
  font: 10px/1.4 "DM Mono", monospace;
  letter-spacing: .04em;
}

.network-hint span { color: var(--lime); }

.hero-footer {
  position: absolute;
  z-index: 8;
  right: clamp(22px, 5vw, 72px);
  bottom: 38px;
  margin: 0;
  color: #b9b9bd;
  text-align: right;
  font-size: 12px;
  line-height: 1.3;
}

/* ---------- Projects ---------- */

.projects {
  padding: 110px clamp(22px, 5vw, 72px);
  background: var(--paper);
}

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

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

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

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

.tab-row {
  height: 255px;
  display: flex;
  gap: 9px;
  overflow: hidden;
}

.panel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  border-radius: 4px;
  cursor: pointer;
  transition: flex .75s var(--ease), filter .4s ease;
}

.panel:hover { filter: brightness(1.06); }
.panel.active { flex: 14 1 0; cursor: default; }

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--thumb);
  background-position: var(--pos, center);
  background-size: cover;
  filter: saturate(.9);
  transition: transform .8s ease;
}

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

.panel-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(16,16,17,.91) 0%, rgba(16,16,17,.66) 47%, rgba(16,16,17,.10) 100%);
}

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

.tab-label {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: 50%;
  color: #fff;
  font: 500 10px/1 "DM Mono", monospace;
  letter-spacing: .12em;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: translateX(-50%);
}

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

.panel-content {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 42%;
  left: clamp(22px, 4vw, 55px);
  color: #fff;
  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/1 "DM Mono", monospace;
  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);
  font: 11px/1 "DM Mono", monospace;
  text-decoration: none;
}

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

/* ---------- Footer ---------- */

footer {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 30px clamp(22px, 5vw, 72px);
  color: #fff;
  background: var(--ink);
  font: 12px "DM Mono", monospace;
}

footer p { margin: 0; opacity: .65; }
footer > a:last-child { color: var(--lime); text-decoration: none; }

/* ---------- Motion ---------- */

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

@keyframes pulse {
  0% { transform: scale(.95); opacity: .75; }
  70%, 100% { transform: scale(1.16); opacity: 0; }
}

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

@media (max-width: 900px) {
  .hero { min-height: 760px; }
  .hero-copy { max-width: 500px; }
  .network { opacity: .9; }
  .core { left: 69%; top: 53%; }
  .section-heading { grid-template-columns: 1fr; gap: 18px; }
  .section-heading > p:last-child { margin: 0; }
  .tab-row { height: 310px; }
  .panel-content { right: 14px; }
  .description { max-width: 310px; }
}

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

  .nav a:not(.wordmark) { font-size: 10px; }

  .hero-copy {
    margin-top: 92px;
  }

  .hero h1 { font-size: clamp(52px, 14vw, 70px); }
  .intro { max-width: 320px; margin-top: 28px; }

  .network {
    inset: 29% -15% 0 -15%;
    transform: none;
  }

  .network-glow {
    width: 24rem;
    height: 24rem;
    left: 66%;
    top: 49%;
  }

  .core {
    left: 62%;
    top: 51%;
    width: 122px;
    height: 122px;
  }

  .core > span { font-size: 28px; }
  .core small { font-size: 8px; }

  .node {
    min-width: 74px;
    min-height: 39px;
    padding: 7px 10px;
    font-size: 9px;
  }

  .node strong { display: none; }
  .network-hint {
    right: 18px;
    bottom: 16px;
    font-size: 9px;
  }

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

  .projects { padding-block: 75px; }
  .projects h2 { font-size: clamp(48px, 15vw, 70px); }

  .tab-row {
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .tab-row + .tab-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .panel,
  .panel.active {
    height: 300px;
    min-height: 300px;
    flex: initial;
  }

  .panel.active { grid-column: span 4; }
  .tab-row + .tab-row .panel.active { grid-column: span 3; }

  .panel:not(.active) .panel-content { opacity: 0; }
  .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; }

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

@media (max-width: 420px) {
  .hero { min-height: 720px; }
  .hero-copy { margin-top: 82px; }
  .hero h1 { font-size: 53px; }

  .network {
    inset: 32% -23% 0 -23%;
  }

  .core {
    left: 63%;
    top: 52%;
    width: 108px;
    height: 108px;
  }

  .node { min-width: 68px; }
  .hero-footer { display: none; }

  .panel,
  .panel.active {
    height: 270px;
    min-height: 270px;
  }
}

/* Respeta usuarios que reducen el movimiento del sistema. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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