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

:root {
  /* Color Tokens */
  --surface: #0b1326;
  --surface-dim: #0b1326;
  --surface-bright: #31394d;
  --surface-container-lowest: #060e20;
  --surface-container-low: #131b2e;
  --surface-container: #171f33;
  --surface-container-high: #222a3d;
  --surface-container-highest: #2d3449;
  --on-surface: #dae2fd;
  --on-surface-variant: #bbcabf;
  --inverse-surface: #dae2fd;
  --inverse-on-surface: #283044;
  --outline: #86948a;
  --outline-variant: #3c4a42;
  --surface-tint: #4edea3;
  --primary: #4edea3;
  /* Emerald Accent */
  --on-primary: #003824;
  --primary-container: #10b981;
  --on-primary-container: #00422b;
  --secondary: #ddb7ff;
  /* Purple Accent */
  --on-secondary: #490080;
  --secondary-container: #6f00be;
  --on-secondary-container: #d6a9ff;
  --tertiary: #ffb3af;
  --on-tertiary: #650911;
  --error: #ffb4ab;
  --on-error: #690005;
  --background: #0b1326;
  --on-background: #dae2fd;

  /* Font Families */
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing (4px base) */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;

  /* Border Radii */
  --rounded-sm: 4px;
  --rounded-default: 8px;
  --rounded-md: 12px;
  --rounded-lg: 16px;
  --rounded-xl: 24px;
  --rounded-full: 9999px;
}

/* Global Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--background);
  color: var(--on-background);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Typography styles matching DESIGN.md */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.text-display-lg {
  font-size: 48px;
  font-weight: 700;
  line-height: 56px;
  letter-spacing: -0.02em;
}

.text-headline-lg {
  font-size: 32px;
  font-weight: 600;
  line-height: 40px;
  letter-spacing: -0.01em;
}

.text-title-md {
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.text-body-lg {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--on-surface-variant);
}

.text-body-sm {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--on-surface-variant);
}

.text-label-md {
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.text-mono-data {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--spacing-lg);
  padding-right: var(--spacing-lg);
}

.grid-cols-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--spacing-lg);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.flex-wrap {
  flex-wrap: wrap;
}

.grow {
  flex-grow: 1;
}

/* Spacing Helpers */
.mt-sm {
  margin-top: var(--spacing-sm);
}

.mt-md {
  margin-top: var(--spacing-md);
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

.mt-xl {
  margin-top: var(--spacing-xl);
}

.mb-sm {
  margin-bottom: var(--spacing-sm);
}

.mb-md {
  margin-bottom: var(--spacing-md);
}

.mb-lg {
  margin-bottom: var(--spacing-lg);
}

.p-md {
  padding: var(--spacing-md);
}

.p-lg {
  padding: var(--spacing-lg);
}

.py-lg {
  padding-top: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
}

.py-xl {
  padding-top: var(--spacing-xl);
  padding-bottom: var(--spacing-xl);
}

.py-2xl {
  padding-top: var(--spacing-2xl);
  padding-bottom: var(--spacing-2xl);
}

.gap-sm {
  gap: var(--spacing-sm);
}

.gap-md {
  gap: var(--spacing-md);
}

.gap-lg {
  gap: var(--spacing-lg);
}

/* Glassmorphism & Elevation */
.surface-glass {
  background: rgba(19, 27, 46, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--rounded-lg);
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.surface-glass:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(19, 27, 46, 0.55);
}

.card-xl {
  border-radius: var(--rounded-xl);
  padding: var(--spacing-xl);
}

/* Neon Blooms & Accent Shadows */
.glow-primary {
  box-shadow: 0 0 25px rgba(78, 222, 163, 0.15);
}

.glow-secondary {
  box-shadow: 0 0 25px rgba(221, 183, 255, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--rounded-md);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  border: none;
  gap: var(--spacing-sm);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover {
  background-color: #63ebb4;
  box-shadow: 0 0 15px rgba(78, 222, 163, 0.5);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(49, 57, 77, 0.3);
  border: 1px solid rgba(221, 183, 255, 0.4);
  color: #ffffff;
}

.btn-secondary:hover {
  background: rgba(49, 57, 77, 0.5);
  border-color: var(--secondary);
  box-shadow: 0 0 15px rgba(221, 183, 255, 0.25);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn:disabled,
.btn-primary:disabled {
  background-color: var(--outline-variant);
  color: var(--outline);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* Input Fields */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  width: 100%;
}

.input-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  letter-spacing: 0.05em;
}

.input-field {
  background-color: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--rounded-md);
  color: #ffffff;
  padding: 12px 16px;
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
  width: 100%;
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(78, 222, 163, 0.15);
}

.input-field::placeholder {
  color: #5d677d;
}

.select-field {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23dae2fd' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* Chips & Pills */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--rounded-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--outline);
  background: transparent;
  color: #ffffff;
}

.chip-primary {
  border-color: var(--primary);
  color: var(--primary);
}

.chip-secondary {
  border-color: var(--secondary);
  color: var(--secondary);
}

/* Slider Custom Styling */
.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--rounded-full);
  background: var(--surface-container-highest);
  outline: none;
  margin: 12px 0;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(78, 222, 163, 0.6);
  transition: transform 0.1s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(78, 222, 163, 0.6);
  border: none;
  transition: transform 0.1s ease;
}

.range-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Navigation Menu */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(11, 19, 38, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  height: 70px;
}

.nav-link {
  color: var(--on-surface-variant);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: color 0.3s ease;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.brand-logo {
  height: 50px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(0, 255, 170, 0.45));
  transition: all 0.3s ease;
}

.brand-text {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  transition: all 0.3s ease;
}

.bottom-nav {
  display: none;
}

/* Hero Section Background Mesh Glows */
.hero-glow-1 {
  position: absolute;
  top: -100px;
  left: -100px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(78, 222, 163, 0.08) 0%, rgba(11, 19, 38, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

.hero-glow-2 {
  position: absolute;
  top: 200px;
  right: -100px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(221, 183, 255, 0.08) 0%, rgba(11, 19, 38, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

/* Upload Area */
.upload-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--rounded-lg);
  padding: var(--spacing-xl);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(19, 27, 46, 0.2);
}

.upload-zone:hover,
.upload-zone.drag-active {
  border-color: var(--primary);
  background: rgba(78, 222, 163, 0.05);
}

/* Chat Widget Style */
.chat-widget {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  z-index: 90;
}

.chat-trigger {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(78, 222, 163, 0.4);
  transition: all 0.3s ease;
  border: none;
  color: var(--on-primary);
}

.chat-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 25px rgba(78, 222, 163, 0.6);
}

.chat-panel {
  position: fixed;
  bottom: 90px;
  right: var(--spacing-lg);
  width: 380px;
  height: 500px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: var(--rounded-md);
  max-width: 80%;
  font-size: 14px;
  line-height: 1.4;
}

.chat-bubble-agent {
  background: var(--surface-container-high);
  color: #ffffff;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.chat-bubble-user {
  background: var(--primary);
  color: var(--on-primary);
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

/* Responsive Overrides */
@media (max-width: 992px) {
  .grid-cols-12 {
    grid-template-columns: 1fr;
  }

  .text-display-lg {
    font-size: 36px;
    line-height: 44px;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 90px !important;
  }

  .navbar {
    position: fixed;
    height: 54px;
    padding: 0;
    display: flex;
    align-items: center;
    background: rgba(11, 19, 38, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .navbar .container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }

  /* Logo wrapper */
  .navbar .container > .flex.items-center.gap-sm {
    width: auto;
    display: flex;
    align-items: center;
  }

  .brand-logo {
    height: 26px;
    filter: none;
  }

  .brand-text {
    font-size: 16px;
  }

  /* Traditional links hidden on mobile */
  .nav-links-container {
    display: none !important;
  }

  .navbar-cart {
    display: none !important;
  }

  /* Cart & Language switcher */
  .navbar .container > .flex.items-center.gap-md {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-sm);
    width: auto;
    align-items: center;
  }

  .navbar .container > .flex.items-center.gap-md > .flex.gap-sm.surface-glass {
    padding: 2px;
    border-radius: var(--rounded-sm);
  }

  .navbar .container > .flex.items-center.gap-md > .flex.gap-sm.surface-glass button {
    padding: 3px 6px !important;
    font-size: 10px !important;
  }

  /* Bottom Nav Bar */
  .bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: rgba(6, 11, 19, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 255, 170, 0.25);
    z-index: 99999;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--on-surface-variant);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    width: 25%;
    height: 100%;
    gap: 3px;
    transition: all 0.2s ease;
  }

  .bottom-nav-icon {
    width: 20px;
    height: 20px;
    fill: var(--on-surface-variant);
    transition: fill 0.2s ease;
  }

  .bottom-nav-item:hover,
  .bottom-nav-item.active {
    color: var(--primary);
  }

  .bottom-nav-item:hover .bottom-nav-icon,
  .bottom-nav-item.active .bottom-nav-icon {
    fill: var(--primary);
  }

  section:first-of-type {
    margin-top: 60px !important;
    padding-top: 20px !important;
    padding-bottom: var(--spacing-xl) !important;
  }
}

@media (max-width: 600px) {
  .chat-panel {
    width: calc(100vw - 32px);
    right: 16px;
    height: 450px;
  }
}

/* Custom Desktop Navbar Overrides */
@media screen and (min-width: 769px) {
  .custom-navbar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 40px !important;
    height: 75px !important;
  }

  .logo-container {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
  }

  .brand-logo {
    height: 45px !important;
    filter: drop-shadow(0 0 10px rgba(0, 255, 170, 0.45)) !important;
  }

  .brand-text {
    color: #ffffff !important;
    font-size: 24px !important;
    font-weight: 700 !important;
  }

  .navbar-right {
    display: flex !important;
    align-items: center !important;
    gap: 40px !important;
  }

  .nav-links-container {
    display: flex !important;
    align-items: center !important;
    gap: 30px !important;
  }

  .bottom-nav {
    display: none !important;
  }
}

/* Custom Mobile Navbar & Chat Overrides */
@media screen and (max-width: 768px) {
  .custom-navbar {
    padding: 10px 20px !important;
    display: flex !important;
    width: 100% !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }

  .navbar-right {
    margin-left: auto !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
  }

  .chat-widget {
    bottom: 85px !important;
  }

  .chat-panel {
    bottom: 155px !important;
  }
}

@media screen and (max-width: 768px) {
  .custom-navbar {
    display: flex !important;
    width: 100% !important;
  }

  .custom-navbar .navbar-right .flex.gap-sm.surface-glass {
    margin-left: auto !important;
    display: flex !important;
    justify-content: flex-end !important;
  }
}

/* Gradient effect for brand text (all devices) */
.brand-text {
  background: linear-gradient(135deg, #00ffaa 0%, #6a82fb 50%, #b57bee 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

/* Mobile adjustments (increase size by ~4% and balance margins) */
@media screen and (max-width: 768px) {
  .logo-container {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
  }

  .brand-logo {
    height: 25px !important;
    margin: 0 !important;
  }

  .brand-text {
    font-size: 17px !important;
    margin: 0 !important;
  }
}

/* Portfolio Showcase Gallery Hover Effects */
.surface-glass:hover .showcase-img {
  transform: scale(1.05);
}

.surface-glass:hover .showcase-overlay {
  opacity: 1 !important;
}

/* Infinite Logo Ticker */
@keyframes logo-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.logo-ticker-container {
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  width: 100%;
  position: relative;
  padding: 24px 0;
  background: rgba(6, 14, 32, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.logo-ticker-inner {
  display: flex;
  width: max-content;
  animation: logo-scroll 25s linear infinite;
  gap: 64px;
  padding-right: 64px;
}

.ticker-logo-item {
  font-size: 15px;
  font-weight: 700;
  color: var(--on-surface-variant);
  opacity: 0.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.3s ease;
}

.ticker-logo-item:hover {
  opacity: 0.9;
}