/* ─────────────────────────────────────────────────────────────
   COMPONENT STYLES — Nav, Hero, Services, Modal
   Anchored to logo palette (ink + blue + violet gradient)
   ───────────────────────────────────────────────────────────── */

/* ─── NAV ─── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: padding .4s var(--ease), background .4s var(--ease),
              backdrop-filter .4s var(--ease), border .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  padding: 10px 0;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
}
.brand { display: inline-flex; align-items: center; height: 52px; }
.brand-logo {
  height: 46px;
  width: auto;
  display: block;
  /* light/dark-aware: invert only the ink portion via filter trick */
  transition: filter .4s var(--ease);
}
[data-theme="dark"] .brand-logo {
  /* invert only the dark text, keep the gradient marks roughly intact */
  filter: invert(1) hue-rotate(180deg) brightness(1.05);
}

.nav-links {
  display: flex;
  gap: 30px;
  justify-content: center;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
}
.nav-links a {
  position: relative;
  padding: 6px 2px;
  color: var(--ink-soft);
  transition: color .25s var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 2px;
  background: var(--brand-grad);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .35s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  color: var(--ink-soft);
  transition: border-color .3s var(--ease), color .3s var(--ease),
              transform .3s var(--ease), background .3s var(--ease);
}
.theme-toggle:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: rotate(20deg);
}
.nav-cta { padding: 12px 18px; font-size: 13px; }

@media (max-width: 920px) {
  .nav-links { display: none; }
  .nav-inner { grid-template-columns: auto 1fr auto; }
  .nav-cta { display: none; }
}

/* ─── HERO ─── */
.hero {
  position: relative;
  padding-top: clamp(140px, 18vh, 200px);
  padding-bottom: 0;
  overflow: hidden;
  isolation: isolate;
}

.hero-inner {
  display: grid;
  gap: clamp(40px, 6vw, 80px);
  position: relative;
  z-index: 2;
}

/* — Background scene (aurora + grid) — */
.hero-scene {
  position: absolute;
  inset: -10% 0 0 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-blob {
  position: absolute;
  width: 90vmax;
  height: 90vmax;
  top: -20vmax;
  right: -25vmax;
  background:
    radial-gradient(circle at 30% 30%, rgba(83, 114, 253, .55) 0%, transparent 45%),
    radial-gradient(circle at 70% 60%, rgba(203, 107, 230, .55) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(138, 111, 242, .4) 0%, transparent 60%);
  filter: blur(120px) saturate(140%);
  opacity: 0.5;
  will-change: transform;
}
[data-theme="dark"] .hero-blob { opacity: 0.7; }

.hero-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in oklab, var(--ink) 6%, transparent) 1px, transparent 1px);
  background-size: clamp(80px, 8vw, 120px) 100%;
  mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 75%);
  opacity: .8;
}

/* — Meta strip — */
.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 14px;
}
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 13px;
}
.hero-chip-flag {
  display: inline-flex;
  border-radius: 3px;
  overflow: hidden;
  line-height: 0;
  border: 1px solid var(--line);
}
.hero-chip-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--blue) 22%, transparent);
  animation: pulseDot 2.4s var(--ease) infinite;
  margin-left: 4px;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in oklab, var(--blue) 22%, transparent); }
  50%      { box-shadow: 0 0 0 8px color-mix(in oklab, var(--blue) 8%, transparent); }
}

.hero-meta-right { display: inline-flex; gap: 10px; color: var(--muted); }

/* — Headline — */
.hero-headline {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(56px, 11vw, 168px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-weight: 600;
  color: var(--ink);
  font-optical-sizing: auto;
}
.hero-line {
  display: block;
  position: relative;
}
.hero-line--accent {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 44px);
}
.hero-line .grad-text {
  font-weight: 700;
  letter-spacing: -0.05em;
}
.hero-line .serif {
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hero-mark {
  display: inline-flex;
  flex-shrink: 0;
  animation: floatMark 6s var(--ease) infinite;
}
@keyframes floatMark {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-8px) rotate(4deg); }
}

/* — Subtitle + CTAs — */
.hero-foot {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  align-items: end;
}
.hero-sub {
  font-size: clamp(18px, 1.45vw, 22px);
  line-height: 1.45;
  max-width: 62ch;
  margin: 0;
  color: var(--ink-soft);
  font-weight: 400;
}
.hero-sub-aside {
  font-family: var(--serif);
  font-style: italic;
  color: var(--violet-deep);
}
.hero-ctas {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* — Metric strip — */
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 8px;
}
.hero-metric {
  padding: 28px 24px;
  border-right: 1px solid var(--line);
  position: relative;
  text-align: left;
}
.hero-metric:last-child { border-right: 0; }
.hero-metric-n {
  font-family: var(--display);
  font-size: clamp(40px, 4.4vw, 64px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.hero-metric-l {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.hero-metric-cta {
  background: var(--ink-deep);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  transition: background .4s var(--ease);
}
.hero-metric-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--brand-grad);
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.hero-metric-cta:hover::before { opacity: 1; }
.hero-metric-cta > * { position: relative; }
.hero-metric-cta-label { font-weight: 500; font-size: 15px; line-height: 1.2; max-width: 14ch; }
.hero-metric-cta-arrow {
  font-size: 28px;
  transition: transform .4s var(--ease);
}
.hero-metric-cta:hover .hero-metric-cta-arrow { transform: translate(4px, -4px); }

@media (max-width: 920px) {
  .hero-foot { grid-template-columns: 1fr; }
  .hero-ctas { justify-content: flex-start; }
  .hero-metrics { grid-template-columns: repeat(2, 1fr); }
  .hero-metric { border-bottom: 1px solid var(--line); }
  .hero-metric:nth-child(2n) { border-right: 0; }
  .hero-metric:nth-last-child(-n+2) { border-bottom: 0; }
}

/* hero marquee */
.hero-marquee {
  margin-top: 72px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  padding: 22px 0;
  background: var(--bg);
  position: relative;
  z-index: 2;
}
.hero-marquee .marquee-row {
  display: flex;
  align-items: center;
  gap: 32px;
  padding-right: 32px;
  font-size: clamp(22px, 2.6vw, 36px);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.hero-marquee .marquee-item { white-space: nowrap; }
.hero-marquee .marquee-sep { display: inline-flex; }

/* ─── SERVICIOS ─── */
.services {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  position: relative;
  background: var(--bg);
  overflow: hidden;
}

.services-head {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: end;
  margin-bottom: clamp(40px, 6vw, 80px);
}
.services-head-left { display: grid; gap: 20px; }
.services-title {
  font-family: var(--display);
  font-size: clamp(40px, 6vw, 88px);
  line-height: 0.95;
  letter-spacing: -0.045em;
  margin: 0;
  font-weight: 600;
  color: var(--ink);
  max-width: 14ch;
}
.services-title .grad-text {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.services-sub {
  font-size: clamp(16px, 1.2vw, 19px);
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 0;
  line-height: 1.5;
}
.services-sub strong { font-weight: 600; color: var(--ink); }

/* Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 1100px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px)  {
  .services-grid { grid-template-columns: 1fr; }
  .services-head { grid-template-columns: 1fr; align-items: start; gap: 24px; }
}

/* Card */
.service-card {
  position: relative;
  text-align: left;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  display: grid;
  gap: 16px;
  overflow: hidden;
  transition: border-color .4s var(--ease), box-shadow .4s var(--ease),
              transform .25s var(--ease);
  isolation: isolate;
  cursor: pointer;
}
.service-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 30px 60px -30px rgba(83, 114, 253, .25);
}

.service-card-spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%),
              color-mix(in oklab, var(--blue) 14%, transparent) 0%, transparent 40%);
  opacity: 0;
  transition: opacity .4s var(--ease);
  z-index: -1;
}
.service-card--violet .service-card-spotlight {
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%),
              color-mix(in oklab, var(--violet) 14%, transparent) 0%, transparent 40%);
}
.service-card:hover .service-card-spotlight { opacity: 1; }

.service-card-inner {
  display: grid;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.service-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.service-card-n {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.service-card-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-grad-soft);
  color: var(--violet-deep);
}
[data-theme="dark"] .service-card-tag { color: var(--violet-glow); }

.service-card-visual {
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-warm);
  border: 1px solid var(--line-soft, var(--line));
  aspect-ratio: 16 / 9;
}
.service-card-visual .vis { display: block; width: 100%; height: 100%; }

.service-card-name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  line-height: 1.15;
}
.service-card-pitch {
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0;
}
.service-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-top: 4px;
}
.service-card:hover .arrow { transform: translateX(4px); }
.service-card-cta .arrow {
  display: inline-block;
  transition: transform .35s var(--ease);
  color: var(--violet-deep);
}

/* ─── MODAL ─── */
.svc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: color-mix(in oklab, var(--ink-deep) 60%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: modalIn .4s var(--ease);
}
@keyframes modalIn {
  from { opacity: 0; backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); }
  to   { opacity: 1; }
}
.svc-modal {
  position: relative;
  width: min(900px, 100%);
  max-height: 88vh;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.45);
  animation: modalPop .55s var(--ease);
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}
.svc-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 2;
  width: 40px; height: 40px;
  border-radius: 999px;
  display: grid; place-items: center;
  background: var(--bg-tint);
  color: var(--ink);
  border: 1px solid var(--line);
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.svc-modal-close:hover {
  background: var(--ink-deep);
  color: #FFFFFF;
  transform: rotate(90deg);
}
.svc-modal-inner {
  overflow-y: auto;
  padding: clamp(28px, 4vw, 56px);
}
.svc-modal-head { margin-bottom: 24px; max-width: 32ch; }
.svc-modal-title {
  font-family: var(--display);
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 12px 0 0;
  font-weight: 600;
  color: var(--ink);
}
.svc-modal-visual {
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 7;
  margin-bottom: 28px;
}
.svc-modal-visual .vis { width: 100%; height: 100%; display: block; }

.svc-modal-lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.4;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin: 0 0 16px;
  max-width: 58ch;
}
.svc-modal-body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 32px;
  max-width: 64ch;
}

.svc-modal-bullets ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.svc-modal-bullets li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink-soft);
  animation: bulletIn .5s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 60ms + 200ms);
}
.svc-modal-bullets li:last-child { border-bottom: 1px solid var(--line); }
@keyframes bulletIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.bullet-tick {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}

.svc-modal-meta {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.svc-modal-meta p {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.svc-modal-cta { display: inline-flex; }
@media (max-width: 680px) { .svc-modal-meta { grid-template-columns: 1fr; } }

/* ─── tweaks panel ─── */
.tweaks-panel { z-index: 200; }
