/* ==========================================================================
   ESTEEM — TOKENS
   Único lugar donde viven color, tipografía y ritmo.
   Cambia --brand y toda la aplicación se reviste. brand.js calcula además
   --brand-ink y --brand-text para que cualquier color de cliente se lea.
   ========================================================================== */

/* Tipografías alojadas en el propio sitio (ver vendor/README.md). Antes venían
   de Google Fonts: un tercero en la ruta crítica, bloqueado en redes
   corporativas e imposible de guardar para usarse sin conexión. */
@font-face {
  font-family: 'Instrument Serif';
  src: url('../assets/tipografias/instrument-serif-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('../assets/tipografias/instrument-serif-latin-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/tipografias/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/tipografias/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 800; font-style: normal; font-display: swap;
}

:root {
  color-scheme: dark;

  /* ---- Marca: el único acento ---- */
  --brand:       #c8a951;
  --brand-ink:   #17130a;              /* texto sobre relleno de marca: lo recalcula brand.js */
  --brand-text:  #d6bd72;              /* marca legible sobre el fondo: lo recalcula brand.js */
  --brand-soft:  color-mix(in srgb, var(--brand) 14%, transparent);
  --brand-dim:   color-mix(in srgb, var(--brand) 8%,  transparent);
  --brand-line:  color-mix(in srgb, var(--brand) 38%, transparent);

  /* ---- Superficies ---- */
  --bg:          #0a0a0b;
  --bg-raise:    #111113;
  --bg-sunken:   #060607;
  --surface:     rgba(255,255,255,.038);
  --surface-2:   rgba(255,255,255,.055);
  --surface-3:   rgba(255,255,255,.08);
  --line:        rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.17);

  /* ---- Tinta ----
     --ink-3 no baja de 5:1 sobre ninguna superficie, tampoco las teñidas de
     marca. La anterior (#6b6760) daba 3:1 y era el fallo de contraste de
     todas las pantallas. */
  --ink:   #f4f2ee;
  --ink-2: #b3aea6;
  --ink-3: #948f86;

  /* ---- Estado: reservado para concedido, denegado y aviso ---- */
  --ok:        #4ade80;
  --ok-soft:   rgba(74,222,128,.12);
  --ok-line:   rgba(74,222,128,.34);
  --ok-fill:   #0f7a3f;
  --no:        #fb7185;
  --no-soft:   rgba(251,113,133,.12);
  --no-line:   rgba(251,113,133,.36);
  --no-fill:   #a3122f;
  --warn:      #fbbf24;
  --warn-soft: rgba(251,191,36,.12);
  --warn-line: rgba(251,191,36,.38);

  /* ---- Tipos de credencial ----
     Color funcional, como el de estado: el staff distingue un gafete de
     expositor de uno de prensa de un vistazo. Nunca va solo: siempre con el
     nombre de la credencial escrito. `-ink` es el tono para texto sobre el
     fondo oscuro; `-band` el relleno de la franja del gafete impreso. */
  --cred-visitante-ink: #aab3be; --cred-visitante-band: #4b5563;
  --cred-ponente-ink:   var(--brand-text); --cred-ponente-band: var(--brand);
  --cred-expositor-ink: #5eead4; --cred-expositor-band: #0f766e;
  --cred-prensa-ink:    #c4b5fd; --cred-prensa-band:    #6d28d9;

  /* ---- Tipografía ---- */
  --serif: 'Instrument Serif', Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, monospace;

  /* ---- Radios ---- */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-full: 999px;

  /* ---- Elevación ---- */
  --lift-1: 0 1px 0 rgba(255,255,255,.06) inset, 0 10px 30px -12px rgba(0,0,0,.8);
  --lift-2: 0 1px 0 rgba(255,255,255,.07) inset, 0 30px 70px -20px rgba(0,0,0,.9);

  /* ---- Movimiento ---- */
  --ease: cubic-bezier(.16,1,.3,1);
  --fast: .18s;
  --med:  .3s;

  /* ---- Capas ---- */
  --z-nav: 100;
  --z-menu: 300;
  --z-modal: 500;
  --z-toast: 900;
}

/* Proyector y pantallas grandes: todo lo que se mide en rem crece con esto. */
@media (min-width: 1600px) { html { font-size: 17px; } }
@media (min-width: 1880px) { html { font-size: 18px; } }

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

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Luz ambiental cálida. Fija, no se mueve con el scroll. */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(80vw 60vh at 10% -12%, color-mix(in srgb, var(--brand) 9%, transparent), transparent 62%),
    radial-gradient(70vw 50vh at 95% 105%, rgba(120,130,190,.07), transparent 60%);
}

/* Grano fino: lo que separa un negro plano de uno que se ve caro. */
body::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .3;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-sunken); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--brand-line); }

::selection { background: var(--brand-soft); color: var(--brand-text); }

:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; border-radius: 3px; }

[hidden] { display: none !important; }

/* ==========================================================================
   Utilidades compartidas
   ========================================================================== */

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Números alineados: relojes, folios, aforos en columna. */
.tabular {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

/* Etiqueta pequeña en versalitas mono: el conector visual de toda la app. */
.eyebrow {
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.eyebrow-brand { color: var(--brand-text); }

.eyebrow-rule { display: flex; align-items: center; gap: 8px; }
.eyebrow-rule::before {
  content: ''; width: 15px; height: 1px;
  background: currentColor; opacity: .7; flex: none;
}

.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.015em; }

/* ---- Monogramas: iniciales sobre un tono estable por persona ---- */
.avatar {
  --av-a: #3a3f4b; --av-b: #252830;
  display: inline-grid; place-items: center; flex: none;
  border-radius: 50%; overflow: hidden;
  background: linear-gradient(145deg, var(--av-a), var(--av-b));
  color: #f4f2ee; font-family: var(--serif); letter-spacing: .02em;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset;
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 32px; height: 32px; font-size: .86rem; }
.avatar--md { width: 44px; height: 44px; font-size: 1.1rem; }
.avatar--lg { width: 56px; height: 56px; font-size: 1.4rem; }
.avatar--xl { width: 68px; height: 68px; font-size: 1.75rem; }
.tone-0 { --av-a: #3d4a5c; --av-b: #232b36; }
.tone-1 { --av-a: #2f5550; --av-b: #1b302d; }
.tone-2 { --av-a: #57523a; --av-b: #302d20; }
.tone-3 { --av-a: #553a52; --av-b: #30202e; }
.tone-4 { --av-a: #5e4234; --av-b: #33241c; }
.tone-5 { --av-a: #3a4a63; --av-b: #212a39; }
.tone-6 { --av-a: #45553a; --av-b: #283121; }
.tone-7 { --av-a: #5a5147; --av-b: #332e28; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .45; transform: scale(.82); }
}

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