/* ============================================================
   AGENTIC PROJECT — fresh/light startup rework
   Swiss neutral type · warm paper + warm black · brand red accent
   ============================================================ */

:root {
  --red: #E8442E;
  --red-ink: #C9301C;
  --paper: #F6F5F2;
  --paper-2: #EFEDE8;
  --ink: #131210;
  --ink-2: #55524C;
  --black: #0B0A09;
  --black-2: #141312;
  --line-d: rgba(246, 245, 242, 0.12);
  --line-l: rgba(19, 18, 16, 0.12);
  --fg: var(--paper);
  --sans: "Helvetica Neue", "Instrument Sans", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Menlo", "Cascadia Code", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --grid-opacity: 1;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--black);
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--red); color: #fff; }

/* ---------- fixed layers ---------- */
#sysgrid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: var(--grid-opacity);
  background-image:
    linear-gradient(rgba(246,245,242,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246,245,242,0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 40%, #000 40%, transparent 100%);
          mask-image: radial-gradient(120% 90% at 50% 40%, #000 40%, transparent 100%);
}
#bg-nodes {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: calc(0.9 * var(--grid-opacity));
  transition: opacity 0.6s ease;
}
#gl {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  width: 100vw; height: 100vh; display: block;
}
body.on-light #bg-nodes { opacity: 0; }

#progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--red); z-index: 60;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  width: min(1240px, calc(100vw - 32px));
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 10px 20px;
  border-radius: 100px;
  background: rgba(11, 10, 9, 0.55);
  border: 1px solid var(--line-d);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  transition: background 0.45s ease, border-color 0.45s ease, color 0.45s ease;
}
body.on-light .nav {
  background: rgba(246, 245, 242, 0.7);
  border-color: var(--line-l);
  color: var(--ink);
}
.logo {
  display: flex; align-items: baseline; gap: 10px;
  text-decoration: none; color: inherit;
}
.logo strong {
  font-size: 21px; font-weight: 700; letter-spacing: -0.03em;
}
.logo strong i { color: var(--red); font-style: normal; }
.logo span {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.2em;
  color: inherit; opacity: 0.55; text-transform: uppercase;
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  font-family: var(--sans); font-size: 14px; letter-spacing: 0.01em;
  font-weight: 500; text-decoration: none; color: inherit;
  opacity: 0.78; padding: 9px 14px; border-radius: 100px;
  transition: opacity 0.2s, background 0.2s;
}
.nav-links a:hover { opacity: 1; background: rgba(232, 68, 46, 0.12); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-size: 15px; letter-spacing: 0.005em;
  font-weight: 600; text-decoration: none; cursor: pointer;
  border-radius: 100px; padding: 15px 28px;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease-out), background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s;
  will-change: transform;
}
.btn-red {
  background: var(--red); color: #fff;
  box-shadow: 0 10px 30px -10px rgba(232, 68, 46, 0.55);
}
.btn-red:hover { background: var(--red-ink); box-shadow: 0 14px 36px -8px rgba(232, 68, 46, 0.65); }
.btn-ghost { border-color: var(--line-d); color: var(--paper); }
.btn-ghost:hover { border-color: var(--paper); }
.btn-sm { padding: 11px 22px; font-size: 14px; }
.on-light .btn-ghost, .light .btn-ghost { border-color: var(--line-l); color: var(--ink); }
.on-light .btn-ghost:hover, .light .btn-ghost:hover { border-color: var(--ink); }
.btn .arr { transition: transform 0.25s var(--ease-out); }
.btn:hover .arr { transform: translateX(4px); }

/* ---------- shared section bits ---------- */
section { position: relative; }
.wrap { width: min(1240px, calc(100vw - 48px)); margin: 0 auto; position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--red);
}
.eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); animation: blink 2.2s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.h-display {
  font-weight: 700; letter-spacing: -0.025em; line-height: 1.02;
  text-wrap: balance;
}
.h-xl { font-size: clamp(50px, 8.6vw, 132px); }
.h-lg { font-size: clamp(38px, 5.2vw, 78px); }
.h-md { font-size: clamp(28px, 3.4vw, 48px); letter-spacing: -0.02em; }
.dot { color: var(--red); }
.lead {
  font-size: clamp(16px, 1.5vw, 20px); line-height: 1.55; color: inherit;
  opacity: 0.72; max-width: 56ch; text-wrap: pretty;
}

/* dark chapters are transparent — the fixed bg + 3D shows through; content sits ABOVE the GL canvas */
.chapter-dark { background: transparent; color: var(--paper); z-index: 2; }
/* light chapters cover the canvas */
.light {
  background: var(--paper); color: var(--ink);
  position: relative; z-index: 2;
  border-radius: 44px;
}

/* ---------- reveals ---------- */
.rv { opacity: 0; transform: translateY(34px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
.rv.in { opacity: 1; transform: none; }
.rv-d1 { transition-delay: 0.08s; } .rv-d2 { transition-delay: 0.16s; }
.rv-d3 { transition-delay: 0.24s; } .rv-d4 { transition-delay: 0.32s; }

/* ============================================================ HERO */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: flex-end; z-index: 2; }
.hero .wrap { padding: 150px 0 0; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 24px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 28px; max-width: 640px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-stats { display: flex; gap: 36px; margin-top: 18px; flex-wrap: wrap; }
.hstat { display: flex; flex-direction: column; gap: 4px; }
.hstat b { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.hstat span { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.5; }
.hero-stage { min-height: 40vh; } /* empty — 3D lives here */

/* ticker */
.ticker {
  margin-top: 56px; border-top: 1px solid var(--line-d); border-bottom: 1px solid var(--line-d);
  overflow: hidden; padding: 13px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track { display: flex; gap: 0; width: max-content; animation: ticker 30s linear infinite; }
.ticker span {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--paper); opacity: 0.6;
  display: inline-flex; align-items: center; gap: 28px; padding-right: 28px; white-space: nowrap;
}
.ticker span::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--red); opacity: 0.9; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ============================================================ PROCESO */
.proceso { z-index: 2; }
.proc-track { height: 420vh; position: relative; }
.proc-sticky {
  position: sticky; top: 0; height: 100vh;
  display: flex; align-items: center;
}
.proc-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: 40px; width: 100%; }
.proc-copy { display: flex; flex-direction: column; gap: 34px; }
.proc-steps { display: flex; flex-direction: column; gap: 6px; counter-reset: step; }
.pstep {
  display: grid; grid-template-columns: 52px 1fr; gap: 18px; align-items: start;
  padding: 18px 20px; border-radius: 20px;
  border: 1px solid transparent;
  opacity: 0.34; transition: opacity 0.5s ease, border-color 0.5s ease, background 0.5s ease, transform 0.5s var(--ease-out);
}
.pstep .num {
  font-family: var(--mono); font-size: 12px; color: var(--red);
  border: 1px solid var(--line-d); border-radius: 12px;
  width: 44px; height: 44px; display: grid; place-items: center;
  transition: background 0.4s, color 0.4s, border-color 0.4s;
}
.pstep h3 { font-size: 21px; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 5px; }
.pstep p { font-size: 14px; line-height: 1.5; opacity: 0.65; }
.pstep .tag {
  display: inline-block; margin-top: 10px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red); border: 1px solid rgba(232, 68, 46, 0.4);
  padding: 5px 10px; border-radius: 6px;
}
.pstep.active {
  opacity: 1; border-color: var(--line-d);
  background: rgba(246, 245, 242, 0.035); transform: translateX(6px);
}
.pstep.active .num { background: var(--red); color: #fff; border-color: var(--red); }

/* ============================================================ SERVICIOS (light) */
.servicios { padding: 110px 0 120px; margin: 0; }
.sec-head { display: flex; flex-direction: column; gap: 18px; margin-bottom: 64px; }
.offers { display: grid; grid-template-columns: 1fr 1.15fr; gap: 20px; align-items: stretch; }
.offer {
  border: 1px solid var(--line-l); border-radius: 28px;
  padding: 42px 40px; display: flex; flex-direction: column; gap: 22px;
  background: #fff;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.offer:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(19, 18, 16, 0.25); }
.offer-flag { display: flex; gap: 8px; flex-wrap: wrap; }
.flag {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 100px; border: 1px solid var(--line-l); color: var(--ink-2);
}
.flag.hot { background: var(--red); border-color: var(--red); color: #fff; }
.offer h3 { font-size: clamp(26px, 2.6vw, 36px); font-weight: 700; letter-spacing: -0.03em; }
.offer > p { font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.offer ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.offer li { display: flex; gap: 12px; font-size: 14.5px; line-height: 1.45; color: var(--ink); }
.offer li::before { content: ""; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin-top: 7px; }
.offer-price { display: flex; gap: 36px; margin-top: auto; padding-top: 10px; }
.price b { display: block; font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.price span { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.offer.featured { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.offer.featured > p { color: rgba(246, 245, 242, 0.65); }
.offer.featured li { color: var(--paper); }
.offer.featured .flag { border-color: var(--line-d); color: rgba(246, 245, 242, 0.7); }
.offer.featured .price span { color: rgba(246, 245, 242, 0.5); }

/* bento stack */
.stack { margin-top: 110px; }
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.tile {
  border: 1px solid var(--line-l); border-radius: 24px; background: #fff;
  padding: 30px 30px 28px; display: flex; flex-direction: column; gap: 12px;
  min-height: 210px; position: relative; overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 24px 48px -28px rgba(19, 18, 16, 0.22); }
.tile-7 { grid-column: span 7; } .tile-5 { grid-column: span 5; }
.tile .t-head { display: flex; justify-content: space-between; align-items: center; }
.tile .t-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.tile .t-live { font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--red); display: flex; align-items: center; gap: 7px; }
.tile .t-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--red); animation: blink 2s infinite; }
.tile h3 { font-size: clamp(20px, 2vw, 27px); font-weight: 700; letter-spacing: -0.025em; margin-top: auto; }
.tile p { font-size: 14px; line-height: 1.55; color: var(--ink-2); max-width: 46ch; }
.tile::after {
  content: ""; position: absolute; inset: auto -20% -55% auto; width: 65%; aspect-ratio: 1;
  border-radius: 50%; background: radial-gradient(closest-side, rgba(232, 68, 46, 0.09), transparent);
}

/* ============================================================ CASOS (dark) */
.casos { z-index: 2; padding: 130px 0 40px; }
.casos-stage { height: 78vh; pointer-events: none; } /* MacBook 3D parks here */
.cases-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.case {
  border: 1px solid var(--line-d); border-radius: 24px;
  background: rgba(11, 10, 9, 0.62); backdrop-filter: blur(8px);
  padding: 34px 32px; display: flex; flex-direction: column; gap: 14px;
}
.case .c-sector { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red); }
.case h3 { font-size: clamp(21px, 2.1vw, 28px); font-weight: 700; letter-spacing: -0.025em; }
.case p { font-size: 14.5px; line-height: 1.55; opacity: 0.62; }
.case .c-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.case .c-tags span {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase;
  border: 1px solid rgba(232, 68, 46, 0.45); color: #ff7b6a;
  border-radius: 7px; padding: 6px 11px;
}

/* metrics */
.metrics { padding: 110px 0 130px; z-index: 2; }
.metrics-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; border-top: 1px solid var(--line-d); }
.metric { padding: 38px 8px 0; border-top: 2px solid transparent; margin-top: -1px; transition: border-color 0.5s; }
.metric.in { border-top-color: var(--red); }
.metric b { font-size: clamp(40px, 5vw, 72px); font-weight: 700; letter-spacing: -0.04em; display: block; font-variant-numeric: tabular-nums; }
.metric b small { font-size: 0.45em; font-weight: 700; letter-spacing: -0.01em; }
.metric span { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.5; display: block; margin-top: 10px; }

/* ============================================================ QUOTE */
.quote { min-height: 88vh; display: grid; place-items: center; z-index: 2; padding: 80px 0; }
.quote blockquote {
  font-size: clamp(30px, 4.6vw, 64px); font-weight: 700; letter-spacing: -0.035em;
  line-height: 1.12; text-align: center; max-width: 18.5em; text-wrap: balance;
}
.quote blockquote .dot { display: inline; }
.quote cite { display: block; margin-top: 34px; font-style: normal; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.45; text-align: center; }

/* ============================================================ CONTACTO (light) */
.contacto { padding: 110px 0 120px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.contact-copy { display: flex; flex-direction: column; gap: 26px; position: sticky; top: 110px; }
.contact-points { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line-l); }
.cpoint { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line-l); align-items: baseline; }
.cpoint i { font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--red); }
.cpoint div b { font-size: 16px; display: block; margin-bottom: 3px; letter-spacing: -0.01em; }
.cpoint div p { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }

.form-card {
  background: #fff; border: 1px solid var(--line-l); border-radius: 28px;
  padding: 40px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 40px 80px -50px rgba(19, 18, 16, 0.3);
}
.form-card label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: -6px; }
.form-card input, .form-card select, .form-card textarea {
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-l); border-radius: 14px;
  padding: 15px 16px; outline: none; width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
  border-color: var(--red); box-shadow: 0 0 0 3px rgba(232, 68, 46, 0.14);
}
.form-card textarea { resize: vertical; min-height: 96px; }
.form-card .btn { justify-content: center; margin-top: 8px; }
.form-foot { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--ink-2); text-align: center; }
.form-card.sent input, .form-card.sent select, .form-card.sent textarea { opacity: 0.45; pointer-events: none; }

/* ============================================================ FOOTER */
footer { position: relative; z-index: 2; padding: 70px 0 40px; color: var(--paper); }
.foot-grid { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; flex-wrap: wrap; border-top: 1px solid var(--line-d); padding-top: 44px; }
.foot-grid .logo strong { font-size: 26px; }
.foot-co { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.45; margin-top: 10px; }
.foot-links { display: flex; gap: 26px; }
.foot-links a { font-family: var(--sans); font-size: 13.5px; font-weight: 500; letter-spacing: 0.01em; color: inherit; opacity: 0.6; text-decoration: none; }
.foot-links a:hover { opacity: 1; }
.foot-legal { margin-top: 40px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; opacity: 0.32; }

/* ============================================================ responsive */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-stage { min-height: 34vh; }
  .proc-cols { grid-template-columns: 1fr; }
  .offers { grid-template-columns: 1fr; }
  .tile-7, .tile-5 { grid-column: span 12; }
  .cases-grid { grid-template-columns: 1fr; }
  .casos-stage { height: 60vh; }
  .metrics-row { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-copy { position: static; }
  .nav-links { display: none; }
}
@media (max-width: 620px) {
  .form-card { padding: 26px 22px; }
  .light { border-radius: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
  .rv { opacity: 1; transform: none; transition: none; }
  .eyebrow::before, .tile .t-live::before { animation: none; }
}
