/*
 * Humanity — hoja de estilos (1/3): tokens, base y layout.
 * Se carga junto con components.css y sections.css (ver layouts/application.html.erb).
 * CSS puro con nesting nativo; sin preprocesadores ni frameworks.
 */

@font-face {
  font-family: "Montserrat";
  src: url("/assets/montserrat-latin-wght-normal-9fa5e944.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  /* Marca */
  --ink: #0b2540;
  --ink-soft: #2b4560;
  --muted: #53677b;
  --blue: #0e76bc;
  --blue-dark: #0a5c94;
  --green: #3bb54a;
  --green-text: #1d7a2e;
  --green-light: #8be09a;
  --accent: #f08a3c;
  --gradient: linear-gradient(135deg, var(--green), var(--blue));
  --gradient-text: linear-gradient(135deg, #1d8a30, var(--blue));

  /* Superficies */
  --bg: #ffffff;
  --bg-cool: #f5f9fb;
  --bg-mint: #eef7f2;
  --card: #ffffff;
  --line: #dbe5ec;

  /* Forma y sombras */
  --radius: 1.25rem;
  --radius-lg: 1.75rem;
  --shadow-sm: 0 1px 2px rgb(11 37 64 / 0.06), 0 2px 8px rgb(11 37 64 / 0.04);
  --shadow-md: 0 12px 32px -8px rgb(11 37 64 / 0.18);
  --shadow-lg: 0 24px 48px -12px rgb(11 37 64 / 0.24);

  /* Tipografía */
  --font-title: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Escala fluida */
  --step--1: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  --step-2: clamp(1.3rem, 1.15rem + 0.8vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.2rem + 2.3vw, 2.75rem);
  --step-4: clamp(2.25rem, 1.3rem + 4vw, 4rem);

  /* Espaciado y layout */
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 3rem + 5vw, 7.5rem);
  --max: 1180px;
  --header-h: 4.5rem;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--header-h);

  @media (prefers-reduced-motion: no-preference) {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* Los íconos se incrustan sin width/height: se dimensionan aquí. */
svg[aria-hidden="true"] {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

address {
  font-style: normal;
}

a {
  color: var(--blue-dark);
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

main:focus {
  outline: none;
}

::selection {
  background: color-mix(in srgb, var(--green) 30%, white);
  color: var(--ink);
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-y);
  position: relative;

  &.section--cool {
    background: var(--bg-cool);
  }

  &.section--mint {
    background: var(--bg-mint);
  }

  &.section--navy {
    background:
      radial-gradient(60rem 30rem at 85% -10%, rgb(14 118 188 / 0.35), transparent 60%),
      radial-gradient(40rem 24rem at 0% 110%, rgb(59 181 74 / 0.16), transparent 60%),
      var(--ink);
    color: #c9d8e6;

    h2,
    h3,
    h4 {
      color: #fff;
    }
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1.1rem;
  border-radius: 0.75rem;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);

  &:focus-visible {
    transform: none;
    outline-color: var(--green-light);
  }
}

/* Encabezado de sección */
.section-head {
  max-width: 46rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.eyebrow {
  margin: 0 0 1rem;
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-text);

  .section--navy & {
    color: var(--green-light);
  }
}

.section-title {
  font-size: var(--step-3);
  letter-spacing: -0.025em;

  &::after {
    content: "";
    display: block;
    width: 3.5rem;
    height: 0.3rem;
    margin-top: 1rem;
    border-radius: 999px;
    background: var(--gradient);
  }
}

.section-lead {
  margin: 1.25rem 0 0;
  font-size: var(--step-1);
  color: var(--muted);

  .section--navy & {
    color: #b7c9db;
  }
}

.subhead {
  margin-bottom: 1.25rem;
  font-size: var(--step-1);
  color: var(--ink);
}

.cta-row {
  display: flex;
  justify-content: center;
  margin: clamp(2rem, 4vw, 3.5rem) 0 0;
}
