/* ==========================================================================
   TUME HORTUM (tumehortum.com) — INDUSTRIAL PRECISION DESIGN SYSTEM v2
   WCAG 2.1 AA Accessible + Mobile-First + Dark Forged Gunmetal + Molten Copper
   ========================================================================== */

:root {
  --bg-obsidian: #070a10;
  --bg-gunmetal: #0c111d;
  --bg-slate-900: #0f172a;
  --bg-slate-800: #1e293b;
  --bg-paper: #f8fafc;
  --metal-border: rgba(148, 163, 184, 0.20);
  --metal-border-bright: rgba(226, 232, 240, 0.36);

  /* Brand & WCAG 2.1 AA Accessible Action Tokens (>= 5.1:1 with #ffffff) */
  --accent-orange: #f97316;
  --accent-orange-cta: #c2410c;       /* 5.18:1 contrast with #ffffff */
  --accent-orange-cta-hover: #9a3412; /* 7.12:1 contrast with #ffffff */
  --accent-sky: #38bdf8;
  --accent-sky-cta: #0369a1;          /* 5.90:1 contrast with #ffffff */
  --accent-emerald-cta: #047857;      /* 5.47:1 contrast with #ffffff */
  --accent-red: #ef4444;

  --text-light: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --focus-ring: #fb923c;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-obsidian);
  color: var(--text-light);
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  width: 100%;
}

/* Skip to Main Content Link (Keyboard Accessibility WCAG 2.4.1) */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background-color: var(--accent-orange-cta);
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* High-Visibility Keyboard Focus Ring (WCAG 2.4.7) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--focus-ring) !important;
  outline-offset: 2px !important;
}

/* Unified Form Control Focus State */
select:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
  border-color: var(--focus-ring) !important;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.20);
}

.font-display {
  font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
}

.font-mono-tech {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* Custom Industrial Grid Background */
.bg-blueprint-grid {
  background-color: var(--bg-obsidian);
  background-image:
    linear-gradient(to right, rgba(56, 189, 248, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
}

/* Metallic Specular Cards */
.metal-card {
  background: linear-gradient(155deg, rgba(22, 31, 48, 0.92) 0%, rgba(11, 15, 25, 0.96) 100%);
  border: 1px solid var(--metal-border);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.65), inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

@media (hover: hover) {
  .metal-card:hover {
    border-color: rgba(249, 115, 22, 0.45);
    box-shadow: 0 24px 48px -12px rgba(249, 115, 22, 0.14), inset 0 1px 0 0 rgba(255, 255, 255, 0.16);
  }
  .metal-card-interactive:hover {
    transform: translateY(-3px);
  }
}

/* WCAG 2.1 AA Compliant Primary Molten CTA Button (Contrast >= 5.18:1) */
.btn-molten {
  background: linear-gradient(135deg, #c2410c 0%, #b91c1c 100%);
  color: #ffffff;
  border: 1px solid rgba(251, 146, 60, 0.45);
  box-shadow: 0 10px 25px -5px rgba(194, 65, 12, 0.45), inset 0 1px 0 0 rgba(255, 255, 255, 0.20);
  transition: all 0.2s ease;
}

.btn-molten:hover {
  background: linear-gradient(135deg, #9a3412 0%, #991b1b 100%);
  border-color: rgba(251, 146, 60, 0.75);
  box-shadow: 0 14px 30px -5px rgba(234, 88, 12, 0.55), inset 0 1px 0 0 rgba(255, 255, 255, 0.28);
}

/* Brushed Stainless & Molten Text Gradients */
.text-stainless {
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 55%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-molten {
  background: linear-gradient(135deg, #fdba74 0%, #fb923c 50%, #f87171 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Range Slider Styling for Temperature Derating (Touch-Optimized 40px Hit Area) */
input[type="range"].thermal-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  margin: 8px 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #0284c7 0%, #eab308 50%, #f97316 75%, #dc2626 100%);
  outline: none;
  cursor: pointer;
}

input[type="range"].thermal-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #c2410c;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.85);
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type="range"].thermal-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"].thermal-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #c2410c;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.85);
  cursor: pointer;
}

/* Sticky First Column in Spec Table for Mobile Horizontal Scrolling */
.sticky-col-dn {
  position: sticky;
  left: 0;
  z-index: 5;
  background-color: #0f172a;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.45);
}

/* Prevent iOS Safari Auto-Zoom on Form Inputs (< 768px) */
@media (max-width: 767px) {
  select,
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  textarea {
    font-size: 16px !important;
  }
}

/* Hide scrollbars on horizontal pill bars while keeping scrollability */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Custom Scrollbar for Desktop Engineering Tables & RFQ Drawer */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0b0f19;
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

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

/* Print Stylesheet for Official Technical RFQ & Datasheet Export */
@media print {
  body * {
    visibility: hidden;
  }
  #printable-datasheet,
  #printable-datasheet * {
    visibility: visible;
  }
  #printable-datasheet {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: #ffffff !important;
    color: #0f172a !important;
    padding: 24px !important;
    display: block !important;
  }
}
