/* =========================================================
   SYS NETWORK · Depends on: foundations.css, js/sys-network.js
   Pixel network of DOS-style windows (SysNetwork, divider) and
   the scroll journey (SysJourney, behind the hero). The modules
   paint the canvases; this file only places them. The canvas is drawn at low resolution and scaled
   up here without smoothing, so every pixel stays crisp.
========================================================= */

.sys-net {
  position: absolute;
  display: block;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

/* -----------------------------
   Journey (js/sys-journey.js): a tall track that wraps the hero.
   Its stage is sticky; the hero is pulled up over it (negative
   margin on the hero, not on the stage: a sticky box with a
   negative margin would overflow the end of the track and cover
   Trabajos). JS sets the track height.
----------------------------- */
.journey {
  position: relative;
}

.journey__stage {
  position: sticky;
  top: 0;
  z-index: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  pointer-events: none;
}

.journey > .hero {
  margin-top: -100vh;
  margin-top: -100svh;
}

.journey__stage .sys-net {
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero,
.work {
  position: relative;
  z-index: 1;
}

/* Skills as text: visually hidden (screen readers read it; the
   canvas is decorative). With reduced motion it becomes a visible,
   static list under the hero. */
.journey__list {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.journey__list-title {
  font-size: var(--fs-3xl);
  margin-bottom: var(--space-4);
}

.journey__list ul {
  display: grid;
  gap: var(--space-3);
  border-top: var(--border-hairline);
  padding-top: var(--space-4);
}

.journey__list strong {
  display: block;
  font-family: var(--font-system);
  font-weight: 400;
  font-size: var(--fs-xl);
  line-height: 1;
  text-transform: uppercase;
  color: var(--color-mint);
}

.journey__list span {
  font-size: var(--fs-sm);
  color: var(--color-ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  /* No flight: the still orbit gets its own block under the hero text, then
     the skills list. Behind the text it made the hero unreadable, and a stage
     as tall as the screen cut the ring once the page scrolled. */
  .journey {
    display: flex;
    flex-direction: column;
  }

  .journey > .hero {
    order: 1;
    margin-top: 0;
  }

  .journey__stage {
    order: 2;
    position: relative;
    height: clamp(300px, 52vh, 520px);
    height: clamp(300px, 52svh, 520px);
  }

  .journey__list {
    order: 3;
    position: relative;
    z-index: 1;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    padding-block: var(--space-7);
  }
}

/* Closed track (the reader already went through the journey): the stage is
   taller than the screen so the orbit, which sits low in the hero, is not
   cut at its bottom edge. Same number as CLOSED_STAGE in js/sys-journey.js. */
.journey.is-closed .journey__stage {
  height: 128vh;
}

.journey.is-closed > .hero {
  margin-top: -128vh;
}

@supports (height: 100svh) {
  .journey.is-closed .journey__stage {
    height: 128svh;
  }

  .journey.is-closed > .hero {
    margin-top: -128svh;
  }
}

/* -----------------------------
   Strip under Sobre mí (.about__strip, home.css)
----------------------------- */
.about__strip .sys-net {
  inset: 0;
  width: 100%;
  height: 100%;
}

/* -----------------------------
   Divider: a band between two sections (Trabajos / Servicios)
----------------------------- */
.sys-divider {
  position: relative;
  z-index: 1;
  height: 200px;
  margin-bottom: var(--space-8);   /* same as the space above it (.section padding) */
  touch-action: pan-y;
}

.sys-divider .sys-net {
  inset: 0;
  width: 100%;
  height: 100%;
}

@media (min-width: 900px) {
  .sys-divider {
    height: 320px;
    margin-bottom: var(--space-9);
  }
}
