/* ============================================================
   Base: reset, tipografía, layout, utilidades
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--ink-900);
  scroll-behavior: auto;
}

html.is-locked,
html.is-loading {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink-850);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

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

::selection {
  background: var(--sage);
  color: var(--ink-900);
}

:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--sage);
  color: var(--ink-900);
  border-radius: 10px;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease-out);
}

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

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono {
  font-family: var(--font-mono);
}

.i {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.i--flip {
  transform: scaleX(-1);
}

/* ---------- Secciones ---------- */
.section {
  position: relative;
  padding-block: var(--section-pad);
  background: var(--bg);
  color: var(--fg);
}

.section--paper {
  --bg: var(--paper);
}

.section--forest {
  --bg: var(--forest-900);
  background:
    radial-gradient(120% 80% at 85% 0%, rgba(64, 145, 108, 0.22), transparent 60%),
    radial-gradient(90% 70% at 0% 100%, rgba(27, 67, 50, 0.9), transparent 70%),
    var(--forest-900);
}

.section--ink {
  --bg: var(--ink-900);
}

/* ---------- Tipografía ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6.4vw, 5.6rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  text-wrap: balance;
}

.display--xl {
  font-size: clamp(3rem, 9vw, 8.4rem);
  line-height: 0.88;
}

.display--sm {
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  line-height: 0.98;
}

.display em {
  font-style: normal;
  font-weight: 400;
  text-transform: lowercase;
  color: var(--sage);
  letter-spacing: -0.02em;
}

[data-split] {
  visibility: hidden;
}

.lead {
  font-size: clamp(1.02rem, 1.35vw, 1.22rem);
  line-height: 1.6;
  color: var(--fg-muted);
  max-width: 60ch;
  font-weight: 300;
}

.lead strong {
  font-weight: 600;
  color: var(--fg);
}

.muted {
  color: var(--fg-dim);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--forest-500);
}

.tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent);
}

.tag:has(svg)::before {
  display: none;
}

.tag--dark {
  color: var(--sage);
}

.section-head {
  display: grid;
  gap: 18px;
  margin-bottom: clamp(44px, 6vw, 80px);
}

.section-head--row {
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 32px;
}

.section-head--row > div {
  display: grid;
  gap: 18px;
}

.section-head--center {
  justify-items: center;
  text-align: center;
}

.section-head--center .lead {
  margin-inline: auto;
}

@media (max-width: 760px) {
  .section-head--row {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

.split-line {
  padding-bottom: 0.06em;
  margin-bottom: -0.06em;
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
