/* Base del sitio: tipografía, reinicio y piezas compartidas por
   todas las secciones. Los colores salen de portfolio.css. */

@font-face {
  font-family: "Funnel Sans Local";
  src: url("../fonts/funnel-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
}

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

html {
  /* El header es fijo: sin esto los enlaces internos dejarían el
     título de cada sección escondido debajo. */
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

/* Quita la espera de 300 ms del doble toque en enlaces y botones. */
a,
button,
summary {
  touch-action: manipulation;
}

body {
  margin: 0;
  /* Teléfonos con muesca en horizontal: el contenido no se mete debajo. */
  padding-right: env(safe-area-inset-right);
  padding-left: env(safe-area-inset-left);
  /* Una palabra más ancha que su columna se parte en vez de desbordar. */
  overflow-wrap: break-word;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Funnel Sans Local", Arial, Helvetica, sans-serif;
  font-size: 1.125rem;
  line-height: 1.35;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
figure {
  margin: 0;
}

ol {
  padding: 0;
  list-style: none;
}

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

/* Sin esto, el atributo height del HTML fija el alto en píxeles y
   deforma la imagen cuando el CSS solo cambia el ancho. */
img {
  height: auto;
}

a {
  color: inherit;
}

:where(a, button):focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 4px;
}

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

/* ---------- Botones ---------- */
.button {
  display: inline-flex;
  min-height: 48px;
  padding: 12px 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
}

.button--primary {
  background: var(--star-yellow);
  color: var(--night-deep);
}

.button--primary:hover {
  background: var(--moon-yellow);
}

/* Sobre fondo claro. */
.button--solid {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.button--solid:hover {
  background: var(--night-blue);
}

.button--outline {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.button--outline:hover {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.button--ghost {
  border-color: rgba(255, 255, 255, .65);
  color: #fff;
}

.button--ghost:hover {
  background: #fff;
  color: var(--night-deep);
}

/* ---------- Cabecera de sección ----------
   Punto amarillo, título y, si lo hay, un enlace a la derecha.
   La regla que sigue va al mismo margen que el título. */
main > section {
  margin-top: var(--section-gap);
}

.heading-row {
  display: flex;
  padding: 0 var(--gutter);
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
}

.heading-row h2 {
  font-size: clamp(2.5rem, 5.85vw, 5.25rem);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.043em;
  text-wrap: balance;
}

.eyebrow {
  display: block;
  width: 8px;
  height: 8px;
  margin-bottom: clamp(10px, 1.1vw, 16px);
  border-radius: 50%;
  background: var(--moon-yellow);
}

.heading-row > a {
  flex: none;
  font-size: clamp(1.75rem, 3.6vw, 3.25rem);
  line-height: .9;
  letter-spacing: -.04em;
  text-align: right;
  text-decoration: none;
}

.heading-row > a small {
  display: block;
  margin-top: 10px;
  font-size: clamp(0.75rem, 1.2vw, 1.0625rem);
  line-height: 1.2;
  letter-spacing: 0;
}

.rule {
  height: 1px;
  margin: clamp(24px, 3.2vw, 46px) var(--gutter) 0;
  background: var(--color-text);
}

/* ---------- Llamada a la acción al pie de una sección ---------- */
.section-cta {
  display: flex;
  margin: clamp(28px, 3.6vw, 52px) var(--gutter) 0;
  gap: 16px 28px;
  flex-wrap: wrap;
  align-items: center;
  font-size: clamp(1.25rem, 1.9vw, 1.6875rem);
  line-height: 1.16;
  letter-spacing: -.02em;
}

.section-cta span {
  max-width: 24em;
  text-wrap: balance;
}

/* ---------- Saltar al contenido (teclado y lectores de pantalla) ---------- */
.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--star-yellow);
  color: var(--night-deep);
  font-size: 1rem;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Botones que abren WhatsApp ----------
   El icono va como máscara para que tome el color del texto del botón. */
.is-whatsapp::before {
  content: "";
  width: 1.15em;
  height: 1.15em;
  margin-right: .5em;
  flex: none;
  background: currentColor;
  -webkit-mask: url("../images/icono-whatsapp.svg") center / contain no-repeat;
  mask: url("../images/icono-whatsapp.svg") center / contain no-repeat;
}

.is-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* WhatsApp es el canal principal: en el cierre, el correo queda como
   segunda opción. */
.has-whatsapp .footer-button:not(.footer-button--wa) {
  border-color: var(--color-border);
}
