/* Design System Tokens - unsandbox phosphor terminal theme */
/* Ported from unsandbox_new React/Next.js design */

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

:root {
  /* Colors - Brand Palette */
  --color-bg: #191A19;
  --color-surface: #1D2920;
  --color-surface-2: #3F4538;
  --color-surface-3: #4D5944;
  --color-border: #2A332B;
  --color-border-strong: #3F4538;
  --color-text: #D2D3CF;
  --color-text-muted: #A8A9A8;
  --color-accent: #C0B55F;
  --color-accent-strong: #BDB15D;

  /* Semantic Colors */
  --color-success: #6FBF8A;
  --color-warning: #D8B25A;
  --color-danger: #D06C6C;
  --color-focus: #C0B55F;

  /* Spacing (8pt grid) */
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 8px;
  --space-4: 12px;
  --space-5: 16px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 48px;
  --space-9: 64px;

  /* Border Radius */
  --radius-1: 2px;
  --radius-2: 4px;
  --radius-3: 6px;
  --radius-4: 10px;
  --radius-full: 9999px;

  /* Typography */
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --font-size-micro: 11px;
  --font-size-small: 13px;
  --font-size-body: 15px;
  --font-size-h3: 18px;
  --font-size-h2: 22px;
  --font-size-h1: 28px;
  --font-size-display: 42px;

  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(192, 181, 95, 0.15);
  --shadow-glow-strong: 0 0 30px rgba(192, 181, 95, 0.25);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 180ms ease-out;
  --transition-slow: 280ms ease-out;

  /* Z-index layers */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-popover: 500;
  --z-tooltip: 600;
}

/* Base styles for new design theme */
.theme-phosphor {
  font-family: var(--font-mono);
  font-size: var(--font-size-body);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* CRT scanline effect overlay */
.theme-phosphor::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.03) 0px,
    rgba(0, 0, 0, 0.03) 1px,
    transparent 1px,
    transparent 2px
  );
  opacity: 0.5;
}

/* Selection styles */
.theme-phosphor ::selection {
  background-color: var(--color-accent);
  color: var(--color-bg);
}

/* Focus styles */
.theme-phosphor :focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Scrollbar styling */
.theme-phosphor ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.theme-phosphor ::-webkit-scrollbar-track {
  background: var(--color-surface);
}

.theme-phosphor ::-webkit-scrollbar-thumb {
  background: var(--color-surface-3);
  border-radius: var(--radius-full);
}

.theme-phosphor ::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* Typography */
.theme-phosphor h1,
.theme-phosphor h2,
.theme-phosphor h3,
.theme-phosphor h4,
.theme-phosphor h5,
.theme-phosphor h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
  margin: 0;
}

.theme-phosphor h1 { font-size: var(--font-size-display); }
.theme-phosphor h2 { font-size: var(--font-size-h1); }
.theme-phosphor h3 { font-size: var(--font-size-h2); }
.theme-phosphor h4 { font-size: var(--font-size-h3); }

/* Link styles - exclude buttons, nav links, logo, and footer links */
.theme-phosphor a:not(.ui-btn):not(.ui-header__nav-link):not(.ui-header__logo):not(.link-accent):not(.no-underline) {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.theme-phosphor a:not(.ui-btn):not(.ui-header__nav-link):not(.ui-header__logo):not(.link-accent):not(.no-underline):hover {
  color: var(--color-accent-strong);
}

/* Phosphor glow effect */
.glow {
  text-shadow: 0 0 10px rgba(192, 181, 95, 0.5);
}

.glow-box {
  box-shadow: var(--shadow-glow);
}

.glow-box-strong {
  box-shadow: var(--shadow-glow-strong);
}

/* Animations */
@keyframes ui-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes ui-blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0.7; }
}

@keyframes ui-cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
