/* Hyperstudio Design System — DESIGN.md Reference Specification */
:root {
  --color-obsidian: #101010;
  --color-carbon: #080808;
  --color-chalk: #f3f3f3;
  --color-smoke: #9c9c9c;
  --color-ash: #c1c1c1;
  --color-graphite: #212121;
  --color-iron: #474747;
  --color-signal-white: #ffffff;
  --color-compass-gold: #6f6759;
  --color-card-slate: #3b3d45;
  --color-pulse: #98ff38;
  --color-loss: #ff7a6b;

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: #101010;
  color: #f3f3f3;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-feature-settings: 'ss01' on, 'cv11' on;
  background-color: #101010;
  color: #f3f3f3;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, strong, b, th {
  font-weight: 400;
}

::selection {
  background: var(--color-chalk);
  color: var(--color-obsidian);
}

/* Color utility fallbacks */
.bg-obsidian { background-color: var(--color-obsidian); }
.bg-carbon { background-color: var(--color-carbon); }
.text-chalk { color: var(--color-chalk); }
.text-smoke { color: var(--color-smoke); }
.text-ash { color: var(--color-ash); }
.text-loss { color: var(--color-loss); }
.text-pulse { color: var(--color-pulse); }
.border-graphite { border-color: var(--color-graphite); }
.border-iron { border-color: var(--color-iron); }

.rounded-card { border-radius: 8px; }
.rounded-tag { border-radius: 4px; }
.max-w-page { max-width: 1200px; }

/* Type scale fallbacks */
.text-display { font-size: 63px; line-height: 1.05; letter-spacing: -0.69px; }
.text-heading-lg { font-size: 44px; line-height: 1.07; letter-spacing: -0.31px; }
.text-heading { font-size: 34px; line-height: 1.03; }
.text-heading-sm { font-size: 23px; line-height: 1.07; }
.text-subheading { font-size: 21px; line-height: 1.3; }
.text-heading-xs { font-size: 18px; line-height: 1.31; }
.text-body { font-size: 16px; line-height: 1.5; }
.text-caption { font-size: 13px; line-height: 1.5; }

/* Borders & Structural Hairlines */
.hairline { border: 1px solid var(--color-graphite); }
.hairline-b { border-bottom: 1px solid var(--color-graphite); }
.hairline-t { border-top: 1px solid var(--color-graphite); }
.hairline-l { border-left: 1px solid var(--color-graphite); }
.hairline-r { border-right: 1px solid var(--color-graphite); }

/* Containers */
.panel {
  background: transparent;
  border: 1px solid var(--color-graphite);
  border-radius: 8px;
}

.panel-deep {
  background: var(--color-carbon);
  border: 1px solid var(--color-graphite);
  border-radius: 8px;
}

/* Metadata typography */
.meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: -0.022em;
  text-transform: uppercase;
  color: var(--color-smoke);
}

/* White Pill Button — Primary Action CTA */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--color-signal-white);
  color: var(--color-obsidian);
  border: 1px solid var(--color-signal-white);
  border-radius: 9999px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.btn-pill:hover:not(:disabled) {
  background: transparent;
  color: var(--color-signal-white);
}

/* Ghost Outline Button — Secondary Action */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--color-chalk);
  border: 1px solid var(--color-iron);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--color-signal-white);
  color: var(--color-signal-white);
}

.btn-ghost.is-danger:hover:not(:disabled) {
  border-color: var(--color-loss);
  color: var(--color-loss);
}

.btn-pill:disabled,
.btn-ghost:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Status Pill Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a1a1a;
  border: 1px solid var(--color-graphite);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-smoke);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--color-iron);
  flex-shrink: 0;
}

.dot.is-live {
  background: var(--color-chalk);
}

/* Input Fields */
.field {
  width: 100%;
  background: var(--color-carbon);
  border: 1px solid var(--color-graphite);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--color-chalk);
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.field::placeholder {
  color: var(--color-iron);
}

.field:focus {
  outline: none;
  border-color: var(--color-smoke);
}

/* Outlined icon accent */
.icon-gold {
  color: var(--color-compass-gold);
}

.up { color: var(--color-pulse); }
.down { color: var(--color-loss); }

/* Decorative Dot-Matrix Visual Motif */
.dot-field {
  background-image: radial-gradient(rgba(243, 243, 243, 0.14) 1px, transparent 1.2px);
  background-size: 14px 14px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}

/* Range Sliders */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
  padding: 8px 0;
  margin: 2px 0;
  cursor: pointer;
}

input[type=range]:focus {
  outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
  height: 3px;
  background: var(--color-graphite);
  border-radius: 2px;
}

input[type=range]::-moz-range-track {
  height: 3px;
  background: var(--color-graphite);
  border-radius: 2px;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 22px;
  width: 22px;
  border-radius: 99px;
  background: var(--color-signal-white);
  border: 4px solid var(--color-obsidian);
  box-shadow: 0 0 0 1px var(--color-signal-white);
  margin-top: -10px;
  cursor: pointer;
}

input[type=range]::-moz-range-thumb {
  height: 18px;
  width: 18px;
  border-radius: 99px;
  background: var(--color-signal-white);
  border: 4px solid var(--color-obsidian);
  box-shadow: 0 0 0 1px var(--color-signal-white);
  cursor: pointer;
}

input[type=range]:disabled::-webkit-slider-thumb {
  background: var(--color-iron);
  box-shadow: 0 0 0 1px var(--color-iron);
  cursor: not-allowed;
}

/* Leaderboard Deltas */
.rank-up { color: var(--color-pulse); font-size: 12px; }
.rank-down { color: var(--color-loss); font-size: 12px; }
.rank-same { color: var(--color-iron); font-size: 12px; }

.tabular {
  font-variant-numeric: tabular-nums;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.card-in {
  animation: card-in 0.4s ease both;
}

/* Sliding Diagonals Background Effect */
.bg-sliding-container {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg,
.bg-sliding {
  animation: slide 3s ease-in-out infinite alternate;
  background-image: linear-gradient(-60deg, #222a36 50%, #383023 50%);
  bottom: 0;
  left: -50%;
  opacity: .55;
  position: absolute;
  right: -50%;
  top: 0;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.bg2 {
  animation-direction: alternate-reverse;
  animation-duration: 4s;
}

.bg3 {
  animation-duration: 5s;
}

@keyframes slide {
  0% {
    transform: translate3d(-25%, 0, 0);
  }
  100% {
    transform: translate3d(25%, 0, 0);
  }
}

/* Scrollbar utilities for responsive mobile strips */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

