/* base.css — reset, tipografía, layout y movimiento. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; color-scheme: light dark; }

@view-transition { navigation: auto; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { line-height: 1.2; color: var(--text); }
a { color: var(--primary); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

.app-shell {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: calc(var(--safe-top) + var(--space-4)) var(--space-5) calc(var(--nav-height) + var(--safe-bottom) + var(--space-8));
  min-height: 100dvh;
  position: relative;
}
.app-shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 320px;
  background: var(--glow);
  pointer-events: none;
  z-index: -1;
}

.app-shell > * { animation: rise 520ms var(--ease-out) backwards; }
.app-shell > *:nth-child(2) { animation-delay: 60ms; }
.app-shell > *:nth-child(3) { animation-delay: 120ms; }
.app-shell > *:nth-child(4) { animation-delay: 180ms; }
.app-shell > *:nth-child(n+5) { animation-delay: 240ms; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: 220ms; }
.bottom-nav { view-transition-name: bottom-nav; }
::view-transition-group(bottom-nav) { animation: none; }

.section { margin-top: var(--space-8); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.section-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--radius-lg);
}

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::selection { background: var(--primary-solid); color: var(--on-primary); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
