/* PiBead — premium DTC pixel bead brand */

:root {
  --cream: #F7F2EA;
  --cream-2: #EFE8DA;
  --cream-3: #E6DECB;
  --ink: #111111;
  --ink-2: #1A1A1A;
  --muted: #5A5A5A;
  --muted-2: #8A8A8A;
  --line: #E3DBC8;
  --line-2: #D6CCB4;

  /* Arcade accents */
  --yellow: #FFD83D;
  --yellow-deep: #F2C500;
  --blue: #2DD4FF;
  --blue-deep: #0BB7E0;
  --pink: #FF6FCF;
  --pink-deep: #E94BB3;
  --green: #6EE787;

  --shadow-sm: 0 1px 0 rgba(17,17,17,.04), 0 1px 2px rgba(17,17,17,.04);
  --shadow-md: 0 4px 14px -2px rgba(17,17,17,.08), 0 2px 4px -1px rgba(17,17,17,.06);
  --shadow-lg: 0 20px 40px -12px rgba(17,17,17,.18), 0 8px 16px -8px rgba(17,17,17,.08);
  --shadow-pop: 0 8px 0 -2px var(--ink);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "ss02";
  letter-spacing: -0.01em;
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.font-display { font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: -0.03em; }
.font-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; letter-spacing: 0; }
.font-pixel { font-family: 'Silkscreen', monospace; letter-spacing: 0; font-weight: 400; }

/* Pixel grid backdrop */
.pixel-bg {
  background-image:
    linear-gradient(to right, rgba(17,17,17,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17,17,17,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}
.pixel-bg-tight {
  background-image:
    linear-gradient(to right, rgba(17,17,17,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17,17,17,0.06) 1px, transparent 1px);
  background-size: 8px 8px;
}
.pixel-bg-dark {
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Pixel border treatment — a faux dotted outer ring */
.pixel-border {
  position: relative;
}
.pixel-border::before {
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px dashed var(--ink);
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.08;
}

/* Scrollbar */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(17,17,17,.15);
  border-radius: 10px;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(17,17,17,.3); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  border: 1.5px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--ink-2); box-shadow: var(--shadow-md); }
.btn-yellow {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--ink);
}
.btn-yellow:hover { box-shadow: 0 6px 0 -2px var(--ink); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--cream); }
.btn-soft {
  background: rgba(17,17,17,0.06);
  color: var(--ink);
}
.btn-soft:hover { background: rgba(17,17,17,0.1); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 56px; padding: 0 26px; font-size: 16px; }

/* Card primitive */
.card {
  background: #FFFDF7;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-flat {
  background: #FFFDF7;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

/* Section heading */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .dot {
  width: 8px; height: 8px;
  background: var(--yellow);
  border: 1.5px solid var(--ink);
  display: inline-block;
}

/* Bead / dot */
.bead {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  position: relative;
  box-shadow: inset -3px -3px 6px rgba(0,0,0,.18), inset 3px 3px 4px rgba(255,255,255,.45);
}
.bead::before {
  content: "";
  position: absolute;
  inset: 26% 28% 50% 28%;
  border-radius: 999px;
  background: radial-gradient(closest-side, rgba(255,255,255,.7), rgba(255,255,255,0));
}
.bead::after {
  content: "";
  position: absolute;
  inset: 38%;
  border-radius: 999px;
  background: rgba(0,0,0,0.22);
  box-shadow: inset 0 0 2px rgba(0,0,0,0.5);
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--cream-2);
  color: var(--ink);
  border: 1px solid var(--line);
}
.tag-yellow { background: var(--yellow); border-color: var(--ink); }
.tag-blue { background: var(--blue); border-color: var(--ink); }
.tag-pink { background: var(--pink); color: #fff; border-color: var(--ink); }
.tag-dark { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* Pixel grid (interactive in creator) */
.pixel-cell {
  width: 100%;
  height: 100%;
  outline: 1px solid rgba(17,17,17,0.04);
  outline-offset: -1px;
  transition: transform .08s ease;
}
.pixel-cell:hover { transform: scale(0.92); outline-color: rgba(17,17,17,0.4); }

/* Marquee strip */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee {
  display: flex;
  animation: marquee 40s linear infinite;
  width: max-content;
}

/* Subtle entrance */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }

/* Slight wobble for hover beads */
@keyframes wobble {
  0%,100% { transform: rotate(0); }
  25% { transform: rotate(-4deg); }
  75% { transform: rotate(4deg); }
}

/* Loader bar (pattern generate) */
@keyframes load {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Star rating bits */
.star-row { display: inline-flex; gap: 1px; align-items: center; }

/* Selected pixel cell ring */
.pixel-cell.sel { outline: 2px solid var(--ink); z-index: 1; }

/* Tab/segment */
.seg {
  display: inline-flex;
  padding: 4px;
  background: rgba(17,17,17,0.06);
  border-radius: 999px;
  gap: 2px;
}
.seg button {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.seg button.on {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* Util */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 1024px) { .container { padding: 0 40px; } }

.divider { height: 1px; background: var(--line); }

.hairline { border: 1px solid var(--line); }

/* Hover lift */
.lift { transition: transform .2s ease, box-shadow .2s ease; }
.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* Image placeholder gradient */
.ph-grad-1 { background: linear-gradient(135deg, #FFD83D, #FF6FCF); }
.ph-grad-2 { background: linear-gradient(135deg, #2DD4FF, #6EE787); }
.ph-grad-3 { background: linear-gradient(135deg, #FF6FCF, #2DD4FF); }
.ph-grad-4 { background: linear-gradient(135deg, #111111, #5A5A5A); }
.ph-grad-5 { background: linear-gradient(135deg, #FFD83D, #2DD4FF); }
.ph-grad-6 { background: linear-gradient(135deg, #6EE787, #FFD83D); }

/* Selected nav link */
.nav-link {
  font-size: 14px; font-weight: 500;
  color: var(--ink); opacity: 0.7;
  padding: 6px 0;
  position: relative;
}
.nav-link:hover { opacity: 1; }
.nav-link.on { opacity: 1; }
.nav-link.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; background: var(--ink);
}

/* Creator-specific dark panels */
.panel {
  background: #FFFDF7;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.panel-dark {
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius-md);
}

/* Tool button */
.tool-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  transition: all .12s ease;
}
.tool-btn:hover { background: rgba(17,17,17,0.06); }
.tool-btn.on { background: var(--ink); color: var(--cream); }
.tool-btn.on svg { color: var(--yellow); }

/* Range slider styling */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 999px;
  background: var(--ink);
  border: 2px solid var(--cream);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

/* Pretty wrap for headings */
h1,h2,h3,h4 { text-wrap: balance; margin: 0; }
p { text-wrap: pretty; margin: 0; }

/* Faux pixel mascot/sprite */
.sprite {
  image-rendering: pixelated;
}
