/* =========================================================
   SAMIFY — Premium Dark Mode
   Additive stylesheet only. Nothing in styles.css / legal.css /
   butterfly-fx.css / intro.css is modified — light mode remains
   pixel-for-pixel unchanged. Every rule below is scoped under
   html[data-theme="dark"] and simply overrides the specific
   properties needed to re-theme the page.
   ========================================================= */

/* ---------- Dark palette tokens ---------- */
html[data-theme="dark"] {
  --dm-bg:#0B0B0D;              /* page background */
  --dm-bg-soft:#141416;         /* dim / alternate section background */
  --dm-surface:#18181B;         /* raised card surfaces */
  --dm-surface-2:#1E1E22;       /* inputs, dropdowns, popovers */
  --dm-text:#F2F1ED;            /* primary text */
  --dm-text-soft:#B7B4AE;       /* secondary text */
  --dm-text-faint:#8C8985;      /* muted / tertiary text */
  --dm-line:rgba(255,255,255,0.12);   /* hairline borders/dividers */
  --dm-line-strong:rgba(255,255,255,0.24);
  --dm-line-fill:#333338;       /* solid decorative bars (waveforms, grid gaps) */
  --dm-invert-bg:#F2F1ED;       /* buttons that flip to a light fill in dark mode */
  --dm-invert-text:#111113;
  --dm-shadow:rgba(0,0,0,0.55);
  --dm-success:#6FBF8B;
  --dm-error:#E08668;
  color-scheme: dark;
}

/* Smooth, refined cross-fade. Zero specificity so it can never
   override a more specific transition already declared elsewhere. */
*{
  transition:background-color .35s ease, color .35s ease, border-color .35s ease, box-shadow .35s ease, fill .35s ease;
}

/* ---------- Theme toggle button (own styling, both themes) ----------
   Matches .nav-toggle exactly: 40x40 hit area, circular hover state,
   same visual weight, so it reads as a native part of the header. */
.theme-toggle{
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  width:40px;
  height:40px;
  padding:0;
  border:0;
  border-radius:50%;
  background:transparent;
  cursor:pointer;
  flex-shrink:0;
  -webkit-tap-highlight-color:transparent;
}
.theme-toggle:hover{background:rgba(13,13,13,0.05);}
.theme-toggle:focus-visible{outline:2px solid var(--ember); outline-offset:2px;}
.theme-toggle-icon{
  width:19px;
  height:19px;
  color:var(--ink);
  position:absolute;
  transition:opacity .35s ease, transform .5s cubic-bezier(.65,0,.35,1);
}
.theme-toggle .icon-sun{opacity:1; transform:rotate(0deg) scale(1);}
.theme-toggle .icon-moon{opacity:0; transform:rotate(45deg) scale(.6);}
html[data-theme="dark"] .theme-toggle .icon-sun{opacity:0; transform:rotate(-45deg) scale(.6);}
html[data-theme="dark"] .theme-toggle .icon-moon{opacity:1; transform:rotate(0deg) scale(1);}

@media (max-width:480px){
  .theme-toggle{width:36px; height:36px;}
  .theme-toggle-icon{width:17px; height:17px;}
}

/* ---------- Base page ---------- */
html[data-theme="dark"] body{background:var(--dm-bg); color:var(--dm-text);}

/* ---------- Header / navigation ---------- */
html[data-theme="dark"] header.scrolled{
  background:rgba(11,11,13,0.86);
  border-bottom-color:var(--dm-line);
  box-shadow:0 12px 30px var(--dm-shadow);
}
html[data-theme="dark"] .logo{color:var(--dm-text);}
html[data-theme="dark"] .nav-links a{color:var(--dm-text);}
html[data-theme="dark"] .lang-btn{color:var(--dm-text-faint);}
html[data-theme="dark"] .lang-btn.is-active{color:var(--dm-text);}
html[data-theme="dark"] .lang-sep{color:var(--dm-text-faint);}
html[data-theme="dark"] .nav-toggle span{background:var(--dm-text);}
html[data-theme="dark"] .nav-toggle:hover{background:rgba(255,255,255,0.08);}
html[data-theme="dark"] .nav-panel{background:var(--dm-surface); box-shadow:-8px 0 30px var(--dm-shadow);}
html[data-theme="dark"] .nav-panel-footer{border-top-color:var(--dm-line);}

/* Theme toggle button itself */
html[data-theme="dark"] .theme-toggle:hover{background:rgba(255,255,255,0.08);}
html[data-theme="dark"] .theme-toggle-icon{color:var(--dm-text);}

/* Primary nav CTA + hero CTA: solid-black buttons invert to a light fill
   so they stay visible against the now-dark page. */
html[data-theme="dark"] .btn-nav,
html[data-theme="dark"] .btn-primary{
  background:var(--dm-invert-bg);
  color:var(--dm-invert-text);
  border-color:var(--dm-invert-bg);
}
html[data-theme="dark"] .btn-ghost{color:var(--dm-text); border-bottom-color:rgba(255,255,255,0.3);}
html[data-theme="dark"] .btn-ghost:hover{border-color:var(--dm-text);}

/* ---------- Hero ---------- */
html[data-theme="dark"] .hero{background:linear-gradient(180deg, var(--dm-bg) 0%, var(--dm-bg-soft) 100%);}
html[data-theme="dark"] .hero h1{color:var(--dm-text);}
html[data-theme="dark"] .hero p{color:var(--dm-text-soft);}
html[data-theme="dark"] .hero-photo-frame::before{border-color:rgba(255,255,255,0.10);}
html[data-theme="dark"] .hero-photo{box-shadow:0 34px 90px rgba(0,0,0,0.58), 0 10px 28px rgba(0,0,0,0.34);}
html[data-theme="dark"] .hero-photo-caption{border-color:rgba(255,255,255,0.16); background:rgba(11,11,13,0.62); color:var(--dm-text);}
html[data-theme="dark"] .play-icon{border-color:rgba(255,255,255,0.35);}
html[data-theme="dark"] .scroll-cue{color:rgba(255,255,255,0.45);}
html[data-theme="dark"] .scroll-line{background:linear-gradient(180deg, rgba(255,255,255,0.5), transparent);}
html[data-theme="dark"] .hv-ring--outer{border-color:var(--dm-line);}
html[data-theme="dark"] .hv-fragment--story{background:var(--dm-surface); border-color:var(--dm-line);}
html[data-theme="dark"] .hv-fragment-line{background:var(--dm-line-fill);}
html[data-theme="dark"] .hv-fragment-label{color:var(--dm-text-faint);}
html[data-theme="dark"] .hv-fragment--note{background:var(--dm-invert-bg); color:var(--dm-invert-text);}
html[data-theme="dark"] .hv-fragment--tag{background:var(--dm-surface); border-color:var(--dm-line); color:var(--dm-text-soft);}

/* ---------- Section headings (shared across the page) ---------- */
html[data-theme="dark"] .section-heading{color:var(--dm-text);}
html[data-theme="dark"] .section-sub{color:var(--dm-text-soft);}

/* ---------- How it works / flow ---------- */
html[data-theme="dark"] .flow-grid{border-top-color:var(--dm-line); border-bottom-color:var(--dm-line);}
html[data-theme="dark"] .flow-item:not(:last-child){border-right-color:var(--dm-line); border-left-color:var(--dm-line);}
html[data-theme="dark"] .flow-item::before{background:var(--dm-surface); border-color:var(--dm-line);}
html[data-theme="dark"] .what-is-mark{color:var(--dm-text);}
html[data-theme="dark"] .what-is-block h3{color:var(--dm-text);}
html[data-theme="dark"] .what-is-block p{color:var(--dm-text-soft);}
html[data-theme="dark"] .process-index{-webkit-text-stroke-color:var(--dm-text); color:transparent;}
html[data-theme="dark"] .process-step h3{color:var(--dm-text);}
html[data-theme="dark"] .process-step p{color:var(--dm-text-soft);}

/* ---------- Styles section ---------- */
html[data-theme="dark"] .styles-section{background:var(--dm-bg-soft);}
html[data-theme="dark"] .style-index{border-top-color:var(--dm-line);}
html[data-theme="dark"] .style-row{border-bottom-color:var(--dm-line); color:var(--dm-text);}
html[data-theme="dark"] .style-name{color:var(--dm-text);}
html[data-theme="dark"] .style-desc{color:var(--dm-text-soft);}

/* ---------- Portfolio / song cards ---------- */
html[data-theme="dark"] .portfolio{background:var(--dm-bg-soft); color:var(--dm-text);}
html[data-theme="dark"] .song-card{background:var(--dm-surface); border-color:var(--dm-line);}
html[data-theme="dark"] .song-card h3{color:var(--dm-text);}
html[data-theme="dark"] .song-card .song-desc{color:var(--dm-text-soft);}
html[data-theme="dark"] .play-btn.unavailable{background:rgba(255,255,255,0.12);}
html[data-theme="dark"] .mini-wave span{background:rgba(255,255,255,0.22);}
html[data-theme="dark"] .song-status{color:var(--dm-text-faint);}
html[data-theme="dark"] .audio-progress{background:rgba(255,255,255,0.14);}
html[data-theme="dark"] .audio-time{color:var(--dm-text-faint);}

/* ---------- Occasions ---------- */
html[data-theme="dark"] .occasions-section{background:var(--dm-bg);}
html[data-theme="dark"] .occasions-section .section-eyebrow{color:var(--dm-text);}
html[data-theme="dark"] .occasions-grid{background:var(--dm-line-fill); border-color:var(--dm-line-fill);}
html[data-theme="dark"] .occasion-card{background:var(--dm-bg);}
html[data-theme="dark"] .occasion-link::before{background:var(--dm-bg-soft);}
html[data-theme="dark"] .occasion-icon,
html[data-theme="dark"] .occasion-name{color:var(--dm-text);}

/* ---------- Trust ---------- */
html[data-theme="dark"] .trust{background:var(--dm-bg);}
html[data-theme="dark"] .trust-item{border-top-color:var(--dm-line);}
html[data-theme="dark"] .trust-item h3{color:var(--dm-text);}
html[data-theme="dark"] .trust-item p{color:var(--dm-text-soft);}

/* ---------- About teaser ---------- */
html[data-theme="dark"] .about-teaser{background:var(--dm-bg-soft);}
html[data-theme="dark"] div.about-visual{
  background:linear-gradient(155deg, var(--dm-surface) 0%, var(--dm-bg-soft) 100%);
  border-color:var(--dm-line);
}
html[data-theme="dark"] .about-text p{color:var(--dm-text-soft);}

/* ---------- FAQ ---------- */
html[data-theme="dark"] .faq-section{background:var(--dm-bg);}
html[data-theme="dark"] .faq-list{border-top-color:var(--dm-line);}
html[data-theme="dark"] .faq-item{border-bottom-color:var(--dm-line);}
html[data-theme="dark"] .faq-trigger{color:var(--dm-text);}
html[data-theme="dark"] .faq-panel-inner p{color:var(--dm-text-soft);}

/* ---------- Forms / order flow ---------- */
html[data-theme="dark"] .create-section{background:var(--dm-bg-soft); border-top-color:var(--dm-line);}
html[data-theme="dark"] .create-intro p{color:var(--dm-text-soft);}
html[data-theme="dark"] .form-section-heading h3{color:var(--dm-text);}
html[data-theme="dark"] .form-section-heading p{color:var(--dm-text-soft);}

html[data-theme="dark"] .form-field input,
html[data-theme="dark"] .form-field select,
html[data-theme="dark"] .form-field textarea{
  border-color:rgba(255,255,255,0.16);
  background:rgba(255,255,255,0.045);
  color:var(--dm-text);
}
html[data-theme="dark"] .form-field input:focus,
html[data-theme="dark"] .form-field select:focus,
html[data-theme="dark"] .form-field textarea:focus{
  background:var(--dm-surface-2);
}
html[data-theme="dark"] .form-field input::placeholder,
html[data-theme="dark"] .form-field textarea::placeholder{color:var(--dm-text-faint);}

html[data-theme="dark"] .character-note,
html[data-theme="dark"] .form-privacy,
html[data-theme="dark"] .field-help,
html[data-theme="dark"] .submit-note{color:var(--dm-text-faint);}

html[data-theme="dark"] .form-status.success{color:var(--dm-success);}
html[data-theme="dark"] .form-status.error{color:var(--dm-error);}
html[data-theme="dark"] .form-field.has-error input{
  border-color:var(--dm-error);
  box-shadow:0 0 0 4px rgba(224,134,104,0.14);
}

html[data-theme="dark"] .checkbox-row span{color:var(--dm-text-soft);}
html[data-theme="dark"] .form-final{border-top-color:var(--dm-line);}

/* Language search / dropdown */
html[data-theme="dark"] .language-results{background:var(--dm-surface-2); border-color:var(--dm-line); box-shadow:0 20px 40px var(--dm-shadow);}
html[data-theme="dark"] .language-result-item{color:var(--dm-text);}
html[data-theme="dark"] .language-result-item:hover,
html[data-theme="dark"] .language-result-item.is-active{background:var(--dm-bg-soft);}
html[data-theme="dark"] .language-results-empty{color:var(--dm-text-faint);}
html[data-theme="dark"] .language-selected{border-color:var(--dm-line); background:var(--dm-bg-soft);}
html[data-theme="dark"] .language-selected-label{color:var(--dm-text-faint);}
html[data-theme="dark"] .language-selected-clear{color:var(--dm-text-faint);}

/* Choice cards (package / add-on pickers) */
html[data-theme="dark"] .choice-card{border-color:rgba(255,255,255,0.16); background:var(--dm-surface);}
html[data-theme="dark"] .choice-card:hover{border-color:rgba(255,255,255,0.4);}
html[data-theme="dark"] .choice-card:has(input:checked){background:rgba(196,98,45,0.12);}
html[data-theme="dark"] .choice-content strong,
html[data-theme="dark"] .choice-card > span{color:var(--dm-text);}
html[data-theme="dark"] .choice-content small{color:var(--dm-text-faint);}

/* ---------- Pricing ---------- */
html[data-theme="dark"] .pricing-section{background:var(--dm-bg); border-top-color:var(--dm-line); border-bottom-color:var(--dm-line);}
html[data-theme="dark"] .pricing-card{background:var(--dm-surface); border-color:var(--dm-line); box-shadow:0 20px 40px var(--dm-shadow);}
html[data-theme="dark"] .pricing-card:hover{border-color:rgba(255,255,255,0.24);}
html[data-theme="dark"] .pricing-featured{background:var(--dm-bg-soft);}
html[data-theme="dark"] .pricing-badge{background:var(--dm-surface);}
html[data-theme="dark"] .pricing-numeral,
html[data-theme="dark"] .pricing-tag,
html[data-theme="dark"] .price-label,
html[data-theme="dark"] .price-unit{color:var(--dm-text-faint);}
html[data-theme="dark"] .pricing-numeral::before{background:var(--dm-text-faint);}
html[data-theme="dark"] .pricing-header h3{color:var(--dm-text);}
html[data-theme="dark"] .pricing-waveform span{background:var(--dm-line-fill);}
html[data-theme="dark"] .pricing-price{border-bottom-color:var(--dm-line);}
html[data-theme="dark"] .price-value{color:var(--dm-text);}
html[data-theme="dark"] .pricing-description,
html[data-theme="dark"] .pricing-features li{color:var(--dm-text-soft);}
html[data-theme="dark"] .pricing-note{border-top-color:var(--dm-line);}
html[data-theme="dark"] .pricing-note p{color:var(--dm-text-soft);}

html[data-theme="dark"] .btn-pricing{color:var(--dm-text); border-color:rgba(255,255,255,0.24);}
html[data-theme="dark"] .btn-pricing:hover{
  border-color:var(--dm-invert-bg);
  background:var(--dm-invert-bg);
  color:var(--dm-invert-text);
}
html[data-theme="dark"] .btn-primary-pricing{
  background:var(--dm-invert-bg);
  color:var(--dm-invert-text);
  border-color:var(--dm-invert-bg);
}

/* ---------- Showcase ---------- */
html[data-theme="dark"] .showcase-section{background:var(--dm-bg-soft);}
html[data-theme="dark"] .showcase-art{
  background:linear-gradient(155deg, var(--dm-surface) 0%, var(--dm-bg-soft) 100%);
  border-bottom-color:var(--dm-line);
}

/* ---------- Transform chain ---------- */
html[data-theme="dark"] .fragment{background:var(--dm-bg-soft); border-color:var(--dm-line); color:var(--dm-text-soft);}
html[data-theme="dark"] .transform-stage{background:var(--dm-surface); border-color:var(--dm-line);}
html[data-theme="dark"] .transform-label{color:var(--dm-text);}
html[data-theme="dark"] .transform-stage--final{background:var(--dm-invert-bg); border-color:var(--dm-invert-bg);}
html[data-theme="dark"] .transform-stage--final .transform-label{color:var(--dm-invert-text);}

/* ---------- Legal pages ---------- */
html[data-theme="dark"] .legal-hero{background:linear-gradient(180deg, var(--dm-bg) 0%, var(--dm-bg-soft) 100%);}
html[data-theme="dark"] .legal-title{color:var(--dm-text);}
html[data-theme="dark"] .legal-updated{color:var(--dm-text-faint);}
html[data-theme="dark"] .legal-intro{color:var(--dm-text-soft);}
html[data-theme="dark"] .legal-switch a,
html[data-theme="dark"] .legal-switch span{border-color:var(--dm-line); color:var(--dm-text-soft);}
html[data-theme="dark"] .legal-switch span.is-current{
  background:var(--dm-invert-bg);
  color:var(--dm-invert-text);
  border-color:var(--dm-invert-bg);
}
html[data-theme="dark"] .legal-toc{background:var(--dm-bg-soft); border-color:var(--dm-line);}
html[data-theme="dark"] .legal-toc-label{color:var(--dm-text-faint);}
html[data-theme="dark"] .legal-toc a{color:var(--dm-text);}
html[data-theme="dark"] .legal-section + .legal-section{border-top-color:var(--dm-line);}
html[data-theme="dark"] .legal-section h2,
html[data-theme="dark"] .legal-section h3{color:var(--dm-text);}
html[data-theme="dark"] .legal-section p,
html[data-theme="dark"] .legal-section li{color:var(--dm-text-soft);}
html[data-theme="dark"] .legal-callout{background:var(--dm-bg-soft); border-color:var(--dm-line);}
html[data-theme="dark"] .legal-callout h3{color:var(--dm-text);}

/* ---------- Success page ---------- */
html[data-theme="dark"] header{
  background:rgba(11,11,13,0.9);
  border-bottom-color:var(--dm-line);
}
html[data-theme="dark"] .success-heading{color:var(--dm-text);}
html[data-theme="dark"] .success-subheading{color:var(--dm-text-soft);}
html[data-theme="dark"] .order-card,
html[data-theme="dark"] .success-content{background:var(--dm-bg-soft); border-color:var(--dm-line);}
html[data-theme="dark"] .order-label{color:var(--dm-text-faint);}
html[data-theme="dark"] .order-number{color:var(--dm-text);}
html[data-theme="dark"] .copy-button{
  background:var(--dm-invert-bg);
  color:var(--dm-invert-text);
  border-color:var(--dm-invert-bg);
}
html[data-theme="dark"] .success-content h3{color:var(--dm-text);}
html[data-theme="dark"] .success-content p,
html[data-theme="dark"] .success-content li{color:var(--dm-text-soft);}
html[data-theme="dark"] footer p{color:rgba(255,255,255,0.35);}

/* ---------- Footer (site-wide) ---------- */
/* Footer, and the emotional / final CTA bands are
   already solid-black-with-white-text by design in light mode and are
   intentionally left unchanged here — they continue to work exactly as
   before, providing the same "moment" of contrast in dark mode too. */

/* Unified pill header — dark mode companion */
html[data-theme="dark"] header#site-header,
html[data-theme="dark"] header#site-header.scrolled{
  background:transparent;
  border-bottom:0;
  box-shadow:none;
}
html[data-theme="dark"] header#site-header nav.wrap.nav-bar{
  background:rgba(24,24,27,.96);
  border-color:var(--dm-line);
  box-shadow:0 18px 48px var(--dm-shadow);
}
html[data-theme="dark"] header#site-header .nav-panel{
  background:var(--dm-surface);
  border-color:var(--dm-line);
  box-shadow:0 22px 60px var(--dm-shadow);
}
html[data-theme="dark"] header#site-header .nav-links a{color:var(--dm-text);}
html[data-theme="dark"] header#site-header .nav-links li + li,
html[data-theme="dark"] header#site-header .nav-panel-footer{border-color:var(--dm-line);}
html[data-theme="dark"] header#site-header .nav-toggle span{background:var(--dm-text);}
