/*
 * Copyright © 2026 Tech Redux. All rights reserved. Original work by Muhammad Bilal Khan, Founder & CEO of Tech Redux. Unauthorized copying, reproduction, distribution, or use is prohibited.
 */

/* =========================================================
FONTS
========================================================= */

@font-face { font-family: 'SF Pro Display'; src: url('/demo/459kAj5HQX/koAj6pvCR7/Qd9hwH0MavNQ.OTF') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'SF Pro Display'; src: url('/demo/459kAj5HQX/koAj6pvCR7/vccRRowb1Ji9.OTF') format('opentype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'SF Pro Display'; src: url('/demo/459kAj5HQX/koAj6pvCR7/eGLPgaVYyuyE.OTF') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }

/* =========================================================
GLOBAL
========================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

:root {
--panel-color: #4D7C0F;
--panel-gradient-start: rgba(35, 84, 0, 0.5);
--panel-gradient-end: rgba(0, 0, 0, 0.2);
--panel-text: rgba(255, 255, 255, 0.8);
--panel-text-strong: #f5f8e1;
--panel-text-muted: #fff;
--panel-border: rgba(220, 235, 185, 0.16);
--panel-divider: rgba(220, 235, 185, 0.1);
--button-bg: rgba(220, 235, 185, 0.06);
--button-border: rgba(220, 235, 185, 0.14);
--button-text: #fff;
--button-hover-bg: rgba(220, 235, 185, 0.13);
--button-hover-text: #fff;
--button-active-bg: rgba(220, 235, 185, 0.3);
--button-active-text: #fff;
--slider-fill: #e0e9bd;
--slider-track: rgba(220, 235, 185, 0.2);
--slider-thumb: #B9E66F;
--toggle-off: rgba(255, 255, 255, 0.2);
--toggle-on: #fff;
--toggle-knob: #fff;
--toggle-knob-active: #B9E66F;
--cta-bg: #e0e9bd;
--cta-text: #304b08;
--cta-hover-bg: #edf2d5;
}

.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}

.three-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; }

/* .three-inspector { display: none !important; } */

/* =========================================================
CONTROLS PANEL
========================================================= */

.controls-panel {
position: fixed;
top: 70px;
right: 20px;
width: 320px;
max-height: calc(100vh - 90px);
padding: 5px;
overflow: hidden;
z-index: 9999;
color: var(--panel-text);
background: linear-gradient(180deg, var(--panel-gradient-start) 0%, var(--panel-gradient-end) 70%);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid var(--panel-border);
border-radius: 24px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.controls-scroll {
height: 100%;
max-height: calc(100vh - 90px);
padding: 15px;
overflow-y: auto;
overflow-x: hidden;
scrollbar-width: thin;
scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.controls-scroll::-webkit-scrollbar { width: 5px; }
.controls-scroll::-webkit-scrollbar-track { background: transparent; }
.controls-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.22); border-radius: 999px; }
.controls-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.35); }

.panel-header {
display: flex;
align-items: center;
gap: 10px;
padding-bottom: 14px;
margin-bottom: 16px;
color: var(--panel-text-strong);
font-size: 28px;
font-weight: 600;
border-bottom: 1px solid var(--panel-divider);
}

.section-title {
margin: 16px 0 10px;
color: var(--panel-text-muted);
font-size: 12px;
font-weight: 500;
letter-spacing: 1.2px;
text-transform: uppercase;
}

/* =========================================================
DROPDOWNS
========================================================= */

.preset-select { position: relative; width: 100%; }

.preset-select-trigger {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 13px;
color: var(--button-text);
background: var(--button-bg);
border: 1px solid var(--button-border);
border-radius: 14px;
font-family: inherit;
font-size: 16px;
font-weight: 500;
cursor: pointer;
transition: background 0.2s ease, border-color 0.2s ease;
}

.preset-select-trigger:hover { background: var(--button-hover-bg); color: var(--button-hover-text); }

.preset-select-trigger svg {
width: 18px;
height: 18px;
fill: none;
stroke: currentColor;
stroke-width: 1.8;
transition: transform 0.2s ease;
}

.preset-select.open .preset-select-trigger svg { transform: rotate(180deg); }

.preset-dropdown {
position: absolute;
top: calc(100% + 6px);
left: 0;
right: 0;
z-index: 10000;
padding: 6px;
opacity: 0;
visibility: hidden;
transform: translateY(-5px);
background: rgba(0, 0, 0, 0.8);
border: 1px solid var(--panel-border);
border-radius: 14px;
box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.preset-select.open .preset-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.preset-option {
width: 100%;
display: block;
padding: 9px 11px;
color: var(--button-text);
background: transparent;
border: 0;
border-radius: 9px;
font-family: inherit;
font-size: 15px;
font-weight: 500;
text-align: left;
cursor: pointer;
transition: background 0.15s ease, color 0.15s ease;
}

.preset-option:hover { background: var(--button-hover-bg); color: var(--button-hover-text); }
.preset-option.active { background: var(--button-active-bg); color: var(--button-active-text); font-weight: 500; }

/* =========================================================
SLIDERS
========================================================= */

.control-group { margin-bottom: 14px; }

.control-label-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 6px;
color: var(--panel-text);
font-size: 16px;
}

.number-input {
width: 50px;
color: var(--panel-text-strong);
background: transparent;
border: 0;
outline: 0;
font-size: 16px;
font-weight: 700;
text-align: right;
}

.number-input::-webkit-inner-spin-button,
.number-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.slider {
width: 100%;
height: 6px;
appearance: none;
-webkit-appearance: none;
background: linear-gradient(to right, var(--slider-fill) 85%, var(--slider-track) 85%);
border-radius: 3px;
outline: 0;
cursor: pointer;
}

.slider::-webkit-slider-thumb {
width: 16px;
height: 16px;
appearance: none;
-webkit-appearance: none;
background: var(--slider-thumb);
border-radius: 50%;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
cursor: pointer;
}

.slider::-moz-range-thumb {
width: 16px;
height: 16px;
background: var(--slider-thumb);
border: 0;
border-radius: 50%;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
cursor: pointer;
}

/* =========================================================
TOGGLE
========================================================= */

.toggle-row {
display: flex;
align-items: center;
justify-content: space-between;
margin: 18px 0 20px;
color: var(--panel-text);
font-size: 16px;
}

.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { width: 0; height: 0; opacity: 0; }

.toggle-slider {
position: absolute;
inset: 0;
background: var(--toggle-off);
border-radius: 24px;
cursor: pointer;
transition: 0.3s;
}

.toggle-slider::before {
content: "";
position: absolute;
left: 3px;
bottom: 3px;
width: 18px;
height: 18px;
background: var(--toggle-knob);
border-radius: 50%;
transition: 0.3s;
}

input:checked + .toggle-slider { background: var(--toggle-on); }
input:checked + .toggle-slider::before { transform: translateX(20px); background: var(--toggle-knob-active); }

/* =========================================================
CTA
========================================================= */

.cta-btn {
width: 100%;
display: block;
margin-top: 16px;
padding: 12px 20px;
color: #B9E66F;
background: linear-gradient(180deg, #18331e 0%, #0d1e124b 100%);
border: 1px solid rgba(188, 247, 111, 0.3);
border-radius: 100px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
font-size: 18px;
font-weight: 700;
letter-spacing: 0.5px;
text-align: center;
text-decoration: none;
cursor: pointer;
transition: 0.2s ease;
}

.cta-btn:hover {
color: #fff;
background: linear-gradient(180deg, #204428 0%, #122818 100%);
border-color: rgba(188, 247, 111, 0.6);
transform: translateY(-1px);
box-shadow: 0 0 12px rgba(188, 247, 111, 0.25), 0 6px 16px rgba(0, 0, 0, 0.5);
}

.cta-btn-docs {
  width: 100%;
  display: block;
  margin-top: 10px;
  padding: 10px 20px;
  color: #B9E66F;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: 0.2s ease;
}

.cta-btn-docs:hover {
  color: #B9E66F;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

/* =========================================================
MOBILE PANEL TOGGLE
========================================================= */

.mobile-panel-toggle { display: none; }

/* =========================================================
PRESET OVERLAY
========================================================= */

.preset-overlay {
position: fixed;
top: 50%;
left: 50%;
z-index: 100;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
transform: translate(-50%, -50%);
opacity: 0;
pointer-events: none;
}

.preset-overlay__content { display: flex; align-items: center; justify-content: center; gap: 18px; }
.preset-overlay__label { color: #fff; font-size: 70px; font-weight: 500; line-height: 1; letter-spacing: 0.28em; text-transform: uppercase; white-space: nowrap; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5); opacity: 0; }
.preset-overlay__line { width: 45px; height: 1px; flex-shrink: 0; background: rgba(255, 255, 255, 0.7); }

/* =========================================================
FPS
========================================================= */

.fps-counter {
position: fixed;
top: 20px;
right: 20px;
z-index: 100;
display: flex;
align-items: center;
gap: 18px;
padding: 10px 16px;
background: linear-gradient(180deg, var(--panel-gradient-start) 0%, var(--panel-gradient-end) 120%);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
border-radius: 24px;
border: 1px solid rgba(255, 255, 255, 0.12);
color: #fff;
font-family: Arial, sans-serif;
font-size: 16px;
line-height: 1;
pointer-events: none;
user-select: none;
}

.fps-counter__metric {
display: flex;
align-items: center;
gap: 8px;
}

.fps-counter__label {
opacity: 0.8;
font-weight: 500;
letter-spacing: 0.08em;
}

.fps-counter__value {
font-weight: 600;
text-align: right;
font-variant-numeric: tabular-nums;
}

/* =========================================================
DEMO BRAND
========================================================= */

.demo-brand {
position: fixed;
top: 24px;
left: 24px;
z-index: 9999;
padding: 14px 18px;
color: var(--panel-text-strong);
background: linear-gradient(180deg, var(--panel-gradient-start) 0%, var(--panel-gradient-end) 100%);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
border: 1px solid var(--panel-border);
border-radius: 14px;
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
user-select: none;
}

.demo-brand-title { display: flex; align-items: center; font-size: 28px; font-weight: 700; line-height: 1.2; text-transform: uppercase; }
.demo-brand-title img { width: auto; height: 70px; }

.demo-controls {
display: flex;
align-items: center;
gap: 20px;
margin-top: 12px;
padding-top: 10px;
color: rgba(255, 255, 255, 0.65);
border-top: 1px solid rgba(255, 255, 255, 0.08);
font-size: 11px;
font-weight: 500;
letter-spacing: 0.3px;
white-space: nowrap;
}

.demo-control { display: inline-flex; align-items: center; gap: 6px; }

.demo-control-key {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 22px;
height: 20px;
padding: 0 5px;
color: #fff;
background: rgba(0, 0, 0, 0.4);
border: 1px solid rgba(255, 255, 255, 0.2);
border-bottom: 2px solid rgba(255, 255, 255, 0.35);
border-radius: 4px;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
font-family: monospace;
font-size: 10px;
font-weight: 700;
letter-spacing: 0.5px;
}

.demo-control-label { color: rgba(255, 255, 255, 0.7); }

/* =========================================================
LOADING SCREEN
========================================================= */

.loading-overlay {
--r: 0px;
position: fixed;
inset: 0;
z-index: 100000;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
gap: 20px;
background: radial-gradient(circle at 50% 30%, rgba(26, 36, 43, 0.85) 0%, rgba(15, 20, 25, 0.95) 60%, rgba(10, 13, 16, 1) 100%), linear-gradient(135deg, #141a1f 0%, #0d1115 50%, #080a0c 100%);
-webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 0, transparent calc(var(--r) - 100px), #333 calc(var(--r) - 50px), #000 var(--r));
mask-image: radial-gradient(circle at 50% 50%, transparent 0, transparent calc(var(--r) - 100px), #333 calc(var(--r) - 50px), #000 var(--r));
}

.loading-logo { position: fixed; top: 38px; left: 40px; height: 70px; }

.loading-items { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 30px; }

.loader-logo { position: relative; width: 300px; height: 210px; }

.logo-outline { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

.logo-fill { position: absolute; inset: 0; overflow: hidden; clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%); }

.logo-fill img { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; object-fit: contain; }

.progress-container { width: 100%; max-width: 420px; display: flex; align-items: center; flex-direction: column; gap: 12px; color: #e0e6ed; }

.progress-bar-track { position: relative; width: 100%; height: 4px; overflow: hidden; background: rgba(255, 255, 255, 0.08); border-radius: 4px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4); }

.progress-bar { width: 100%; transform: scaleX(0); transform-origin: left center; will-change: transform; height: 100%; background: linear-gradient(90deg, #99E2FE, #B9E66F); border-radius: 4px; box-shadow: 0 0 12px rgba(110, 231, 183, 0.6); transition: transform 0.2s ease-in; }

.progress-text { width: 100%; display: flex; justify-content: space-between; color: #a0aec0; font-size: 16px; font-weight: 500; letter-spacing: 0.3px; }
.progress-text span { margin-left: 4px; color: #B9E66F; font-weight: 600; }

/* =========================================================
PRODUCT CREDIT
========================================================= */

.product-credit {
position: fixed;
right: 24px;
bottom: 20px;
z-index: 100;
display: flex;
align-items: center;
gap: 7px;
color: #fff;
opacity: 0.7;
text-decoration: none;
font-size: 12px;
letter-spacing: 0.04em;
transition: opacity 0.25s ease;
}

.product-credit img { height: 18px; }
.product-credit:hover { opacity: 1; }

.loading-product-credit {
left: unset !important;
right: 24px !important;
bottom: 20px !important;
}

/* =========================================================
START BUTTON
========================================================= */

.start-button {
position: relative;
width: 100%;
padding: 13px 38px;
opacity: 0;
pointer-events: none;
overflow: hidden;
color: #e8f5c9;
background: linear-gradient(180deg, rgba(34, 55, 25, 0.92) 0%, rgba(10, 18, 12, 0.96) 100%);
border: 1px solid rgba(185, 230, 111, 0.32);
border-radius: 999px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.025), inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.25);
backdrop-filter: blur(14px);
-webkit-backdrop-filter: blur(14px);
font-size: 20px;
font-weight: 600;
letter-spacing: 1.8px;
text-transform: uppercase;
cursor: pointer;
transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.start-button::before {
content: "";
position: absolute;
top: 0;
left: -120%;
width: 80%;
height: 100%;
background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.04) 45%, rgba(185, 230, 111, 0.12) 50%, rgba(255, 255, 255, 0.04) 55%, transparent 100%);
transform: skewX(-20deg);
animation: start-button-shimmer 4s ease-in-out infinite;
pointer-events: none;
}

.start-button::after {
content: "";
position: absolute;
top: 0;
left: 18%;
right: 18%;
height: 1px;
background: linear-gradient(90deg, transparent, rgba(185, 230, 111, 0.45), transparent);
opacity: 0.8;
pointer-events: none;
}

.start-button:hover {
color: #fff;
background: linear-gradient(180deg, rgba(45, 72, 32, 0.96) 0%, rgba(13, 25, 16, 0.98) 100%);
border-color: rgba(185, 230, 111, 0.65);
transform: translateY(-2px);
box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 22px rgba(185, 230, 111, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.start-button:active { transform: translateY(0) scale(0.97); }

.start-button:focus-visible {
outline: 0;
border-color: rgba(185, 230, 111, 0.8);
box-shadow: 0 0 0 3px rgba(185, 230, 111, 0.12), 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(185, 230, 111, 0.15);
}

@keyframes start-button-shimmer {
0%, 45% { left: -120%; }
70%, 100% { left: 140%; }
}

/* =========================================================
MOBILE CTA
========================================================= */

.mobile-cta-btn { display: none; }

/* =========================================================
MOBILE
========================================================= */

@media (max-width: 900px) {
.preset-overlay__label { font-size: 52px; letter-spacing: 0.22em; }
.preset-overlay__content { gap: 14px; }
.preset-overlay__line { width: 32px; }
}

@media (max-width: 700px) {
.controls-panel {
top: auto;
right: 0;
bottom: 0;
width: 100%;
max-height: 82dvh;
padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
border-radius: 24px 24px 0 0;
transform: translateY(calc(100% - 42px));
overflow-y: auto;
overscroll-behavior: contain;
-webkit-overflow-scrolling: touch;
transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.controls-panel.mobile-open { transform: translateY(0); }
.controls-scroll { max-height: none; overflow: unset; }

.mobile-panel-toggle {
position: absolute;
top: 8px;
left: 50%;
width: 52px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
color: var(--panel-text-strong);
background: transparent;
border: 0;
transform: translateX(-50%);
cursor: pointer;
touch-action: manipulation;
z-index: 10;
}

.mobile-panel-toggle::before { content: ""; position: absolute; width: 42px; height: 4px; background: rgba(245, 248, 225, 0.45); border-radius: 999px; }
.mobile-panel-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; opacity: 0; transition: transform 0.35s ease; }
.controls-panel.mobile-open .mobile-panel-toggle svg { transform: rotate(180deg); }

.panel-header { padding-top: 24px; margin-bottom: 14px; font-size: 20px; }
.preset-select-trigger { min-height: 46px; }
.preset-option { min-height: 44px; }
.slider { height: 7px; }
.slider::-webkit-slider-thumb { width: 20px; height: 20px; }
.slider::-moz-range-thumb { width: 20px; height: 20px; }
.cta-btn { display: none; }
.cta-btn-docs { display: none; }

.demo-brand { top: 12px; left: 12px; padding: 5px 10px; border-radius: 9999px; max-width: calc(100vw - 24px); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.demo-brand-title { font-size: 20px; line-height: 1.1; }
.demo-brand-title img { height: 30px; }
.demo-controls { display: none; }

.fps-counter { top: auto; right: auto; bottom: 55px; left: 12px; font-size: 12px; gap: 10px; }
.fps-counter__metric { gap: 2px; }

.mobile-cta-btn {
position: fixed;
top: 12px;
right: 12px;
z-index: 9999;
min-height: 42px;
display: block;
padding: 10px 15px;
color: #B9E66F;
background: linear-gradient(180deg, #18331e 0%, #0d1e124b 100%);
backdrop-filter: blur(10px);
border: 1px solid rgba(188, 247, 111, 0.3);
border-radius: 999px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
font-size: 14px;
font-weight: 700;
letter-spacing: 0.5px;
text-decoration: none;
cursor: pointer;
}

.mobile-cta-btn:active { transform: scale(0.97); }

.loading-items { gap: 15px; }
.start-button { width: fit-content; font-size: 16px; }
.loading-logo { top: 17px; left: 22px; height: 40px; }
.loader-logo { width: 80vw; height: 140px; }
.logo-fill, .logo-outline { width: 200px; height: 140px; margin: 0 auto; }

.preset-overlay__label { font-size: 32px; letter-spacing: 0.18em; }
.preset-overlay__content { gap: 10px; }
.preset-overlay__line { width: 22px; }

.product-credit { right: 16px; bottom: 60px; z-index: 999; font-size: 9px; }
.product-credit img { height: 13px; }
}

/* =========================================================
REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
.start-button::before { animation: none; }
.start-button { transition: none; }
}
