/* ============================================================
   LCS Bar Top Configurator — Premium Dark Industrial UI
   ============================================================ */

:root {
  --bg: #07070a;
  --bg-elev: #0c0c10;
  --bg-card: #131317;
  --bg-card-hi: #1a1a20;
  --ink: #f5f3ee;
  --ink-warm: #ebe5d7;
  --ink-dim: rgba(245, 243, 238, 0.66);
  --ink-faint: rgba(245, 243, 238, 0.34);
  --ink-ghost: rgba(245, 243, 238, 0.12);
  --gold: #c8922a;
  --gold-bright: #e3aa3c;
  --gold-glow: rgba(200, 146, 42, 0.22);
  --line: rgba(245, 243, 238, 0.07);
  --line-bright: rgba(245, 243, 238, 0.16);
  --panel-bg: rgba(9, 9, 12, 0.78);
  --panel-blur: blur(18px) saturate(140%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body {
  background: #000;
  color: var(--ink);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--gold); color: var(--bg); }
button { font-family: inherit; cursor: pointer; }

/* ============ LOADER ============ */
.loader {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: #000;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { text-align: center; max-width: 320px; padding: 0 24px; }
.loader-mark {
  width: 56px; height: 56px;
  border: 1px solid var(--gold);
  display: grid; place-items: center;
  margin: 0 auto 22px;
  font-family: 'Fraunces', serif;
  font-style: italic; font-weight: 300;
  font-size: 28px;
  color: var(--gold);
}
.loader-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px; letter-spacing: 0.28em;
  color: var(--ink);
  margin-bottom: 32px;
}
.loader-name span { color: var(--gold); margin: 0 4px; }
.loader-bar {
  width: 100%; height: 1px;
  background: var(--line);
  margin-bottom: 14px;
  overflow: hidden;
}
.loader-bar-fill {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.3s ease;
}
.loader-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

/* ============ TOP NAV ============ */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 32px;
  background: linear-gradient(180deg, rgba(7,7,10,0.85) 0%, rgba(7,7,10,0) 100%);
}
.topnav-logo {
  display: flex; align-items: center; gap: 14px;
}
.logo-mark {
  width: 30px; height: 30px;
  border: 1px solid var(--gold);
  display: grid; place-items: center;
  font-family: 'Fraunces', serif;
  font-style: italic; font-weight: 300;
  font-size: 15px; color: var(--gold);
}
.logo-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 19px;
  letter-spacing: 0.2em;
  color: var(--ink);
}
.logo-name i { color: var(--gold); font-style: normal; margin: 0 3px; }

.topnav-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  text-transform: uppercase;
  display: flex; gap: 22px;
}
.topnav-meta i { color: var(--gold); font-style: normal; }

.topnav-cta {
  justify-self: end;
  display: flex; align-items: center; gap: 28px;
}
.topnav-link {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: none;
  position: relative;
  transition: color 0.3s;
}
.topnav-link:hover { color: var(--ink); }
.btn-quote-top {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600; font-size: 12px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bg); background: var(--gold);
  padding: 11px 22px;
  border: 1px solid var(--gold);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.btn-quote-top:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  transform: translateY(-1px);
}

/* ============ VIEWPORT ============ */
#viewport {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  display: block;
  z-index: 1;
}

/* ============ SECTION TITLE (top-left under nav) ============ */
.section-title {
  position: fixed;
  top: 110px; left: 32px;
  z-index: 5;
  max-width: 460px;
  pointer-events: none;
}
.section-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.42em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
}
.section-tag::before {
  content: ''; width: 32px; height: 1px; background: var(--gold);
}
.section-h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(40px, 4.8vw, 72px);
  line-height: 0.86;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-bottom: 16px;
  text-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}
.section-h1 i {
  font-family: 'Fraunces', serif;
  font-style: italic; font-weight: 300;
  color: var(--gold);
  font-size: 0.86em;
  letter-spacing: -0.02em;
}
.section-lede {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 300;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink-warm);
  line-height: 1.55;
  max-width: 380px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

/* ============ CONTROL PANEL (right side) ============ */
.controls {
  position: fixed;
  top: 110px; right: 32px;
  bottom: 32px;
  width: 380px;
  z-index: 10;
  background: var(--panel-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}
/* Gold corner brackets */
.controls::before, .controls::after {
  content: ''; position: absolute;
  width: 24px; height: 24px;
  border-color: var(--gold); border-style: solid;
  pointer-events: none;
}
.controls::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.controls::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

.controls::-webkit-scrollbar { width: 4px; }
.controls::-webkit-scrollbar-track { background: transparent; }
.controls::-webkit-scrollbar-thumb { background: var(--gold); }

.ctrl-section {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.ctrl-section:last-child { border-bottom: none; }

.ctrl-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.ctrl-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  color: var(--gold);
  font-weight: 500;
}
.ctrl-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.ctrl-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--gold);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* ============ FINISH GRID (2-col, 12 chips) ============ */
.finish-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.finish-grid::-webkit-scrollbar { width: 3px; }
.finish-grid::-webkit-scrollbar-thumb { background: var(--gold); }
.finish-chip {
  position: relative;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 0;
  text-align: left;
  color: var(--ink);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.finish-chip:hover { border-color: var(--line-bright); transform: translateY(-1px); }
.finish-chip.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 8px 22px -8px var(--gold-glow);
}
.finish-chip.active::after {
  content: ''; position: absolute;
  top: 6px; right: 6px;
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--gold);
}
.finish-swatch {
  width: 100%; height: 56px;
  position: relative;
  overflow: hidden;
}
.finish-swatch::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.20) 50%, transparent 65%);
  pointer-events: none;
}
.finish-body { padding: 8px 10px 10px; }
.finish-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink);
  display: block;
  line-height: 1.2;
}
.finish-spec {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  margin-top: 4px;
  text-transform: uppercase;
}

/* Photoreal CSS swatches that hint at the finish (real material rendered in WebGL) */
.sw-brushed-304 {
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.10) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.06) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #d4d4d4 0%, #a8a8a8 50%, #c8c8c8 100%);
}
.sw-m5 {
  background:
    radial-gradient(circle at 18% 28%, rgba(255,255,255,0.20) 4%, transparent 7%),
    radial-gradient(circle at 58% 48%, rgba(0,0,0,0.12) 4%, transparent 7%),
    radial-gradient(circle at 28% 68%, rgba(255,255,255,0.16) 4%, transparent 7%),
    radial-gradient(circle at 78% 22%, rgba(0,0,0,0.10) 4%, transparent 7%),
    radial-gradient(circle at 73% 78%, rgba(255,255,255,0.14) 4%, transparent 7%),
    linear-gradient(180deg, #cecece 0%, #adadad 50%, #c4c4c4 100%);
}
.sw-polished {
  background:
    radial-gradient(ellipse at 30% 25%, rgba(255,255,255,0.5), transparent 55%),
    linear-gradient(180deg, #f0f0f0 0%, #b0b0b0 50%, #d8d8d8 100%);
}
.sw-hammered-copper {
  background:
    radial-gradient(circle at 20% 30%, rgba(255,220,180,0.4) 6%, transparent 9%),
    radial-gradient(circle at 50% 50%, rgba(180,80,40,0.35) 5%, transparent 8%),
    radial-gradient(circle at 80% 30%, rgba(255,220,180,0.35) 5%, transparent 8%),
    radial-gradient(circle at 30% 70%, rgba(180,80,40,0.3) 5%, transparent 8%),
    radial-gradient(circle at 70% 75%, rgba(255,200,140,0.3) 6%, transparent 9%),
    linear-gradient(180deg, #c87838 0%, #8a4520 50%, #b06a30 100%);
}
.sw-pvd-black {
  background:
    radial-gradient(ellipse at 30% 25%, rgba(110,110,110,0.20), transparent 50%),
    linear-gradient(180deg, #2a2a2e 0%, #08080a 55%, #1a1a1e 100%);
}
.sw-brass-bronze {
  background:
    radial-gradient(ellipse at 30% 30%, rgba(255,220,140,0.35), transparent 50%),
    linear-gradient(180deg, #d8a850 0%, #8a6315 50%, #c4922a 100%);
}
.sw-brushed-316 {
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.10) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.06) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #c8ccd0 0%, #9aa0a6 50%, #b8bdc2 100%);
}
.sw-brushed-copper {
  background:
    repeating-linear-gradient(90deg, rgba(255,200,150,0.18) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(90deg, rgba(80,30,15,0.14) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #d2783a 0%, #8e4520 50%, #be6c30 100%);
}
.sw-pvd-gold {
  background:
    radial-gradient(ellipse at 30% 25%, rgba(255,235,170,0.45), transparent 55%),
    linear-gradient(180deg, #e5b65a 0%, #9a7522 50%, #d4a440 100%);
}
.sw-pvd-bronze {
  background:
    radial-gradient(ellipse at 30% 25%, rgba(180,120,70,0.30), transparent 55%),
    linear-gradient(180deg, #8a5530 0%, #4a2a16 50%, #6e4124 100%);
}
.sw-zinc {
  background:
    radial-gradient(circle at 25% 30%, rgba(160,170,180,0.30) 5%, transparent 12%),
    radial-gradient(circle at 70% 60%, rgba(110,120,130,0.30) 5%, transparent 12%),
    radial-gradient(circle at 50% 80%, rgba(180,185,190,0.25) 5%, transparent 12%),
    linear-gradient(180deg, #a4aab0 0%, #6e747a 50%, #94999e 100%);
}
.sw-pewter {
  background:
    radial-gradient(ellipse at 35% 25%, rgba(180,180,185,0.20), transparent 55%),
    linear-gradient(180deg, #7c7e82 0%, #4e5054 50%, #686a6e 100%);
}

/* ============ EDGE GRID (3-col, 9 profiles) ============ */
.edge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.edge-chip {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 8px 4px 6px;
  text-align: center;
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  color: var(--ink-dim);
  transition: all 0.3s;
}
.edge-chip:hover { border-color: var(--line-bright); }
.edge-chip.active {
  border-color: var(--gold);
  background: rgba(200, 146, 42, 0.06);
  color: var(--ink);
}
.edge-chip svg {
  width: 100%; height: 28px;
  color: currentColor;
}
.edge-chip span {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 9.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  line-height: 1.2;
}

/* ============ DIMENSION SLIDERS ============ */
.dim-row { margin-bottom: 16px; }
.dim-row:last-child { margin-bottom: 0; }
.dim-head {
  display: flex; justify-content: space-between;
  align-items: baseline;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.dim-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--gold);
}
.dim-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%; height: 2px;
  background: var(--line);
  outline: none; margin: 0;
  cursor: pointer;
}
.dim-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 1px var(--gold), 0 0 14px var(--gold-glow);
  transition: transform 0.2s;
}
.dim-slider::-webkit-slider-thumb:hover { transform: scale(1.18); }
.dim-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--bg-card);
}
.dim-marks {
  margin-top: 4px;
  display: flex; justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--ink-faint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ============ CTA / SPECS ============ */
.ctrl-cta {
  background: linear-gradient(180deg, transparent 0%, rgba(200,146,42,0.04) 100%);
  position: relative;
}
.ctrl-cta::before {
  content: ''; position: absolute;
  top: 0; left: 0;
  width: 60px; height: 2px;
  background: var(--gold);
}
.spec-row {
  display: flex; justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 6px 0;
}
.spec-row span:last-child {
  color: var(--ink);
}
.btn-quote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-top: 18px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 0.22em;
  color: var(--bg);
  background: var(--gold);
  padding: 16px;
  border: 1px solid var(--gold);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.btn-quote:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  transform: translateY(-1px);
}
.btn-quote svg { transition: transform 0.3s; }
.btn-quote:hover svg { transform: translateX(4px); }
.ctrl-disc {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.5;
  margin-top: 12px;
}

/* ============ HINT (drag/zoom) ============ */
.hint {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--panel-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 1px solid var(--line);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: opacity 0.6s ease;
}
.hint.fade { opacity: 0.3; }
.hint strong {
  color: var(--gold);
  font-weight: 500;
}
.hint-reset {
  background: transparent;
  border: 1px solid var(--line-bright);
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 6px 12px;
  transition: border-color 0.3s, background 0.3s;
}
.hint-reset:hover {
  border-color: var(--gold);
  background: rgba(200, 146, 42, 0.1);
  color: var(--gold);
}

/* ============ BOTTOM-LEFT STATUS ============ */
.status {
  position: fixed;
  bottom: 32px; left: 32px;
  z-index: 5;
  display: flex; align-items: center; gap: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.status-dot {
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--gold);
  animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
  50% { opacity: 0.4; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1280px) {
  .controls { width: 340px; }
  .section-title { max-width: 380px; }
}

@media (max-width: 980px) {
  .topnav { grid-template-columns: 1fr auto; padding: 14px 20px; }
  .topnav-meta { display: none; }
  .topnav-link { display: none; }
  .section-title {
    top: 90px; left: 20px;
    max-width: calc(100% - 40px);
  }
  .section-h1 { font-size: 36px; }
  .controls {
    top: auto; right: 0; left: 0;
    bottom: 0; width: 100%;
    max-height: 50vh;
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .controls::before, .controls::after { display: none; }
  .hint { bottom: 52vh; font-size: 9px; padding: 8px 14px; }
  .status { display: none; }
}
