/* ==========================================================================
   Bongfinity — single-page styles
   ========================================================================== */

:root {
  /* Surfaces — near-black with a subtle canopy-green undertone */
  --bg: #0a0d0b;
  --surface: #131c16;
  --surface-2: #1c2a21;
  --border: #2a3d32;
  --text: #e8eee9;
  --text-dim: #94a39a;

  /* Primary action accent — fresh leaf green */
  --accent: #6fc16a;
  --accent-dim: #5aa256;
  --accent-ink: #06140a;

  /* Brand palette — cannabis plant tones (decorative, not for buttons) */
  --green-dark: #1f5232;      /* deep canopy */
  --green-mid: #2d7a48;       /* mid canopy */
  --purple: #8b4cd8;          /* trichome purple */
  --purple-dim: #6e35b8;
  --orange: #e88a3a;          /* pistil amber */
  --orange-dim: #c8701f;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 16px;
  --s-4: 24px;
  --s-5: 40px;
  --s-6: 64px;
  --s-7: 96px;

  --max-w: 1180px;
  --nav-h: 64px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
button { font: inherit; }

/* ---------- typography ---------- */
h1, h2, h3 {
  line-height: 1.1;
  margin: 0 0 var(--s-3);
  font-weight: 800;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: var(--s-4); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 var(--s-3); }
a { color: var(--accent); }
a:hover { color: var(--accent-dim); }

.section__lede {
  color: var(--text-dim);
  max-width: 60ch;
  margin-bottom: var(--s-5);
  font-size: 1.05rem;
}

/* ---------- layout ---------- */
main > section {
  padding: var(--s-6) var(--s-4);
  max-width: var(--max-w);
  margin: 0 auto;
}
@media (min-width: 768px) {
  main > section { padding: var(--s-7) var(--s-4); }
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-h);
  padding: 0 var(--s-4);
  background: rgba(10, 10, 10, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 1.1rem;
}
.nav__brand img { width: 32px; height: 32px; }
.nav__links {
  display: none;
  gap: var(--s-4);
  align-items: center;
}
.nav__links a {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}
.nav__links a:hover { color: var(--accent); }
.nav__toggle {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav__toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s, opacity 0.2s;
}
.nav--open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav--open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav--open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 768px) {
  .nav__links { display: flex; }
  .nav__toggle { display: none; }
}

.nav--open .nav__links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: var(--s-2) var(--s-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.nav--open .nav__links a {
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--border);
}
.nav--open .nav__links a:last-child { border-bottom: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s ease, background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: var(--accent-ink);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- hero ---------- */
.hero {
  display: grid;
  gap: var(--s-5);
  align-items: center;
}
.hero__tagline {
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--s-2);
}
.hero__sub {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: var(--s-4);
  max-width: 50ch;
}
.hero__cta {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.hero__art {
  aspect-ratio: 1;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--s-3);
  width: 100%;
  height: 100%;
  padding: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero__tile {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero__tile::before {
  content: '';
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  /* --tile-color is set per tile by script.js from the live palette */
  background: radial-gradient(circle, var(--tile-color, var(--accent)) 0%, transparent 65%);
  opacity: 0.5;
  transition: background 0.3s ease;
}

@media (min-width: 768px) {
  .hero {
    grid-template-columns: 1.2fr 1fr;
    padding-top: var(--s-7) !important;
  }
}

/* ---------- pitch ---------- */
.pitch__lede {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 65ch;
  margin-bottom: var(--s-5);
}
.pitch__features {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: 1fr;
  list-style: none;
  padding: 0;
  margin: 0;
}
.pitch__features li {
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}
.pitch__features li:nth-child(2) { border-left-color: var(--orange); }
.pitch__features li:nth-child(3) { border-left-color: var(--purple); }
.pitch__features li:nth-child(4) { border-left-color: var(--green-mid); }
@media (min-width: 720px) {
  .pitch__features { grid-template-columns: 1fr 1fr; }
}

/* ---------- modules ---------- */
.modules__grid {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-4);
  transition: border-color 0.15s, transform 0.15s;
}
.module-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.module-card__img {
  aspect-ratio: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--s-3);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.02em;
  color: var(--text-dim);
  position: relative;
  overflow: hidden;
}
.module-card__img::after {
  content: '';
  position: absolute;
  inset: 12%;
  border: 2px dashed var(--border);
  border-radius: 50%;
  pointer-events: none;
}
.module-card p {
  color: var(--text-dim);
  margin: 0;
  font-size: 0.92rem;
}
.module-card h3 { margin-bottom: var(--s-1); }
.module-card__photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--s-3);
  display: block;
}

/* ---------- configurator ---------- */
.cfg__base-color { margin-bottom: var(--s-5); }
.cfg__base-color label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--s-2);
  font-size: 0.95rem;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease, box-shadow 0.15s;
  position: relative;
}
.swatch:hover { transform: scale(1.08); }
.swatch--active {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  border-color: var(--bg);
}
.swatch[data-custom] {
  background: repeating-conic-gradient(#3a3a3a 0% 25%, #1f1f1f 0% 50%) 50% / 12px 12px;
}
.swatch[data-custom]::after {
  content: '?';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--text);
  font-size: 0.9rem;
}

.cfg__layout {
  display: grid;
  gap: var(--s-5);
}
@media (min-width: 900px) {
  .cfg__layout {
    grid-template-columns: 1.3fr 1fr;
    align-items: start;
  }
}

.cfg__grid-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.cfg__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 1;
  box-shadow: var(--shadow);
}
.cfg__hint {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
  margin: 0;
}
.cfg__slot {
  background: var(--surface-2);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-3);
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, color 0.15s, transform 0.12s ease;
  text-align: center;
}
.cfg__slot:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.cfg__slot:active { transform: scale(0.98); }
.cfg__slot--filled {
  border-style: solid;
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}
.cfg__slot--filled:hover { border-color: var(--accent); color: var(--text); }
.cfg__slot-label {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  font-weight: 700;
}
.cfg__slot-empty {
  font-size: 0.95rem;
  font-weight: 600;
}
.cfg__slot-name {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
}
.cfg__slot-color {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border);
}

.cfg__summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-4);
}
@media (min-width: 900px) {
  .cfg__summary {
    position: sticky;
    top: calc(var(--nav-h) + 16px);
  }
}
.cfg__summary h3 { margin-bottom: var(--s-3); }
#cfg-summary-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s-4);
}
#cfg-summary-list li {
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  font-size: 0.92rem;
  flex-wrap: wrap;
}
#cfg-summary-list li > span { color: var(--text-dim); }
#cfg-summary-list li > strong { text-align: right; font-weight: 600; }
#cfg-summary-list li:last-child { border-bottom: none; }
.cfg__actions {
  display: grid;
  gap: var(--s-2);
}
@media (min-width: 480px) {
  .cfg__actions { grid-template-columns: 1fr 1fr; }
  .cfg__actions .btn--primary { grid-column: 1 / -1; }
}
.cfg__order-hint {
  margin: var(--s-3) 0 0;
  font-size: 0.85rem;
  color: var(--accent);
}

#cfg-summary-list .cfg__summary-total {
  border-top: 1px solid var(--border);
  margin-top: var(--s-2);
  padding-top: var(--s-3);
  font-size: 1rem;
}
#cfg-summary-list .cfg__summary-total > span { color: var(--text); font-weight: 600; }
#cfg-summary-list .cfg__summary-total > strong {
  color: var(--accent);
  font-size: 1.15rem;
}

#paypal-button-container {
  margin-bottom: var(--s-3);
}
#paypal-button-container:empty { margin: 0; }

.cfg__thanks {
  padding: var(--s-3);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(111, 193, 106, 0.08);
  color: var(--text);
  line-height: 1.5;
}

/* ---------- slot editor dialog ---------- */
.slot-editor {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  max-width: 520px;
  width: calc(100% - 32px);
  padding: var(--s-4);
  box-shadow: var(--shadow);
}
.slot-editor::backdrop {
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.slot-editor h3 { margin-bottom: var(--s-4); }
.slot-editor fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 var(--s-4);
}
.slot-editor legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: var(--s-2);
  font-size: 0.95rem;
}
.modules-pick {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-2);
}
.modules-pick button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px var(--s-3);
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.2;
  transition: border-color 0.15s, background 0.15s;
}
.modules-pick button:hover { border-color: var(--accent); }
.modules-pick button.is-active {
  border-color: var(--accent);
  background: rgba(111, 193, 106, 0.1);
  color: var(--accent);
}
.slot-editor__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* ---------- gallery ---------- */
.gallery__grid {
  display: grid;
  gap: var(--s-2);
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.gallery__thumb {
  aspect-ratio: 1;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.gallery__thumb::after {
  content: '';
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  opacity: 0.25;
}
.gallery__thumb[data-thumb="1"]::after { background: radial-gradient(circle, var(--accent), transparent 70%); }
.gallery__thumb[data-thumb="2"]::after { background: radial-gradient(circle, var(--orange), transparent 70%); }
.gallery__thumb[data-thumb="3"]::after { background: radial-gradient(circle, var(--purple), transparent 70%); }
.gallery__thumb[data-thumb="4"]::after { background: radial-gradient(circle, var(--green-mid), transparent 70%); opacity: 0.4; }
.gallery__thumb[data-thumb="5"]::after { background: radial-gradient(circle, var(--purple), transparent 70%); opacity: 0.4; }
.gallery__thumb[data-thumb="6"]::after { background: radial-gradient(circle, var(--orange), transparent 70%); opacity: 0.4; }

/* ---------- faq ---------- */
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--s-2);
  overflow: hidden;
}
.faq summary {
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--accent);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  padding: 0 var(--s-4) var(--s-4);
  margin: 0;
  color: var(--text-dim);
}

/* ---------- contact ---------- */
.contact__alt {
  margin-top: var(--s-4);
  color: var(--text-dim);
}

.contact__links {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: var(--s-4);
}
.contact__links .btn {
  min-width: 220px;
  text-align: center;
}

/* ---------- footer ---------- */
.footer {
  padding: var(--s-5) var(--s-4);
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: var(--s-6);
}
.footer p { margin: 0 0 var(--s-1); }
.footer__small {
  font-size: 0.75rem;
  color: var(--text-dim);
  opacity: 0.7;
}

/* ---------- focus visibility ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
