:root {
  --bg-0: #efe2c8;
  --bg-1: #f7f0e1;
  --cream: #fcf6ea;
  --brown-0: #3a2918;
  --brown-1: #6b4a2b;
  --brown-2: #8a6740;
  --brown-soft: #a98a63;
  --text: #3a2918;
  --text-muted: #7a6347;
  --line: rgba(58, 41, 24, 0.16);
  --line-soft: rgba(58, 41, 24, 0.09);

  /* Memphis accent pops */
  --c-mustard: #f4b942;
  --c-coral: #ff7a6b;
  --c-teal: #4cc9b0;
  --c-pink: #ff9ec7;
  --c-lilac: #b79cf0;

  --radius: 30px;
  --maxw: 820px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 640px at 50% -12%, var(--cream), transparent 60%),
    radial-gradient(900px 600px at 92% 108%, #ddc79a, transparent 55%),
    radial-gradient(700px 500px at 6% 96%, #e7d6b2, transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  background-attachment: fixed;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Dotted background pattern */
#bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--line-soft) 1.4px, transparent 1.4px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
  opacity: 0.8;
}

/* Floating Memphis blobs */
.blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
  animation: floaty 14s ease-in-out infinite;
}

.blob--1 { width: 120px; height: 120px; left: 8%;  top: 16%; background: var(--c-mustard); animation-delay: 0s;  animation-duration: 16s; }
.blob--2 { width: 80px;  height: 80px;  left: 84%; top: 22%; background: var(--c-teal);    animation-delay: -3s; animation-duration: 13s; }
.blob--3 { width: 150px; height: 150px; left: 78%; top: 74%; background: var(--c-coral);   animation-delay: -6s; animation-duration: 18s; }
.blob--4 { width: 90px;  height: 90px;  left: 12%; top: 76%; background: var(--c-pink);    animation-delay: -9s; animation-duration: 15s; }

.blob--ring {
  background: transparent;
  border: 3px solid var(--brown-2);
  opacity: 0.4;
  filter: none;
}
.blob--5 { width: 70px; height: 70px; left: 22%; top: 64%; border-color: var(--c-lilac); animation-delay: -2s; animation-duration: 20s; }
.blob--6 { width: 46px; height: 46px; left: 70%; top: 12%; animation-delay: -7s; animation-duration: 12s; }

@keyframes floaty {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(14px, -22px) scale(1.06); }
  50% { transform: translate(-10px, 12px) scale(0.96); }
  75% { transform: translate(8px, -8px) scale(1.03); }
}

.page {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: clamp(16px, 4vw, 40px);
}

.stage-wrap {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 3vw, 28px);
}

/* Text */
.text {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 640px;
}

.text h1 {
  margin: 0;
  font-size: clamp(1.9rem, 6vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--brown-0);
}

.squiggle {
  display: block;
  width: min(300px, 78%);
  height: 16px;
  margin: 6px auto 12px;
  overflow: visible;
}

.squiggle path {
  fill: none;
  stroke: var(--c-coral);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 420;
  stroke-dashoffset: 420;
  animation: draw 4.5s ease-in-out infinite;
}

@keyframes draw {
  0% { stroke-dashoffset: 420; opacity: 0; }
  10% { opacity: 1; }
  50% { stroke-dashoffset: 0; opacity: 1; }
  85% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

.subheadline {
  margin: 0 0 8px;
  font-size: clamp(1.02rem, 2.7vw, 1.3rem);
  color: var(--brown-0);
}

.hint {
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(0.92rem, 2.2vw, 1.05rem);
  font-weight: 600;
}

/* Stage area (no box – dog floats free over the page background) */
.stage-frame {
  position: relative;
  flex: none;
  align-self: center;
  width: min(1250px, calc(100vw - 24px));
  max-width: none;
  height: clamp(440px, 70vh, 720px);
  margin-inline: auto;
  background: transparent;
  border: 0;
  overflow: hidden;
}

.comic-pop {
  position: absolute;
  z-index: 6;
  padding: 10px 13px;
  border: 2px solid var(--brown-0);
  color: var(--brown-0);
  background: var(--cream);
  box-shadow: 4px 4px 0 var(--brown-0);
  font-size: 0.78rem;
  font-weight: 900;
  font-family: inherit;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  transform: rotate(var(--base-rotation));
  transition:
    transform 180ms ease-out,
    filter 160ms ease,
    box-shadow 160ms ease;
  will-change: transform;
}

.comic-pop:hover,
.comic-pop:focus-visible {
  filter: brightness(1.06);
  box-shadow: 6px 6px 0 var(--brown-0);
  outline: none;
}

.comic-pop:active {
  box-shadow: 2px 2px 0 var(--brown-0);
}

.comic-pop--left {
  left: calc(50% - 520px);
  top: 39%;
  --base-rotation: -8deg;
}

.comic-pop--right {
  right: auto;
  left: calc(50% + 26px);
  top: 29%;
  border-radius: 999px;
  background: var(--c-pink);
  --base-rotation: 7deg;
}

.comic-pop.is-popped {
  animation: plaque-pop 420ms cubic-bezier(0.2, 0.9, 0.3, 1.35);
}

@keyframes plaque-pop {
  50% { scale: 1.22; }
}

.stage {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
}

#dog-stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
}

/* Decorative doodles + particles removed – dog floats free. */

/* Loader overlay (small, transparent – never hides the dog) */
.loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  pointer-events: none;
}

.loader-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--brown-1);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 18px;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

.footer a,
.privacy-card a {
  color: var(--brown-1);
  text-decoration-color: rgba(107, 74, 43, 0.4);
  text-underline-offset: 0.18em;
}

.footer a:hover,
.footer a:focus-visible,
.privacy-card a:hover,
.privacy-card a:focus-visible {
  color: var(--brown-0);
  text-decoration-color: currentColor;
}

/* Privacy page */
.privacy-page {
  display: block;
  min-height: auto;
  padding-block: clamp(28px, 7vw, 72px);
}

.privacy-card {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 64px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(252, 246, 234, 0.9);
  box-shadow: 0 24px 70px rgba(58, 41, 24, 0.12);
  backdrop-filter: blur(12px);
}

.privacy-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-bottom: clamp(24px, 5vw, 48px);
  font-weight: 700;
}

.privacy-card h1 {
  margin: 0 0 0.25em;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.privacy-card h2 {
  margin: 2.2em 0 0.65em;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  line-height: 1.2;
  scroll-margin-top: 1.5rem;
}

.privacy-card h3 {
  margin: 1.6em 0 0.55em;
  font-size: 1.1rem;
}

.privacy-card p,
.privacy-card li {
  line-height: 1.68;
}

.privacy-card ul {
  padding-left: 1.35rem;
}

.privacy-card .index {
  columns: 2 280px;
  column-gap: 2.5rem;
  padding: 1.2rem 1.2rem 1.2rem 2.6rem;
  border-radius: 18px;
  background: rgba(239, 226, 200, 0.62);
}

.privacy-card .index li {
  break-inside: avoid;
  margin-bottom: 0.35rem;
}

.privacy-card .m-elements,
.privacy-card .glossary {
  padding-left: 1.2rem;
}

.privacy-card .m-elements > li,
.privacy-card .glossary > li {
  margin-bottom: 0.9rem;
}

.privacy-card .seal {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 640px) {
  .stage-frame {
    width: calc(100vw - 12px);
    height: clamp(400px, 64vh, 560px);
  }
  .blob { opacity: 0.42; }
  .comic-pop--left { left: 1%; }
  .comic-pop--right {
    right: 8%;
    left: auto;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .blob { display: none; }
  .squiggle path { stroke-dashoffset: 0; opacity: 1; }
}
