/* ============================================================
   SofiaX — design tokens & base styles
   Dark, premium, technical-editorial
   ============================================================ */

:root {
  /* surfaces */
  --bg: #0B0E14;
  --surface: #0F1620;
  --surface-deep: #070A0F;
  --border: #1E2A3A;
  --border-soft: #16202D;

  /* text */
  --text: #EAF0F6;
  --muted: #8A97A8;
  --faint: #5A6678;

  /* brand */
  --gold: #E5B567;
  --gold-soft: rgba(229, 181, 103, 0.12);

  /* status */
  --blue: #3B9EFF;
  --green: #3FCF8E;
  --amber: #F0A03C;
  --purple: #A78BFA;
  --red: #FF6B6B;

  /* radius (overridden by density tweak if needed) */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  /* density spacing scale */
  --pad: 28px;
  --gap: 20px;
  --stack: 18px;

  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
  --display: 'Space Grotesk', 'Inter', sans-serif;
}

/* density variants */
[data-density="compact"] {
  --pad: 18px;
  --gap: 12px;
  --stack: 12px;
}
[data-density="roomy"] {
  --pad: 40px;
  --gap: 30px;
  --stack: 26px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  /* subtle technical grid wash */
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(229,181,103,0.05), transparent 60%),
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 100% 100%, 64px 64px, 64px 64px;
  background-position: 0 0, 0 0, 0 0;
}

::selection { background: var(--gold); color: #11151c; }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #1b2736; border-radius: 10px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #25344a; }

/* ---------- typography helpers ---------- */
.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.mono { font-family: var(--mono); }
.display { font-family: var(--display); letter-spacing: -0.02em; }

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; font-weight: 600; margin: 0; }

/* ---------- focus ---------- */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
input, textarea, button { font-family: inherit; }

/* ---------- keyframes ---------- */
@keyframes sx-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* transform-only entrance: stays visible even if the animation clock is frozen */
@keyframes sx-slide-in {
  from { transform: translateY(12px); }
  to   { transform: translateY(0); }
}
@keyframes sx-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes sx-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
@keyframes sx-spin { to { transform: rotate(360deg); } }
@keyframes sx-scan {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(2000%); }
}
@keyframes sx-bar-stripe {
  to { background-position: 28px 0; }
}

.sx-shimmer {
  background: linear-gradient(100deg, #0f1620 30%, #18222f 50%, #0f1620 70%);
  background-size: 200% 100%;
  animation: sx-shimmer 1.6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* app entrance (transform-only — never leaves content invisible) */
.screen-enter { animation: sx-slide-in 0.42s cubic-bezier(.2,.7,.3,1) both; }

/* generic reset for buttons */
button.bare {
  background: none; border: none; padding: 0; margin: 0; cursor: pointer; color: inherit;
}
