/* ============================================================================
   Snowtrail Research - Design System v2
   Institutional, Modern, Developer-credible
   ============================================================================ */

/* Google Fonts - Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette - Multi-accent Professional */
  --background: #ffffff;
  --background-subtle: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #e5e7eb;

  /* Primary Colors */
  --primary-blue: #2563eb;
  --primary-dark: #1e293b;
  --primary-navy: #0f172a;

  /* Accent Colors */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-blue: #3b82f6;
  --accent-coral: #f97316;
  --accent-gold: #eab308;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --section-padding: 72px;
  --section-padding-mobile: 48px;
  --max-width: 1200px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-dropdown: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition: all 0.15s ease;
}

/* ============================================================================
   Base Styles
   ============================================================================ */

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--background);
  line-height: 1.6;
  font-size: 16px;
  margin: 0;
  padding: 0;
}

/* ============================================================================
   Typography
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
}

h1 {
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(18px, 2.5vw, 22px);
  line-height: 1.3;
}

h4 {
  font-size: 18px;
  line-height: 1.4;
}

p {
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

.lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.eyebrow,
.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 0.75rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

/* ============================================================================
   Layout
   ============================================================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: var(--section-padding) 0;
}

.section-muted {
  background: #f8fafc;
}

/* ============================================================================
   Navigation
   ============================================================================ */

/* Override Bootstrap navbar defaults */
.navbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(8px) !important;
  border-bottom: 1px solid var(--border) !important;
  z-index: 1000 !important;
  padding: 0 !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
}

.navbar-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 64px !important;
  max-width: var(--max-width) !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
  width: 100% !important;
}

.navbar-brand {
  padding: 0 !important;
  margin: 0 !important;
}

.navbar-brand img {
  height: 48px !important;
  width: auto !important;
}

.navbar-center {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.navbar-right {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
}

.navbar .nav-item {
  position: relative !important;
  margin: 0 !important;
}

.navbar .nav-link {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 8px 14px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  border-radius: var(--radius-sm) !important;
  transition: var(--transition) !important;
  cursor: pointer !important;
  background: transparent !important;
}

.navbar .nav-link:hover {
  color: var(--text-primary) !important;
  background: #f8fafc !important;
}

.navbar .nav-link svg {
  width: 16px !important;
  height: 16px !important;
  transition: transform 0.15s ease !important;
}

.navbar .nav-item:hover .nav-link svg {
  transform: rotate(180deg) !important;
}

/* Dropdown Menu - Override Bootstrap */
.navbar .nav-item .dropdown-menu {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  min-width: 200px !important;
  background: white !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-dropdown) !important;
  padding: 8px !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.15s ease;
  z-index: 1000 !important;
  display: block !important;
  margin: 0 !important;
}

.navbar .nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.dropdown-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.dropdown-item span {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Mobile Navigation */
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  padding: 12px;
  cursor: pointer;
  position: relative;
  z-index: 1001;
  -webkit-tap-highlight-color: transparent;
}

.navbar-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: all 0.3s ease;
  transform-origin: center;
  transition: var(--transition);
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #f8fafc;
  color: var(--text-primary);
  border-color: #d1d5db;
}

.btn-secondary-light {
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary-light:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

/* ============================================================================
   Hero Section
   ============================================================================ */

.hero {
  padding-top: calc(64px + var(--section-padding));
  padding-bottom: var(--section-padding);
  background: var(--background);
}

/* Dark hero for interior pages */
.hero-section {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-navy) 100%);
  color: white;
  padding: 96px 0 64px 0;
  margin-top: 64px;
  position: relative;
  overflow: hidden;
}

.hero-section h1 {
  color: white;
}

.hero-section .hero-subtext,
.hero-section .lead {
  color: rgba(255, 255, 255, 0.75);
  max-width: 700px;
}

.hero-section .section-label,
.hero-section .eyebrow {
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.15);
}

.hero-section .hero-content {
  padding-top: 32px;
  padding-bottom: 32px;
}

.hero-section .hero-text .lead {
  color: rgba(255, 255, 255, 0.75);
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero-text {
  max-width: 560px;
}

.hero-text h1 {
  margin-bottom: 24px;
}

.hero-text .lead {
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-visual {
  display: flex;
  justify-content: flex-end;
}

/* Integration section two-column layout */
.integration-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

/* API Preview Card */
.api-card {
  background: var(--text-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 480px;
  width: 100%;
}

.api-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.api-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.api-card-dot.red { background: #ef4444; }
.api-card-dot.yellow { background: #f59e0b; }
.api-card-dot.green { background: #22c55e; }

.api-card pre {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #93c5fd;
  overflow-x: auto;
}

.api-card code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
}

/* ============================================================================
   Cards
   ============================================================================ */

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: var(--transition);
}

.card:hover {
  border-color: #d1d5db;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.card-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.card h3 {
  margin-bottom: 12px;
}

.card p {
  margin-bottom: 16px;
}

.card-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-link:hover {
  gap: 8px;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.card-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ============================================================================
   Section Headers
   ============================================================================ */

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 64px auto;
}

.section-header h2 {
  margin-bottom: 16px;
}

.section-header p {
  font-size: 18px;
}

/* ============================================================================
   Feature List (Built for trading teams)
   ============================================================================ */

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 48px;
}

.feature-list-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.feature-list-item svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--accent);
  margin-top: 2px;
}

.feature-list-item h4 {
  margin-bottom: 4px;
}

.feature-list-item p {
  margin: 0;
  font-size: 15px;
}

/* ============================================================================
   Developer Section
   ============================================================================ */

.dev-section {
  background: #f8fafc;
}

.dev-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.dev-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-top: 32px;
}

.dev-feature {
  display: flex;
  gap: 12px;
}

.dev-feature svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--accent);
  margin-top: 2px;
}

.dev-feature h4 {
  font-size: 15px;
  margin-bottom: 4px;
}

.dev-feature p {
  font-size: 14px;
  margin: 0;
  color: var(--text-muted);
}

/* ============================================================================
   Footer
   ============================================================================ */

footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 32px 0;
  margin-top: var(--section-padding);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand {
  grid-column: span 2;
}

.footer-brand img {
  height: 48px;
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 280px;
}

.footer-col h5 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.footer-bottom span {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-legal {
  display: flex;
  gap: 24px;
}

.footer-legal a {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================================
   Form Styles
   ============================================================================ */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-primary);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* ============================================================================
   Market Cards (horizontal)
   ============================================================================ */

.market-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.market-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  transition: var(--transition);
}

.market-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.market-card-icon {
  font-size: 32px;
  margin-bottom: 16px;
}

.market-card h3 {
  margin-bottom: 8px;
}

.market-card p {
  font-size: 14px;
  margin-bottom: 16px;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-visual {
    justify-content: center;
  }

  .card-grid-3,
  .card-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .dev-grid,
  .integration-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
  }

  .footer-brand {
    grid-column: span 4;
    margin-bottom: 8px;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: var(--section-padding-mobile);
  }

  .navbar-center {
    display: none !important;
  }

  .navbar-toggle {
    display: block !important;
  }

  .navbar-right {
    display: none !important;
  }

  .hero-text {
    max-width: 100%;
    text-align: center;
  }

  .hero-buttons {
    justify-content: center;
    flex-direction: column;
    align-items: center;
  }

  .hero-buttons .btn {
    width: 100%;
    max-width: 280px;
  }

  .api-card {
    max-width: 100%;
  }

  .card-grid,
  .card-grid-3,
  .card-grid-4,
  [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: 1fr !important;
  }

  .market-cards {
    grid-template-columns: 1fr;
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .dev-features {
    grid-template-columns: 1fr;
  }

  .br-desktop {
    display: none;
  }

  .dev-grid {
    text-align: center;
  }

  .dev-features {
    justify-items: center;
  }

  .dev-grid .mt-4 {
    display: flex;
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

  .footer-brand {
    grid-column: span 2;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .section-header {
    margin-bottom: 48px;
  }

  /* Fix inline grid styles */
  .container [style*="display: grid"] {
    grid-template-columns: 1fr !important;
  }

  /* Hero section adjustments */
  .hero-section {
    padding: 72px 0 48px 0;
  }

  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 26px;
  }

  .lead {
    font-size: 16px;
  }

  /* Card padding */
  .card {
    padding: 24px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .navbar-inner {
    padding: 0 16px !important;
  }

  .mobile-nav {
    padding: 16px;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 22px;
  }

  .section-header {
    margin-bottom: 32px;
  }

  .btn-lg {
    padding: 12px 20px;
    font-size: 14px;
  }

  .card {
    padding: 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-brand {
    grid-column: span 1;
  }

  .footer-legal {
    flex-direction: column;
    gap: 12px;
  }

  /* CTA section */
  .container [style*="display: flex"][style*="justify-content: center"] {
    flex-direction: column !important;
    align-items: center !important;
  }
}

/* ============================================================================
   Mobile Navigation Overlay
   ============================================================================ */

.mobile-nav {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  padding: 24px;
  z-index: 1000;
  overflow-y: auto;
}

.mobile-nav.active {
  display: block;
}

.mobile-nav-item {
  border-bottom: 1px solid var(--border);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
}

.mobile-nav-link svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.mobile-nav-item.active .mobile-nav-link svg {
  transform: rotate(180deg);
}

.mobile-nav-dropdown {
  display: none;
  padding-left: 16px;
  padding-bottom: 16px;
}

.mobile-nav-item.active .mobile-nav-dropdown {
  display: block;
}

.mobile-nav-dropdown a {
  display: block;
  padding: 10px 0;
  font-size: 15px;
  color: var(--text-secondary);
}

/* Hamburger Animation */
.navbar-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.active span:nth-child(2) {
  opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 48px; }

.py-0 { padding-top: 0; padding-bottom: 0; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
