/* ============================================
   MSC Ingenierías y Redes SAS — Base
   ============================================ */

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
}

/* ── Media ── */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* ── Form ── */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-blue);
}

/* ── Lists ── */
ul,
ol {
  list-style: none;
}

/* ── Tables ── */
table {
  border-collapse: collapse;
  width: 100%;
}

/* ── Selection ── */
::selection {
  background-color: var(--color-red);
  color: var(--color-white);
}

/* ── Focus ── */
:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ══════════════════════════════════════════════
   Tipografía
   ══════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-heading);
}

h1, .h1 { font-size: var(--text-5xl); }
h2, .h2 { font-size: var(--text-4xl); }
h3, .h3 { font-size: var(--text-3xl); }
h4, .h4 { font-size: var(--text-2xl); }
h5, .h5 { font-size: var(--text-xl); font-weight: var(--weight-semibold); }
h6, .h6 { font-size: var(--text-lg); font-weight: var(--weight-semibold); }

p {
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

.text-red    { color: var(--color-red); }
.text-blue   { color: var(--color-blue); }
.text-navy   { color: var(--color-navy); }
.text-white  { color: var(--color-white); }
.text-gray   { color: var(--color-gray); }
.text-green  { color: var(--color-green); }

.text-sm     { font-size: var(--text-sm); }
.text-lg     { font-size: var(--text-lg); }
.text-xl     { font-size: var(--text-xl); }
.text-2xl    { font-size: var(--text-2xl); }

.font-body   { font-family: var(--font-body); }
.font-heading { font-family: var(--font-heading); }

.leading-relaxed { line-height: var(--leading-relaxed); }
.leading-snug    { line-height: var(--leading-snug); }

/* ══════════════════════════════════════════════
   Contenedores
   ══════════════════════════════════════════════ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: var(--container-wide);
}

/* ══════════════════════════════════════════════
   Secciones
   ══════════════════════════════════════════════ */

.section {
  padding-top: var(--section-padding-y);
  padding-bottom: var(--section-padding-y);
}

.section--sm {
  padding-top: var(--section-padding-y-sm);
  padding-bottom: var(--section-padding-y-sm);
}

.section--dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-inverse);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
  color: var(--color-white);
}

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

.section--overlap {
  position: relative;
  z-index: 1;
}

/* ── Section header ── */

.section-header {
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-16);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  font-size: var(--text-lg);
  color: var(--color-gray);
}

.section-header--left {
  text-align: left;
  margin-left: 0;
}

/* ── Section label ── */

.section-label {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-red);
  margin-bottom: var(--space-3);
}

/* ══════════════════════════════════════════════
   Grid system
   ══════════════════════════════════════════════ */

.grid {
  display: grid;
  gap: var(--space-8);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

@media (max-width: 768px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid--3,
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ══════════════════════════════════════════════
   Responsive: tipografía
   ══════════════════════════════════════════════ */

@media (max-width: 768px) {
  h1, .h1 { font-size: var(--text-4xl) !important; }
  h2, .h2 { font-size: var(--text-3xl) !important; }
  h3, .h3 { font-size: var(--text-2xl) !important; }

  .section-header p {
    font-size: var(--text-base) !important;
  }
}

@media (max-width: 480px) {
  h1, .h1 { font-size: var(--text-3xl) !important; }
  h2, .h2 { font-size: var(--text-2xl) !important; }
  h3, .h3 { font-size: var(--text-xl) !important; }

  .section-header p {
    font-size: var(--text-sm) !important;
  }
}