/* ═══════════════════════════════════════════════════════════
   IASOFTLAB · base — tokens, reset, tipografía, chrome global
   ═══════════════════════════════════════════════════════════ */

:root {
  /* superficie */
  --ink:      #08090b;
  --ink-2:    #0d0f12;
  --ink-3:    #14171b;
  --ink-4:    #1c2025;

  /* tinta */
  --bone:     #ece7de;
  --bone-dim: #b8b3aa;
  --muted:    #85827b;

  /* acento único: reactivo, de laboratorio */
  --acid:     #c6f24e;
  --acid-dim: #8fae35;
  --signal:   #ff5c35;

  --line:      rgba(236, 231, 222, .11);
  --line-soft: rgba(236, 231, 222, .06);

  /* tipografía */
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --mono:  'JetBrains Mono', ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Consolas, monospace;
  --sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* escala de espaciado (4px) */
  --s1: .25rem;  --s2: .5rem;   --s3: .75rem;  --s4: 1rem;
  --s5: 1.5rem;  --s6: 2rem;    --s7: 3rem;    --s8: 4rem;
  --s9: 6rem;    --s10: 8rem;

  --radius:    2px;
  --radius-lg: 4px;

  --shell: 1280px;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);

  --ease: cubic-bezier(.22, .68, .32, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-size: clamp(.95rem, .35vw + .86rem, 1.0625rem);
  line-height: 1.6;
  letter-spacing: .002em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* trama sutil de laboratorio, no un gradiente decorativo */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 78%);
  opacity: .55;
}

main { position: relative; z-index: 1; }

img, svg, canvas { display: block; max-width: 100%; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.015em;
  line-height: 1.04;
  margin: 0;
  text-wrap: balance;
}
h1 em, h2 em, h3 em { font-style: italic; color: var(--acid); }

p { margin: 0; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--acid); color: var(--ink); }

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

/* ── utilidades ───────────────────────────────────────────── */

.mono {
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.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: -100px; left: var(--s4); z-index: 999;
  background: var(--acid); color: var(--ink);
  padding: var(--s3) var(--s5); font-family: var(--mono); font-size: .75rem;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: var(--s4); }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s3);
  font-family: var(--mono); font-size: .6875rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--bone-dim);
}
.pulse {
  width: 6px; height: 6px; background: var(--acid);
  border-radius: 50%; flex: none;
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1;  box-shadow: 0 0 0 0 rgba(198, 242, 78, .45); }
  50%      { opacity: .6; box-shadow: 0 0 0 7px rgba(198, 242, 78, 0); }
}

/* ── botones ──────────────────────────────────────────────── */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--bone);
  --btn-bd: var(--line);
  position: relative;
  display: inline-flex; align-items: center; gap: var(--s3);
  padding: var(--s4) var(--s6);
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--btn-bd); border-radius: var(--radius);
  font-family: var(--mono); font-size: .75rem;
  letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; overflow: hidden;
  transition: color .35s var(--ease), border-color .35s var(--ease), background-color .35s var(--ease);
}
.btn::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: var(--acid);
  transform: translateY(101%);
  transition: transform .45s var(--ease-out);
}
.btn > * { position: relative; }
.btn:hover::after { transform: translateY(0); }
.btn:hover { color: var(--ink); border-color: var(--acid); }

.btn--solid { --btn-bg: var(--acid); --btn-fg: var(--ink); --btn-bd: var(--acid); }
.btn--solid::after { background: var(--bone); }
.btn--solid:hover { color: var(--ink); border-color: var(--bone); }

.btn--ghost:hover { background: transparent; }
.btn--sm { padding: var(--s2) var(--s4); font-size: .6875rem; }

.linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--mono); font-size: .6875rem;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--bone-dim);
  border-bottom: 1px solid var(--line);
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.linkish:hover { color: var(--acid); border-color: var(--acid); }

.stepper {
  width: 44px; height: 44px;
  background: transparent; border: 1px solid var(--line);
  border-radius: 50%; color: var(--bone); cursor: pointer;
  display: grid; place-items: center;
  transition: border-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.stepper:hover { border-color: var(--acid); color: var(--acid); transform: scale(1.06); }
.stepper__count { font-family: var(--mono); font-size: .75rem; color: var(--muted); letter-spacing: .12em; }

/* ── boot ─────────────────────────────────────────────────── */

.boot {
  position: fixed; inset: 0; z-index: 900;
  background: var(--ink);
  display: grid; place-items: center;
  transition: opacity .6s var(--ease), visibility .6s;
}
.boot.is-done { opacity: 0; visibility: hidden; }
.boot__inner { width: min(320px, 70vw); text-align: left; }
.boot__mark {
  font-family: var(--serif); font-size: 2.5rem; line-height: 1;
  letter-spacing: -.02em; margin-bottom: var(--s5);
}
.boot__mark span { color: var(--acid); }
.boot__log {
  font-family: var(--mono); font-size: .6875rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: var(--s3); min-height: 1.2em;
}
.boot__bar { height: 1px; background: var(--line); overflow: hidden; }
.boot__bar i {
  display: block; height: 100%; width: 0;
  background: var(--acid);
  transition: width .3s linear;
}

/* ── cursor ───────────────────────────────────────────────── */

.cursor { display: none; }
@media (pointer: fine) {
  .cursor {
    display: block; position: fixed; top: 0; left: 0;
    z-index: 800; pointer-events: none;
    mix-blend-mode: difference;
  }
  .cursor__ring, .cursor__dot {
    position: absolute; border-radius: 50%;
    transform: translate(-50%, -50%);
  }
  .cursor__ring {
    width: 34px; height: 34px;
    border: 1px solid rgba(236, 231, 222, .7);
    transition: width .3s var(--ease), height .3s var(--ease), background-color .3s var(--ease);
  }
  .cursor__dot { width: 4px; height: 4px; background: var(--bone); }
  .cursor__label {
    position: absolute;
    transform: translate(-50%, 26px);
    font-family: var(--mono); font-size: .625rem;
    letter-spacing: .12em; text-transform: uppercase;
    white-space: nowrap; opacity: 0;
    transition: opacity .25s var(--ease);
  }
  .cursor.is-active .cursor__ring { width: 62px; height: 62px; background: rgba(236, 231, 222, .12); }
  .cursor.is-active .cursor__label { opacity: 1; }
}

/* ── riel de progreso ─────────────────────────────────────── */

.scroll-rail {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 700; background: transparent;
}
.scroll-rail i {
  display: block; height: 100%; width: 0;
  background: var(--acid);
  box-shadow: 0 0 12px rgba(198, 242, 78, .5);
}

/* ── nav ──────────────────────────────────────────────────── */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 600;
  display: flex; align-items: center; gap: var(--s5);
  padding: var(--s4) var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background-color .4s var(--ease), border-color .4s var(--ease), padding .4s var(--ease);
}
.nav.is-stuck {
  background: rgba(8, 9, 11, .78);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
  padding-top: var(--s3); padding-bottom: var(--s3);
}

.nav__brand { display: flex; align-items: center; gap: var(--s3); margin-right: auto; }
.nav__glyph {
  width: 14px; height: 14px; flex: none;
  background: var(--acid);
  clip-path: polygon(0 0, 100% 0, 100% 42%, 42% 42%, 42% 100%, 0 100%);
  transition: transform .5s var(--ease-out);
}
.nav__brand:hover .nav__glyph { transform: rotate(90deg); }
.nav__name {
  font-family: var(--mono); font-size: .8125rem;
  letter-spacing: .22em; font-weight: 500;
}

.nav__links { display: flex; gap: var(--s5); }
.nav__links a {
  font-family: var(--mono); font-size: .6875rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--bone-dim);
  display: inline-flex; align-items: baseline; gap: var(--s2);
  padding-bottom: 2px; border-bottom: 1px solid transparent;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.nav__links a:hover { color: var(--bone); }
.nav__links a.is-current { color: var(--acid); border-bottom-color: var(--acid); }
.nav__idx { color: var(--muted); font-size: .5625rem; }
.nav__links a.is-current .nav__idx { color: var(--acid-dim); }

.nav__toggle {
  display: none; width: 40px; height: 40px;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer;
}
.nav__bars { display: grid; gap: 5px; place-items: center; }
.nav__bars i { display: block; width: 16px; height: 1px; background: var(--bone); transition: transform .3s var(--ease); }
.nav__toggle[aria-expanded='true'] .nav__bars i:first-child { transform: translateY(3px) rotate(45deg); }
.nav__toggle[aria-expanded='true'] .nav__bars i:last-child  { transform: translateY(-3px) rotate(-45deg); }

.drawer {
  position: fixed; inset: 0; z-index: 590;
  background: var(--ink);
  display: flex; flex-direction: column; justify-content: center;
  gap: var(--s5); padding: var(--gutter);
}
.drawer[hidden] { display: none; }
.drawer a {
  font-family: var(--serif); font-size: clamp(2rem, 9vw, 3rem);
  line-height: 1; border-bottom: 1px solid var(--line); padding-bottom: var(--s4);
}
.drawer a:hover { color: var(--acid); }

@media (max-width: 900px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: grid; place-items: center; }
}

/* ── revelado al scroll ───────────────────────────────────── */

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* ── footer ───────────────────────────────────────────────── */

.footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--line);
  padding: var(--s6) var(--gutter);
}
.footer__row {
  max-width: var(--shell); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between;
}
.footer__row a:hover { color: var(--acid); }

/* ── dedos, no mouse ──────────────────────────────────────
   Sin hover que valga y con targets de al menos 40px. */

@media (pointer: coarse) {
  .btn { padding: var(--s4) var(--s5); min-height: 48px; }
  .btn--sm { min-height: 40px; }
  .btn:hover::after { transform: translateY(101%); }
  .btn:hover { color: var(--btn-fg); border-color: var(--btn-bd); }
  .linkish { padding: var(--s2) 0; }
  .stepper { width: 48px; height: 48px; }
}

/* ── movimiento reducido ──────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .cursor { display: none; }
}
