/* ============================================================
   ISC-24 — Sistema de diseño (dark tech)
   Direcciones via [data-theme]: circuito | atomo | editorial
   ============================================================ */

:root {
  /* type */
  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* palette — default: CIRCUITO */
  --bg:        #070b14;
  --bg-2:      #0a1020;
  --surface:   rgba(255,255,255,0.025);
  --surface-2: rgba(255,255,255,0.05);
  --line:      rgba(255,255,255,0.09);
  --line-2:    rgba(255,255,255,0.16);
  --text:      #eaf1fb;
  --muted:     #93a3bd;
  --accent:    #2ee6ff;
  --accent-2:  #2f6bff;
  --accent-ink:#04121a;
  --glow:      0 0 48px rgba(46,230,255,0.28);
  --grid-op:   0.55;
  --orb-op:    0.5;

  --radius:    16px;
  --radius-sm: 11px;
  --maxw:      1200px;
  --ease:      cubic-bezier(.2,.7,.2,1);
}

[data-theme="atomo"] {
  --bg:        #04050e;
  --bg-2:      #090717;
  --text:      #f0ecff;
  --muted:     #a59bc7;
  --accent:    #36e0f0;
  --accent-2:  #8b5cff;
  --accent-ink:#0b0420;
  --glow:      0 0 64px rgba(139,92,255,0.34);
  --grid-op:   0.3;
  --orb-op:    0.85;
  --font-head: 'Sora', system-ui, sans-serif;
}

[data-theme="editorial"] {
  --bg:        #0a0f1a;
  --bg-2:      #0e1422;
  --text:      #eef2f8;
  --muted:     #8fa0b8;
  --accent:    #5b8cff;
  --accent-2:  #5b8cff;
  --accent-ink:#04101f;
  --glow:      0 0 30px rgba(91,140,255,0.18);
  --grid-op:   0.22;
  --orb-op:    0.35;
  --font-head: 'Outfit', system-ui, sans-serif;
  --radius:    10px;
  --radius-sm: 8px;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  letter-spacing: 0.1px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ambient background field */
body::before {
  content: "";
  position: fixed; inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 78% -8%, color-mix(in oklab, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(800px 620px at 8% 12%, color-mix(in oklab, var(--accent-2) 15%, transparent), transparent 58%),
    var(--bg);
  transition: background .5s var(--ease);
}
body::after {
  content: "";
  position: fixed; inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 78%);
          mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 78%);
  opacity: var(--grid-op);
  transition: opacity .5s var(--ease);
}

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
section { position: relative; padding: clamp(72px, 11vw, 132px) 0; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: currentColor; opacity: .7;
}
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(30px, 4.2vw, 50px); }
.section-head p { color: var(--muted); font-size: 18px; margin-top: 18px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 100px;
  font-weight: 600; font-size: 15px; letter-spacing: 0.2px;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s, color .25s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: var(--glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 64px color-mix(in oklab, var(--accent) 45%, transparent); }
.btn-ghost { border-color: var(--line-2); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- nav ---------- */
header.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
header.nav.scrolled {
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .mark { width: 40px; height: 40px; filter: drop-shadow(0 0 14px color-mix(in oklab, var(--accent) 40%, transparent)); }
.brand .wm { display: flex; flex-direction: column; line-height: 1.05; }
.brand .wm b { font-family: var(--font-head); font-weight: 700; font-size: 19px; letter-spacing: 0.5px; }
.brand .wm span { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.24em; color: var(--muted); text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a { font-size: 14.5px; color: var(--muted); transition: color .2s; position: relative; }
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1.5px; width: 0; background: var(--accent); transition: width .25s var(--ease);
}
.nav-links a:hover::after { width: 100%; }
.nav-cta { display: flex; align-items: center; gap: 16px; }
.burger { display: none; background: none; border: 0; color: var(--text); padding: 8px; }

/* ---------- hero ---------- */
.hero { padding-top: 150px; padding-bottom: clamp(60px, 9vw, 110px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 40px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 8px; border-radius: 100px;
  border: 1px solid var(--line-2); background: var(--surface);
  font-size: 13px; color: var(--muted); margin-bottom: 26px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.hero h1 { font-size: clamp(38px, 6vw, 74px); font-weight: 700; }
.hero h1 .grad { background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: clamp(17px, 2vw, 20px); color: var(--muted); margin: 26px 0 36px; max-width: 540px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-meta { display: flex; gap: 30px; margin-top: 44px; flex-wrap: wrap; }
.hero-meta .m b { font-family: var(--font-head); font-size: 26px; font-weight: 700; display: block; }
.hero-meta .m span { font-size: 13px; color: var(--muted); }

/* atom visual */
.atom-stage { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.atom { width: min(100%, 460px); aspect-ratio: 1; position: relative; }
.atom .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.6px solid color-mix(in oklab, var(--accent) 55%, transparent);
  opacity: var(--orb-op);
}
.atom .ring.r1 { transform: rotateZ(0deg) rotateX(72deg); animation: spin 9s linear infinite; }
.atom .ring.r2 { transform: rotateZ(60deg) rotateX(72deg); border-color: color-mix(in oklab, var(--accent-2) 60%, transparent); animation: spin 13s linear infinite reverse; }
.atom .ring.r3 { transform: rotateZ(120deg) rotateX(72deg); animation: spin 16s linear infinite; }
.atom .electron { position: absolute; top: 50%; left: -5px; width: 11px; height: 11px; margin-top: -5.5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px 2px var(--accent); }
.atom .ring.r2 .electron { background: var(--accent-2); box-shadow: 0 0 14px 2px var(--accent-2); }
@keyframes spin { to { transform: rotateZ(var(--rz,0deg)) rotateX(72deg) rotateY(360deg); } }
.atom .nucleus {
  position: absolute; inset: 0; margin: auto; width: 120px; height: 120px;
  display: grid; place-items: center;
}
.atom .nucleus::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--accent) 55%, transparent), transparent 70%);
  filter: blur(8px); animation: pulse 4s var(--ease) infinite;
}
.atom .nucleus img { width: 96px; position: relative; z-index: 1; filter: drop-shadow(0 0 18px color-mix(in oklab, var(--accent) 60%, transparent)); }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.12); opacity: 1; } }

/* ---------- stats strip ---------- */
.stats { padding-top: 0; }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stat { background: var(--bg-2); padding: 32px 28px; }
.stat b { font-family: var(--font-head); font-size: clamp(32px, 4vw, 46px); font-weight: 700; display: block; line-height: 1; }
.stat b i { font-style: normal; color: var(--accent); }
.stat span { color: var(--muted); font-size: 14.5px; display: block; margin-top: 10px; }

/* ---------- services ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.svc {
  position: relative; padding: 28px 24px 26px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), transparent);
  border: 1px solid var(--line); overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s, background .35s;
}
.svc::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, color-mix(in oklab, var(--accent) 60%, transparent), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s;
}
.svc:hover { transform: translateY(-6px); border-color: transparent; background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.svc:hover::before { opacity: 1; }
.svc .ico {
  width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in oklab, var(--accent) 12%, var(--bg-2));
  border: 1px solid var(--line-2); margin-bottom: 20px; color: var(--accent);
}
.svc .ico svg { width: 25px; height: 25px; }
.svc h3 { font-size: 18.5px; margin-bottom: 9px; }
.svc p { color: var(--muted); font-size: 14.5px; }

/* ---------- tech stack ---------- */
.stack { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stack-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 14px; }
.chip {
  aspect-ratio: 1; display: grid; place-items: center; gap: 8px;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); transition: transform .3s var(--ease), border-color .3s, background .3s;
  padding: 14px;
}
.chip img { width: 38px; height: 38px; opacity: .82; transition: opacity .3s, transform .3s; }
.chip span { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); letter-spacing: .02em; text-align: center; }
.chip:hover { transform: translateY(-4px); border-color: var(--line-2); background: var(--surface-2); }
.chip:hover img { opacity: 1; transform: scale(1.06); }

/* ---------- process ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: s; }
.step { position: relative; padding-top: 30px; }
.step::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line);
}
.step .num {
  font-family: var(--font-mono); font-size: 13px; color: var(--accent);
  display: inline-block; padding-top: 18px; margin-bottom: 14px;
}
.step h4 { font-size: 19px; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 14.5px; }
.step.active::before { background: linear-gradient(90deg, var(--accent), transparent); height: 2px; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 0.92fr; gap: 56px; align-items: center; }
.about p { color: var(--muted); font-size: 17px; margin-bottom: 18px; }
.about p strong { color: var(--text); font-weight: 600; }
.about-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 48px; }
.feat { display: flex; gap: 13px; align-items: flex-start; }
.feat .fi { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; background: color-mix(in oklab, var(--accent) 12%, var(--bg-2)); color: var(--accent); border: 1px solid var(--line); }
.feat .fi svg { width: 19px; height: 19px; }
.feat b { font-family: var(--font-head); font-size: 15.5px; display: block; }
.feat span { font-size: 13.5px; color: var(--muted); }
.about-visual {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); aspect-ratio: 4/5; background: var(--bg-2);
}
.about-visual image-slot { width: 100%; height: 100%; }
.about-visual .ov {
  position: absolute; left: 22px; bottom: 22px; right: 22px;
  padding: 18px 20px; border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--bg) 60%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--line-2);
}
.about-visual .ov b { font-family: var(--font-head); display: block; font-size: 15px; }
.about-visual .ov span { font-size: 13px; color: var(--muted); }

/* ---------- contact ---------- */
.contact { background: var(--bg-2); border-top: 1px solid var(--line); }
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 56px; }
.contact-info h2 { font-size: clamp(30px, 4vw, 46px); margin-bottom: 18px; }
.contact-info > p { color: var(--muted); font-size: 18px; margin-bottom: 36px; }
.cinfo-list { display: flex; flex-direction: column; gap: 14px; }
.cinfo {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .25s, background .25s;
}
.cinfo:hover { border-color: var(--line-2); background: var(--surface-2); }
.cinfo .ci { width: 42px; height: 42px; border-radius: 11px; flex: none; display: grid; place-items: center; background: color-mix(in oklab, var(--accent) 12%, var(--bg-2)); color: var(--accent); border: 1px solid var(--line); }
.cinfo .ci svg { width: 19px; height: 19px; }
.cinfo b { font-family: var(--font-head); font-size: 14px; display: block; }
.cinfo span { font-size: 14.5px; color: var(--muted); }

form.cform {
  padding: 34px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), transparent);
}
.field { margin-bottom: 20px; }
.field label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 9px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--line-2); color: var(--text);
  font-family: var(--font-body); font-size: 15.5px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
form.cform .btn-primary { width: 100%; justify-content: center; margin-top: 6px; }
.form-note { font-size: 12.5px; color: var(--muted); margin-top: 16px; text-align: center; }

/* ---------- footer ---------- */
footer.foot { border-top: 1px solid var(--line); padding: 60px 0 34px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.foot p { color: var(--muted); font-size: 14.5px; margin-top: 18px; max-width: 320px; }
.foot h5 { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.foot ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.foot ul a { font-size: 14.5px; color: var(--text); opacity: .82; transition: opacity .2s, color .2s; }
.foot ul a:hover { opacity: 1; color: var(--accent); }
.foot-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 26px; border-top: 1px solid var(--line); flex-wrap: wrap; gap: 16px; }
.foot-bottom span { font-size: 13px; color: var(--muted); }
.socials { display: flex; gap: 10px; }
.socials a { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); transition: all .25s; }
.socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.socials svg { width: 17px; height: 17px; }

/* ---------- theme switcher ---------- */
.switcher {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.switcher .panel {
  display: flex; gap: 6px; padding: 6px; border-radius: 100px;
  background: color-mix(in oklab, var(--bg) 80%, transparent); backdrop-filter: blur(14px);
  border: 1px solid var(--line-2); box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.switcher button {
  border: 0; background: transparent; color: var(--muted);
  padding: 9px 16px; border-radius: 100px; font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .03em; transition: all .25s;
}
.switcher button.on { background: linear-gradient(100deg, var(--accent), var(--accent-2)); color: var(--accent-ink); }
.switcher button:not(.on):hover { color: var(--text); }
.switcher .lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding-right: 6px; }

/* ---------- reveal (transform-only: stays visible, just slides up) ---------- */
.reveal { transform: translateY(22px); transition: transform .7s var(--ease); will-change: transform; }
.reveal.in { transform: none; }
.reveal[data-d="1"] { transition-delay: .07s; }
.reveal[data-d="2"] { transition-delay: .14s; }
.reveal[data-d="3"] { transition-delay: .21s; }
.reveal[data-d="4"] { transition-delay: .28s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { transform: none; transition: none; }
  .atom .ring, .atom .nucleus::before { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 10px; }
  .atom-stage { order: -1; max-width: 380px; margin: 0 auto; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .about-features { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .stack-grid { grid-template-columns: repeat(6, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .svc-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .burger { display: inline-flex; }
  .nav-cta .btn-ghost { display: none; }
  .svc-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stack-grid { grid-template-columns: repeat(4, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; gap: 32px; }
  .switcher .lbl { display: none; }
  .hero-meta { gap: 22px; }
  .hero { padding-top: 100px; }
  .section-head { margin-bottom: 40px; }
}

@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .hero { padding-top: 88px; }
  .section-head { margin-bottom: 32px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .about-features { grid-template-columns: 1fr; }
  form.cform { padding: 22px 16px; }
}

/* mobile menu */
.mmenu {
  position: fixed; inset: 0; z-index: 49;
  background: color-mix(in oklab, var(--bg) 96%, transparent); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.mmenu.open { opacity: 1; pointer-events: auto; }
.mmenu a { font-family: var(--font-head); font-size: 26px; padding: 12px; color: var(--text); }
.mmenu a:hover { color: var(--accent); }
