/* =============================================================
   StructuralFEM — Landing de producto
   Archetype: Glassmorphism / Tech (adaptado a oscuro "ingeniería")
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
@property --mesh-shift {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}

:root {
  /* Fondo oscuro cálido-frío (nunca negro puro) */
  --bg:        #0a0e12;
  --bg-2:      #0d131a;
  --bg-3:      #111a22;
  --panel:     rgba(255, 255, 255, 0.045);
  --panel-2:   rgba(255, 255, 255, 0.08);

  --ink:       #eef4f2;
  --ink-soft:  rgba(238, 244, 242, 0.64);
  --ink-mute:  rgba(238, 244, 242, 0.42);

  /* Marca StructuralFEM — Verde Musgo #497D59 + Gris Oscuro #474645
     (acento frío --cyan/--violet solo para mapas de esfuerzo, no es marca) */
  --brand:        #497d59;   /* Verde Musgo (color de marca) */
  --brand-bright: #7dbf8e;   /* tinte claro para texto/acentos sobre fondo oscuro */
  --brand-deep:   #3c6b4c;
  --gray-brand:   #474645;   /* Gris Oscuro de marca */
  --cyan:         #46b9cf;
  --violet:       #7c7cf0;

  --line:   rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);

  --container: 1200px;
  --radius: 14px;
  --radius-lg: 22px;

  /* Gotham Pro (marca) no existe como fuente web; Montserrat es su sustituta estándar */
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --display: 'Montserrat', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --shadow-lg: 0 40px 80px -30px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 60px -12px rgba(73, 125, 89, 0.55);

  --header-h: 74px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 {
  font-family: var(--display);
  text-wrap: balance;
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 600;
}
::selection { background: var(--brand); color: #06110a; }
:focus-visible { outline: 2px solid var(--brand-bright); outline-offset: 3px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.4rem); }
.container--narrow { max-width: 820px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem;
  background: var(--brand); color: #06110a; z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.section { padding-block: clamp(4rem, 9vw, 8rem); position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--mono); font-size: .8rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand-bright);
  margin-bottom: 1.1rem;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--brand); }

.section-head { max-width: 640px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); }
.section-head p { color: var(--ink-soft); font-size: 1.12rem; margin-top: 1rem; }

.lead { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--ink-soft); }
.mono { font-family: var(--mono); }

/* =============================================================
   4. Typography scale
   ============================================================= */
h1 { font-size: clamp(2.4rem, 7vw, 5rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 4vw, 2.9rem); }
h3 { font-size: 1.25rem; }

/* =============================================================
   5. Components
   ============================================================= */
.btn {
  --btn-bg: var(--brand);
  --btn-fg: #06110a;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--display); font-weight: 600; font-size: .98rem; line-height: 1;
  padding: .95rem 1.5rem; border-radius: 10px;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid transparent;
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.btn:active { transform: translateY(0); }
.btn svg { width: 1.1em; height: 1.1em; }
.btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--ink);
  border-color: var(--line-2);
}
.btn--ghost:hover { border-color: var(--brand); box-shadow: none; background: var(--panel); }
.btn--lg { padding: 1.1rem 1.8rem; font-size: 1.05rem; }
.btn-icon svg { width: 1.15em; height: 1.15em; }

.pill {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--mono); font-size: .78rem; letter-spacing: .06em;
  color: var(--ink-soft); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: .4rem .85rem;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 10px var(--brand); }

/* Glass card */
.glass {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
@supports (backdrop-filter: blur(20px)) {
  .glass { background: var(--panel); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%); }
}

/* =============================================================
   6. Header / Nav
   ============================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
}
.site-header.is-scrolled {
  background: rgba(10, 14, 18, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .6rem; }
.brand img { width: 36px; height: 36px; object-fit: contain; }
.brand__name { font-family: var(--display); font-weight: 700; font-size: 1.18rem; letter-spacing: -0.02em; }
.brand__name b { color: var(--brand-bright); font-weight: 700; }

.nav-links { display: flex; align-items: center; gap: .3rem; list-style: none; }
.nav-links a {
  font-family: var(--display); font-weight: 500; font-size: .95rem; color: var(--ink-soft);
  padding: .5rem .8rem; border-radius: 8px; transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--ink); background: var(--panel); }

.nav-actions { display: flex; align-items: center; gap: .7rem; }
.lang-switch {
  font-family: var(--mono); font-size: .82rem; font-weight: 500; letter-spacing: .04em;
  color: var(--ink-soft); border: 1px solid var(--line-2); border-radius: 8px; padding: .45rem .6rem;
  transition: color .2s, border-color .2s;
}
.lang-switch:hover { color: var(--ink); border-color: var(--brand); }

.menu-toggle { display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; justify-content: center; }
.menu-toggle span { height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .2s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =============================================================
   7. Hero
   ============================================================= */
.hero { position: relative; padding-top: clamp(3rem, 7vw, 5.5rem); padding-bottom: clamp(3rem, 7vw, 6rem); overflow: hidden; }
.hero-mesh {
  position: absolute; inset: -20% -10% auto -10%; height: 130%; z-index: -2;
  background:
    radial-gradient(38% 44% at 22% 18%, rgba(73,125,89,0.42), transparent 60%),
    radial-gradient(34% 40% at 82% 26%, rgba(70,185,207,0.26), transparent 60%),
    radial-gradient(40% 50% at 60% 88%, rgba(124,124,240,0.16), transparent 60%);
  filter: blur(50px) saturate(135%);
  animation: meshDrift 22s ease-in-out infinite;
}
.hero-grid-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(75% 65% at 50% 40%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(75% 65% at 50% 40%, #000 40%, transparent 100%);
}
@keyframes meshDrift {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50%      { transform: translate3d(0,-3%,0) scale(1.12); }
}
.hero-inner { display: grid; grid-template-columns: 1.02fr 0.98fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-title { margin: 1.1rem 0 1.3rem; }
.hero-title em { font-style: normal; color: var(--brand-bright); }
.hero-sub { max-width: 44ch; margin-bottom: 1.8rem; }

.hero-form { display: flex; gap: .6rem; max-width: 440px; flex-wrap: wrap; }
.hero-form .field { flex: 1 1 220px; }
.hero-form .field--full { flex: 1 1 100%; }
.hero-form input[type="email"],
.hero-form input[type="text"] {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px;
  padding: .95rem 1.1rem; transition: border-color .2s, box-shadow .2s;
}
.hero-form input::placeholder { color: var(--ink-mute); }
.hero-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(116,177,122,0.22); }
.hero-note { font-family: var(--mono); font-size: .78rem; color: var(--ink-mute); margin-top: .9rem; display: flex; align-items: center; gap: .5rem; }

.hero-badges { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }

/* Form success/feedback */
.form-msg { font-size: .9rem; margin-top: .8rem; min-height: 1.2em; }
.form-msg.ok { color: var(--brand-bright); }
.form-msg.err { color: #ff9b8a; }

/* =============================================================
   8. FEM viewport mockup (hero visual placeholder)
   ============================================================= */
.app-frame {
  position: relative; border-radius: 16px; overflow: hidden;
  background: linear-gradient(180deg, #0c141b, #0a1016);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
}
.app-frame__bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: rgba(255,255,255,0.04); border-bottom: 1px solid var(--line); }
.app-frame__bar i { width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,0.2); display: block; }
.app-frame__bar i:first-child { background: var(--brand); }
.app-frame__bar span { margin-left: auto; font-family: var(--mono); font-size: .72rem; color: var(--ink-mute); }
.app-frame__body { position: relative; aspect-ratio: 16 / 11; }
.app-frame__body img { width: 100%; height: 100%; object-fit: cover; }
.fem-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Cuerpo para capturas reales (fondo claro para fundir con el screenshot; sin recortes) */
.app-frame__body.shot-body { aspect-ratio: 16 / 9; background: #f5f6f7; }
.app-frame__body.shot-body img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
/* Captura que cubre el mockup SVG del hero/showcase principal */
.shot-cover { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: contain; background: #f5f6f7; }

.hero-float {
  position: absolute; z-index: 3;
  font-family: var(--mono); font-size: .74rem; color: var(--ink);
  background: rgba(10,14,18,0.8); border: 1px solid var(--line-2);
  border-radius: 10px; padding: .55rem .8rem; backdrop-filter: blur(6px);
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: .5rem;
}
.hero-float b { color: var(--brand-bright); }
.hero-float--1 { top: 12%; left: -6%; }
.hero-float--2 { bottom: 10%; right: -5%; }
@media (max-width: 1100px) { .hero-float--1 { left: 2%; } .hero-float--2 { right: 2%; } }

/* =============================================================
   9. Marquee / trust
   ============================================================= */
.trust { border-block: 1px solid var(--line); background: var(--bg-2); }
.trust-inner { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; justify-content: center; padding-block: 1.6rem; }
.trust-inner span { font-family: var(--mono); font-size: .82rem; color: var(--ink-mute); letter-spacing: .05em; }
.trust-inner b { color: var(--ink-soft); font-weight: 500; }

/* =============================================================
   10. Feature grid
   ============================================================= */
.grid { display: grid; gap: 1.3rem; }
.features-grid { grid-template-columns: repeat(3, 1fr); }
.feature {
  padding: 1.7rem; border-radius: var(--radius-lg);
  background: var(--panel); border: 1px solid var(--line);
  transition: transform .25s var(--ease-out), border-color .25s, background .25s;
}
.feature:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: var(--panel-2); }
.feature__icon {
  width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 1.1rem;
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--brand-bright); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
}
.feature__icon svg { width: 26px; height: 26px; }
.feature h3 { margin-bottom: .5rem; }
.feature p { color: var(--ink-soft); font-size: .98rem; }

/* =============================================================
   11. Showcase (screenshots)
   ============================================================= */
.showcase-main { margin-bottom: 1.3rem; }
.showcase-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.3rem; }
.shot {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2);
  background: var(--bg-3); box-shadow: var(--shadow-lg); position: relative;
}
.shot img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16/10; }
.shot__cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: .8rem 1rem;
  font-family: var(--mono); font-size: .76rem; color: var(--ink);
  background: linear-gradient(0deg, rgba(6,10,14,0.85), transparent);
}

/* =============================================================
   12. Steps (how it works)
   ============================================================= */
.steps { grid-template-columns: repeat(4, 1fr); counter-reset: step; }
.step { position: relative; padding-top: 1.2rem; border-top: 2px solid var(--line-2); }
.step__n { font-family: var(--mono); font-size: .8rem; color: var(--brand-bright); letter-spacing: .1em; }
.step h3 { margin: .5rem 0; font-size: 1.15rem; }
.step p { color: var(--ink-soft); font-size: .95rem; }

/* =============================================================
   13. Stats
   ============================================================= */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat { text-align: center; padding: 1.4rem 1rem; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.stat__v { font-family: var(--display); font-weight: 700; font-size: clamp(1.7rem, 4vw, 2.6rem); color: var(--ink); line-height: 1; }
.stat__l { font-size: .9rem; color: var(--ink-soft); margin-top: .4rem; }

/* =============================================================
   14. Beta / pricing
   ============================================================= */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; align-items: stretch; }
.plan { display: flex; flex-direction: column; padding: 1.8rem; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); position: relative; }
.plan--featured { border-color: var(--brand); box-shadow: var(--shadow-glow); }
.plan__tag { position: absolute; top: -12px; left: 1.8rem; font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; background: var(--brand); color: #06110a; padding: .25rem .7rem; border-radius: 999px; }
.plan h3 { font-size: 1.25rem; }
.plan__price { display: flex; align-items: baseline; gap: .35rem; margin: .7rem 0 1.2rem; }
.plan__price b { font-family: var(--display); font-weight: 700; font-size: 2rem; color: var(--ink); }
.plan__price span { color: var(--ink-mute); font-family: var(--mono); font-size: .85rem; }
.plan ul { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .7rem; }
.plan li { display: flex; gap: .55rem; align-items: flex-start; font-size: .95rem; color: var(--ink-soft); }
.plan li svg { width: 18px; height: 18px; flex: none; margin-top: .15rem; color: var(--brand-bright); }
.plan .btn { margin-top: auto; }

/* =============================================================
   15. FAQ
   ============================================================= */
.faq { max-width: 820px; margin-inline: auto; display: grid; gap: .8rem; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.4rem; text-align: left; font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.faq-q .chev { width: 22px; height: 22px; flex: none; transition: transform .3s var(--ease-out); color: var(--brand-bright); }
.faq-item.open .chev { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s var(--ease-out); }
.faq-a p { padding: 0 1.4rem 1.3rem; color: var(--ink-soft); }

/* =============================================================
   16. CTA band
   ============================================================= */
.cta-band { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: clamp(2.5rem, 6vw, 4.5rem); text-align: center; border: 1px solid var(--line-2); }
.cta-band .hero-mesh { opacity: .8; }
.cta-band h2 { font-size: clamp(1.9rem, 4.5vw, 3.2rem); }
.cta-band p { color: var(--ink-soft); max-width: 52ch; margin: 1rem auto 2rem; font-size: 1.1rem; }
.cta-band .hero-form { margin-inline: auto; justify-content: center; }

/* =============================================================
   17. Footer
   ============================================================= */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding-block: 3.5rem 2rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.footer-brand p { color: var(--ink-soft); margin-top: 1rem; max-width: 32ch; font-size: .95rem; }
.footer-col h4 { font-family: var(--mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-bright); margin-bottom: 1rem; font-weight: 500; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.footer-col a { color: var(--ink-soft); font-size: .95rem; transition: color .2s; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.footer-bottom p { font-size: .85rem; color: var(--ink-mute); }

/* =============================================================
   18. Reveal on scroll
   ============================================================= */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
[data-reveal].is-revealed { opacity: 1; transform: none; }
/* Defensive: split elements never invisible */
.reveal[data-split] { opacity: 1; transform: none; }

/* =============================================================
   19. Responsive
   ============================================================= */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 560px; }
  .plans { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
  .nav-links, .nav-actions .btn { display: none; }
  .menu-toggle { display: flex; }
  .site-header .nav-links.is-open {
    display: flex; position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch;
    background: rgba(10,14,18,0.96); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
    padding: 1rem clamp(1.1rem, 4vw, 2.4rem) 1.5rem; gap: .2rem;
  }
  .site-header .nav-links.is-open a { padding: .9rem .5rem; font-size: 1.1rem; border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .features-grid, .showcase-grid, .stats { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* =============================================================
   20. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero-mesh { animation: none; }
}
