/**
 * MiyobiLab & MiyoIA — Design Tokens & Core Theme
 */

:root {
  /* Paleta base clara */
  --bg: #fbfbfd;
  --ink: #17171a;
  --mute: #86868f;
  --rule: rgba(0, 0, 0, 0.07);
  --rule-d: #d4d4d8;
  --soft: rgba(0, 0, 0, 0.04);
  --paper: #ffffff;
  --line: rgba(0, 0, 0, 0.07);

  /* Marca y acentos */
  --red: #e4003a;
  --red-d: #c70032;
  --pink: #fde8ec;
  --accent: #e4003a;

  /* Colores de capas y categorías anatómicas */
  --c1: #e4003a;
  --c2: #ff7a59;
  --c3: #f4b740;
  --c4: #34c3a0;
  --c5: #6b7cff;
  --c6: #f08aa0;

  /* Sombras y elevaciones */
  --shadow: 0 1px 2px rgba(23, 23, 26, .04), 0 14px 44px rgba(23, 23, 26, .08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.09);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.76);
  --glass-border: rgba(255, 255, 255, 0.88);
  --glass-shadow: 0 12px 36px rgba(0, 0, 0, 0.05), inset 0 1px 1.5px rgba(255, 255, 255, 0.95);
  --glass-blur: blur(22px) saturate(190%);

  /* Geometría de disposición */
  --font: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --rail: 76px;
  --bar: 0px;
  --app-header: 64px;
  --max-content: 1200px;
  --read-content: 840px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
}

/* Modo oscuro */
[data-theme="dark"] {
  --bg: #121216;
  --ink: #f5f5f7;
  --mute: #9999a4;
  --rule: rgba(255, 255, 255, 0.08);
  --rule-d: #383842;
  --soft: rgba(255, 255, 255, 0.05);
  --paper: #1a1a22;
  --line: rgba(255, 255, 255, 0.08);

  --red: #ff3360;
  --red-d: #e4003a;
  --pink: #341822;
  --accent: #ff3360;

  --shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 18px 48px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 52px rgba(0, 0, 0, 0.6);

  --glass-bg: rgba(24, 24, 32, 0.82);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

/* Reseteo estructural y tipografía fluida */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: light dark;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

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

svg.i {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Transiciones de vista nativas (Chrome 126+) */
@view-transition {
  navigation: auto;
}

::view-transition-old(header),
::view-transition-new(header) {
  animation: none;
  mix-blend-mode: normal;
}
