:root {
  --bg: #0e0e0e;
  --panel: #161616;
  --border: #2b2b2b;
  --text: #f5f5f5;
  --muted: #a9a9a9;
  --accent: #ffd400;
  --highlight: #FC0FC0;
  --radius: 16px;
  --shadow: 0 10px 24px rgba(0, 0, 0, .45);
}

[data-theme="light"] {
  --bg: #f8f8f8;
  --panel: #ffffff;
  --border: #e5e5e5;
  --text: #111;
  --muted: #5f6368;
  --accent: #ffb800;
  --shadow: 0 10px 24px rgba(0, 0, 0, .10);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .35s, color .35s;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

/* nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(14, 14, 14, .75);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .25s, background .25s;
}

.nav-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  height: 64px;
}

.brand {
  text-decoration: none;
  font-weight: 700;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
}

.nav-links a {
  text-decoration: none;
  margin-top: 10px;
  color: var(--muted);
  transition: color .2s;
}

.nav-links a:hover {
  color: var(--text);
}

@media(max-width:600px) {
  .nav-bar {
    grid-template-columns: 1fr;
    text-align: center;
    height: auto;
    padding: 12px 0;
    gap: 12px;
  }

  .nav-links {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* section */
.section {
  padding: 28px 0
}

.section.dark {
  background: linear-gradient(180deg, rgba(15, 15, 15, 1), rgba(10, 10, 10, 1))
}

[data-theme="light"] .section.dark {
  background: linear-gradient(180deg, #fff, #f7f7f7)
}

/* hero */
.hero-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

@media(max-width:980px) {
  .hero-wrap {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.hero-copy {
  flex: 1;
  min-width: 0;
  padding-right: 24px
}

.hero-copy h1 {
  font-size: 56px;
  line-height: 1.08;
  margin: 0 0 8px
}

.lead {
  color: var(--muted);
  font-size: 18px
}

.btn-row {
    margin-top: 18px;
    text-align: center;
    display: flex;
    width: 100%;
    gap: 10px;
}

.microcopy {
  margin-top: 10px;
  color: var(--highlight);
  font-size: 14px;
  text-align: center;
}

.microcopy-wht {
  margin-top: 10px;
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.hero-art {
  flex: 1;
  min-width: 0
}

.hero-art img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #0c0c0c
}

@media(max-width:980px) {
  .hero-wrap {
    flex-direction: column
  }

  .hero-copy h1 {
    font-size: 40px
  }

  .hero-copy {
    padding-right: 0
  }
}

/* buttons (stronger CTA) */
.btn {
  appearance: none;
    border: 1px solid var(--border);
    background: #202020;
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    transition: all .25s 
ease;
    align-items: center;
    justify-content: center;
}

[data-theme="light"] .btn {
  background: #f1f1f1;
  color: #111
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25)
}

.btn-primary {
  background: var(--accent);
  color: #111;
  border-color: transparent;
  font-weight: 700
}

.btn-primary:hover {
  filter: brightness(.97);
  transform: translateY(-2px)
}

.btn-secondary {
  background: var(--highlight);
  color: #111;
  border-color: transparent;
  font-weight: 700
}

.btn-secondary:hover {
  filter: brightness(.97);
  transform: translateY(-2px)
}

.btn-outline {
  background: transparent;
  color: var(--text)
}

.btn-outline:hover {
  background: rgba(255, 255, 255, .05)
}

.btn-cta {
  background: linear-gradient(180deg, var(--accent), #ff9f00);
  color: #111;
  border-color: transparent;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .35)
}

.btn-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .42)
}

.btn-xl {
    padding: 16px 28px;
    font-size: 16px;
    border-radius: 14px;
    flex-grow: 1;
    font-family: 'Space Grotesk', system-ui, sans-serif;
}

.btn.block {
  display: block;
  width: 100%
}

.btn.disabled {
  opacity: .55;
  cursor: not-allowed
}

/* cards */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px
}

/* explainer */
.explainer .center {
  text-align: center
}

.explainer .muted {
  color: var(--muted)
}

.explainer-stage {
  margin-top: 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, .1)
}

[data-theme="light"] .explainer-stage {
  background: rgba(0, 0, 0, .04)
}

.explainer-svg {
  width: 100%;
  height: auto
}

.exp-text {
  font: 700 18px 'Space Grotesk', sans-serif;
  fill: var(--text);
  opacity: .0;
  animation: txt 6s infinite
}

.exp-text:nth-of-type(1) {
  animation-delay: .2s
}

.exp-text:nth-of-type(2) {
  animation-delay: .7s
}

.exp-text:nth-of-type(3) {
  animation-delay: 1.2s
}

.exp-bar {
  opacity: 0;
  animation: bar 6s infinite 1.6s
}

.exp-square {
  fill: url(#grad);
  opacity: 0;
  rx: 10;
  animation: sq 6s infinite 2.8s
}

@keyframes txt {
  0% {
    opacity: 0;
    transform: translateX(-6px)
  }

  20% {
    opacity: 1;
    transform: none
  }

  40% {
    opacity: 1
  }

  60% {
    opacity: 0
  }

  100% {
    opacity: 0
  }
}

@keyframes bar {
  0% {
    opacity: 0;
    transform: scaleX(.7);
    transform-origin: left
  }

  25% {
    opacity: 1
  }

  50% {
    transform: scaleX(1)
  }

  80% {
    opacity: 1
  }

  100% {
    opacity: 0
  }
}

@keyframes sq {
  0% {
    opacity: 0;
    transform: scale(.85) rotate(0.001deg)
  }

  40% {
    opacity: 1;
    transform: scale(1)
  }

  70% {
    opacity: 1
  }

  100% {
    opacity: 0
  }
}

/* steps */
.step-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
}

.step {
  flex: 1 1 300px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform .25s;
}

.step:hover {
  transform: translateY(-3px);
}

/* builder */
.builder-row {
  display: flex;
  align-items: flex-start
}

.customizer {
  flex: 1;
  margin-right: 18px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .45s, transform .45s
}

.preview-panel {
  flex: 1;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .45s, transform .45s
}

.fade-in.show {
  opacity: 1;
  transform: none
}

@media(max-width:980px) {
  .builder-row {
    flex-direction: column
  }

  .customizer {
    margin-right: 0;
    margin-bottom: 18px
  }
}

.customizer h2,
.preview-panel h2 {
  margin: 0 0 10px
}

.muted {
  color: var(--muted)
}

.hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px
}

.field {
  margin-bottom: 14px
}

.row {
  display: flex
}

.row.two .field {
  flex: 1
}

.row.two .field:first-child {
  margin-right: 12px
}

.align-end {
  align-items: flex-end
}

label {
  display: block;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px
}

input[type="text"],
textarea,
select {
  width: 100%;
  background: #101010;
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  transition: border-color .2s, background .2s
}

[data-theme="light"] input[type="text"],
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: #fff;
  color: #111;
  border-color: #e4e4e4
}

textarea {
  min-height: 120px;
  resize: vertical
}

/* swatch dropdown */
.swatch-select {
  position: relative
}

.swatch-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #101010;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: #fff;
  cursor: pointer;
  transition: transform .15s
}

[data-theme="light"] .swatch-trigger {
  background: #fff;
  color: #111
}

.swatch-trigger:active {
  transform: scale(.99)
}

.swatch-preview {
  flex: 0 0 120px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #3a3a3a;
  background: linear-gradient(90deg, #666, #999);
  margin-right: 10px
}

.swatch-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted)
}

.chev {
  opacity: .7;
  margin-left: 8px
}

.swatch-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 260px;
  overflow: auto;
  display: none;
  z-index: 20;
  box-shadow: var(--shadow);
  transform-origin: top center;
  animation: menuIn .18s ease forwards
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: scaleY(.96)
  }

  to {
    opacity: 1;
    transform: scaleY(1)
  }
}

.swatch-item {
  padding: 10px 12px;
  border-bottom: 1px solid #222;
  cursor: pointer;
  transition: background .15s, transform .1s
}

.swatch-item:last-child {
  border-bottom: none
}

.swatch-item:hover {
  background: #151515
}

[data-theme="light"] .swatch-item:hover {
  background: #f6f6f6
}

.swatch-bar {
  height: 24px;
  border-radius: 6px;
  border: 1px solid #333
}

/* bg picker */
.bg-picker {
  background: #101010;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center
}

[data-theme="light"] .bg-picker {
  background: #fff
}

.bg-preview {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #383838;
  margin-right: 10px
}

.bg-controls {
  display: flex;
  width: 100%;
  margin-top: 8px
}

.bg-controls input[type="range"] {
  flex: 1
}

.bg-controls input[type="range"]:first-child {
  margin-right: 8px
}

/* preview */
.preview-box {
  position: relative;
  width: 100%;
  background: #0e0e0e;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  overflow: hidden
}

.preview-panel svg {
  width: 100%;
  height: auto;
  display: block;
  animation: fadeIn .35s ease
}

.preview-placeholder {
  position: absolute
}

.preview-placeholder.hide {
  display: none !important;
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

/* shimmer while generating */
.skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0f0f0f 25%, #131313 37%, #0f0f0f 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  display: none
}

[data-theme="light"] .skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #f6f6f6 37%, #f0f0f0 63%)
}

@keyframes shimmer {
  0% {
    background-position: 100% 0
  }

  100% {
    background-position: 0 0
  }
}

.skeleton.show {
  display: block
}

/* actions */
.actions {
  display: flex;
  align-items: center
}

.actions .btn {
  margin-right: 10px
}

.actions .btn:last-child {
  margin-right: 0
}

/* shop */
.shop {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border)
}

.variant {
  margin-bottom: 8px
}

.variant label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #141414;
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 10px;
  color: #fff;
  cursor: pointer
}

[data-theme="light"] .variant label {
  background: #fff;
  color: #111;
  border-color: #e4e4e4
}

/* gallery */
.gallery-card h2 {
  margin: 0 0 10px
}

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  margin-left: -10px;
  margin-right: -10px
}

.gallery-grid img {
  flex: 1 1 260px;
  min-width: 220px;
  margin: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s
}

.gallery-grid img:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25)
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.lightbox.hidden {
  display: none;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  border: 2px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 42px;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
}

.lightbox-close:hover {
  opacity: .7;
}

/* footer */
.footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 18px 0;
  text-align: center
}

/* toast */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: transform .35s, opacity .35s;
  z-index: 100
}

#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1
}

#toast.success {
  color: #0ad26b;
  border-color: #0ad26b
}

#toast.error {
  color: #f15b5b;
  border-color: #f15b5b
}

/* ===== Custom Palette (cp-) ===== */
.cp-card {
  padding: 20px
}

.cp-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px
}

.cp-title {
  margin: 0
}

.small {
  font-size: 12px
}

.cp-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px
}

.cp-tab {
  appearance: none;
  background: #141414;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer
}

[data-theme="light"] .cp-tab {
  background: #fff
}

.cp-tab.is-active {
  background: var(--accent);
  color: #111;
  border-color: transparent;
  font-weight: 700
}

.cp-panels {
  margin-top: 6px
}

.cp-panel {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px
}

.cp-panel.is-hidden {
  display: none
}

.cp-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap
}

.cp-col {
  flex: 1 1 420px
}

.cp-actions {
  display: flex;
  align-items: center;
  gap: 10px
}

.cp-drop {
  position: relative;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  background: #101010;
  cursor: pointer
}

[data-theme="light"] .cp-drop {
  background: #fff
}

.cp-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer
}

.cp-drop-hint strong {
  display: block
}

.cp-drop-hint span {
  display: block;
  margin-top: 4px
}

.cp-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px
}

.cp-preview-grid img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 10px
}

.cp-seed-wrap {
  display: flex;
  gap: 8px;
  align-items: center
}

#cp-seed {
  flex: 0 0 140px;
  background: #101010;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px
}

[data-theme="light"] #cp-seed {
  background: #fff
}

#cp-seed-picker {
  width: 46px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0;
  background: #fff
}

.cp-sliders {
  display: flex;
  gap: 14px;
  margin-top: 10px
}

.cp-sliders label {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.cp-swatch-wrap {
  margin-top: 14px
}

.cp-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px
}

.cp-meta {
  font-size: 12px
}

.cp-swatch {
  display: grid;
  grid-template-columns: repeat(26, minmax(16px, 1fr));
  gap: 4px
}

.cp-swatch .cp-chip {
  height: 46px;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  position: relative;
  overflow: hidden
}

.cp-chip:hover {
  transform: translateY(-1px);
  transition: transform .12s
}

.cp-chip .cp-letter {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-weight: 700;
  font-size: 12px;
  color: rgba(255, 255, 255, .85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4)
}

[data-theme="light"] .cp-chip .cp-letter {
  color: rgba(0, 0, 0, .75)
}

.cp-alpha {
  display: none
}

/* accessibility helper if needed */

.cp-apply {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px
}

/* ---------------------------
   Preview Limit Banner
---------------------------- */
.preview-limit {
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.3;
}

.preview-limit.medium {
  background: #fff4d2;
  /* warm, friendly */
  border: 1px solid #f2d38c;
  /* subtle frame */
  color: #7a5500;
}

.preview-limit.medium strong {
  font-weight: 700;
}

.preview-limit.small {
  opacity: 0.7;
}

.preview-limit.disabled {
  background: #ffe0e0;
  border-color: #ffb3b3;
  color: #a33;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- NAV: Mobile Fix --- */
@media (max-width: 600px) {
  .nav-bar {
    flex-direction: column;
    height: auto;
    padding: 12px 0;
    gap: 8px;
  }

  .brand {
    font-size: 18px;
    text-align: center;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .nav-links a {
    margin-left: 0;
  }
}

/* Prevent overflow on mobile */
@media(max-width: 600px) {

  .builder-row,
  .customizer,
  .preview-panel,
  .row,
  .field {
    max-width: 100%;
    overflow-x: hidden;
  }
}

@media(max-width: 600px) {
  .swatch-preview {
    flex: 0 0 80px;
  }
}

@media(max-width: 600px) {
  .cp-swatch {
    display: flex;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .cp-chip {
    flex: 0 0 40px;
  }
}

/* Fix WordPress admin bar pushing to bottom */
body.admin-bar .nav {
  top: 32px !important;
}

@media(max-width: 782px) {
  body.admin-bar .nav {
    top: 46px !important;
  }
}