/* Hawk (霍克) UI Design System Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

:root {
  /* Hawk Palette Tokens */
  --hawk-gold: #D6AD5C;
  --hawk-gold-rgb: 214, 173, 92;
  --hawk-gold-tab-shadow: 0 0 8px rgba(214, 173, 92, 0.25);
  --hawk-bg-obsidian: #080B0C;
  --hawk-surface-graphite: #111719;
  --hawk-surface-charcoal: #1A2424;
  --hawk-text-ivory: #F3EFE5;
  --hawk-text-slate: #8A9494;
  --hawk-teal: #39C7B0;
  --hawk-teal-rgb: 57, 199, 176;
  --hawk-error: #BE1D5D;
  --hawk-warning: #F4A259;

  /* Geometry & Radius Tokens */
  --hawk-radius-progress: 6px;
  --hawk-radius-button: 8px;
  --hawk-radius-input: 10px;
  --hawk-radius-card: 14px;
  --hawk-radius-pill: 9999px;
  --hawk-card-padding: 20px;
  --hawk-card-gap: 16px;

  /* Global Cursor & Spotlight Coordinates */
  --mouse-x: 50vw;
  --mouse-y: 50vh;
}

/* Base Reset & Fonts */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--hawk-bg-obsidian);
  color: var(--hawk-text-ivory);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Monospace & Tabular Data Rule (Anti-Jitter) */
.font-mono,
.tabular-nums,
[data-tabular] {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* Hide default cursor on desktop when custom cursor is active */
@media (hover: hover) and (pointer: fine) {
  body, button, a, input, select, textarea {
    cursor: none !important;
  }
}

/* 1. Global Custom Dual-Layer Cursor */
#hawk-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background-color: var(--hawk-gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.15s ease-out, height 0.15s ease-out, background-color 0.2s ease;
  box-shadow: 0 0 10px rgba(214, 173, 92, 0.8);
}

#hawk-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(214, 173, 92, 0.45);
  background: radial-gradient(circle, rgba(214, 173, 92, 0.08) 0%, rgba(57, 199, 176, 0.02) 60%, transparent 100%);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.25s cubic-bezier(0.2, 0.9, 0.3, 1),
              height 0.25s cubic-bezier(0.2, 0.9, 0.3, 1),
              border-color 0.25s ease,
              background-color 0.25s ease,
              backdrop-filter 0.25s ease;
  will-change: transform;
}

/* Cursor Interactive States */
#hawk-cursor-ring.cursor-hover {
  width: 64px;
  height: 64px;
  border-color: rgba(57, 199, 176, 0.7);
  background: radial-gradient(circle, rgba(57, 199, 176, 0.15) 0%, rgba(214, 173, 92, 0.05) 70%, transparent 100%);
  backdrop-filter: blur(2px);
  mix-blend-mode: screen;
}

#hawk-cursor-ring.cursor-magnetic {
  width: 52px;
  height: 52px;
  border-color: var(--hawk-gold);
  background: rgba(214, 173, 92, 0.12);
  box-shadow: 0 0 16px rgba(214, 173, 92, 0.3);
}

#hawk-cursor-ring.cursor-action {
  width: 76px;
  height: 76px;
  border-color: rgba(243, 239, 229, 0.8);
  background: rgba(17, 23, 25, 0.6);
  backdrop-filter: blur(8px);
}

#hawk-cursor-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--hawk-gold);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

#hawk-cursor-ring.cursor-action #hawk-cursor-text {
  opacity: 1;
}

/* Global Ambient Spotlight Glow */
.global-spotlight-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    700px circle at var(--mouse-x) var(--mouse-y),
    rgba(214, 173, 92, 0.045),
    rgba(57, 199, 176, 0.02) 40%,
    transparent 75%
  );
  transition: opacity 0.4s ease;
}

/* 2. Interactive Background Canvas */
#ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

/* 3. 3D Tilt & Spotlight Border Cards */
.hawk-spotlight-card {
  position: relative;
  background-color: var(--hawk-surface-graphite);
  border-radius: var(--hawk-radius-card);
  padding: var(--hawk-card-padding);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.2s ease;
  transform-style: preserve-3d;
  will-change: transform;
  overflow: hidden;
}

.hawk-spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: radial-gradient(
    320px circle at var(--card-mouse-x, -200px) var(--card-mouse-y, -200px),
    rgba(214, 173, 92, 0.55),
    rgba(57, 199, 176, 0.3) 45%,
    transparent 80%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hawk-spotlight-card:hover::before {
  opacity: 1;
}

.hawk-spotlight-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    400px circle at var(--card-mouse-x, -200px) var(--card-mouse-y, -200px),
    rgba(214, 173, 92, 0.08),
    transparent 65%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hawk-spotlight-card:hover::after {
  opacity: 1;
}

.hawk-card-inner {
  transform: translateZ(20px);
  position: relative;
  z-index: 2;
}

/* 4. Magnetic Buttons */
.hawk-magnetic-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--hawk-radius-button);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s ease;
  will-change: transform;
}

.hawk-magnetic-btn .btn-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

/* Button Variants */
.btn-gold {
  background-color: var(--hawk-gold);
  color: var(--hawk-bg-obsidian);
  font-weight: 600;
  padding: 10px 22px;
  font-size: 14px;
  border: 1px solid var(--hawk-gold);
  box-shadow: 0 4px 14px rgba(214, 173, 92, 0.2);
}

.btn-gold:hover {
  box-shadow: 0 0 20px rgba(214, 173, 92, 0.45);
}

.btn-charcoal {
  background-color: var(--hawk-surface-charcoal);
  color: var(--hawk-text-ivory);
  font-weight: 500;
  padding: 10px 20px;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-charcoal:hover {
  background-color: #233030;
  border-color: rgba(214, 173, 92, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--hawk-text-slate);
  border: 1px solid rgba(138, 148, 148, 0.2);
  padding: 8px 16px;
  border-radius: var(--hawk-radius-button);
}

.btn-ghost:hover {
  color: var(--hawk-text-ivory);
  border-color: rgba(214, 173, 92, 0.4);
}

/* Status Badges & Pills */
.hawk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--hawk-radius-pill);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.hawk-badge-charcoal {
  background-color: var(--hawk-surface-charcoal);
  color: var(--hawk-text-slate);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.hawk-badge-active {
  background-color: var(--hawk-gold);
  color: var(--hawk-bg-obsidian);
  box-shadow: var(--hawk-gold-tab-shadow);
  font-weight: 600;
}

.hawk-badge-teal {
  background-color: rgba(57, 199, 176, 0.12);
  color: var(--hawk-teal);
  border: 1px solid rgba(57, 199, 176, 0.3);
}

/* Status Indicator Dots with dynamic classes */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.status-dot-teal, .status-running {
  background-color: var(--hawk-teal);
  box-shadow: 0 0 8px rgba(57, 199, 176, 0.7);
}

.status-dot-warning, .status-queue {
  background-color: var(--hawk-warning);
  box-shadow: 0 0 8px rgba(244, 162, 89, 0.7);
}

.status-dot-error, .status-error {
  background-color: var(--hawk-error);
  box-shadow: 0 0 8px rgba(190, 29, 93, 0.7);
}

.status-dot-slate, .status-idle {
  background-color: var(--hawk-text-slate);
  box-shadow: none;
}

/* 6px Stream Progress Bar Token */
.hawk-stream-bar {
  width: 100%;
  height: var(--hawk-radius-progress);
  background-color: var(--hawk-surface-charcoal);
  border-radius: var(--hawk-radius-progress);
  overflow: hidden;
  position: relative;
}

.hawk-stream-progress {
  height: 100%;
  border-radius: var(--hawk-radius-progress);
  background: linear-gradient(90deg, var(--hawk-gold), var(--hawk-teal));
  position: relative;
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hawk-stream-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: stream-sheen 2.5s infinite linear;
}

@keyframes stream-sheen {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* Custom Scrollbar */
.custom-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: var(--hawk-surface-graphite);
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: var(--hawk-surface-charcoal);
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--hawk-text-slate);
}

/* Hero Entrance Typography & Blur Animation */
.hero-stagger-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(24px);
  filter: blur(8px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              filter 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform, filter;
}

.hero-stagger-word.revealed {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Scroll Reveal Elements */
.hawk-reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.75s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.hawk-reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Perspective Grid in Hero */
.perspective-grid {
  position: absolute;
  bottom: -40px;
  left: -20%;
  width: 140%;
  height: 380px;
  background-image: 
    linear-gradient(to right, rgba(214, 173, 92, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(57, 199, 176, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  transform: perspective(600px) rotateX(65deg);
  mask-image: radial-gradient(ellipse 60% 70% at 50% 30%, black 15%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 30%, black 15%, transparent 80%);
  pointer-events: none;
}

/* Drawer / Slide-Over Styles */
.hawk-drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(8, 11, 12, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.hawk-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.hawk-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(440px, 100vw);
  height: 100vh;
  background-color: var(--hawk-surface-graphite);
  border-left: 1px solid rgba(214, 173, 92, 0.2);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.8);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.hawk-drawer-panel.active {
  transform: translateX(0);
}
