/* ═══════════════════════════════════════════════════════════════
   Unique Laser Works — Main Stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ── Theme Tokens ────────────────────────────────────────────── */
/* Tailwind color-channel vars (RGB triplets, dark default)      */
:root {
  --color-light:        245 245 240;  /* used by text-light, bg-light     */
  --color-surface:      11  14  23;   /* used by bg-surface                */
  --color-surface-card: 15  20  32;   /* used by bg-surface-card           */

  /* Component vars */
  --bg:            #0B0E17;
  --bg-card:       rgba(15,20,32,.95);
  --bg-form:       #0B0E17;
  --nav-bg:        rgba(11,14,23,.96);
  --menu-bg:       rgba(11,14,23,.98);
  --border:        rgba(255,255,255,.08);
  --border-med:    rgba(255,255,255,.15);
  --btn-ghost-fg:  rgba(245,245,240,.65);
}

html[data-theme="light"] {
  /* Tailwind color-channel vars — light overrides */
  --color-light:        26  26  46;   /* near-black text                   */
  --color-surface:      240 237 232;  /* warm off-white surface            */
  --color-surface-card: 255 255 255;  /* white card bg                     */

  /* Component vars */
  --bg:            #F0EDE8;
  --bg-card:       rgba(255,255,255,.97);
  --bg-form:       #FFFFFF;
  --nav-bg:        rgba(240,237,232,.97);
  --menu-bg:       rgba(240,237,232,.99);
  --border:        rgba(0,0,0,.08);
  --border-med:    rgba(0,0,0,.15);
  --btn-ghost-fg:  rgba(26,26,46,.65);
}

/* ── Keyframes ──────────────────────────────────────────────── */
@keyframes ticker    { from { transform: translateX(0)    } to { transform: translateX(-50%)   } }
@keyframes marquee   { from { transform: translateX(0)    } to { transform: translateX(-50%)   } }
@keyframes glow-line { 0%,100% { opacity: .6 } 50% { opacity: 1 } }
@keyframes scan-dot  { from { top: 3% } to { top: 97% } }
@keyframes shimmer   { from { transform: translateX(-200%) } to { transform: translateX(200%) } }
@keyframes pulse-badge {
  0%,100% { box-shadow: 0 0 0 0   rgba(244,121,32,0)    }
  50%      { box-shadow: 0 0 0 6px rgba(244,121,32,.08)  }
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: rgb(var(--color-light));
  font-family: Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}

::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #F47920; border-radius: 3px; }

/* ── Layout helpers ─────────────────────────────────────────── */
.section-pad { padding-top: 96px; padding-bottom: 96px; }

.noise-bg { position: relative; }

/* ── Brand elements ─────────────────────────────────────────── */
.laser-line {
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #F47920 20%, #F47920 50%, #2E619D 80%, transparent);
  box-shadow: 0 0 8px rgba(244,121,32,.4);
}

.metal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: background .3s, border-color .3s, box-shadow .3s;
}

html[data-theme="light"] .metal-card {
  box-shadow: 0 2px 20px rgba(0,0,0,.07);
}

.gradient-text {
  background: linear-gradient(100deg, #F47920 0%, #FFB060 40%, #F47920 70%, #D4620C 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Animations ─────────────────────────────────────────────── */
.ticker-track  { display: flex; width: max-content; animation: ticker  32s linear infinite; }
.marquee-track { display: flex; width: max-content; animation: marquee 20s linear infinite; }
.brand-line    { animation: glow-line 3s ease-in-out infinite; }

.scan-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255,215,0,.7), 0 0 12px #fff, 0 0 24px #F47920;
  animation: scan-dot 5s ease-in-out infinite alternate;
}

/* ── Navbar ─────────────────────────────────────────────────── */
#navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background .3s, border .3s, box-shadow .3s;
}

#navbar.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 24px rgba(0,0,0,.15);
}

.nav-link {
  position: relative;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .04em;
  color: rgb(var(--color-light) / .8);
  transition: color .2s;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.active { color: #F47920; }

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 1px;
  background: #F47920;
}

/* ── Mobile menu ─────────────────────────────────────────────── */
#mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--menu-bg);
  backdrop-filter: blur(16px);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}

#mobile-menu.open { transform: translateX(0); }

html[data-theme="light"] #mobile-menu button.font-heading {
  color: rgba(26,26,46,.75) !important;
  border-color: rgba(0,0,0,.08) !important;
}
html[data-theme="light"] #mobile-menu button.font-heading:hover {
  color: #F47920 !important;
}
html[data-theme="light"] #mobile-menu a {
  color: rgba(26,26,46,.5) !important;
}

/* ── Theme Toggle Button ─────────────────────────────────────── */
.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-med);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(var(--color-light) / .6);
  transition: color .2s, border-color .2s, background .2s;
  flex-shrink: 0;
}

.theme-btn:hover {
  color: #F47920;
  border-color: rgba(244,121,32,.5);
  background: rgba(244,121,32,.06);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .04em;
  color: #fff;
  background: #F47920;
  box-shadow: 0 0 28px rgba(244,121,32,.45), 0 4px 20px rgba(0,0,0,.35);
  transition: background .2s, gap .2s;
  border: none;
  cursor: pointer;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.25) 50%, transparent 60%);
  transform: translateX(-200%);
  transition: transform .7s;
}

.btn-primary:hover::before { transform: translateX(200%); }
.btn-primary:hover         { background: #D4620C; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--btn-ghost-fg);
  border: 1px solid var(--border-med);
  transition: all .2s;
  background: none;
  cursor: pointer;
}

.btn-ghost:hover {
  color: rgb(var(--color-light));
  background: rgba(128,128,128,.08);
}

/* ── Cards ───────────────────────────────────────────────────── */
.corner-accent { position: relative; }

.corner-accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  border-top: 2px solid #F47920;
  border-left: 2px solid #F47920;
  z-index: 1;
}

.card-laser {
  height: 2px;
  width: 0;
  transition: width .5s;
  background: linear-gradient(90deg, #F47920, #FFD700);
  box-shadow: 0 0 8px rgba(244,121,32,.6);
}

.service-card:hover .card-laser { width: 100%; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-input {
  width: 100%;
  background: var(--bg-form);
  border: 1px solid var(--border-med);
  border-radius: 4px;
  padding: 10px 16px;
  font-size: 14px;
  color: rgb(var(--color-light));
  outline: none;
  transition: border-color .2s, background .3s;
  font-family: Inter, sans-serif;
}

.form-input:focus        { border-color: rgba(244,121,32,.6); }
.form-input::placeholder { color: rgb(var(--color-light) / .25); }
select.form-input option { background: var(--bg-form); color: rgb(var(--color-light)); }

/* ── Modals ──────────────────────────────────────────────────── */
.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}

.modal-wrap.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Machine card tab panels ─────────────────────────────────── */
.filter-hidden       { display: none !important; }
.mcard-panel         { display: none; }
.mcard-panel.active  { display: block; }
.group-detail        { display: none; }
.group-detail.active { display: block; }

/* ═══════════════════════════════════════════════════════════════
   Light Theme — Section & Component Overrides
   ═══════════════════════════════════════════════════════════════ */

/* Section backgrounds (override inline style="background:#0B0E17") */
html[data-theme="light"] #services,
html[data-theme="light"] #machines,
html[data-theme="light"] #gallery,
html[data-theme="light"] #contact  { background: var(--bg) !important; }

html[data-theme="light"] #about    { background: #E8E4DE !important; }

/* ── Machine filter buttons (inactive border) */
html[data-theme="light"] .mfilter-btn:not(.bg-orange),
html[data-theme="light"] .gfilter-btn:not(.bg-orange) {
  border-color: rgba(0,0,0,.15) !important;
}

/* ── Machine cards (JS-rendered, have inline background) */
html[data-theme="light"] .machine-item {
  background: #fff !important;
  border-color: rgba(0,0,0,.1) !important;
}

/* Machine card image area fallback bg */
html[data-theme="light"] .machine-item .machine-img { background: #DDD9D3 !important; }

/* Machine card inactive tab labels */
html[data-theme="light"] .machine-item .mtab-btn:not(.bg-orange) {
  color: rgba(26,26,46,.45) !important;
}

/* Machine card spec dividers */
html[data-theme="light"] .machine-item .border-b { border-color: rgba(0,0,0,.06) !important; }

/* Machine card thumbnail buttons */
html[data-theme="light"] .machine-item .border-white\/8 { border-color: rgba(0,0,0,.1) !important; }

/* ── Gallery section */
html[data-theme="light"] #gallery { background: var(--bg) !important; }

/* Gallery cards (JS-rendered, masonry) */
html[data-theme="light"] .gallery-card { background: #C8C4BE !important; }

/* Gallery filter pills inactive state */
html[data-theme="light"] .gfilter-btn:not(.bg-orange) {
  color: rgba(26,26,46,.5) !important;
  border-color: rgba(0,0,0,.15) !important;
}

/* ── Machines section — summary stat boxes */
html[data-theme="light"] #machines .mt-16 div[style*="0F1420"] {
  background: #fff !important;
}
html[data-theme="light"] #machines .border-white\/8 { border-color: rgba(0,0,0,.1) !important; }

/* ── About section — bento grid light theme */
html[data-theme="light"] #about { background: #E8E4DE !important; }

/* Bento stat + cert cards */
html[data-theme="light"] #about [style*="0F1420"] {
  background: #fff !important;
  border-color: rgba(0,0,0,.09) !important;
}

/* Values strip container */
html[data-theme="light"] #about .grid.rounded-2xl {
  background: #fff;
  border-color: rgba(0,0,0,.09) !important;
}
html[data-theme="light"] #about .grid.rounded-2xl > div {
  border-color: rgba(0,0,0,.09) !important;
}
html[data-theme="light"] #about .grid.rounded-2xl > div:hover {
  background: rgba(27,58,92,.04) !important;
}

/* Values icon bg */
html[data-theme="light"] #about .w-9.h-9[style*="rgba(244,121,32,.1)"] {
  background: rgba(244,121,32,.1) !important;
}

/* Timeline card */
html[data-theme="light"] #about .rounded-2xl.px-10 {
  background: #fff !important;
  border-color: rgba(0,0,0,.09) !important;
}

/* Story card overlay text */
html[data-theme="light"] #about .text-light\/80 { color: rgba(11,14,23,.82) !important; }
html[data-theme="light"] #about .text-light\/50 { color: rgba(11,14,23,.5) !important; }
html[data-theme="light"] #about .text-light\/40 { color: rgba(11,14,23,.45) !important; }
html[data-theme="light"] #about .text-light\/30 { color: rgba(11,14,23,.35) !important; }
html[data-theme="light"] #about .text-light\/35 { color: rgba(11,14,23,.4) !important; }

/* Timeline text */
html[data-theme="light"] #about .text-light { color: rgba(11,14,23,.88) !important; }

/* ── Contact section */
/* Map: remove dark invert in light mode */
html[data-theme="light"] #contact iframe { filter: none !important; }

/* Map border */
html[data-theme="light"] #contact .border-white\/8 { border-color: rgba(0,0,0,.1) !important; }

/* Form labels */
html[data-theme="light"] #contact label { color: rgba(26,26,46,.5) !important; }

/* Form fine-print */
html[data-theme="light"] #contact .text-light\/30 { color: rgba(26,26,46,.35) !important; }

/* ── Machine modal */
html[data-theme="light"] #machine-modal .max-w-4xl {
  background: #fff !important;
  border-color: rgba(0,0,0,.1) !important;
}
html[data-theme="light"] #machine-modal-content > div:first-child { background: #DDD9D3 !important; }
html[data-theme="light"] #machine-modal .flex.border.rounded       { border-color: rgba(0,0,0,.1) !important; }
html[data-theme="light"] #machine-modal .mm-tab:not(.bg-orange)    { color: rgba(26,26,46,.4) !important; }
html[data-theme="light"] #machine-modal .border-b                  { border-color: rgba(0,0,0,.06) !important; }
html[data-theme="light"] #machine-modal .border-white\/8           { border-color: rgba(0,0,0,.1) !important; }

/* Close button in modal */
html[data-theme="light"] #machine-modal button[onclick="closeMachineModal()"] {
  background: rgba(0,0,0,.08) !important;
  border-color: rgba(0,0,0,.15) !important;
  color: rgba(26,26,46,.5) !important;
}

/* ── Service tag pills */
.svc-tag {
  padding: .25rem .625rem;
  border-radius: .375rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: .6875rem;
  letter-spacing: .03em;
  background: rgba(244,121,32,.08);
  border: 1px solid rgba(244,121,32,.22);
  color: rgba(244,121,32,.9);
  white-space: nowrap;
}

/* ── Services section: light theme */
html[data-theme="light"] #services .text-light\/55 { color: rgba(26,26,46,.68) !important; }
html[data-theme="light"] #services .text-light\/65 { color: rgba(26,26,46,.75) !important; }
/* Service tag pills in light mode */
html[data-theme="light"] .svc-tag {
  background: rgba(244,121,32,.07) !important;
  border-color: rgba(244,121,32,.3) !important;
  color: #C4560A !important;
}

/* ── Group section */
html[data-theme="light"] #group { background: #F0EDE8 !important; }

/* Stats bar cells */
html[data-theme="light"] #group-stats > div {
  background: rgba(0,0,0,.04) !important;
}
/* Stats bar outer border */
html[data-theme="light"] #group-stats {
  border-color: rgba(0,0,0,.08) !important;
}
/* Stats bar divider lines (gap-px produces 1px bg-showing slices) */
html[data-theme="light"] #group-stats { background: rgba(0,0,0,.08) !important; }
/* Stats value numbers (accent-colored, keep them) */
/* Stat label text */
html[data-theme="light"] #group-stats .text-white\/35 { color: rgba(27,58,92,.55) !important; }
html[data-theme="light"] #group-stats .text-light\/40 { color: rgba(26,26,46,.4) !important; }
html[data-theme="light"] #group-stats .text-light\/35 { color: rgba(26,26,46,.38) !important; }
/* H2 heading "One Group. Five Specialties." */
html[data-theme="light"] #group h2 { color: #1B3A5C !important; }
/* Section eyebrow undertext */
html[data-theme="light"] #group .text-light\/45 { color: rgba(26,26,46,.5) !important; }
html[data-theme="light"] #group .text-light\/35 { color: rgba(26,26,46,.4) !important; }
html[data-theme="light"] #group .text-light\/50 { color: rgba(27,58,92,.6) !important; }

/* ── Hero stats strip */
/* ── Hero ticker — light theme */
html[data-theme="light"] #hero-ticker {
  background: rgba(240,237,232,.95) !important;
  border-color: rgba(0,0,0,.08) !important;
}
html[data-theme="light"] #hero-ticker span[style*="rgba(255,255,255,.4)"] {
  color: rgba(26,26,46,.5) !important;
}

html[data-theme="light"] #stats-strip {
  background: rgba(255,255,255,.88) !important;
  border-color: rgba(0,0,0,.09) !important;
  backdrop-filter: blur(16px);
}
html[data-theme="light"] #stats-strip > div {
  border-color: rgba(0,0,0,.09) !important;
}
html[data-theme="light"] #stats-strip > div:hover {
  background: rgba(27,58,92,.05) !important;
}
/* Stat value numbers — remove dark glow */
html[data-theme="light"] #stats-strip .font-heading {
  text-shadow: none !important;
}
/* Blue values (#2E619D) → brand navy */
html[data-theme="light"] #stats-strip [style*="2E619D"] {
  color: #1B3A5C !important;
}
/* Stat labels */
html[data-theme="light"] #stats-strip .font-mono {
  color: rgba(27,58,92,.55) !important;
}
