/* ============================================================
   Inteligencia Artificial — Site Styles
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, .nav-logo, .footer-logo {
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

em { font-style: italic; color: var(--accent); }

/* ---- Utility ---- */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 0.6em 1.25em;
  border-radius: var(--radius);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

.btn-lg { padding: 0.75em 1.75em; font-size: 0.95rem; }

/* ---- Nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.2s, border-color 0.2s;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.125rem;
  margin-left: auto;
}

.nav-links a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4em 0.8em;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-shrink: 0;
}

.theme-switcher {
  display: flex;
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}

.theme-btn {
  padding: 0.25em 0.7em;
  border-radius: calc(var(--radius) - 3px);
  border: none;
  background: transparent;
  color: var(--text-subtle);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.theme-btn:hover { color: var(--text-muted); }
.theme-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* ---- Hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8rem 2rem 7rem;
}

.hero-dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--border-subtle) 1.5px, transparent 1.5px);
  background-size: 32px 32px;
  opacity: 0.8;
  pointer-events: none;
  transition: opacity 0.2s;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 160px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
  transition: background 0.2s;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65em;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
}

.pulse-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.65); }
}

.hero-heading {
  font-size: clamp(2.6rem, 5.5vw, 4.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ---- Stats bar ---- */
.stats-bar {
  background: var(--surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: stretch;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.stat-item {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.75rem 1.5rem;
  gap: 0.35rem;
}

.stat-n {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-l {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-weight: 500;
  max-width: 120px;
}

.stat-div {
  width: 1px;
  background: var(--border-subtle);
  margin: 1rem 0;
  flex-shrink: 0;
}

/* ---- Services ---- */
.services-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 4rem;
  align-items: start;
}

.services-intro h2 {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

.services-intro p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.service-card {
  background: var(--surface);
  padding: 1.75rem;
  transition: background 0.15s;
}
.service-card:hover { background: var(--surface-raised); }

.card-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.service-card h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}

.service-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ---- Sector callout ---- */
.sector-callout {
  background: var(--bg-sunken);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6rem 2rem;
  transition: background 0.2s, border-color 0.2s;
}

.sector-inner {
  max-width: 820px;
  margin: 0 auto;
}

.sector-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft-fg);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  padding: 0.3em 0.8em;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}

.sector-callout h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.sector-callout p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 660px;
  margin-bottom: 2.25rem;
}

.sector-pillars {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pillar {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 500;
  padding: 0.45em 1em;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.pillar:hover { background: var(--surface-raised); color: var(--text); }

/* ---- How it works ---- */
.how-heading {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 3rem;
}

.steps {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.step {
  flex: 1;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-soft-fg);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.step-body h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  letter-spacing: -0.01em;
}

.step-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.step-arrow {
  color: var(--border);
  flex-shrink: 0;
  padding-top: 0.5rem;
}

/* ---- Submission form ---- */
.submission-section {
  background: var(--bg-sunken);
  border-top: 1px solid var(--border-subtle);
  padding: 6rem 2rem;
  transition: background 0.2s, border-color 0.2s;
}

.submission-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 5rem;
  align-items: start;
}

.submission-header h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.submission-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.submission-note {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.project-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.775rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.label-opt {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-subtle);
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-subtle);
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

.form-group input,
.form-group textarea {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  padding: 0.65em 0.9em;
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-subtle); }

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--ring-focus);
}

.form-group textarea { resize: vertical; min-height: 130px; }

/* ---- Custom select ---- */
.custom-select {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  padding: 0.65em 2.5em 0.65em 0.9em;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.2s;
  outline: none;
}
.custom-select:focus,
.custom-select.open {
  border-color: var(--accent);
  box-shadow: var(--ring-focus);
}
.custom-select.has-value .cs-value { color: var(--text); }
.cs-value { color: var(--text-subtle); display: block; }

.cs-chevron {
  position: absolute;
  right: 0.9em;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
  transition: transform 0.2s ease;
}
.custom-select.open .cs-chevron { transform: translateY(-50%) rotate(180deg); }

.cs-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  list-style: none;
  z-index: 50;
  overflow: hidden;
  padding: 4px;
}
.custom-select.open .cs-dropdown { display: block; }

.cs-option {
  padding: 0.55em 0.85em;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.cs-option:first-child { color: var(--text-subtle); }
.cs-option:hover { background: var(--accent-soft); color: var(--text); }
.cs-option.selected { color: var(--accent); font-weight: 500; }

.form-footer {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 0.25rem;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.form-result {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.5;
}
.form-result.success {
  background: var(--success-soft);
  color: var(--success-soft-fg);
  border: 1px solid color-mix(in oklab, var(--success) 40%, transparent);
}
.form-result.error {
  background: var(--danger-soft);
  color: var(--danger-soft-fg);
  border: 1px solid color-mix(in oklab, var(--danger) 40%, transparent);
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 2rem;
  transition: border-color 0.2s;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  flex-wrap: wrap;
}

.footer-logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.footer-logo span { color: var(--accent); }

.footer-brand p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-left: auto;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
}
.footer-nav a:hover { color: var(--accent); }

.footer-legal {
  text-align: right;
}
.footer-legal p {
  font-size: 0.75rem;
  color: var(--text-subtle);
  line-height: 1.7;
}

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .services-layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .submission-inner { grid-template-columns: 1fr; gap: 3rem; }
  .steps { flex-direction: column; gap: 0.75rem; }
  .step-arrow { transform: rotate(90deg); }
  .stat-div { display: none; }
  .stats-bar { flex-wrap: wrap; padding: 1rem 0; }
  .stat-item { min-width: 50%; border-bottom: 1px solid var(--border-subtle); }
  .stat-item:nth-last-child(-n+2) { border-bottom: none; }
}

@media (max-width: 640px) {
  .hero { padding: 4.5rem 1.5rem 5rem; }
  .services-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .nav-links, .nav-cta { display: none; }
  .hero-heading { font-size: 2.25rem; }
  .footer-inner { flex-direction: column; gap: 2rem; }
  .footer-nav { margin-left: 0; }
  .footer-legal { text-align: left; }
  .section { padding: 4rem 1.5rem; }
  .sector-callout, .submission-section { padding: 4rem 1.5rem; }
}
