/* ============================================================
   FERSAMEDIA — Sistema visual
   Lienzo negro · índigo eléctrico sólo en el CTA · Raleway
   ============================================================ */

@font-face {
  font-family: 'Raleway';
  src: url('fonts/Raleway-VariableFont_wght.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Raleway';
  src: url('fonts/Raleway-Italic-VariableFont_wght.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Colors */
  --color-electric-indigo: #1500ff;
  --color-obsidian: #050505;
  --color-charcoal: #151515;
  --color-graphite: #1e1e1e;
  --color-paper: #fdfdfd;
  --color-silver: #e5e5e5;
  --color-pearl: #d4d4d4;
  --color-slate: #2f2f2f;
  --color-ash: #a3a3a3;
  --color-stone: #737373;

  --font: 'Raleway', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Type scale (responsive) */
  --text-caption: 13px;
  --text-body: clamp(15px, 1.1vw, 16px);
  --text-body-lg: clamp(16px, 1.3vw, 18px);
  --text-subheading: clamp(18px, 1.6vw, 21px);
  --text-heading-sm: clamp(20px, 2vw, 24px);
  --text-heading: clamp(24px, 2.6vw, 30px);
  --text-heading-lg: clamp(28px, 3.4vw, 36px);
  --text-display: clamp(40px, 6vw, 60px);
  --text-display-lg: clamp(46px, 8.5vw, 96px);
  --text-editorial: clamp(26px, 3.6vw, 36px);

  /* Spacing */
  --spacing-4: 4px;  --spacing-8: 8px;  --spacing-12: 12px; --spacing-16: 16px;
  --spacing-20: 20px; --spacing-24: 24px; --spacing-32: 32px; --spacing-40: 40px;
  --spacing-48: 48px; --spacing-64: 64px; --spacing-80: 80px; --spacing-96: 96px;
  --spacing-128: 128px;

  --page-max-width: 1200px;
  --radius-card: 14px;
  --radius-full: 9999px;

  --section-pad: clamp(56px, 8vw, 104px);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  background: var(--color-obsidian);
  color: var(--color-paper);
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--text-body);
  line-height: 1.5;
  overflow-x: hidden;
}
::selection { background: var(--color-electric-indigo); color: var(--color-paper); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.shell { width: min(100% - 48px, var(--page-max-width)); margin-inline: auto; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
  transition: background .4s ease, backdrop-filter .4s ease, border-color .4s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5,5,5,.72);
  backdrop-filter: blur(16px) saturate(120%);
  border-bottom-color: rgba(47,47,47,.7);
}
.nav-inner { width: min(100% - 48px, var(--page-max-width)); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.wordmark { font-size: 21px; letter-spacing: -0.01em; line-height: 1; display: inline-flex; }
.wordmark .b { font-weight: 800; }
.wordmark .t { font-weight: 200; }
.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-links a { font-size: 14px; color: var(--color-pearl); letter-spacing: .01em;
  position: relative; transition: color .25s ease; }
.nav-links a::after { content:''; position:absolute; left:0; right:0; bottom:-6px; height:1px;
  background: var(--color-paper); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.nav-links a:hover { color: var(--color-paper); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-divider { width:1px; height:18px; background: var(--color-slate); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--color-paper); cursor: pointer;
  width: 40px; height: 40px; align-items: center; justify-content: center; }
.nav-toggle svg { width: 24px; height: 24px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { font-family: var(--font); font-weight: 500; font-size: 15px; letter-spacing: .005em;
  border-radius: var(--radius-full); cursor: pointer; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 10px; transition: transform .2s ease, background .25s ease, border-color .25s ease, color .25s ease;
  white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-electric-indigo); color: var(--color-paper); padding: 13px 26px; }
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--color-paper); border-color: rgba(253,253,253,.28); padding: 11px 22px; }
.btn-ghost:hover { border-color: var(--color-paper); }
.btn-lg { font-size: 16px; padding: 16px 34px; }
.btn .arrow { transition: transform .25s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: clamp(150px, 20vh, 230px); padding-bottom: var(--section-pad);
  text-align: center; position: relative; }
.hero-glow { position: absolute; top: -10%; left: 50%; transform: translateX(-50%);
  width: 60vw; height: 60vw; max-width: 760px; max-height: 760px;
  background: radial-gradient(circle, rgba(21,0,255,.16) 0%, rgba(21,0,255,0) 62%);
  pointer-events: none; z-index: 0; filter: blur(8px); }
.hero > *:not(.hero-glow) { position: relative; z-index: 1; }
.hero-eyebrow { font-size: 13px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--color-stone); margin-bottom: 30px; }
.hero h1 { font-weight: 500; font-size: var(--text-display-lg); line-height: 0.96;
  letter-spacing: -0.04em; margin: 0 auto; max-width: 15ch; }
.hero h1 .em { color: var(--color-paper); }
.hero-sub { font-size: var(--text-body-lg); line-height: 1.5; color: var(--color-pearl);
  max-width: 56ch; margin: 30px auto 0; font-weight: 400; }
.hero-cta { margin-top: 42px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.hero-proof { font-size: 13px; color: var(--color-stone); letter-spacing: .01em; }

/* hero variant: "stacked" — typographic treatment B */
body[data-hero='stacked'] .hero { text-align: left; }
body[data-hero='stacked'] .hero h1 { margin-left: 0; max-width: 18ch; letter-spacing: -0.045em; }
body[data-hero='stacked'] .hero-sub { margin-left: 0; margin-right: auto; }
body[data-hero='stacked'] .hero-cta { align-items: flex-start; }
body[data-hero='stacked'] .hero-eyebrow { }
body[data-hero='stacked'] .hero h1 .lead { font-weight: 200; display: block; }
body[data-hero='stacked'] .hero h1 .em { font-weight: 600; display: block; }

/* ============================================================
   PRODUCT PREVIEW (abstract brand composition)
   ============================================================ */
.preview-wrap { margin-top: clamp(48px, 7vw, 88px); }
.preview {
  background: var(--color-charcoal); border-radius: var(--radius-card);
  aspect-ratio: 16 / 9; width: 100%; overflow: hidden; position: relative;
}
.preview-inner { position: absolute; inset: 0; }
.preview-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0.55; display: block; }
.preview::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 50%, rgba(5,5,5,0) 40%, rgba(5,5,5,.55) 100%); }

/* ============================================================
   BANNER (marquee)
   ============================================================ */
.banner { background: var(--color-charcoal); border-block: 1px solid var(--color-slate);
  padding: 22px 0; overflow: hidden; white-space: nowrap; }
.marquee { display: inline-flex; gap: 0; will-change: transform; animation: marquee 32s linear infinite; }
.banner:hover .marquee { animation-play-state: paused; }
.marquee-group { display: inline-flex; align-items: center; gap: 0; }
.marquee-item { font-size: clamp(18px, 2.4vw, 28px); font-weight: 500; letter-spacing: -0.01em;
  color: var(--color-pearl); padding-inline: 17px; display: inline-flex; align-items: center; }
.marquee-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-electric-indigo);
  display: inline-block; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================================
   PHILOSOPHY (word-by-word reveal)
   ============================================================ */
.philosophy { padding-block: var(--section-pad); }
.philo-label { font-size: 13px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--color-stone); margin-bottom: 40px; }
.philo-text { font-size: var(--text-editorial); line-height: 1.28; letter-spacing: -0.01em;
  font-weight: 400; max-width: 22ch; }
.philo-text .para { margin: 0 0 1.1em 0; }
.philo-text .para:last-child { margin-bottom: 0; }
.philo-word { color: var(--color-slate); transition: color .5s ease; display: inline; }
.philo-word.lit { color: var(--color-paper); }
.philo-accent.lit { color: var(--color-paper); }
.philo-sign { margin-top: 56px; display: flex; align-items: center; gap: 14px; }
.philo-sign .line { width: 40px; height: 1px; background: var(--color-slate); }
.philo-sign .who { font-size: var(--text-body); color: var(--color-ash); }
.philo-sign .who strong { color: var(--color-paper); font-weight: 600; }

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.sec-head { text-align: center; max-width: none; margin: 0 auto clamp(48px, 6vw, 72px); }
.sec-head.left { text-align: left; margin-left: 0; }
.sec-kicker { font-size: 13px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--color-stone); margin-bottom: 20px; }
.sec-title { font-weight: 500; font-size: var(--text-heading-lg); line-height: 1.08;
  letter-spacing: -0.03em; margin: 0; white-space: nowrap; }
.sec-sub { font-size: var(--text-body-lg); color: var(--color-pearl); margin: 18px auto 0; max-width: none; line-height: 1.5; white-space: nowrap; }
.sec-head.left .sec-sub { margin-left: 0; }

/* ============================================================
   SECTORES
   ============================================================ */
.sectores { padding-block: var(--section-pad); }
.sectores-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sector-card {
  background: var(--color-charcoal); border: 1px solid transparent; border-radius: var(--radius-card);
  padding: 32px; min-height: 320px; display: flex; flex-direction: column; justify-content: space-between;
  cursor: pointer; position: relative; overflow: hidden; transition: background .3s ease, border-color .3s ease, transform .3s ease;
}
.sector-card:hover { background: var(--color-graphite); border-color: var(--color-slate); transform: translateY(-4px); }
.sector-num { font-size: 13px; color: var(--color-stone); letter-spacing: .04em; }
.sector-icon-wrap { position: relative; z-index: 1; }
.sector-head { display: flex; align-items: center; gap: 14px; }
.sector-icon { width: 34px; height: 34px; flex-shrink: 0; color: var(--color-ash);
  transition: color .3s ease, transform .45s cubic-bezier(.16,1,.3,1); display: block; }
.sector-card:hover .sector-icon { color: var(--color-paper); transform: translateY(-2px); }
.sector-body { position: relative; z-index: 1; margin-top: auto; }
.sector-name { font-size: var(--text-heading-sm); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
.sector-desc { font-size: var(--text-body); color: var(--color-pearl); margin: 10px 0 0; }
.sector-go { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--color-ash); margin-top: 20px; transition: color .25s ease; }
.sector-card:hover .sector-go { color: var(--color-paper); }
.sector-go .arrow { transition: transform .25s ease; }
.sector-card:hover .sector-go .arrow { transform: translateX(4px); }

/* ============================================================
   FEATURES / SERVICIOS
   ============================================================ */
.servicios { padding-block: var(--section-pad); }
.serv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--color-slate); border: 1px solid var(--color-slate); border-radius: var(--radius-card); overflow: hidden; }
.serv-card { background: var(--color-obsidian); padding: 38px 32px; min-height: 200px;
  display: flex; flex-direction: column; transition: background .3s ease; position: relative; }
.serv-card:hover { background: var(--color-charcoal); }
.serv-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.serv-glyph { width: 30px; height: 30px; color: var(--color-ash); flex-shrink: 0; transition: color .3s ease, transform .4s ease; }
.serv-card:hover .serv-glyph { color: var(--color-paper); transform: translateY(-2px); }
.serv-name { font-size: var(--text-subheading); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
.serv-desc { font-size: var(--text-body); color: var(--color-pearl); margin: 18px 0 0; line-height: 1.5; }

/* ============================================================
   TESTIMONIOS
   ============================================================ */
.testimonios { padding-block: var(--section-pad); }
.testimonios.shell { width: min(100% - 48px, 1440px); }
.testi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 340px)); justify-content: center; gap: 20px; }
.testi-card { background: var(--color-charcoal); border-radius: var(--radius-card); padding: 30px;
  display: flex; flex-direction: column; gap: 22px; transition: background .3s ease, transform .3s ease; }
.testi-card:hover { background: var(--color-graphite); transform: translateY(-4px); }
.testi-tag { align-self: flex-start; font-size: 12px; letter-spacing: .02em; color: var(--color-pearl);
  border: 1px solid var(--color-slate); border-radius: var(--radius-full); padding: 6px 14px; white-space: nowrap; }
.testi-quote { font-size: var(--text-body-lg); line-height: 1.45; letter-spacing: -0.005em; margin: 0; color: var(--color-paper); }
.testi-foot { display: flex; align-items: center; gap: 14px; margin-top: auto; }
.testi-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 15px; font-weight: 600; color: var(--color-paper);
  background: var(--color-graphite); border: 1px solid var(--color-slate); }
.testi-meta { font-size: 13px; line-height: 1.4; }
.testi-meta .name { color: var(--color-paper); font-weight: 500; }
.testi-meta .place { color: var(--color-stone); }

/* ============================================================
   CTA FINAL
   ============================================================ */
.cta-final { padding-block: clamp(96px, 14vw, 180px); text-align: center; position: relative; overflow: hidden; }
.cta-glow { position: absolute; bottom: -30%; left: 50%; transform: translateX(-50%);
  width: 80vw; height: 60vw; max-width: 900px; max-height: 640px;
  background: radial-gradient(circle, rgba(21,0,255,.14) 0%, rgba(21,0,255,0) 60%); pointer-events: none; }
.cta-final > *:not(.cta-glow) { position: relative; z-index: 1; }
.cta-final h2 { font-weight: 500; font-size: var(--text-display); line-height: 1; letter-spacing: -0.035em;
  margin: 0 auto; max-width: none; white-space: nowrap; }
.cta-final .cta-sub { font-size: var(--text-body-lg); color: var(--color-pearl); max-width: 50ch; margin: 24px auto 0; }
.cta-final .hero-cta { margin-top: 40px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--color-slate); padding-block: clamp(56px, 7vw, 88px) 40px; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; }
.footer-brand { max-width: 280px; }
.footer-tag { font-size: var(--text-body); color: var(--color-ash); margin: 18px 0 0; line-height: 1.5; }
.footer-social { display: flex; gap: 12px; margin-top: 22px; }
.footer-social a { width: 40px; height: 40px; border: 1px solid var(--color-slate); border-radius: 50%;
  display: grid; place-items: center; color: var(--color-pearl); transition: border-color .25s ease, color .25s ease, background .25s ease; }
.footer-social a:hover { border-color: var(--color-paper); color: var(--color-paper); background: var(--color-graphite); }
.footer-social svg { width: 18px; height: 18px; }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(140px, auto)); gap: 48px; }
.footer-col h4 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--color-stone);
  margin: 0 0 18px; font-weight: 500; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-col a { font-size: var(--text-body); color: var(--color-pearl); transition: color .2s ease; }
.footer-col a:hover { color: var(--color-paper); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px;
  margin-top: clamp(48px, 7vw, 80px); padding-top: 28px; border-top: 1px solid var(--color-slate); flex-wrap: wrap; }
.footer-bottom p { margin: 0; font-size: 13px; color: var(--color-stone); }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay='1'] { transition-delay: .08s; }
.reveal[data-delay='2'] { transition-delay: .16s; }
.reveal[data-delay='3'] { transition-delay: .24s; }
.reveal[data-delay='4'] { transition-delay: .32s; }
.reveal[data-delay='5'] { transition-delay: .40s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  .marquee { animation-play-state: running; }
  html { scroll-behavior: auto; }
  .philo-word { color: var(--color-paper) !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .serv-grid { grid-template-columns: repeat(2, 1fr); }
  .sectores-grid { grid-template-columns: 1fr; }
  .testi-grid { grid-template-columns: repeat(2, 1fr); }
  .sec-title, .sec-sub, .cta-final h2 { white-space: normal; }
  .sec-head { max-width: 42ch; }
  .sec-sub { max-width: 54ch; }
}
@media (max-width: 760px) {
  .nav-links, .nav-divider { display: none; }
  .nav-actions .btn-ghost, .nav-actions .btn-primary { display: none; }
  .nav-toggle { display: inline-flex; }
  .serv-grid { grid-template-columns: 1fr; }
  .philo-text { max-width: none; }
  .footer-top { flex-direction: column; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  /* HERO mobile */
  .hero { padding-top: clamp(116px, 22vh, 150px); }
  .hero h1 { font-size: clamp(38px, 11.5vw, 60px); line-height: 1.02; max-width: 16ch; }
  .hero-sub { font-size: 16px; margin-top: 22px; max-width: 42ch; }
  .hero-eyebrow { margin-bottom: 22px; }
  .hero-cta { margin-top: 32px; }
  .hero-cta .btn-lg { font-size: 15px; padding: 15px 28px; }
}
@media (max-width: 560px) {
  .testi-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .footer-cols { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(34px, 10.5vw, 44px); }
  body[data-hero='stacked'] .hero h1, body[data-hero='stacked'] .hero-sub { max-width: none; }
  .shell { width: min(100% - 36px, var(--page-max-width)); }
}
@media (max-width: 400px) {
  .btn-lg { font-size: 14px; padding: 13px 22px; }
  .hero-cta .btn, .cta-final .btn { max-width: 100%; white-space: normal; text-align: center; }
}

/* Mobile menu overlay */
.mobile-menu { position: fixed; inset: 0; z-index: 110; background: rgba(5,5,5,.97);
  backdrop-filter: blur(10px); display: flex; flex-direction: column; justify-content: center;
  gap: 8px; padding: 32px; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu a { font-size: 30px; font-weight: 500; letter-spacing: -0.02em; color: var(--color-paper); padding: 12px 0; }
.mobile-menu .btn { margin-top: 24px; align-self: flex-start; }
.menu-close { position: absolute; top: 18px; right: 22px; background: none; border: 0; color: var(--color-paper);
  cursor: pointer; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.menu-close svg { width: 26px; height: 26px; }

/* ============================================================
   DEVICE PREVIEW (mobile tweak)
   ============================================================ */
.device-stage { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px; padding: 24px;
  background: radial-gradient(120% 100% at 50% 0%, #161616 0%, #070707 70%); }
.device-frame { position: relative; height: 86vh; max-height: 92vh; flex: 0 0 auto;
  border: 12px solid #141414; border-radius: 46px; overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,.6), 0 0 0 1px #262626, inset 0 0 0 2px #000;
  background: #050505; }
.device-frame.r169 { aspect-ratio: 9 / 16; }
.device-frame.r195 { aspect-ratio: 9 / 19.5; }
.device-screen { width: 100%; height: 100%; border: 0; display: block; background: #050505; }
.device-caption { margin: 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--color-stone); }
