/* ═══════════════════════════════════════════════════════════════
   CASHMEREUM DESIGN SYSTEM — design-system.css
   Luxury-grade, dark, gold-accented blockchain UI system
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;1,300&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── TOKENS ── */
:root {
  /* Colors */
  --gold:          #C8A96E;
  --gold-light:    #E8D4A8;
  --gold-dark:     #8B6F3E;
  --gold-faint:    rgba(200,169,110,0.08);
  --obsidian:      #0A0A0F;
  --obsidian-2:    #111118;
  --obsidian-3:    #1A1A24;
  --obsidian-4:    #22222F;
  --obsidian-5:    #2C2C3E;
  --smoke:         #8A8A9A;
  --smoke-light:   #C2C2D0;
  --white:         #F0EFE8;
  --teal:          #2ECFA8;
  --teal-dark:     #1A8F73;
  --teal-faint:    rgba(46,207,168,0.08);
  --violet:        #7C5CBF;
  --violet-light:  #A080E0;
  --violet-faint:  rgba(124,92,191,0.08);
  --red:           #E05050;
  --red-faint:     rgba(224,80,80,0.08);
  --amber:         #E8A030;
  --amber-faint:   rgba(232,160,48,0.08);
  --blue:          #4A90D9;

  /* Borders */
  --border:        rgba(200,169,110,0.12);
  --border-mid:    rgba(200,169,110,0.25);
  --border-strong: rgba(200,169,110,0.45);
  --border-teal:   rgba(46,207,168,0.2);

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10:40px;
  --space-12:48px;
  --space-16:64px;
  --space-20:80px;

  /* Radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl:24px;
  --radius-full:9999px;

  /* Shadows */
  --shadow-gold: 0 0 40px rgba(200,169,110,0.12);
  --shadow-teal: 0 0 30px rgba(46,207,168,0.1);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);

  /* Transitions */
  --ease: cubic-bezier(0.25,1,0.5,1);
  --ease-out: cubic-bezier(0,0,0.2,1);
  --duration: 0.25s;
  --duration-lg: 0.45s;

  /* Layout */
  --nav-h: 64px;
  --sidebar-w: 260px;
  --content-max: 1200px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  color: var(--white);
  background: var(--obsidian);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ── NOISE OVERLAY ── */
body::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: 0.5;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; }
h1 { font-size: clamp(36px, 5vw, 64px); letter-spacing: -2px; }
h2 { font-size: clamp(26px, 3.5vw, 42px); letter-spacing: -1.5px; }
h3 { font-size: clamp(18px, 2vw, 24px); letter-spacing: -0.5px; }
h4 { font-size: 16px; font-weight: 600; letter-spacing: 0; }
p  { color: var(--smoke-light); line-height: 1.7; }

.text-gold    { color: var(--gold); }
.text-teal    { color: var(--teal); }
.text-violet  { color: var(--violet-light); }
.text-smoke   { color: var(--smoke); }
.text-white   { color: var(--white); }
.text-red     { color: var(--red); }
.text-amber   { color: var(--amber); }

.text-mono    { font-family: var(--font-mono); }
.text-display { font-family: var(--font-display); }

.text-xs   { font-size: 11px; }
.text-sm   { font-size: 13px; }
.text-base { font-size: 15px; }
.text-lg   { font-size: 17px; }
.text-xl   { font-size: 20px; }
.text-2xl  { font-size: 26px; }

.font-light  { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-bold   { font-weight: 700; }
.font-black  { font-weight: 800; }

.uppercase   { text-transform: uppercase; letter-spacing: 0.12em; }
.tracking-wide{ letter-spacing: 0.08em; }

/* ── LAYOUT ── */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--space-10); }
.section   { padding: var(--space-20) 0; }
.grid-2    { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--space-6); }
.grid-3    { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--space-5); }
.grid-4    { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-4); }
.flex      { display: flex; }
.flex-col  { display: flex; flex-direction: column; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-between{ justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.w-full { width: 100%; }
.hidden { display: none; }

/* ── CARDS ── */
.card {
  background: var(--obsidian-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.card:hover { border-color: var(--border-mid); transform: translateY(-2px); }
.card--gold  { border-color: rgba(200,169,110,0.3); }
.card--teal  { border-color: rgba(46,207,168,0.2); }
.card--violet{ border-color: rgba(124,92,191,0.2); }
.card--glass {
  background: rgba(26,26,36,0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 11px 22px; border-radius: var(--radius-md);
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  letter-spacing: 0.04em; transition: all var(--duration) var(--ease);
  white-space: nowrap;
}
.btn--primary {
  background: var(--gold); color: var(--obsidian);
}
.btn--primary:hover { background: var(--gold-light); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(200,169,110,0.3); }
.btn--outline {
  background: transparent; color: var(--white);
  border: 1px solid var(--border-mid);
}
.btn--outline:hover { border-color: var(--gold); color: var(--gold); }
.btn--ghost {
  background: transparent; color: var(--smoke-light);
}
.btn--ghost:hover { color: var(--white); background: var(--obsidian-4); }
.btn--teal { background: var(--teal); color: var(--obsidian); }
.btn--teal:hover { background: #4EEFC8; transform: translateY(-1px); }
.btn--danger { background: var(--red-faint); color: var(--red); border: 1px solid rgba(224,80,80,0.25); }
.btn--sm { padding: 7px 14px; font-size: 12px; }
.btn--lg { padding: 14px 32px; font-size: 15px; }
.btn--icon { padding: 10px; border-radius: var(--radius-md); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-family: var(--font-mono); font-size: 11px;
  font-weight: 500; letter-spacing: 0.06em;
}
.badge--gold   { background: rgba(200,169,110,0.12); color: var(--gold);         border: 1px solid rgba(200,169,110,0.25); }
.badge--teal   { background: rgba(46,207,168,0.1);   color: var(--teal);          border: 1px solid rgba(46,207,168,0.2); }
.badge--violet { background: rgba(160,128,224,0.1);  color: var(--violet-light);  border: 1px solid rgba(160,128,224,0.2); }
.badge--red    { background: rgba(224,80,80,0.1);    color: var(--red);           border: 1px solid rgba(224,80,80,0.2); }
.badge--amber  { background: rgba(232,160,48,0.1);   color: var(--amber);         border: 1px solid rgba(232,160,48,0.2); }
.badge--smoke  { background: rgba(138,138,154,0.1);  color: var(--smoke-light);   border: 1px solid rgba(138,138,154,0.15); }
.live-dot::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 5px; animation: pulse-dot 2s ease-in-out infinite; }

/* ── FORM ELEMENTS ── */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }
.form-label {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--gold); letter-spacing: 0.15em; text-transform: uppercase;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--obsidian-4); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 11px 14px;
  color: var(--white); font-size: 14px;
  transition: border-color var(--duration) var(--ease);
  outline: none; appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,169,110,0.08);
}
.form-input::placeholder { color: var(--smoke); }
.form-input--error { border-color: var(--red); }
.form-hint { font-size: 12px; color: var(--smoke); }
.form-error { font-size: 12px; color: var(--red); }
.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238A8A9A' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-textarea { resize: vertical; min-height: 100px; }

/* Range slider */
input[type=range] {
  -webkit-appearance: none; width: 100%; height: 4px;
  background: var(--obsidian-5); border-radius: 2px; outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold); cursor: pointer; border: 2px solid var(--obsidian-3);
  box-shadow: 0 0 8px rgba(200,169,110,0.4);
}

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; border-radius: 12px;
  background: var(--obsidian-5); border: 1px solid var(--border);
  transition: all var(--duration) var(--ease); cursor: pointer;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 16px; height: 16px;
  border-radius: 50%; background: var(--smoke);
  left: 3px; top: 3px; transition: all var(--duration) var(--ease);
}
.toggle input:checked + .toggle-slider { background: var(--teal-dark); border-color: var(--teal); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); background: var(--teal); }

/* ── TABLES ── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border-mid); }
thead th {
  padding: 12px 16px; text-align: left;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--gold); letter-spacing: 0.15em; text-transform: uppercase;
  background: var(--obsidian-3); white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--duration); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--obsidian-4); }
tbody td { padding: 12px 16px; font-size: 14px; color: var(--smoke-light); vertical-align: middle; }
tbody td:first-child { color: var(--white); font-weight: 500; }

/* ── DIVIDERS ── */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-mid), transparent);
  margin: var(--space-8) 0;
}
.divider--vertical { width: 1px; height: auto; background: linear-gradient(to bottom, transparent, var(--border-mid), transparent); }

/* ── SECTION LABELS ── */
.section-tag {
  font-family: var(--font-mono); font-size: 11px; color: var(--gold);
  letter-spacing: 0.2em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.section-tag::before { content: '//'; opacity: 0.45; }

/* ── STAT CARD ── */
.stat-card {
  background: var(--obsidian-3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-5);
}
.stat-value {
  font-family: var(--font-display); font-size: 32px; font-weight: 800;
  color: var(--gold); line-height: 1; margin-bottom: 6px;
}
.stat-label {
  font-family: var(--font-mono); font-size: 11px; color: var(--smoke);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.stat-change {
  font-family: var(--font-mono); font-size: 12px; margin-top: 4px;
}
.stat-change.up   { color: var(--teal); }
.stat-change.down { color: var(--red); }

/* ── PROGRESS BARS ── */
.progress-track {
  height: 6px; background: var(--obsidian-5); border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  transition: width 1.2s var(--ease);
}
.progress-fill--teal  { background: linear-gradient(90deg, var(--teal-dark), var(--teal)); }
.progress-fill--violet{ background: linear-gradient(90deg, var(--violet), var(--violet-light)); }

/* ── NOTIFICATIONS / TOASTS ── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 10000;
  display: flex; align-items: center; gap: 12px;
  background: var(--obsidian-3); border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg); padding: 14px 20px;
  box-shadow: var(--shadow-card); min-width: 280px; max-width: 400px;
  animation: slideInRight 0.3s var(--ease);
}
.toast--success { border-color: var(--teal); }
.toast--error   { border-color: var(--red); }
.toast--warn    { border-color: var(--amber); }

/* ── MODALS ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn 0.2s var(--ease);
}
.modal {
  background: var(--obsidian-2); border: 1px solid var(--border-mid);
  border-radius: var(--radius-2xl); padding: var(--space-8);
  width: 100%; max-width: 520px; position: relative;
  animation: slideInUp 0.3s var(--ease);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-6); padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--obsidian-4); color: var(--smoke);
  transition: all var(--duration); font-size: 18px; border: 1px solid var(--border);
}
.modal-close:hover { color: var(--white); border-color: var(--border-mid); }

/* ── CODE BLOCKS ── */
.code-block {
  background: var(--obsidian-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-5);
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7;
  color: var(--smoke-light); overflow-x: auto; position: relative;
}
.code-block .kw  { color: var(--violet-light); }
.code-block .str { color: var(--teal); }
.code-block .num { color: var(--gold); }
.code-block .cmt { color: var(--smoke); font-style: italic; }
.code-block .fn  { color: #E8C56D; }
.code-block .type{ color: var(--blue); }

/* ── ANIMATIONS ── */
@keyframes pulse-dot   { 0%,100%{ opacity:1; } 50%{ opacity:0.3; } }
@keyframes rotate-slow { from{ transform:rotate(0deg); } to{ transform:rotate(360deg); } }
@keyframes spin        { from{ transform:rotate(0deg); } to{ transform:rotate(360deg); } }
@keyframes fadeIn      { from{ opacity:0; } to{ opacity:1; } }
@keyframes slideInUp   { from{ opacity:0; transform:translateY(20px); } to{ opacity:1; transform:translateY(0); } }
@keyframes slideInRight{ from{ opacity:0; transform:translateX(20px); } to{ opacity:1; transform:translateX(0); } }
@keyframes shimmer     { from{ background-position:-200% 0; } to{ background-position:200% 0; } }
@keyframes float       { 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-8px); } }
@keyframes glow-pulse  { 0%,100%{ box-shadow:0 0 20px rgba(200,169,110,0.2); } 50%{ box-shadow:0 0 40px rgba(200,169,110,0.4); } }

.animate-in       { animation: slideInUp 0.6s var(--ease) forwards; opacity: 0; }
.animate-in.delay-1 { animation-delay: 0.1s; }
.animate-in.delay-2 { animation-delay: 0.2s; }
.animate-in.delay-3 { animation-delay: 0.3s; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--obsidian-3) 25%, var(--obsidian-4) 50%, var(--obsidian-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--obsidian-2); }
::-webkit-scrollbar-thumb { background: var(--obsidian-5); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--smoke); }

/* ── UTILITIES ── */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break-all{ word-break: break-all; }
.mono-address { font-family: var(--font-mono); font-size: 12px; color: var(--smoke-light); }
.gradient-text {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.glow-gold { text-shadow: 0 0 40px rgba(200,169,110,0.35); }
.inset-ring { box-shadow: inset 0 0 0 1px var(--border); }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .container { padding: 0 var(--space-6); }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .container { padding: 0 var(--space-4); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  h1 { font-size: 32px; letter-spacing: -1px; }
  h2 { font-size: 24px; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
}

/* ── SKELETON LOADING STATES ── */
.skeleton {
  background: linear-gradient(90deg, var(--obsidian-3) 25%, var(--obsidian-4) 50%, var(--obsidian-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
  display: inline-block;
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.skeleton-text  { height: 14px; width: 80%; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 12px; }
.skeleton-card  { height: 80px; width: 100%; border-radius: var(--radius-lg); }
.skeleton-badge { height: 24px; width: 80px; border-radius: var(--radius-full); }
.page-loading {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-6); animation: fadeIn 0.3s;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* ── THEME ──
   Dark obsidian is the definitive look — it matches the marketing landing
   page. Light mode is OPT-IN ONLY, via the settings toggle ([data-theme="light"]
   below). We intentionally do NOT auto-switch on prefers-color-scheme: that
   previously washed the whole app out to a cream/light palette on light-mode
   systems, clashing with the dark landing page. */
:root { color-scheme: dark; }

/* JS-controlled theme override */
[data-theme="light"] {
  --obsidian:   #F5F4EE; --obsidian-2: #EEEEE8; --obsidian-3: #E5E5DF;
  --obsidian-4: #DDDDD8; --obsidian-5: #D0D0CA; --white: #0A0A0F;
  --smoke: #5A5A6A; --smoke-light: #3A3A4A;
  --border: rgba(10,10,15,0.12); --border-mid: rgba(10,10,15,0.25);
  color-scheme: light;
}

/* ── NFT GALLERY STYLES ── */
.nft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-4);
  padding: var(--space-4) 0;
}
.nft-card {
  background: var(--obsidian-3); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden;
  transition: all var(--duration); cursor: pointer;
}
.nft-card:hover { border-color: var(--border-mid); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.nft-image {
  aspect-ratio: 1; width: 100%;
  background: linear-gradient(135deg, var(--obsidian-4), var(--obsidian-5));
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}
.nft-info { padding: var(--space-3); }
.nft-name { font-weight: 700; font-size: 13px; color: var(--white); margin-bottom: 2px; }
.nft-collection { font-size: 11px; color: var(--smoke); font-family: var(--font-mono); }
.nft-price { font-size: 12px; color: var(--gold); margin-top: 4px; font-family: var(--font-mono); font-weight: 600; }
