/* ===========================================================
   Variables: Industrial Vintage Workshop Theme
   =========================================================== */
:root {
  /* Color palette */
  --color-bg: #0e1012; /* matte black */
  --color-text: #e7eaee; /* high-contrast steel tint */
  --color-primary: #cc7a29; /* copper orange */
  --color-primary-700: #b36422;
  --color-primary-800: #8f4f12;

  --color-success: #22c55e; /* circuit-board green */
  --color-warning: #f59e0b; /* tungsten yellow */
  --color-danger:  #ef4444; /* alarm red */

  /* Neutral grays (steel) */
  --gray-900: #0b0c0e;
  --gray-800: #131518;
  --gray-700: #191d21;
  --gray-600: #22262b;
  --gray-500: #2c3138;
  --gray-400: #3b424b;
  --gray-300: #6b7280;
  --gray-200: #9ca3af;
  --gray-100: #d1d5db;
  --gray-50:  #f3f4f6;

  /* Surfaces & strokes */
  --color-surface-1: var(--gray-800);
  --color-surface-2: var(--gray-700);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.14);
  --color-edge-highlight: rgba(255, 198, 102, 0.12); /* warm top-edge highlight */
  --color-focus: #ffd166; /* warm tungsten focus ring */

  /* Typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Noto Sans, "Apple Color Emoji", "Segoe UI Emoji";
  --font-display: "Oswald", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; /* optional condensed look if available */
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --fs-100: 12px;
  --fs-200: 14px;
  --fs-300: 16px; /* base */
  --fs-400: 18px;
  --fs-500: 20px;
  --fs-600: 24px;
  --fs-700: 28px;
  --fs-800: 32px;
  --fs-900: 40px;

  --lh-body: 1.6;
  --lh-heading: 1.25;
  --lh-mono: 1.45;

  /* Spacing scale (0–96px) */
  --space-0: 0px;
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-64: 64px;
  --space-80: 80px;
  --space-96: 96px;

  /* Radii */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  /* Shadows (subtle warm highlights + deep base) */
  --shadow-sm: 0 1px 0 var(--color-edge-highlight), 0 1px 2px rgba(0, 0, 0, 0.40);
  --shadow-md: 0 1px 0 var(--color-edge-highlight), 0 6px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 1px 0 var(--color-edge-highlight), 0 12px 24px rgba(0, 0, 0, 0.50);

  /* Transitions */
  --ease-standard: cubic-bezier(0.2, 0.6, 0.2, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 320ms;

  /* Workshop lighting background accents (subtle) */
  --bg-gradient: radial-gradient(1100px 500px at 50% -120px, rgba(255, 182, 76, 0.08), transparent 60%),
                 radial-gradient(800px 400px at 105% -100px, rgba(34, 197, 94, 0.05), transparent 60%),
                 linear-gradient(180deg, #111315 0%, #0b0c0e 100%);
}

/* ===========================================================
   Reset / Normalize
   =========================================================== */
* { box-sizing: border-box; }
*::before, *::after { box-sizing: inherit; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  color-scheme: dark; /* default dark industrial */
}

body {
  margin: 0;
  min-height: 100dvh;
}

/* Remove default margins on common text elements */
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd { margin: 0; }

/* Lists */
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; margin: 0; }

/* Responsive media */
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }

/* Forms inherit font */
input, button, textarea, select { font: inherit; color: inherit; }

/* Smooth scrolling fallback for users who prefer motion reduction */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ===========================================================
   Base Styles
   =========================================================== */
body {
  font-family: var(--font-sans);
  font-size: var(--fs-300);
  line-height: var(--lh-body);
  background-color: var(--color-bg);
  background-image: var(--bg-gradient);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings: sturdy, precise */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--lh-heading);
  letter-spacing: 0.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.2rem + 2.5vw, 3rem); margin-block: var(--space-24) var(--space-16); }
h2 { font-size: clamp(1.6rem, 1rem + 2vw, 2.25rem); margin-block: var(--space-20) var(--space-12); }
h3 { font-size: clamp(1.3rem, 0.9rem + 1.2vw, 1.75rem); margin-block: var(--space-16) var(--space-8); }
h4 { font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.375rem); margin-block: var(--space-12) var(--space-8); }
h5 { font-size: 1rem; margin-block: var(--space-8) var(--space-4); }
h6 { font-size: 0.875rem; margin-block: var(--space-8) var(--space-4); }



/* Links: understated, copper on hover */
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; border-radius: var(--radius-xs); }

/* Selection */
::selection { background: rgba(204, 122, 41, 0.25); }

/* Horizontal rule */
hr { border: 0; border-top: 1px solid var(--color-border); margin-block: var(--space-24); }

/* Code/monospace (for diagnostics, parts, SKUs) */
code, kbd, pre, samp { font-family: var(--font-mono); line-height: var(--lh-mono); }
pre { background: var(--color-surface-1); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-16); overflow: auto; box-shadow: var(--shadow-sm); }

/* ===========================================================
   Utilities
   =========================================================== */
/* Container for readable widths */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-16);
}
@media (min-width: 1440px) {
  .container { max-width: 1320px; }
}

/* Flow utility for vertical rhythm */
.flow > * + * { margin-top: var(--space-16); }

/* Flex/grid helpers */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: var(--space-8); }
.gap-16 { gap: var(--space-16); }

.grid { display: grid; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: var(--space-16); list-style: none; padding: 0;  }

/* Screen reader only */
.sr-only {
  border: 0 !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  -webkit-clip-path: inset(50%) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  width: 1px !important;
  white-space: nowrap !important;
}

/* ===========================================================
   Components
   =========================================================== */
/* Buttons */
.btn {
  --_bg: var(--color-surface-2);
  --_bd: var(--color-border);
  --_fg: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: 10px 14px;
  border: 1px solid var(--_bd);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.12)), var(--_bg);
  color: var(--_fg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--duration-base) var(--ease-standard),
              border-color var(--duration-base) var(--ease-standard),
              color var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard);
}
.btn:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn[disabled], .btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

/* Button variants */
.btn--primary {
  --_bg: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.18)), var(--color-primary);
  --_bd: color-mix(in oklab, var(--color-primary) 70%, black 30%);
  --_fg: #0b0c0e;
  color: #0b0c0e;
}
.btn--primary:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(0,0,0,0.22)), var(--color-primary-700);
}
.btn--success {
  --_bg: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.18)), var(--color-success);
  --_bd: color-mix(in oklab, var(--color-success) 70%, black 30%);
  --_fg: #071109;
}
.btn--warning {
  --_bg: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.18)), var(--color-warning);
  --_bd: color-mix(in oklab, var(--color-warning) 70%, black 30%);
  --_fg: #0b0c0e;
}
.btn--danger {
  --_bg: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.18)), var(--color-danger);
  --_bd: color-mix(in oklab, var(--color-danger) 70%, black 30%);
  --_fg: #0b0c0e;
}
.btn--ghost {
  --_bg: transparent;
  --_bd: var(--color-border);
  --_fg: var(--color-text);
}

/* Inputs */
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"], input[type="url"], input[type="number"],
select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.12)), var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  box-shadow: inset 0 1px 0 var(--color-edge-highlight);
  transition: border-color var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard), background var(--duration-base) var(--ease-standard);
}
input::placeholder, textarea::placeholder { color: color-mix(in oklab, var(--color-text) 40%, transparent); }

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-color: color-mix(in oklab, var(--color-focus) 50%, white 10%);
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.2), inset 0 1px 0 var(--color-edge-highlight);
}

/* Disabled/read-only */
input:disabled, select:disabled, textarea:disabled { opacity: 0.6; cursor: not-allowed; }

/* Cards (panels) */
.card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-16);
  box-shadow: var(--shadow-md);
  position: relative;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 var(--color-edge-highlight);
}

/* Simple tag-like badge (optional minimal helper) */
.badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--color-surface-2); border: 1px solid var(--color-border); font-size: 12px; line-height: 1.4; }

/* Tables (for inventory) minimal baseline */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--color-border); text-align: left; }
th { background: var(--color-surface-2); font-weight: 600; }

/* ===========================================================
   Accessibility
   =========================================================== */
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* Reduce motion where requested */
@media (prefers-reduced-motion: reduce) {
  .btn, input, select, textarea, .card { transition: none !important; }
}

/* ===========================================================
   Helper: Industrial accents (optional)
   =========================================================== */
/* Copper underline utility for section titles */
.accent-underline { position: relative; display: inline-block; padding-bottom: 6px; }
.accent-underline::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--color-primary), color-mix(in oklab, var(--color-primary) 60%, #ffd166 40%)); box-shadow: 0 1px 0 rgba(0,0,0,0.4); }

/* Grid helper for gallery/before-after */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--space-16); }

/* Compact text helpers */
.text-center { text-align: center; }
.text-right { text-align: right; }

/* End of base.css */
