/* Reset muy sencillo */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

/* THEMING -------------------------------------------------- */

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f5f7fb;
  --color-text: #131722;
  --color-muted: #5d6470;
  --color-primary: #004b86; /* azul BITMex base */
  --color-primary-soft: #e1edf7;
  --color-border: #dde1eb;
  --color-card-bg: #ffffff;
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.04);
  --radius-lg: 1.1rem;
}

html[data-theme="dark"] {
  --color-bg: #0b1524;
  --color-bg-alt: #101b2c;
  --color-text: #e8edf8;
  --color-muted: #a2b0c7;
  --color-primary: #5ea4ff;
  --color-primary-soft: #1b2a41;
  --color-border: #24324a;
  --color-card-bg: #111b2b;
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.6);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
}

/* LAYOUT GENERAL ------------------------------------------- */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.section {
  padding: 4rem 1.25rem;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-header {
  max-width: 800px;
  margin: 0 auto 2rem auto;
  text-align: center;
}

.section-header h2 {
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.section-header p {
  margin: 0;
  color: var(--color-muted);
}

/* HEADER --------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.brand-logo {
  height: 38px;
  width: auto;
}

/* NAV */

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.site-nav a:hover {
  color: var(--color-primary);
}

.theme-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
}

/* NAV TOGGLE (MOBILE) */

.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.25rem;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  margin: 4px 0;
  transition: transform 0.2s, opacity 0.2s;
}

/* HERO ----------------------------------------------------- */

.hero {
  padding-top: 3.25rem;
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  animation: hero-fade-up 0.6s ease-out both;
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-bottom: 0.4rem;
}

.hero h1 {
  font-size: 2.2rem;
  line-height: 1.15;
  margin-bottom: 0.9rem;
}

.hero-subtitle {
  max-width: 700px;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

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

/* MÉTRICAS */

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.metric {
  min-width: 140px;
  padding: 0.75rem 1rem;
  border-radius: 0.9rem;
  background: var(--color-card-bg);
  box-shadow: var(--shadow-soft);
  transform: translateY(0);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.metric-number {
  display: block;
  font-size: 1.4rem;
  font-weight: 600;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.metric:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.08);
}

/* BOTONES -------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
}

.btn-primary:hover {
  opacity: 0.95;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary-soft);
}

.btn-outline:hover {
  background: var(--color-primary-soft);
}

/* CARDS ---------------------------------------------------- */

.cards-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
}

.card {
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.card p {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--color-muted);
}

.card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--color-muted);
}

/* SIVI ----------------------------------------------------- */

.sivi-layout {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.sivi-logo-wrapper {
  margin-bottom: 1.5rem;
}

.sivi-logo {
  max-width: 220px;
  height: auto;
}

.sivi-text p {
  margin-bottom: 0.75rem;
}

/* TECNOLOGÍAS ---------------------------------------------- */

.tech-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
}

.tech-column h3 {
  margin-top: 0;
}

.tech-column ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--color-muted);
}

/* NOSOTROS ------------------------------------------------- */

.about-layout {
  max-width: 900px;
  margin: 0 auto;
}

.about-text p {
  margin-bottom: 0.75rem;
}

/* CONTACTO ------------------------------------------------- */

.contact-layout {
  max-width: 700px;
  margin: 0 auto;
}

.contact-form {
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.5rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
}

.field-group {
  margin-bottom: 1rem;
}

.field-group label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
  padding: 0.55rem 0.6rem;
  font: inherit;
  background: var(--color-bg);
  color: var(--color-text);
}

.field-group textarea {
  resize: vertical;
}

.contact-note {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 0.75rem;
}

/* estado del formulario */

.form-status {
  min-height: 1.4rem;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.form-status--ok {
  color: #0c7a3d;
}

.form-status--error {
  color: #b3261e;
}

/* honeypot */

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* FOOTER --------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 1.25rem;
  background: var(--color-bg);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.footer-secondary {
  margin-top: 0.25rem;
}

/* RESPONSIVE ----------------------------------------------- */

@media (min-width: 720px) {
  .section {
    padding: 4.5rem 1.5rem;
  }

  .hero h1 {
    font-size: 2.6rem;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tech-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sivi-layout {
    display: flex;
    align-items: center;
    gap: 2rem;
    text-align: left;
  }

  .sivi-logo-wrapper {
    flex: 0 0 220px;
  }

  .sivi-text {
    flex: 1;
  }
}

@media (max-width: 720px) {
  .site-nav {
    position: absolute;
    inset: 100% 0 auto 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1.25rem 0.9rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.18s ease-out, opacity 0.18s ease-out;
  }

  .site-header.nav-open .site-nav {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-toggle {
    display: inline-block;
  }
}

@media (min-width: 721px) {
  .site-header {
    backdrop-filter: blur(14px);
  }
}

/* ANIMACIONES ---------------------------------------------- */

@keyframes hero-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1 {
  max-width: 820px;
}

.hero-subtitle {
  font-size: 1.05rem;
  line-height: 1.55;
}

.section-header h2 {
  font-weight: 600;
}

.card {
  transition: transform 0.15s ease-out;
}

.card:hover {
  transform: translateY(-3px);
}
