/* Frontier Foundry Manufacturing — Industrial Precision Design System */

:root {
  --bg-void: #070a0f;
  --bg-forge: #0c1118;
  --bg-panel: #121923;
  --bg-elevated: #182230;
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-bright: rgba(249, 115, 22, 0.42);
  --foundry-orange: #f97316;
  --foundry-ember: #ea580c;
  --foundry-glow: rgba(249, 115, 22, 0.22);
  --steel-100: #f1f5f9;
  --steel-300: #cbd5e1;
  --steel-400: #94a3b8;
  --steel-500: #64748b;
  --cyan-laser: #38bdf8;
  --emerald-qc: #22c55e;
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-void);
  color: var(--steel-100);
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-void);
  color: var(--steel-100);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.font-display {
  font-family: var(--font-display);
}

.font-mono-tech {
  font-family: var(--font-mono);
}

/* Precision blueprint dot/grid overlay */
.bg-blueprint {
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
}

.bg-radial-forge {
  background: radial-gradient(circle at 75% 20%, rgba(249, 115, 22, 0.14), transparent 48%),
              radial-gradient(circle at 15% 80%, rgba(56, 189, 248, 0.08), transparent 44%),
              var(--bg-void);
}

/* Glass / Machined Industrial Cards */
.foundry-card {
  background: linear-gradient(180deg, rgba(24, 34, 48, 0.82) 0%, rgba(15, 22, 32, 0.94) 100%);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.foundry-card-hover {
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.foundry-card-hover:hover {
  transform: translateY(-2px);
  border-color: rgba(249, 115, 22, 0.45);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55), 0 0 28px rgba(249, 115, 22, 0.09);
}

/* Primary Action Button */
.btn-foundry {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  font-weight: 600;
  border: 1px solid rgba(251, 146, 60, 0.45);
  box-shadow: 0 10px 25px rgba(234, 88, 12, 0.28);
  transition: all 0.2s ease;
}

.btn-foundry:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(249, 115, 22, 0.38);
}

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

.btn-steel {
  background: rgba(30, 41, 59, 0.72);
  color: var(--steel-100);
  border: 1px solid rgba(148, 163, 184, 0.24);
  transition: all 0.2s ease;
}

.btn-steel:hover {
  background: rgba(51, 65, 85, 0.85);
  border-color: rgba(249, 115, 22, 0.5);
}

/* 3D Viewer Viewport Canvas */
#viewer-container {
  position: relative;
  background: radial-gradient(circle at 50% 42%, #1a2434 0%, #0b1017 75%, #070a0f 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  overflow: hidden;
  user-select: none;
}

#viewer-container.drag-over {
  border-color: var(--foundry-orange);
  box-shadow: inset 0 0 40px rgba(249, 115, 22, 0.25);
}

/* Technical Inputs */
.tech-input,
.tech-select,
.tech-textarea {
  background-color: #0b1119;
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #f8fafc;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.tech-input:focus,
.tech-select:focus,
.tech-textarea:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16);
}

/* Custom Range Slider */
input[type="range"].tech-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: #1e293b;
}

input[type="range"].tech-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f97316;
  border: 2px solid #fff7ed;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.5);
}

/* Pipeline Tracker Steps */
.pipeline-step {
  position: relative;
}

.pipeline-dot-active {
  box-shadow: 0 0 0 6px rgba(249, 115, 22, 0.22);
  animation: pulseEmber 2.2s infinite;
}

@keyframes pulseEmber {
  0%, 100% { box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.24); }
  50% { box-shadow: 0 0 0 9px rgba(249, 115, 22, 0.08); }
}

/* Subtle scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #090d13;
}

::-webkit-scrollbar-thumb {
  background: #243042;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #f97316;
}

/* Toast Notifications */
.toast-enter {
  animation: slideUpFade 0.25s ease-out forwards;
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Active Nav Pill & Scroll Offset */
section[id],
div[id="preset-customizer-studio"] {
  scroll-margin-top: 84px;
}

.nav-link-active {
  color: #fb923c !important;
  background-color: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.35);
}

/* Print Stylesheet for Clean Order Status Sheets */
@media print {
  header, footer, nav, #quote-engine, #capabilities, #materials, #store, #rfq,
  #cart-drawer, #cart-backdrop, #toast-container, #order-track-form, #print-spec-btn {
    display: none !important;
  }
  body, html, #portal {
    background: #ffffff !important;
    color: #0f172a !important;
    padding: 0 !important;
  }
  .foundry-card {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
  }
  .foundry-card * {
    color: #0f172a !important;
  }
}
