/* ============================================================
   ANVERSA — Design tokens
   ============================================================ */
:root {
  --obsidian: #0a0a0b;
  --carbon: #17181b;
  --graphite: #2a2c31;
  --titanium: #b9bdc4;
  --porcelain: #f2f3f5;
  --violet: #6a6aff;
  --violet-dim: rgba(106, 106, 255, 0.35);

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --container: 1180px;
  --pad: clamp(24px, 6vw, 96px);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  background: var(--obsidian);
  color: var(--porcelain);
  font-family: var(--font-body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

::selection { background: var(--violet); color: var(--porcelain); }

/* focus visibility */
a:focus-visible, button:focus-visible {
  outline: 1.5px solid var(--violet);
  outline-offset: 4px;
}

/* ============================================================
   Texture layers
   ============================================================ */
.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 480px; height: 480px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--violet-dim) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  will-change: transform;
}
.cursor-glow.active { opacity: 0.5; }

/* ============================================================
   Reveal animations (toggled via JS .in-view)
   ============================================================ */
.reveal-up, .reveal-fade, .reveal-line, .reveal-word {
  opacity: 0;
}
.reveal-up { transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal-fade { transform: scale(0.97); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.reveal-line { transform: translateY(10px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal-word { display: inline-block; transform: translateY(0.5em); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }

.reveal-up.in-view, .reveal-fade.in-view, .reveal-line.in-view, .reveal-word.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ============================================================
   Layout helpers
   ============================================================ */
section {
  position: relative;
  padding: 140px var(--pad);
  max-width: var(--container);
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.18em;
  color: var(--violet);
  text-transform: uppercase;
  margin: 0 0 28px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 20px;
  max-width: 720px;
}

.section-lead {
  color: var(--titanium);
  font-size: 17px;
  line-height: 1.7;
  max-width: 560px;
  margin: 0 0 64px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 500;
  border-radius: 100px;
  border: 1px solid transparent;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
  white-space: nowrap;
}
.btn--primary {
  background: var(--porcelain);
  color: var(--obsidian);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--violet-dim);
  background: var(--violet);
  color: var(--porcelain);
}
.btn--ghost {
  border-color: var(--graphite);
  color: var(--porcelain);
  background: transparent;
}
.btn--ghost:hover {
  border-color: var(--violet);
  transform: translateY(-2px);
  background: rgba(106, 106, 255, 0.08);
}
.btn--lg { padding: 18px 36px; font-size: 16px; }

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--pad);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), padding 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}
.nav.scrolled {
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--graphite);
  padding-top: 14px;
  padding-bottom: 14px;
}
.nav__brand { display: flex; align-items: center; }
.nav__wordmark { height: 15px; width: auto; }

.nav__links {
  display: flex;
  gap: 36px;
  font-size: 13.5px;
  color: var(--titanium);
}
.nav__links a {
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.3s var(--ease);
  position: relative;
}
.nav__links a span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--graphite);
  transition: color 0.3s var(--ease);
}
.nav__links a:hover { color: var(--porcelain); }
.nav__links a:hover span { color: var(--violet); }

.nav__cta { padding: 10px 22px; font-size: 13.5px; }

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav__burger span {
  width: 22px; height: 1px;
  background: var(--porcelain);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav__burger.open span:first-child { transform: translateY(3px) rotate(45deg); }
.nav__burger.open span:last-child { transform: translateY(-3px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--obsidian);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 22px;
  padding: 32px var(--pad);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.5s var(--ease), opacity 0.5s var(--ease);
  pointer-events: none;
}
.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu a {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--porcelain);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 120px;
  padding-bottom: 80px;
  max-width: none;
}

.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(185, 189, 196, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(185, 189, 196, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 40%, black 20%, transparent 75%);
  z-index: 0;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 760px;
}

.hero .eyebrow { margin-bottom: 8px; }

.hero__logo-wrap {
  position: relative;
  width: min(260px, 55vw);
  margin: 18px 0 26px;
  transform-style: preserve-3d;
  perspective: 800px;
}
.hero__logo {
  width: 100%;
  height: auto;
  will-change: transform;
  transition: transform 0.2s ease-out;
  filter: drop-shadow(0 20px 50px rgba(0,0,0,0.6));
}
.hero__floor-glow {
  position: absolute;
  left: 50%;
  bottom: 14%;
  width: 70%;
  height: 40px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, var(--violet) 0%, transparent 70%);
  filter: blur(18px);
  opacity: 0.35;
  animation: pulse-glow 4.5s ease-in-out infinite;
  z-index: -1;
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.25; transform: translateX(-50%) scaleX(1); }
  50% { opacity: 0.5; transform: translateX(-50%) scaleX(1.15); }
}

.hero__tagline {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--titanium);
  margin: 0 0 30px;
}

.hero__headline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(42px, 8vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}
.hero__headline em {
  font-style: normal;
  color: var(--violet);
}

.hero__sub {
  color: var(--titanium);
  font-size: 17px;
  line-height: 1.7;
  max-width: 480px;
  margin: 0 0 40px;
}

.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero__scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 36px;
  border: 1px solid var(--graphite);
  border-radius: 20px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
  z-index: 1;
  transition: border-color 0.3s;
}
.hero__scroll:hover { border-color: var(--violet); }
.hero__scroll span {
  width: 3px; height: 6px;
  border-radius: 2px;
  background: var(--titanium);
  animation: scroll-dot 1.8s ease-in-out infinite;
}
@keyframes scroll-dot {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ============================================================
   Marquee
   ============================================================ */
.marquee {
  border-top: 1px solid var(--graphite);
  border-bottom: 1px solid var(--graphite);
  overflow: hidden;
  padding: 22px 0;
  background: var(--carbon);
}
.marquee__track {
  display: flex;
  width: max-content;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--titanium);
  animation: marquee 32s linear infinite;
}
.marquee__track span:nth-child(2n) { color: var(--violet); }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============================================================
   Manifiesto
   ============================================================ */
.manifiesto {
  text-align: left;
  padding-top: 160px;
  padding-bottom: 160px;
}
.blueprint {
  position: absolute;
  top: 50%;
  right: -10%;
  transform: translateY(-50%);
  width: 560px;
  max-width: 60vw;
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}
.blueprint__svg { width: 100%; height: auto; }
.bp-line {
  fill: none;
  stroke: var(--graphite);
}
.bp-solid { stroke: var(--titanium); stroke-width: 1.5; stroke-dasharray: 900; stroke-dashoffset: 900; transition: stroke-dashoffset 2.2s var(--ease); }
.bp-dash { stroke-width: 1; stroke-dasharray: 4 6; stroke-dashoffset: 1400; transition: stroke-dashoffset 2.4s var(--ease) 0.2s; }
.bp-dash-thin { stroke-width: 1; stroke-dasharray: 3 5; stroke-dashoffset: 400; transition: stroke-dashoffset 1.6s var(--ease) 0.5s; }
.bp-tick { stroke: var(--violet); stroke-width: 1; opacity: 0.6; }
.bp-label { fill: var(--titanium); font-family: "JetBrains Mono", monospace; font-size: 14px; }

.blueprint.draw .bp-solid,
.blueprint.draw .bp-dash,
.blueprint.draw .bp-dash-thin {
  stroke-dashoffset: 0;
}

.manifiesto__quote {
  position: relative;
  z-index: 1;
  margin: 0 0 44px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 4.2vw, 44px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  max-width: 820px;
}
.manifiesto__quote .accent { color: var(--violet); }

.manifiesto__sub {
  position: relative;
  z-index: 1;
  color: var(--titanium);
  font-size: 17px;
  line-height: 1.8;
  max-width: 540px;
}

/* ============================================================
   Pilares
   ============================================================ */
.pilares__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--graphite);
  border: 1px solid var(--graphite);
  border-radius: 18px;
  overflow: hidden;
}
.pilar {
  background: var(--carbon);
  padding: 44px 34px;
  transition: background 0.4s var(--ease);
}
.pilar:hover { background: #1c1d21; }
.pilar__mark {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--violet);
  border: 1px solid var(--graphite);
  width: 44px; height: 44px;
  line-height: 42px;
  text-align: center;
  border-radius: 50%;
  margin-bottom: 26px;
}
.pilar h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 12px;
}
.pilar p {
  color: var(--titanium);
  font-size: 15px;
  line-height: 1.7;
  margin: 0;
}

/* ============================================================
   Sistema (cards)
   ============================================================ */
.sistema__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.card {
  position: relative;
  background: var(--carbon);
  border: 1px solid var(--graphite);
  border-radius: 18px;
  padding: 40px;
  overflow: hidden;
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(106,106,255,0.10), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card:hover {
  transform: translateY(-6px);
  border-color: var(--violet);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.card__num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--violet);
  margin-bottom: 22px;
  letter-spacing: 0.1em;
}
.card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 23px;
  margin: 0 0 14px;
}
.card p {
  color: var(--titanium);
  font-size: 15.5px;
  line-height: 1.7;
  margin: 0;
  max-width: 400px;
}

/* ============================================================
   Proceso (timeline)
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 8px;
}
.timeline__line {
  position: absolute;
  left: 27px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(to bottom, var(--graphite), var(--graphite) 92%, transparent);
}
.step {
  position: relative;
  display: flex;
  gap: 32px;
  padding: 0 0 56px;
}
.step:last-child { padding-bottom: 0; }
.step__num {
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1px solid var(--graphite);
  background: var(--obsidian);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--violet);
  z-index: 1;
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.step.in-view .step__num {
  border-color: var(--violet);
  box-shadow: 0 0 24px var(--violet-dim);
}
.step__body h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  margin: 4px 0 10px;
}
.step__body p {
  color: var(--titanium);
  font-size: 15.5px;
  line-height: 1.7;
  max-width: 520px;
  margin: 0;
}

/* ============================================================
   Trabajo
   ============================================================ */
.trabajo__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.work-card {
  background: linear-gradient(160deg, var(--carbon), var(--obsidian));
  border: 1px solid var(--graphite);
  border-radius: 18px;
  padding: 36px 30px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}
.work-card:hover {
  transform: translateY(-6px);
  border-color: var(--violet);
}
.work-card__symbol {
  position: absolute;
  right: -10px;
  top: -20px;
  font-family: var(--font-display);
  font-size: 140px;
  font-weight: 700;
  color: var(--graphite);
  opacity: 0.5;
  line-height: 1;
  transition: color 0.4s var(--ease);
}
.work-card:hover .work-card__symbol { color: var(--violet-dim); }
.work-card__tag {
  position: relative;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--violet);
  text-transform: uppercase;
  margin-bottom: 60px;
}
.work-card h3 {
  position: relative;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 21px;
  margin: 0 0 8px;
}
.work-card p {
  position: relative;
  color: var(--titanium);
  font-size: 14.5px;
  margin: 0;
}

/* ============================================================
   Contacto
   ============================================================ */
.contacto {
  text-align: center;
  padding-top: 160px;
  padding-bottom: 180px;
}
.contacto__glow {
  position: absolute;
  top: 10%;
  left: 50%;
  width: 700px;
  height: 500px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, var(--violet-dim) 0%, transparent 65%);
  filter: blur(40px);
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}
.contacto .eyebrow { display: block; text-align: center; }
.contacto__headline {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
}
.contacto .section-lead { margin-left: auto; margin-right: auto; }
.contacto__actions { position: relative; z-index: 1; margin-bottom: 30px; }
.contacto__socials {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 28px;
  font-size: 14px;
  color: var(--titanium);
}
.contacto__socials a { transition: color 0.3s; }
.contacto__socials a:hover { color: var(--violet); }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--graphite);
  padding: 64px var(--pad) 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.footer__symbol { width: 34px; opacity: 0.9; }
.footer__tagline {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--titanium);
  margin: 0;
}
.footer__links {
  display: flex;
  gap: 26px;
  font-size: 13.5px;
  color: var(--titanium);
  flex-wrap: wrap;
  justify-content: center;
}
.footer__links a { transition: color 0.3s; }
.footer__links a:hover { color: var(--violet); }
.footer__copy {
  font-size: 12.5px;
  color: var(--graphite);
  margin: 12px 0 0;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__cta { display: none; }
  .nav__burger { display: flex; }

  .sistema__grid { grid-template-columns: 1fr; }
  .pilares__grid { grid-template-columns: 1fr; }
  .trabajo__grid { grid-template-columns: 1fr; }

  .blueprint { display: none; }

  section { padding: 100px var(--pad); }
  .hero { padding-top: 140px; }
}

@media (max-width: 520px) {
  .hero__actions { flex-direction: column; width: 100%; }
  .hero__actions .btn { width: 100%; justify-content: center; }
  .step { gap: 20px; }
  .step__num { width: 44px; height: 44px; font-size: 12px; }
  .cursor-glow { display: none; }
}
