/* Playful Geometric — base styles + semantic component classes.
   Loaded AFTER Tailwind CDN so utilities below win in cascade order. */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --ink: #1E293B;
  --bg: #FFFDF5;
  --accent: #8B5CF6;
  --secondary: #F472B6;
  --tertiary: #FBBF24;
  --quaternary: #34D399;
  --border: #E2E8F0;
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 500;
}

/* Reset default <a> color — inherit from parent so links pick up our text-* utilities */
a, a:link, a:visited, a:hover, a:active, a:focus { color: inherit; text-decoration: none; }

/* Bulletproof basic color utilities — fallbacks if Tailwind CDN is slow/blocked */
.text-white { color: #ffffff; }
.text-slate-500 { color: #64748B; }
.text-slate-600 { color: #475569; }
.text-red-600 { color: #DC2626; }

/* Sticky footer: body becomes a flex column so main flexes to fill */
html, body { min-height: 100vh; min-height: 100dvh; }
body.app-shell { display: flex; flex-direction: column; }
body.app-shell > main { flex: 1 0 auto; }
body.app-shell > footer { flex-shrink: 0; }

/* Bulletproof design-token utilities — fallbacks in case Tailwind CDN config
   times out or dynamic JS classes aren't scanned. theme.css loads AFTER
   Tailwind, so source-order ties resolve in our favor. */
.bg-accent      { background-color: var(--accent); }
.bg-secondary   { background-color: var(--secondary); }
.bg-tertiary    { background-color: var(--tertiary); }
.bg-quaternary  { background-color: var(--quaternary); }
.bg-ink         { background-color: var(--ink); }
.bg-bg          { background-color: var(--bg); }
.bg-muted       { background-color: #F1F5F9; }
.text-accent      { color: var(--accent); }
.text-secondary   { color: var(--secondary); }
.text-tertiary    { color: var(--tertiary); }
.text-quaternary  { color: var(--quaternary); }
.text-ink         { color: var(--ink); }
.border-ink       { border-color: var(--ink); }

/* Dot grid backdrop — strict Memphis-style polka */
body {
  background-image: radial-gradient(#E2E8F0 1.2px, transparent 1.2px);
  background-size: 24px 24px;
}

h1, h2, h3, h4, h5, .font-display {
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* ===== Buttons ===== */
.btn-pop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--ink);
  border-radius: 9999px;
  background: var(--accent);
  color: #fff;
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 4px 4px 0 0 var(--ink);
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 200ms cubic-bezier(0.34, 1.56, 0.64, 1),
              background 150ms;
  cursor: pointer;
  text-decoration: none;
  min-height: 48px;
}
.btn-pop:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 0 var(--ink); }
.btn-pop:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 0 var(--ink); }
.btn-pop:disabled, .btn-pop[disabled] {
  background: #CBD5E1; color: #475569; cursor: not-allowed;
  transform: none; box-shadow: 4px 4px 0 0 var(--ink);
}

.btn-pop--secondary { background: var(--secondary); }
.btn-pop--tertiary  { background: var(--tertiary); color: var(--ink); }
.btn-pop--mint      { background: var(--quaternary); color: var(--ink); }
.btn-pop--danger    { background: #EF4444; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border: 2px solid var(--ink);
  border-radius: 9999px;
  background: transparent;
  color: var(--ink);
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 200ms, color 200ms;
  min-height: 44px;
}
.btn-ghost:hover { background: var(--tertiary); }

.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
  border: 2px solid var(--ink);
  border-radius: 9999px;
  background: #fff;
  color: var(--ink);
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms, transform 150ms;
}
.btn-mini:hover { background: var(--tertiary); transform: translateY(-1px); }

/* ===== Cards: "Sticker" ===== */
.sticker {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 1rem;
  box-shadow: 6px 6px 0 0 var(--ink);
  transition: transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sticker:hover {
  transform: translate(-2px, -2px) rotate(-1deg);
  box-shadow: 8px 8px 0 0 var(--ink);
}
.sticker--flat { box-shadow: 4px 4px 0 0 var(--ink); }
.sticker--flat:hover { transform: none; box-shadow: 4px 4px 0 0 var(--ink); }
.sticker--soft   { box-shadow: 8px 8px 0 0 var(--border); }
.sticker--pink   { box-shadow: 8px 8px 0 0 var(--secondary); }
.sticker--amber  { box-shadow: 8px 8px 0 0 var(--tertiary); }
.sticker--mint   { box-shadow: 8px 8px 0 0 var(--quaternary); }

/* Sticker card meant to be the page surface for forms — no wiggle on hover */
.sticker-static {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 1rem;
  box-shadow: 6px 6px 0 0 var(--ink);
}

/* ===== Inputs ===== */
.input-pop {
  width: 100%;
  background: #fff;
  border: 2px solid #CBD5E1;
  border-radius: 0.75rem;
  padding: 0.7rem 0.95rem;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 500;
  color: var(--ink);
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
  min-height: 48px;
}
.input-pop::placeholder { color: #94A3B8; }
.input-pop:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 4px 4px 0 0 var(--accent);
  transform: translate(-1px, -1px);
}
textarea.input-pop { min-height: 7rem; font-family: inherit; }

.label-cap {
  display: block;
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: #64748B;
  margin-bottom: 0.35rem;
}

/* ===== Chips / badges ===== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border: 2px solid var(--ink);
  border-radius: 9999px;
  background: #fff;
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.chip--accent    { background: var(--accent); color: #fff; }
.chip--secondary { background: var(--secondary); color: #fff; }
.chip--tertiary  { background: var(--tertiary); color: var(--ink); }
.chip--mint      { background: var(--quaternary); color: var(--ink); }

/* Floating circular icon — for "icon sticking out of top border" effect */
.icon-bubble {
  width: 2.5rem; height: 2.5rem;
  border-radius: 9999px;
  background: var(--accent);
  border: 2px solid var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 3px 3px 0 0 var(--ink);
}
.icon-bubble--secondary { background: var(--secondary); }
.icon-bubble--tertiary  { background: var(--tertiary); color: var(--ink); }
.icon-bubble--mint      { background: var(--quaternary); color: var(--ink); }

/* ===== Decorative shapes (absolute) ===== */
.shape-blob {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

/* Marquee — for infinite scrolling text */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 25s linear infinite;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Pop-in entrance — apply to .pop-in elements */
.pop-in {
  animation: popInKf 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes popInKf {
  0% { transform: scale(0.7); opacity: 0; }
  70% { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 1; }
}

/* Squiggle SVG underline used under headings */
.squiggle {
  display: block;
  height: 12px;
  width: 100%;
  max-width: 220px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 12' fill='none'><path d='M2 6 C 20 -2, 40 14, 60 6 S 100 -2, 120 6 S 160 14, 180 6 S 218 -2, 218 6' stroke='%238B5CF6' stroke-width='3' stroke-linecap='round'/></svg>") center/contain no-repeat;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .sticker:hover, .btn-pop:hover, .btn-pop:active { transform: none !important; }
}

/* Mobile: lighter shadows */
@media (max-width: 640px) {
  .sticker, .sticker-static { box-shadow: 3px 3px 0 0 var(--ink); }
  .sticker--soft   { box-shadow: 4px 4px 0 0 var(--border); }
  .sticker--pink   { box-shadow: 4px 4px 0 0 var(--secondary); }
  .sticker--amber  { box-shadow: 4px 4px 0 0 var(--tertiary); }
  .sticker--mint   { box-shadow: 4px 4px 0 0 var(--quaternary); }
  .btn-pop { box-shadow: 3px 3px 0 0 var(--ink); }
  .shape-blob { display: none; }
}

/* Logo avatar */
.logo-avatar {
  width: 2.5rem; height: 2.5rem;
  border-radius: 9999px;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 0 var(--ink);
  object-fit: cover;
  background: #fff;
}

/* Utility for product image masked as blob */
.img-blob {
  border-radius: 2rem 2rem 2rem 0.5rem;
  border: 2px solid var(--ink);
  background: #fff;
  overflow: hidden;
}

/* Inline scrollbar shaping for thumbnails */
.thin-scroll::-webkit-scrollbar { height: 6px; }
.thin-scroll::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 999px; }
