/* ============================================================
   BASE — reset, tipografía y utilidades
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--c-paper);
  color: var(--c-ink-2);
  font-family: var(--f-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

html[data-nav-open] body { overflow: hidden; }

h1, h2, h3, h4 {
  font-family: var(--f-display);
  color: var(--c-ink);
  font-weight: 500;   /* igual que la referencia "Patagonia Chilena" */
  line-height: var(--lh-head);
  letter-spacing: var(--ls-display);
  margin: 0 0 var(--s-4);
  text-wrap: balance;
}

h1 { font-size: var(--t-h1); line-height: var(--lh-tight); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
h4 { font-size: var(--t-h4); }

p { margin: 0 0 var(--s-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

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

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

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

button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

::selection { background: var(--c-tide); color: var(--c-paper); }

:focus-visible {
  outline: 2px solid var(--c-tide-2);
  outline-offset: 3px;
  border-radius: 1px;
}

/* --- Tipografía de apoyo --- */

.eyebrow {
  display: block;
  font-size: var(--t-eyebrow);
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--c-tide);
  margin: 0 0 var(--s-5);
}

.eyebrow--light { color: rgba(246, 243, 238, 0.82); }

.eyebrow--rule {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}
.eyebrow--rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.3;
  max-width: 6rem;
}

.lead {
  font-size: var(--t-lead);
  line-height: 1.6;
  color: var(--c-ink-2);
}

.display-italic { font-style: italic; }

.measure { max-width: var(--wrap-text); }
.measure-wide { max-width: 78ch; }

/* --- Utilidades --- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow { max-width: 920px; }

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

.section--dark {
  background: var(--c-deep);
  color: var(--c-foam-2);
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--c-paper); }
.section--dark .lead { color: var(--c-foam); }

.section--paper-2 { background: var(--c-paper-2); }

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

.skip-link {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: 200;
  background: var(--c-deep);
  color: var(--c-paper);
  padding: var(--s-3) var(--s-5);
  font-size: var(--t-small);
  transition: transform var(--dur-fast) var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* --- Reveal on scroll --- */

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.9s var(--ease-out) var(--reveal-delay, 0s),
    transform 0.9s var(--ease-out) var(--reveal-delay, 0s);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

[data-reveal="fade"] { transform: none; }
[data-reveal="right"] { transform: translateX(-26px); }

.js-off [data-reveal] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
