/* ============================================================
   Barber.ia — theme.css
   Tokens, reset, tipografía y layout editorial
   ============================================================ */

:root {
  /* Paleta exacta */
  --bg: #09090B;
  --surface: #111114;
  --surface-2: #18181C;
  --line: #26262C;
  --line-strong: #383842;
  --text: #F4F4F6;
  --muted: #9E9EA9;
  --dim: #63636E;

  --accent: #EAB308;
  --accent-hover: #CA8A04;
  --on-accent: #09090B;

  --success: #10B981;
  --danger: #EF4444;
  --info: #38BDF8;

  /* Tipografía */
  --font-display: 'Oswald', 'Arial Narrow', Impact, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  /* Métricas */
  --r-xs: 2px;
  --r-sm: 3px;
  --r-md: 5px;
  --r-lg: 8px;
  --r-full: 999px;
  --nav-h: 60px;
  --topbar-h: 62px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(70rem 42rem at 8% -12%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 62%),
    radial-gradient(55rem 38rem at 104% -4%, rgba(37, 99, 235, .06), transparent 60%);
}

/* Franja Barber Pole */
.pole {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  z-index: 120;
  background-image: repeating-linear-gradient(
    135deg,
    #DC2626 0 10px,
    #F4F4F6 10px 20px,
    #2563EB 20px 30px
  );
  background-size: 42.43px 4px;
  animation: pole-move 18s linear infinite;
}

@keyframes pole-move {
  from { background-position: 0 0; }
  to { background-position: 424px 0; }
}

/* Grano editorial */
.grain {
  position: fixed;
  inset: 0;
  z-index: 110;
  pointer-events: none;
  opacity: .035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0c0c0f; }
::-webkit-scrollbar-thumb { background: #2c2c34; border-radius: 20px; border: 2px solid #0c0c0f; }
::-webkit-scrollbar-thumb:hover { background: #3c3c46; }

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ---------- Tipografía ---------- */

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: .012em;
  color: var(--text);
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }

strong, b { font-weight: 700; }
small { font-size: .8125rem; }

.display {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  line-height: .95;
  letter-spacing: .01em;
}

.display-xl {
  font-size: clamp(2.8rem, 10vw, 7rem);
  line-height: .86;
  letter-spacing: -.015em;
}

.display-lg { font-size: clamp(2.1rem, 5.4vw, 3.6rem); line-height: .92; }
.display-md { font-size: clamp(1.55rem, 3.4vw, 2.3rem); }
.display-sm { font-size: clamp(1.15rem, 2.2vw, 1.4rem); }

.kicker {
  font-family: var(--font-body);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--dim);
  line-height: 1.4;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  letter-spacing: -.01em;
}

.muted { color: var(--muted); }
.dim { color: var(--dim); }
.accent { color: var(--accent); }
.success { color: var(--success); }
.danger { color: var(--danger); }
.balance { text-wrap: balance; }
.pretty { text-wrap: pretty; }

.lead {
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow-line {
  display: flex;
  align-items: center;
  gap: .9rem;
  color: var(--accent);
}
.eyebrow-line::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

/* ---------- Layout ---------- */

.app-root {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(100% - 2.5rem, 1240px);
  margin-inline: auto;
}

.container-wide { width: min(100% - 2.5rem, 1440px); margin-inline: auto; }
.container-narrow { width: min(100% - 2.5rem, 780px); margin-inline: auto; }

.page {
  flex: 1;
  padding: clamp(1.4rem, 4vw, 2.8rem) 0 calc(var(--nav-h) + var(--safe-b) + 2rem);
}

@media (max-width: 480px) {
  .container, .container-wide, .container-narrow { width: calc(100% - 2rem); }
}

.stack { display: flex; flex-direction: column; }
.stack-2 { gap: .5rem; }
.stack-3 { gap: .75rem; }
.stack-4 { gap: 1rem; }
.stack-6 { gap: 1.5rem; }
.stack-8 { gap: 2rem; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.end { justify-content: flex-end; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.grow { flex: 1; min-width: 0; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; } .gap-6 { gap: 1.5rem; }

.grid { display: grid; gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 1rem; }

@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line); border: 0; margin: 1.5rem 0; }
.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;
}

.hide-mobile { display: initial; }
.hide-desktop { display: none; }
@media (max-width: 860px) {
  .hide-mobile { display: none !important; }
  .hide-desktop { display: initial; }
}

/* ---------- Animaciones ---------- */

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -420px 0; }
  100% { background-position: 420px 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }

.animate-in { animation: rise-in .38s var(--ease) both; }
.fade-in { animation: fade-in .35s var(--ease) both; }

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

/* ---------- Splash ---------- */

.boot-splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  background: var(--bg);
  transition: opacity .45s var(--ease), visibility .45s;
}
.boot-splash.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.boot-mark {
  width: 76px; height: 76px;
  color: var(--accent);
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 50%;
  animation: fade-in .6s var(--ease) both;
}
.boot-mark .emblem { width: 52px; height: 52px; }
.boot-word {
  font-size: 1.5rem;
  letter-spacing: .28em;
  padding-left: .28em;
  color: var(--text);
}
.boot-bar {
  width: 140px; height: 2px; background: var(--line); overflow: hidden;
}
.boot-bar span {
  display: block; height: 100%; width: 40%;
  background: var(--accent);
  animation: boot-slide 1.1s var(--ease) infinite;
}
@keyframes boot-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.noscript {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg); color: var(--text); padding: 2rem; text-align: center; z-index: 300;
}

/* ---------- Impresión (pase) ---------- */
@media print {
  body { background: #fff; color: #000; }
  .pole, .grain, .topbar, .bottomnav, .no-print, .toasts { display: none !important; }
  .page { padding: 0; }
  .ticket { border-color: #000; background: #fff; color: #000; }
  .ticket * { color: #000 !important; }
}
