/* DIPL theme layer — dark (default design) + light mode */
html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

html[data-theme="light"] {
  --bg: #f6f4ef;
  --bg2: #ffffff;
  --bg3: #ece9e2;
  --border: rgba(20,18,15,0.10);
  --border2: rgba(20,18,15,0.18);
  --text: #1a1815;
  --muted: rgba(26,24,21,0.62);
  --faint: rgba(26,24,21,0.38);
  --red-dim: rgba(212,34,41,0.10);
}

/* surfaces that hard-coded the dark colour */
html[data-theme="light"] nav { background: rgba(246,244,239,0.88); }
html[data-theme="light"] .mobile-menu { background: rgba(246,244,239,0.98); box-shadow: 0 20px 40px rgba(0,0,0,0.12); }
html[data-theme="light"] header { background: rgba(246,244,239,0.92); }
html[data-theme="light"] .about-card,
html[data-theme="light"] .faq-card { background: var(--bg2); }
html[data-theme="light"] .about-card::after,
html[data-theme="light"] .faq-card::after { box-shadow: 0 16px 40px rgba(0,0,0,0.18); }
html[data-theme="light"] .footer-col a { color: rgba(26,24,21,0.6); }
html[data-theme="light"] .btn-outline:hover { border-color: rgba(20,18,15,0.4); }
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus { border-color: rgba(20,18,15,0.35); }
html[data-theme="light"] .product-img-box { box-shadow: 0 10px 24px rgba(0,0,0,0.14); }
html[data-theme="light"] .faq-item.open .faq-toggle svg { color: var(--text); }
html[data-theme="light"] .cart-toast { background: #1a1815; color: #fff; }
html[data-theme="light"] .social-btn { color: var(--text); }
html[data-theme="light"] .nav-fixit { box-shadow: inset 0 0 0 1px var(--border2); }
html[data-theme="light"] .tab.on { color: #fff; }

/* dark "stage" areas stay dark in both modes so their text stays readable */
#showcase-3d, .about-card .about-label, #fx-dark {
  --text: #f0ede8; --muted: rgba(240,237,232,0.55); --border: rgba(255,255,255,0.08);
}
html[data-theme="light"] .prod-visual .model { background: #1a1815; }
html[data-theme="light"] .covered-copy,
html[data-theme="light"] .why-list,
html[data-theme="light"] .intro-copy,
html[data-theme="light"] .about-copy {
  --text: #f0ede8; --muted: rgba(240,237,232,0.55);
}

/* ── theme toggle button ── */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: transparent; color: var(--text); cursor: pointer;
  border: 1px solid var(--border2); transition: background .2s, border-color .2s;
}
.theme-toggle:hover { border-color: var(--red); background: var(--red-dim); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
html[data-theme="light"] .theme-toggle .i-sun { display: block; }
html[data-theme="light"] .theme-toggle .i-moon { display: none; }

/* ── first-visit mode popup ── */
.tm-overlay {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(8,8,8,0.82); backdrop-filter: blur(10px);
  font-family: "DM Sans", sans-serif; animation: tmFade .35s ease;
}
@keyframes tmFade { from { opacity: 0; } to { opacity: 1; } }
.tm-box {
  width: 100%; max-width: 520px; text-align: center;
  background: #141414; color: #f0ede8; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px; padding: 36px 28px 30px; box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.tm-box h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.01em; }
.tm-box p { font-size: 14px; color: rgba(240,237,232,0.6); margin-bottom: 26px; }
.tm-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tm-opt {
  cursor: pointer; border-radius: 14px; padding: 14px 12px 16px; font: 600 15px "DM Sans", sans-serif;
  border: 2px solid transparent; transition: transform .15s, border-color .2s;
}
.tm-opt:hover, .tm-opt:focus-visible { transform: translateY(-2px); border-color: #D42229; outline: none; }
.tm-opt .tm-prev { height: 74px; border-radius: 9px; margin-bottom: 12px; padding: 10px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.tm-opt .tm-prev i { display: block; height: 7px; border-radius: 4px; }
.tm-opt .tm-prev i:first-child { width: 55%; }
.tm-opt .tm-prev i:last-child { width: 80%; opacity: .5; }
.tm-dark { background: #0c0c0c; color: #f0ede8; border-color: rgba(255,255,255,0.14); }
.tm-dark .tm-prev { background: #1a1a1a; } .tm-dark .tm-prev i { background: #f0ede8; }
.tm-light { background: #f6f4ef; color: #1a1815; border-color: rgba(0,0,0,0.12); }
.tm-light .tm-prev { background: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); } .tm-light .tm-prev i { background: #1a1815; }
.tm-note { margin: 18px 0 0; font-size: 12px; color: rgba(240,237,232,0.4); }
.tm-prev i:first-child { background-image: none; }
.tm-prev::before { content: ""; width: 22px; height: 7px; border-radius: 4px; background: #D42229; }

@media (max-width: 480px) {
  .tm-box { padding: 28px 18px 24px; }
  .tm-box h2 { font-size: 21px; }
  .tm-opts { gap: 10px; }
}

/* ── mobile hardening (all pages) ── */
img, video, canvas, svg { max-width: 100%; }
@media (max-width: 768px) {
  nav { padding: 0 16px !important; }
  .nav-brand-name { font-size: 10px !important; }
  .nav-brand-sub { display: none; }
  .nav-mob { display: flex; align-items: center; gap: 10px; }
  main, section { overflow-wrap: anywhere; }
}

.nav-actions .theme-toggle { margin-left: 12px; }
/* stacked cards: text sits over a photo + dark scrim, so keep that card dark in light mode */
@media (max-width: 1100px) {
  html[data-theme="light"] .about-card,
  html[data-theme="light"] .faq-card {
    background: #0c0c0c;
    --text: #f0ede8; --muted: rgba(240,237,232,0.62); --faint: rgba(240,237,232,0.35); --border: rgba(255,255,255,0.1);
  }
}
