/* =====================================================================
   Base: reset ligero, tipografia y estructura del cascaron
   ===================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.35;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
  /* Sin seleccion accidental al tocar rapido, como en una app nativa. */
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

input, textarea, select, [contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}

h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

a { color: var(--blue); text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ------------------------------------------------------------------ cascaron */

#shell {
  min-height: 100dvh;
  max-width: var(--shell-max);
  margin-inline: auto;
  position: relative;
}

/* En pantallas anchas el contenido se lee como un telefono centrado,
   con rieles discretos en lugar de estirarse sin control. */
@media (min-width: 700px) {
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
      radial-gradient(120% 80% at 50% -10%, rgba(98,40,215,.10), transparent 60%),
      var(--bg);
    z-index: -1;
  }
  #shell {
    border-inline: 1px solid var(--hairline);
    min-height: 100dvh;
    background: var(--bg);
  }
}

.view {
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + var(--s6));
  min-height: 100dvh;
}

.view--plain { padding-bottom: var(--s6); }

/* ------------------------------------------------------------------ utilidades */

.stack     { display: grid; gap: var(--s3); }
.stack-2   { display: grid; gap: var(--s2); }
.row       { display: flex; align-items: center; gap: var(--s3); }
.row--tight{ gap: var(--s2); }
.spread    { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.grow      { flex: 1 1 auto; min-width: 0; }
.center    { text-align: center; }
.truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabular   { font-variant-numeric: tabular-nums; }
.mono-num  { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

.pad       { padding-inline: var(--s4); }
.section   { padding: var(--s4) var(--s4) 0; }
.section + .section { padding-top: var(--s5); }

.muted   { color: var(--text-2); }
.faint   { color: var(--text-3); }
.pos     { color: var(--green); }
.neg     { color: var(--red); }
.warn    { color: var(--orange); }

.label {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-2);
}

.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;
}

.hidden { display: none !important; }

/* ------------------------------------------------------------------ animacion */

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes shimmer {
  from { background-position: -180% 0; }
  to   { background-position: 180% 0; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.82); }
}
@keyframes pop {
  0%   { transform: scale(.6); opacity: 0; }
  60%  { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

.enter { animation: rise var(--mid) var(--ease) both; }
.enter-1 { animation-delay: 30ms; }
.enter-2 { animation-delay: 60ms; }
.enter-3 { animation-delay: 90ms; }
.enter-4 { animation-delay: 120ms; }

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