/* ═══════════════════════════════════════════════════════════════
   PrepTraX · Traxium · Ship-Trax — Unified Design Tokens (v2)
   Single source of truth across all three apps.
   Space Grotesk Display · Inter Body · JetBrains Mono Data.
   Load order: theme.css → traxium-design-system.css → page.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* All design tokens previously defined here have been migrated to
   css/0-tokens/. This file now contains only the body / focus-ring /
   utility rules and the dark-mode-specific overrides. */

/* Dark-mode tokens migrated to css/0-tokens/legacy.css */

/* ══════════════════════════════════════
   GLOBAL BODY RESET
   Deep sapphire canvas with animated aurora mesh.
══════════════════════════════════════ */
body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image: var(--grad-mesh);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animated mesh — drifts slowly behind content */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--grad-mesh);
  animation: ptxMeshDrift 26s ease-in-out infinite alternate;
}
@keyframes ptxMeshDrift {
  0%   { transform: translate(0,0)   scale(1);    }
  100% { transform: translate(-2%,1%) scale(1.04); }
}

/* ══════════════════════════════════════
   FOCUS RING — Electric Royal
══════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ══════════════════════════════════════
   ICON SIZING NORMALIZATION
══════════════════════════════════════ */
[data-lucide] { width: 1em; height: 1em; stroke-width: 1.6; flex-shrink: 0; }
.icon-xs { width: 12px; height: 12px; }
.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 16px; height: 16px; }
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 28px; height: 28px; }

/* ═══════════════════════════════════════════════════════════════
   CANONICAL TRAXIUM / PREPTRAX LOGO
   "Pt" tile with aurora gradient (violet → blue → cyan → magenta).
   Use <a class="tx-logo"> anywhere — sidebar, nav, auth, footer.
═══════════════════════════════════════════════════════════════ */
.tx-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.022em;
  line-height: 1;
  white-space: nowrap;
}
.tx-logo-mark {
  position: relative;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--tx-color-violet-600) 0%, var(--tx-color-blue-brand) 35%, var(--tx-color-cyan-brand) 70%, var(--tx-color-pink-brand) 100%);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--tx-color-white);
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: -0.04em;
  box-shadow:
    0 6px 18px rgba(61,123,255,0.45),
    inset 0 1px 0 rgba(255,255,255,0.32),
    inset 0 -6px 12px rgba(138,91,255,0.25);
  flex-shrink: 0;
  transition: transform var(--tr-spring), box-shadow var(--tr-fast);
}
.tx-logo-mark::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.14), transparent 55%);
  pointer-events: none;
}
.tx-logo:hover .tx-logo-mark {
  transform: rotate(-4deg) scale(1.06);
  box-shadow: 0 8px 22px rgba(61,123,255,0.55),
              inset 0 1px 0 rgba(255,255,255,0.36),
              inset 0 -6px 12px rgba(138,91,255,0.30);
}
/* Word mark: now in white (was gold) — gradient applied via .tx-logo-word.grad */
.tx-logo-word {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.022em;
  color: var(--text);
}
.tx-logo-word sup {
  font-size: 0.48em;
  font-weight: 600;
  vertical-align: super;
  line-height: 0;
  letter-spacing: 0;
  color: inherit;
  opacity: 0.75;
  margin-left: 1px;
}
.tx-logo-sub {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-left: 2px;
}
.tx-logo-sm .tx-logo-mark { width: 26px; height: 26px; border-radius: 7px; font-size: 0.62rem; }
.tx-logo-sm .tx-logo-word { font-size: 0.92rem; }
.tx-logo-sm .tx-logo-sub  { font-size: 0.58rem; }
.tx-logo-lg .tx-logo-mark { width: 42px; height: 42px; border-radius: 12px; font-size: 0.92rem; }
.tx-logo-lg .tx-logo-word { font-size: 1.25rem; }
.tx-logo-lg .tx-logo-sub  { font-size: 0.72rem; }

.tx-logo .logo-main { color: var(--text); }
.tx-logo .logo-sub  { color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   PREMIUM ICON TILES  (.tx-icon-box)
   Tinted icon containers used across pages and cards.
═══════════════════════════════════════════════════════════════ */
.tx-icon-box {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--primary);
  flex-shrink: 0;
  position: relative;
  transition: transform var(--tr-spring), border-color var(--tr-fast), box-shadow var(--tr-fast);
  overflow: hidden;
}
.tx-icon-box::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 120% 90% at 50% 0%, currentColor, transparent 70%);
  opacity: 0.10;
  pointer-events: none;
}
.tx-icon-box svg, .tx-icon-box [data-lucide] {
  width: 26px; height: 26px;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
  position: relative; z-index: 1;
}
.tx-icon-box:hover { transform: translateY(-2px) rotate(-2deg); box-shadow: var(--shadow-card); }
.tx-icon-box.xs { width: 36px; height: 36px; border-radius: 10px; }
.tx-icon-box.xs svg, .tx-icon-box.xs [data-lucide] { width: 18px; height: 18px; }
.tx-icon-box.sm { width: 44px; height: 44px; border-radius: 12px; }
.tx-icon-box.sm svg, .tx-icon-box.sm [data-lucide] { width: 20px; height: 20px; }
.tx-icon-box.lg { width: 72px; height: 72px; border-radius: 20px; }
.tx-icon-box.lg svg, .tx-icon-box.lg [data-lucide] { width: 32px; height: 32px; }
/* Tints (semantic categories) */
.tx-icon-cyan   { color: var(--tx-color-cyan-brand); background: rgba(56,225,255,0.09); border-color: rgba(56,225,255,0.26); }
.tx-icon-blue   { color: var(--tx-color-blue-brand); background: rgba(61,123,255,0.10); border-color: rgba(61,123,255,0.28); }
.tx-icon-purple { color: var(--tx-color-violet-600); background: rgba(138,91,255,0.10); border-color: rgba(138,91,255,0.26); }
.tx-icon-pink   { color: var(--tx-color-pink-brand); background: rgba(255,61,165,0.08); border-color: rgba(255,61,165,0.24); }
.tx-icon-gold   { color: var(--tx-color-amber-mid); background: rgba(255,179,71,0.09); border-color: rgba(255,179,71,0.26); }
.tx-icon-green  { color: var(--tx-color-emerald-lime); background: rgba(124,255,178,0.09); border-color: rgba(124,255,178,0.26); }

/* ══════════════════════════════════════
   LEGACY LOGO-MARK ALIAS
══════════════════════════════════════ */
.logo-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}
