/* ═══════════════════════════════════════════════════
   PORTFOLIO OS — css/base.css
   Design tokens, reset, typography
═══════════════════════════════════════════════════ */

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

/* ── Light mode tokens ── */
:root {
  --bg:        #F5F2EC;
  --bg2:       #EFEBE3;
  --surface:   #FFFFFF;
  --surface2:  #FAFAF8;
  --border:    #E2DDD5;
  --border2:   #D4CFC6;

  --text:      #1A1A1A;
  --text2:     #4A4A4A;
  --text3:     #8A8A8A;
  --text4:     #C0C0C0;

  --gold:      #D4AF37;
  --gold-h:    #E8C84A;
  --gold-bg:   rgba(212,175,55,0.08);
  --gold-bdr:  rgba(212,175,55,0.25);

  --green:     #16A34A;
  --green-bg:  rgba(22,163,74,0.08);
  --red:       #DC2626;
  --red-bg:    rgba(220,38,38,0.08);
  --blue:      #2563EB;
  --blue-bg:   rgba(37,99,235,0.08);
  --teal:      #0D9488;
  --teal-bg:   rgba(13,148,136,0.08);
  --purple:    #7C3AED;
  --purple-bg: rgba(124,58,237,0.08);
  --amber:     #F59E0B;
  --amber-bg:  rgba(245,158,11,0.08);

  --gold-text: #8B6914;

  --nav-h:    56px;
  --sidebar-w: 240px;
  --sidebar-collapsed: 60px;
  --r-sm:     4px;
  --r:        6px;
  --r-md:     8px;
  --r-lg:     12px;
  --r2:       12px;
  --shadow:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow2:  0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow3:  0 20px 60px rgba(0,0,0,0.12);
}

/* ── Dark mode tokens ── */
body.dark {
  --bg:        #0D1117;
  --bg2:       #161B25;
  --surface:   #1C2333;
  --surface2:  #212940;
  --border:    #2A3347;
  --border2:   #3A4F68;

  --text:      #F0F2F5;
  --text2:     #9BACC5;
  --text3:     #56708A;
  --text4:     #3A5070;

  --gold:      #D4AF37;
  --gold-h:    #E8C84A;
  --gold-bg:   rgba(212,175,55,0.10);
  --gold-bdr:  rgba(212,175,55,0.22);
  --gold-text: #C9A227;

  --green:     #22C55E;
  --green-bg:  rgba(34,197,94,0.10);
  --red:       #EF4444;
  --red-bg:    rgba(239,68,68,0.10);
  --teal:      #14B8A6;
  --teal-bg:   rgba(20,184,166,0.10);
  --blue:      #60A5FA;
  --blue-bg:   rgba(96,165,250,0.10);
  --amber:     #FBBF24;
  --amber-bg:  rgba(251,191,36,0.10);

  --shadow:    0 1px 3px rgba(0,0,0,0.30);
  --shadow2:   0 4px 20px rgba(0,0,0,0.40);
  --shadow3:   0 20px 60px rgba(0,0,0,0.50);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background:  var(--bg);
  color:       var(--text);
  font-family: 'Inter', sans-serif;
  font-size:   14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition:  background 0.2s, color 0.2s;
}

/* ── Typography ── */
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.3px; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }

.mono { font-family: 'JetBrains Mono', monospace; letter-spacing: -0.3px; }
.caps { font-size: 10.5px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text3); }

.text-gold   { color: var(--gold);   }
.text-green  { color: var(--green);  }
.text-red    { color: var(--red);    }
.text-teal   { color: var(--teal);   }
.text-blue   { color: var(--blue);   }
.text-muted  { color: var(--text3);  }

.pos  { color: var(--green); }
.neg  { color: var(--red);   }
.zero { color: var(--text3); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text4, var(--text3)); }

/* ── Selection ── */
::selection {
  background: rgba(212, 175, 55, 0.15);
  color: var(--text);
}

/* ── Utility ── */
.hidden   { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex     { display: flex; align-items: center; }
.gap-sm   { gap: 8px; }
.gap-md   { gap: 16px; }
.gap-lg   { gap: 24px; }
.ml-auto  { margin-left: auto; }
.mt-sm    { margin-top: 8px; }
.mt-md    { margin-top: 16px; }
.mt-lg    { margin-top: 24px; }
.fw-6     { font-weight: 600; }
.fw-7     { font-weight: 700; }
.fs-sm    { font-size: 12px; }
.fs-xs    { font-size: 11px; }
.ta-r     { text-align: right; }
.ta-c     { text-align: center; }

/* ── Extended Layout Utilities ── */
.flex-col     { display: flex; flex-direction: column; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }
.items-start  { align-items: flex-start; }
.items-stretch { align-items: stretch; }
.w-full       { width: 100%; }

/* ── Extended Spacing ── */
.p-sm  { padding: 8px; }   .p-md  { padding: 16px; }  .p-lg  { padding: 24px; }
.px-sm { padding-left: 8px;  padding-right: 8px; }
.px-md { padding-left: 16px; padding-right: 16px; }
.px-lg { padding-left: 24px; padding-right: 24px; }
.py-sm { padding-top: 8px;   padding-bottom: 8px; }
.py-md { padding-top: 16px;  padding-bottom: 16px; }
.py-lg { padding-top: 24px;  padding-bottom: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mb-xl { margin-bottom: 32px; }

/* ── Extended Typography ── */
.text-xs  { font-size: 10px; }
.text-sm  { font-size: 12px; }
.text-base { font-size: 13.5px; }
.text-md  { font-size: 14px; }
.text-lg  { font-size: 16px; }
.text-xl  { font-size: 20px; }
.text-2xl { font-size: 26px; }
.text-3xl { font-size: 36px; }
.text-amber { color: var(--amber); }
.font-mono { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.uppercase-label { font-size: 10.5px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text3); }

/* ── Skeleton Loader ── */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--bg2) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--r);
}
.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: 4px; }
.skeleton-card { height: 120px; border-radius: var(--r2); }
.skeleton-metric { height: 80px; border-radius: var(--r2); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes pnlPulse { 0% { opacity: 0.4; } 50% { opacity: 1; } 100% { opacity: 0.4; } }

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
