/* ══════════════════════════════════════════════════════════════
   SUPERSIMULADOR PY — Utility Classes
   Diagonal motion · Trama patterns · Editorial typography
   ══════════════════════════════════════════════════════════════ */

/* ─── Typography ─────────────────────────────────────────── */
.num-mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' on, 'zero' on;
  font-variant-numeric: tabular-nums slashed-zero;
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-terracotta), var(--color-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted-soft { color: var(--color-muted); font-family: var(--font-body); }
.text-ink { color: var(--color-ink); }
.fw-500 { font-weight: 500; }
.text-start { text-align: left; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.italic { font-style: italic; }

/* Type scale utils */
.text-display { font-family: var(--font-display); }
.text-body { font-family: var(--font-body); }
.text-mono { font-family: var(--font-mono); }
.fs-hero { font-size: var(--text-hero); font-family: var(--font-display); }
.fs-xl { font-size: var(--text-xl); }
.fs-lg { font-size: var(--text-lg); }
.fs-md { font-size: var(--text-md); }
.fs-sm { font-size: var(--text-sm); }
.fs-xs { font-size: var(--text-xs); }

/* ─── Display ────────────────────────────────────────────── */
.d-none { display: none; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-inline-flex { display: inline-flex; }

@media (min-width: 768px) {
  .d-md-inline { display: inline; }
  .d-md-block { display: block; }
  .d-md-flex { display: flex; }
}

/* ─── Flex ───────────────────────────────────────────────── */
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow-1 { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: var(--space-1); }
.gap-sm { gap: var(--space-2); }
.gap-md { gap: var(--space-4); }
.gap-lg { gap: var(--space-5); }
.gap-xl { gap: var(--space-6); }

/* ─── Spacing ────────────────────────────────────────────── */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-2); }
.mt-md { margin-top: var(--space-4); }
.mt-lg { margin-top: var(--space-5); }
.mt-xl { margin-top: var(--space-6); }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-2); }
.mb-md { margin-bottom: var(--space-4); }
.mb-lg { margin-bottom: var(--space-5); }
.mb-xl { margin-bottom: var(--space-6); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-0 { padding: 0; }
.p-sm { padding: var(--space-2); }
.p-md { padding: var(--space-4); }
.p-lg { padding: var(--space-5); }
.px-md { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-sm { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-md { padding-top: var(--space-4); padding-bottom: var(--space-4); }

/* ─── Sizing ─────────────────────────────────────────────── */
.w-100 { width: 100%; }
.w-auto { width: auto; }
.h-100 { height: 100%; }
.max-w-sm { max-width: 420px; }
.max-w-md { max-width: 520px; }
.max-w-lg { max-width: 720px; }
.min-w-0 { min-width: 0; }

/* ─── Visual ──────────────────────────────────────────────── */
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* ─── Hover Effects ──────────────────────────────────────── */
.hover-lift {
  transition: transform var(--duration-normal) var(--ease-out-expo);
}
.hover-lift:hover {
  transform: translate(2px, -2px);
}

.hover-gold:hover { color: var(--color-gold-bright); }
.hover-terracotta:hover { color: var(--color-terracotta); }

/* ─── Diagonal Section Transitions ───────────────────────── */
.section-diagonal-bottom {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 3vw), 0 100%);
}

.section-diagonal-top {
  clip-path: polygon(0 3vw, 100% 0, 100% 100%, 0 100%);
}

/* ─── Trama Background Pattern ───────────────────────────── */
.bg-trama {
  background-image: var(--pattern-trama);
  background-size: 120px 120px;
}

.bg-trama-dark {
  background-image: var(--pattern-trama);
  background-size: 140px 140px;
  opacity: 0.04;
}

/* ─── Career Background Colors ───────────────────────────── */
.bg-contabilidad { background-color: var(--career-contabilidad); }
.bg-administracion { background-color: var(--career-administracion); }
.bg-comercio { background-color: var(--career-comercio); }
.bg-ingenieria { background-color: var(--career-ingenieria); }

/* ─── Animations ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDiagonal {
  from { opacity: 0; transform: translate(24px, -24px); }
  to { opacity: 1; transform: translate(0, 0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(80px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(80px); }
}

@keyframes tramaExpand {
  from { clip-path: circle(0% at center); }
  to { clip-path: circle(100% at center); }
}

@keyframes rotateOctagon {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200,150,62,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(200,150,62,0); }
}

.animate-fade { animation: fadeIn var(--duration-reveal) var(--ease-out-expo) both; }
.animate-diagonal { animation: slideDiagonal var(--duration-slow) var(--ease-out-expo) both; }
.animate-scale { animation: scaleIn var(--duration-normal) var(--ease-out-expo) both; }
.animate-trama { animation: tramaExpand var(--duration-slow) var(--ease-out-expo) both; }

/* Octagonal spinner */
.octa-spin {
  width: 28px;
  height: 28px;
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  background: var(--color-terracotta);
  animation: rotateOctagon 1.5s var(--ease-out-expo) infinite;
}

/* Pulse ring for achievements / status changes */
.pulse-gold {
  animation: pulseGold 2s var(--ease-out-expo) infinite;
}

/* Stagger children */
.animate-stagger > * {
  animation: fadeIn var(--duration-slow) var(--ease-out-expo) both;
}
.animate-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.10s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.20s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.30s; }
.animate-stagger > *:nth-child(7) { animation-delay: 0.35s; }
.animate-stagger > *:nth-child(8) { animation-delay: 0.40s; }

/* ─── HTMX Transitions ───────────────────────────────────── */
.htmx-swapping { opacity: 0; transition: opacity var(--duration-fast) var(--ease-out-expo); }
.htmx-settling { opacity: 1; }

/* ─── Responsive visibility ──────────────────────────────── */
@media (max-width: 767px) {
  .d-none-mobile { display: none !important; }
  .w-100-mobile { width: 100% !important; }
}
@media (min-width: 768px) {
  .d-none-desktop { display: none !important; }
}