/* ============================================================
   base.css — Reset e tipografia base
   ============================================================ */

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

html, body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* ── Tipografia ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: var(--fw-semi);
  color: var(--text);
  line-height: 1.2;
  letter-spacing: 0.01em;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-base); }

p { line-height: 1.55; }

small { font-size: var(--fs-sm); color: var(--text-dim); }

a {
  color: var(--gold);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--gold-dim); }

/* ── Elementos de formulário ── */
input,
textarea,
select,
button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
  user-select: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  resize: none;
  line-height: 1.45;
}

/* ── Imagens / mídia ── */
img, svg, video, audio {
  display: block;
  max-width: 100%;
}

/* ── Listas ── */
ul, ol { list-style: none; }

/* ── Scrollbars (webkit) ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--surface3); }

/* ── Seleção de texto ── */
::selection {
  background: var(--gold-soft);
  color: var(--text);
}

/* ── Acessibilidade ── */
:focus-visible {
  outline: 2px solid var(--gold-dim);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

[hidden] { display: none !important; }

/* ── Helpers de tipografia ── */
.serif { font-family: var(--font-serif); }
.sans  { font-family: var(--font-sans); }

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

.uppercase {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--fs-xs);
}

/* ── Animações utilitárias ── */
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(201, 168, 76, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface2) 25%,
    var(--border) 50%,
    var(--surface2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius-sm);
}
