/* assets/css/base.css */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: var(--text-body);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* === Hebraico (fonte real) ===
   Aplica Frank Ruhl Libre — fonte hebraica clássica serifada.
   Use lang="he" em qualquer elemento contendo letras hebraicas,
   ou a classe utilitária .heb. */
[lang="he"],
.heb {
  font-family: "Frank Ruhl Libre", "SBL Hebrew", "Times New Roman", serif;
  font-weight: 500;
  direction: rtl;
  unicode-bidi: isolate;
}

/* === Screen reader only === */
.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;
}

.sr-only-focusable:focus {
  position: fixed;
  top: var(--space-sm);
  left: var(--space-sm);
  z-index: 10000;
  width: auto;
  height: auto;
  padding: var(--space-sm) var(--space-md);
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--bg-card);
  color: var(--purpura-text);
  font-family: var(--sans);
  font-weight: 500;
  font-size: var(--text-caption);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(46, 31, 74, 0.15);
  text-decoration: none;
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* === Focus visible === */
:focus-visible {
  outline: 2px solid var(--purpura);
  outline-offset: 2px;
}

/* === Typography scale === */
.text-display {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: var(--text-display);
  line-height: 1.2;
}

.text-h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: var(--text-h1);
  line-height: 1.2;
}

.text-h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: var(--text-h2);
  line-height: 1.3;
}

.text-h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: var(--text-h3);
  line-height: 1.3;
}

.text-body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: var(--text-body);
  line-height: 1.75;
}

.text-body-sm {
  font-family: var(--sans);
  font-weight: 300;
  font-size: var(--text-body-sm);
  line-height: 1.6;
}

.text-caption {
  font-family: var(--sans);
  font-weight: 400;
  font-size: var(--text-caption);
  line-height: 1.5;
}

.text-overline {
  font-family: var(--mono);
  font-weight: 400;
  font-size: var(--text-overline);
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.text-fine {
  font-family: var(--mono);
  font-weight: 400;
  font-size: var(--text-fine);
  line-height: 1.5;
}

/* === Scroll reveal base === */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s var(--ease-out),
    transform 0.6s var(--ease-out);
}

.reveal-stagger.visible > *:nth-child(1) {
  transition-delay: 0s;
}
.reveal-stagger.visible > *:nth-child(2) {
  transition-delay: 0.1s;
}
.reveal-stagger.visible > *:nth-child(3) {
  transition-delay: 0.15s;
}
.reveal-stagger.visible > *:nth-child(4) {
  transition-delay: 0.2s;
}

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
