/* ===== Tokens ===== */
:root {
  --color-primary: #4F46E5;
  --color-primary-dark: #4338CA;
  --color-accent: #22D3EE;
  --color-bg-dark: #0F172A;
  --color-bg-light: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-text: #0F172A;
  --color-text-muted: #64748B;
  --color-border: #E2E8F0;

  --font-heading: "Poppins", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --max-width: 1120px;
  --radius: 14px;
}

/* ===== Reset ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-surface);
  line-height: 1.6;
}
h1, h2, h3 { font-family: var(--font-heading); line-height: 1.2; margin: 0 0 16px; }
p { margin: 0 0 16px; color: var(--color-text-muted); }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.section { padding: 96px 0; }
.section-alt { background: var(--color-bg-light); }
.section-subtitle { font-size: 1.05rem; max-width: 560px; }

.section-dark {
  background: var(--color-bg-dark);
  color: #E2E8F0;
}
.section-dark .eyebrow { color: var(--color-accent); }
.section-dark h2 { color: #fff; }
.section-dark .section-subtitle { color: #94A3B8; }

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: 0 8px 20px -6px rgba(79, 70, 229, 0.55); }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-ghost { border-color: var(--color-border); color: var(--color-text); }
.btn-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-sm { padding: 9px 18px; font-size: 0.85rem; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 16px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-word {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--color-text);
}
.logo-word strong { color: var(--color-primary); }
.logo-word.small { font-size: 0.95rem; }

.main-nav {
  display: flex;
  gap: 26px;
  font-weight: 500;
  font-size: 0.95rem;
}
.main-nav a:hover { color: var(--color-primary); }

.header-actions { display: flex; align-items: center; gap: 14px; }

.lang-switch {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}
.lang-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-text-muted);
}
.lang-btn.active { background: var(--color-primary); color: #fff; }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 110px 0 96px;
  text-align: center;
  background-color: var(--color-surface);
  background-image:
    radial-gradient(620px circle at 15% 10%, rgba(79, 70, 229, 0.16), transparent 60%),
    radial-gradient(520px circle at 85% 5%, rgba(34, 211, 238, 0.16), transparent 55%),
    radial-gradient(700px circle at 50% 105%, rgba(79, 70, 229, 0.10), transparent 60%);
  overflow: hidden;
}
.hero-inner { max-width: 760px; margin: 0 auto; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
.hero-subtitle { font-size: 1.1rem; margin: 0 auto 32px; max-width: 600px; }
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.stack-block { margin-top: 56px; }
.stack-label {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}
.stack-strip { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.stack-chip {
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* ===== Cards ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.card {
  background: var(--color-surface);
  border: 1px solid rgba(226, 232, 240, 0.7);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px -8px rgba(15, 23, 42, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(15, 23, 42, 0.06), 0 20px 36px -10px rgba(79, 70, 229, 0.18);
}
.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #EEF2FF;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.card p { margin: 0; }

/* ===== Process ("Cómo trabajamos") ===== */
.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 64px;
}
.process-step { position: relative; text-align: center; padding: 0 8px; }
.process-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 26px;
  left: calc(50% + 26px);
  width: calc(100% - 52px);
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
}
.step-num {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 auto 20px;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.18);
}
.process-step h3 { color: #fff; font-size: 1.05rem; }
.process-step p { color: #94A3B8; font-size: 0.92rem; margin: 0; }

/* ===== Portfolio ===== */
.portfolio-list {
  display: flex;
  flex-direction: column;
  gap: 80px;
  margin-top: 56px;
}
.portfolio-item {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
  align-items: center;
}
.portfolio-item:nth-child(even) .portfolio-media { order: 2; }
.portfolio-item:nth-child(even) .portfolio-text { order: 1; }

.portfolio-media {
  max-width: 280px;
  margin: 0 auto;
}
.phone-frame {
  background: var(--color-bg-dark);
  border-radius: 32px;
  padding: 14px 14px 20px;
  box-shadow: 0 24px 48px -16px rgba(15, 23, 42, 0.32);
  transition: transform 0.3s ease;
}
.portfolio-media:hover .phone-frame { transform: translateY(-6px); }
.phone-frame::before {
  content: "";
  display: block;
  width: 56px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
  margin: 0 auto 14px;
}
.phone-frame .screen {
  border-radius: 20px;
  overflow: hidden;
  height: 480px;
}
.phone-frame .screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.portfolio-text .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-bg-dark);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.portfolio-text h3 { font-size: 1.5rem; margin-bottom: 8px; }
.portfolio-text .formerly { font-size: 0.9rem; font-weight: 400; color: var(--color-text-muted); }
.portfolio-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--color-primary);
}
.portfolio-link:hover { text-decoration: underline; }

/* ===== About ===== */
.about-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.about-points li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
  font-weight: 500;
}
.about-points li:last-child { border-bottom: none; }
.check {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Contact ===== */
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.contact-info { margin-top: 32px; padding: 0; }
.contact-info div { margin-bottom: 18px; }
.contact-info dt {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.contact-info dd { margin: 0; font-weight: 500; }
.contact-info a:hover { color: var(--color-primary); }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--color-surface);
  border: 1px solid rgba(226, 232, 240, 0.7);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 20px 40px -14px rgba(15, 23, 42, 0.12);
}
.contact-form label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 12px;
}
.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}
.contact-form button { margin-top: 20px; }
.form-status {
  margin: 14px 0 0;
  font-weight: 500;
  font-size: 0.9rem;
}
.form-status.success { color: #15803D; }
.form-status.error { color: #DC2626; }

/* ===== Footer ===== */
.site-footer {
  background: var(--color-bg-dark);
  color: #94A3B8;
  padding: 40px 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}
.site-footer .logo-word { color: #fff; }
.site-footer .logo-word strong { color: var(--color-accent); }
.site-footer p { margin: 0; color: #94A3B8; font-size: 0.9rem; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .about-inner, .contact-inner { grid-template-columns: 1fr; }
  .portfolio-item { grid-template-columns: 1fr; text-align: center; }
  .portfolio-item:nth-child(even) .portfolio-media,
  .portfolio-item:nth-child(even) .portfolio-text { order: initial; }
  .section { padding: 72px 0; }

  .process-steps { grid-template-columns: repeat(2, 1fr); gap: 40px 24px; }
  .process-step:not(:last-child)::after {
    display: none;
  }
}

@media (max-width: 760px) {
  .main-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .menu-toggle { display: flex; }
  .header-actions .btn-sm { display: none; }

  .process-steps { grid-template-columns: 1fr; }
}
