/* ==========================================================================
   Base / Reset
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--ink);
  font-size: var(--step-sm);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, picture, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p { max-width: 62ch; }
p.wide { max-width: none; }

::selection { background: var(--teal); color: var(--ivory); }

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 4px;
  border-radius: 4px;
}
.surface-dark :focus-visible, .surface-darker :focus-visible, .site-footer :focus-visible { outline-color: var(--ivory); }

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.section {
  position: relative;
  padding-block: var(--sp-3xl);
}
.section--tight { padding-block: var(--sp-2xl); }

.surface-ivory { background: var(--bg-page); color: var(--ink); }
.surface-dark  { background: var(--bg-dark); color: var(--on-dark); }
.surface-darker{ background: var(--bg-darker); color: var(--on-dark); }

.section-head {
  max-width: 640px;
  margin-bottom: var(--sp-xl);
}
.section-head--center { margin-inline: auto; text-align: center; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font-size: var(--step-xs);
  font-weight: 600;
  color: var(--amber-on-dark);
  margin-bottom: var(--sp-sm);
}
.surface-ivory .kicker { color: var(--terracotta-text); }
.kicker::before {
  content: '';
  width: 22px;
  height: 2px;
  background: var(--amber);
  border-radius: 2px;
}
.kicker { text-transform: uppercase; letter-spacing: .08em; font-weight: 500; }

h2.headline {
  font-size: var(--step-2xl);
}
h3.headline-sm {
  font-size: var(--step-lg);
}

.lede {
  font-size: var(--step-md);
  color: var(--ink-soft);
  margin-top: var(--sp-sm);
}
.surface-dark .lede, .surface-darker .lede { color: var(--on-dark-soft); }

/* ---- Buttons ----
   Sistema de botón "amanecer": el ámbar nunca es fondo de texto (falla
   contraste contra toda la paleta); vive como acento en el círculo
   terminal, que se rellena de ámbar y empuja la flecha al hacer hover. */
.btn {
  --btn-bg: var(--teal);
  --btn-fg: var(--ivory);
  display: inline-flex;
  align-items: center;
  gap: .75em;
  min-height: 52px;
  padding: 0 .5em 0 1.6em;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--step-2xs);
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.btn:not(:has(.btn-dot)) { padding-right: 1.6em; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }

.btn-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px; min-width: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--amber);
  transition: background var(--dur-med) var(--ease-out);
}
.btn-dot svg {
  width: 14px; height: 14px;
  stroke: var(--amber);
  transition: stroke var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}
.btn:hover .btn-dot { background: var(--amber); }
.btn:hover .btn-dot svg { stroke: var(--teal); transform: translateX(2px); }

/* Secundario: contorno, se rellena en hover */
.btn--secondary {
  --btn-bg: transparent;
  --btn-fg: var(--teal);
  border-color: var(--teal);
}
.btn--secondary:hover { background: var(--teal); color: var(--ivory); }

/* Sobre fondos oscuros (Deep Teal u overlay de foto): se invierte a marfil */
.surface-dark .btn, .surface-darker .btn {
  --btn-bg: var(--ivory);
  --btn-fg: var(--teal);
}
.surface-dark .btn--secondary, .surface-darker .btn--secondary {
  --btn-bg: transparent;
  --btn-fg: var(--ivory);
  border-color: var(--ivory);
}
.surface-dark .btn--secondary:hover, .surface-darker .btn--secondary:hover {
  background: var(--ivory); color: var(--teal);
}
.surface-dark .btn:focus-visible, .surface-darker .btn:focus-visible { outline-color: var(--ivory); }

/* Enlace de texto con subrayado ámbar que crece en hover */
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-weight: 600;
  font-size: var(--step-xs);
  color: var(--teal);
  border-bottom: 2px solid var(--amber);
  padding-bottom: 2px;
  transition: border-width var(--dur-fast) var(--ease-out);
}
.btn-link:hover { border-bottom-width: 6px; }
.surface-dark .btn-link, .surface-darker .btn-link { color: var(--ivory); }

.btn--olive { --btn-bg: var(--olive); --btn-fg: var(--ivory); }
.btn--sm { min-height: 44px; padding-left: 1.3em; font-size: var(--step-2xs); }
.btn--sm:not(:has(.btn-dot)) { padding-right: 1.3em; }
.btn--sm .btn-dot { width: 26px; height: 26px; min-width: 26px; }
.btn--block { width: 100%; justify-content: space-between; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ---- Reveal-on-scroll utility ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
