/* ============================================================================
   Bita Express · Base
   Reset + tipografía + utilidades globales
   ============================================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background-color: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--body-md);
  line-height: var(--line-body);
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
}

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

a {
  color: var(--text-link);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--motion-fast) var(--ease-standard);
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

button {
  font-family: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Tipografía · headings */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: var(--tracking-display);
  line-height: var(--line-display);
  color: var(--text-primary);
}

h1 { font-size: var(--heading-h1); line-height: 1.05; letter-spacing: -0.012em; }
h2 { font-size: var(--heading-h2); line-height: 1.1; letter-spacing: -0.01em; }
h3 { font-size: var(--heading-h3); line-height: 1.18; letter-spacing: -0.006em; font-weight: 700; }
h4 { font-size: var(--heading-h4); line-height: 1.25; letter-spacing: 0; font-weight: 700; }

p {
  margin: 0;
  max-width: 65ch;
}

ul, ol {
  margin: 0;
  padding: 0;
}

/* Labels · mono */
.label-mono,
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--label-md);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--brand-secondary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.eyebrow::before {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  flex-shrink: 0;
}

.eyebrow--accent { color: var(--brand-accent); }
.eyebrow--ink { color: var(--text-primary); }

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--brand-secondary);
  color: var(--on-brand-secondary);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--label-md);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  z-index: var(--z-toast);
  transition: top var(--motion-fast) var(--ease-standard);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.skip-link:focus {
  top: var(--space-4);
  text-decoration: none;
}

/* Utilidades de layout */
.container {
  width: 100%;
  max-width: var(--container-main);
  margin: 0 auto;
  padding-left: var(--margin-x);
  padding-right: var(--margin-x);
}

.container--content { max-width: var(--container-content); }
.container--reading { max-width: var(--container-reading); }
.container--form { max-width: var(--container-form); }

.section {
  position: relative;
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

@media (min-width: 768px) {
  .section { padding-top: var(--space-20); padding-bottom: var(--space-20); }
}

@media (min-width: 1024px) {
  .section { padding-top: var(--space-24); padding-bottom: var(--space-24); }
}

.section--dark {
  background-color: var(--surface-inverse);
  color: var(--text-inverse);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 { color: var(--text-inverse); }

.section--dark .eyebrow { color: var(--brand-accent); }

.section--dark a { color: var(--link-inverse); }

.section--wine {
  background-color: var(--brand-secondary);
  color: var(--text-inverse);
}

.section--wine h1,
.section--wine h2,
.section--wine h3,
.section--wine h4 { color: var(--text-inverse); }

.section--wine .eyebrow { color: var(--brand-accent); }

.section--orange {
  background-color: var(--brand-primary);
  color: var(--on-brand-primary);
}

.section--orange h1,
.section--orange h2,
.section--orange h3,
.section--orange h4 { color: var(--on-brand-primary); }

.section--orange .eyebrow { color: var(--on-brand-primary); }

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

/* Display utility */
.display-2xl { font-size: var(--display-2xl); line-height: 0.95; }
.display-xl { font-size: var(--display-xl); line-height: 0.98; }

.text-orange { color: var(--brand-primary); }
.text-wine { color: var(--brand-secondary); }
.text-accent { color: var(--brand-accent); }
.text-muted { color: var(--text-muted); }

/* Hairline divider */
.divider {
  height: 1px;
  background: var(--border-subtle);
  border: none;
  margin: 0;
}

.divider--inverse { background: var(--border-inverse); }

/* Selección */
::selection {
  background: var(--brand-primary);
  color: var(--on-brand-primary);
}

.section--dark ::selection,
.section--wine ::selection {
  background: var(--brand-accent);
  color: var(--on-brand-accent);
}
