:root {
  --bg: #0a0c12;
  --surface: rgba(20, 24, 38, 0.8);
  --card: rgba(28, 34, 52, 0.7);
  --yellow: #ffe050;
  --cyan: #06b6d4;
  --violet: #8b5cf6;
  --border: rgba(6, 182, 212, 0.3);
  --text: #ffffff;
  --text2: #94a3b8;
  --radius: 20px;
}
body.light {
  --bg: #f0f4f8;
  --surface: rgba(255,255,255,0.9);
  --card: rgba(255,255,255,0.95);
  --border: rgba(59,130,246,0.2);
  --text: #0f172a;
  --text2: #475569;
  --yellow: #f5cc00;
}
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* HEADER */
header {
  position: sticky; top: 0; z-index: 999;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 70px;
  background: rgba(10,12,18,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
body.light header { background: rgba(255,255,255,0.92); }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-m {
  width: 38px; height: 38px; background: linear-gradient(135deg,#ffe050,#f59e0b);
  color: #000; border-radius: 10px; display: grid; place-items: center;
  font-weight: 900; font-size: 1.3rem; box-shadow: 0 4px 16px rgba(255,224,80,0.4);
}
.logo-name {
  font-size: 1.3rem; font-weight: 900;
  background: linear-gradient(135deg,#fff,#a5b4fc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
body.light .logo-name { background: linear-gradient(135deg,#0f172a,#2563eb); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a { color: var(--text2); text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.header-right { display: flex; align-items: center; gap: 10px; }
select.lang-sel, button.theme-btn {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 30px;
  padding: 7px 14px; font-size: 0.82rem; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
select.lang-sel:hover, button.theme-btn:hover { border-color: var(--yellow); box-shadow: 0 0 12px rgba(255,224,80,0.3); }
.btn-gold {
  background: linear-gradient(135deg,#ffe050,#f59e0b);
  color: #000; border: none; border-radius: 30px;
  padding: 10px 22px; font-weight: 800; font-size: 0.9rem;
  cursor: pointer; text-decoration: none; display: inline-block;
  transition: all 0.2s; box-shadow: 0 4px 18px rgba(255,224,80,0.35);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(255,224,80,0.55); }

/* HERO */
.hero { padding: 70px 32px 50px; text-align: center; max-width: 1200px; margin: 0 auto; }
h1.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 900;
  letter-spacing: -1.5px; margin-bottom: 18px; line-height: 1.15;
  background: linear-gradient(135deg,#fff 0%,#60a5fa 50%,#c084fc 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
body.light h1.hero-title { background: linear-gradient(135deg,#0f172a,#2563eb,#7c3aed); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { font-size: 1.15rem; color: var(--text2); margin-bottom: 32px; }
.hero-cta { margin-bottom: 52px; }

/* DEMO SLIDERS */
.demo-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  max-width: 940px; margin: 0 auto;
}
@media(max-width:700px) { .demo-grid { grid-template-columns: 1fr; } }
.demo-card {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  background: var(--card);
  backdrop-filter: blur(16px);
  transition: transform 0.3s, border-color 0.3s;
}
.demo-card:hover { transform: translateY(-4px); border-color: var(--yellow); }

.slider-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: #0a0c12;
  user-select: none;
  touch-action: none;
  --p: 50%;
}
.slider-wrap img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: block;
}
.slider-wrap .img-before {
  z-index: 2;
  clip-path: polygon(0 0, var(--p) 0, var(--p) 100%, 0 100%);
}
.slider-wrap .img-after { z-index: 1; }
.slider-line {
  position: absolute; top: 0; bottom: 0;
  width: 3px; background: var(--yellow);
  z-index: 5; pointer-events: none;
  left: var(--p);
  transform: translateX(-50%);
  box-shadow: 0 0 12px rgba(255,224,80,0.9);
}
.slider-handle {
  position: absolute; top: 50%; left: var(--p);
  transform: translate(-50%, -50%);
  width: 42px; height: 42px;
  background: linear-gradient(135deg,#ffe050,#f59e0b);
  border-radius: 50%; z-index: 6; pointer-events: none;
  display: grid; place-items: center;
  font-weight: 900; color: #000; font-size: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.8);
}
.slider-range {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: ew-resize; z-index: 10;
  -webkit-appearance: slider-horizontal;
  appearance: slider-horizontal;
  margin: 0; padding: 0; border: 0;
  background: transparent;
}
.slider-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 100%; height: 100%;
  background: transparent; cursor: ew-resize;
}
.slider-range::-moz-range-thumb {
  width: 100%; height: 100%;
  background: transparent; cursor: ew-resize; border: none;
}
/* SECTIONS */
section { padding: 60px 32px; }
.container { max-width: 1200px; margin: 0 auto; }
.section-title {
  font-size: clamp(1.6rem,3vw,2.2rem); font-weight: 900;
  text-align: center; margin-bottom: 36px; letter-spacing: -0.5px;
}

/* STUDIO */
#studio { background: transparent; }
.studio-grid {
  display: grid; grid-template-columns: 360px 1fr; gap: 28px;
  align-items: start;
}
@media(max-width:900px) { .studio-grid { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.card-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }

/* UPLOAD ZONE */
.upload-label {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px dashed var(--border); border-radius: 14px;
  padding: 44px 20px; text-align: center; cursor: pointer;
  background: var(--card); transition: all 0.25s; gap: 12px;
}
.upload-label:hover {
  border-color: var(--yellow);
  box-shadow: 0 0 24px rgba(6,182,212,0.18);
}
.upload-label.drag-over { border-color: var(--cyan); background: rgba(6,182,212,0.08); }
.upload-icon {
  width: 56px; height: 56px; background: rgba(6,182,212,0.15);
  border-radius: 14px; display: grid; place-items: center; font-size: 1.8rem;
}
.upload-title { font-weight: 700; font-size: 1rem; }
.upload-hint { font-size: 0.8rem; color: var(--text2); }
.file-badge {
  display: none; margin-top: 16px;
  background: rgba(6,182,212,0.12); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 16px;
  font-size: 0.85rem; align-items: center; gap: 8px;
}
.file-badge.show { display: flex; }
.scenario-heading { font-size: 0.85rem; font-weight: 700; color: var(--text2); margin-top: 20px; margin-bottom: 10px; }
.scenario-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.scenario-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 8px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.scenario-btn:hover { border-color: var(--yellow); }
.scenario-btn.active {
  background: linear-gradient(135deg,#ffe050,#f59e0b);
  color: #000; border-color: transparent;
  box-shadow: 0 4px 14px rgba(255,224,80,0.35);
}
.btn-restore {
  width: 100%; margin-top: 20px; padding: 16px;
  background: linear-gradient(135deg,#ffe050,#f59e0b);
  color: #000; border: none; border-radius: 30px;
  font-size: 1.05rem; font-weight: 900; cursor: pointer;
  font-family: inherit; transition: all 0.25s;
  box-shadow: 0 6px 22px rgba(255,224,80,0.35);
}
.btn-restore:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255,224,80,0.55); }
.btn-restore:disabled { opacity: 0.35; cursor: not-allowed; }

/* STAGE */
.stage-card {
  min-height: 480px; display: flex; flex-direction: column;
  justify-content: center; align-items: center; position: relative; overflow: hidden;
}
.empty-msg { text-align: center; color: var(--text2); padding: 40px; }
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.loading-cover {
  position: absolute; inset: 0;
  background: rgba(10,12,18,0.95);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; z-index: 20;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
  border-radius: var(--radius);
}
.loading-cover.on { opacity: 1; pointer-events: all; }
.spinner {
  width: 52px; height: 52px;
  border: 3px solid rgba(255,224,80,0.2);
  border-top-color: var(--yellow); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg { font-weight: 700; color: var(--text); text-align: center; padding: 0 20px; }

/* RESULT SLIDER (studio) */
.result-wrap {
  display: none; position: relative; width: 100%; border-radius: 14px;
  overflow: hidden; touch-action: none; user-select: none; --p: 50%;
}
.result-wrap.show { display: block; }
.result-wrap img {
  display: block; width: 100%; height: auto;
  pointer-events: none; position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain;
}
.result-wrap .img-before { z-index: 2; clip-path: polygon(0 0, var(--p) 0, var(--p) 100%, 0 100%); }
.result-wrap .img-after { z-index: 1; }
.lbl-before, .lbl-after {
  position: absolute; top: 14px; z-index: 7; pointer-events: none;
  background: rgba(10,12,18,0.85); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 14px; font-size: 0.72rem; font-weight: 700;
}
.lbl-before { left: 14px; }
.lbl-after { right: 14px; }

.toolbar { display: none; justify-content: space-between; align-items: center; padding: 18px 28px; }
.toolbar.show { display: flex; }
.btn-dl {
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 30px;
  padding: 10px 22px; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.btn-dl:hover { border-color: var(--cyan); }

/* FEATURES */
.feats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
@media(max-width:800px) { .feats-grid { grid-template-columns: 1fr; } }
.feat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  backdrop-filter: blur(12px);
}
.feat h3 { font-size: 1rem; font-weight: 800; margin-bottom: 8px; }
.feat p { font-size: 0.85rem; color: var(--text2); line-height: 1.6; }

/* FAQ */
.faq-list { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; backdrop-filter: blur(12px);
}
.faq-q {
  padding: 18px 22px; font-weight: 700; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  user-select: none;
}
.faq-a { display: none; padding: 0 22px 18px; color: var(--text2); font-size: 0.9rem; line-height: 1.6; }
.faq-item.open .faq-a { display: block; }
.faq-item.open { border-color: var(--cyan); }
.faq-icon { transition: transform 0.25s; flex-shrink: 0; }
.faq-item.open .faq-icon { transform: rotate(45deg); }

/* DONATE MODAL */
.donate-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(5px);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.donate-overlay.show { opacity: 1; pointer-events: all; }
.donate-modal {
  background: var(--surface); border: 1px solid var(--border);
  padding: 30px; border-radius: 20px; width: 95%; max-width: 750px;
  max-height: 85vh; overflow-y: auto;
  text-align: center; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transform: translateY(20px); transition: transform 0.3s;
}
.donate-overlay.show .donate-modal { transform: translateY(0); }
.donate-close {
  position: absolute; top: 15px; right: 20px;
  font-size: 1.5rem; cursor: pointer; color: var(--text2);
  z-index: 10;
}
.donate-modal h2 { margin-bottom: 10px; font-weight: 800; }
.donate-modal p { margin-bottom: 20px; color: var(--text2); font-size: 0.9rem; }
.donate-flex { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.qr-box { flex: 1; min-width: 260px; background: rgba(255,255,255,0.05); padding: 20px; border-radius: 12px; border: 1px solid var(--border); }
.qr-box img {
  width: 100%; border-radius: 8px; background: #fff; margin-bottom: 10px; object-fit: contain;
}
.qr-box h4 { font-size: 1rem; margin-top: 10px; }

/* FOOTER */
footer {
  border-top: 1px solid var(--border); padding: 40px 32px 24px;
  background: var(--surface); backdrop-filter: blur(16px);
}
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; margin-bottom: 28px; }
@media(max-width:700px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand h4 { font-size: 1.2rem; margin-bottom: 10px; }
.footer-brand p { font-size: 0.85rem; color: var(--text2); }
.footer-col h5 { font-weight: 700; margin-bottom: 12px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { color: var(--text2); text-decoration: none; font-size: 0.85rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { text-align: center; color: var(--text2); font-size: 0.8rem; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 20px; }

/* ── MOBILE OVERRIDES (kept last so they win the cascade at equal specificity) ── */
@media (max-width: 850px) {
  header { padding: 0 12px; height: 60px; }
  .nav-links { display: none; }
  .logo-name { display: none; }
  .header-right { gap: 6px; }
  select.lang-sel { padding: 4px 6px; font-size: 0.8rem; max-width: 90px; }
  button.theme-btn { padding: 4px 8px; font-size: 1.05rem; min-width: 40px; min-height: 40px; }
  .header-right .btn-gold { display: none; }
  .hero { padding: 40px 16px 30px; }
  section { padding: 40px 16px; }
  .feats-grid { gap: 16px; }
  .btn-restore, .btn-dl { min-height: 48px; }
  .upload-label { padding: 32px 16px; }
}

@media (max-width: 600px) {
  .hero-title { font-size: 1.8rem; }
  .hero-sub { font-size: 0.95rem; }
  .card { padding: 20px; }
  .btn-gold { width: 100%; text-align: center; }
  .stage-card { min-height: 350px; }
  .feats-grid { gap: 12px; }
  .footer-inner { gap: 20px; }
  .studio-grid { gap: 20px; }
  .lbl-before, .lbl-after { font-size: 0.65rem; padding: 4px 10px; }
}
