/* ============================================================
   HoomanPaw — Coming Soon
   Mobile-first. Design system + all styles.
   ============================================================ */

:root {
  /* Palette */
  --bg:          #f9f6ea;
  --bg-deep:     #f2ecd8;
  --text:        #494641;
  --text-soft:   #6f6a62;
  --accent:      #fac1b6;
  --accent-deep: #e89e90;
  --card:        #fffdf7;

  /* Effects */
  --ring: rgba(73, 70, 65, 0.12);
  --shadow-sm: 0 4px 14px rgba(73, 70, 65, 0.08);
  --shadow-md: 0 14px 40px rgba(73, 70, 65, 0.12);
  --shadow-glow: 0 10px 30px rgba(250, 193, 182, 0.45);

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: "Quicksand", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout — kept narrow so the floating products have room to orbit */
  --maxw: 460px;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);

  /* Paw cursors — native CSS image cursors: no JS, no lag, exact hotspot.
     Hotspot (16 9) sits near the top of the paw so it "points" precisely. */
  --cursor-paw: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='34' height='36' viewBox='0 0 34 36'><g fill='%23494641' stroke='%23fffdf7' stroke-width='1.4'><ellipse cx='17' cy='26' rx='8.6' ry='7.6'/><ellipse cx='6.6' cy='16.5' rx='3.3' ry='4.3'/><ellipse cx='13.4' cy='10.4' rx='3.5' ry='4.7'/><ellipse cx='20.6' cy='10.4' rx='3.5' ry='4.7'/><ellipse cx='27.4' cy='16.5' rx='3.3' ry='4.3'/></g></svg>") 16 9, auto;
  --cursor-paw-active: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='36' height='38' viewBox='0 0 34 36'><g fill='%23e89e90' stroke='%23fffdf7' stroke-width='1.4'><ellipse cx='17' cy='26' rx='8.6' ry='7.6'/><ellipse cx='6.6' cy='16.5' rx='3.3' ry='4.3'/><ellipse cx='13.4' cy='10.4' rx='3.5' ry='4.7'/><ellipse cx='20.6' cy='10.4' rx='3.5' ry='4.7'/><ellipse cx='27.4' cy='16.5' rx='3.3' ry='4.3'/></g></svg>") 16 9, pointer;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(120% 120% at 80% 0%, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

/* ---------- Paw cursor (fine pointers / desktop only) ---------- */
@media (pointer: fine) {
  html { cursor: var(--cursor-paw); }
  a, button, .btn, label, [role="button"], .rail__links a {
    cursor: var(--cursor-paw-active);
  }
  input, textarea, select { cursor: text; }
  #scene { cursor: var(--cursor-paw); }
  #scene.is-grab { cursor: var(--cursor-paw-active); }
}

/* ============================================================
   Background blobs
   ============================================================ */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  will-change: transform;
}
.blob--1 {
  width: 46vmax; height: 46vmax;
  top: -16vmax; left: -12vmax;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 70%);
  animation: drift1 22s var(--ease-spring) infinite alternate;
}
.blob--2 {
  width: 38vmax; height: 38vmax;
  bottom: -14vmax; right: -10vmax;
  background: radial-gradient(circle at 60% 40%, #ffe7b8, transparent 70%);
  opacity: 0.5;
  animation: drift2 26s var(--ease-spring) infinite alternate;
}
.blob--3 {
  width: 30vmax; height: 30vmax;
  top: 40%; left: 55%;
  background: radial-gradient(circle at 50% 50%, #d9ecd6, transparent 70%);
  opacity: 0.4;
  animation: drift3 30s var(--ease-spring) infinite alternate;
}
@keyframes drift1 { to { transform: translate(8vmax, 6vmax) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-7vmax, -5vmax) scale(1.08); } }
@keyframes drift3 { to { transform: translate(-6vmax, 7vmax) scale(0.92); } }

/* ============================================================
   three.js canvas
   ============================================================ */
#scene {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;          /* allow page scroll, scene reads gestures */
}

/* ============================================================
   Drifting paw prints (decorative)
   ============================================================ */
.paw-field {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.paw-field .paw {
  position: absolute;
  font-size: 20px;
  opacity: 0;
  color: var(--accent-deep);
  animation: pawFloat linear infinite;
  will-change: transform, opacity;
}
@keyframes pawFloat {
  0%   { transform: translateY(8vh) rotate(0deg) scale(0.6); opacity: 0; }
  10%  { opacity: 0.35; }
  90%  { opacity: 0.35; }
  100% { transform: translateY(-110vh) rotate(220deg) scale(1); opacity: 0; }
}

/* ============================================================
   Ambient twinkle "treat" (soft, classy, continuous)
   ============================================================ */
.sparkles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.sparkles .spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, var(--accent) 45%, transparent 70%);
  opacity: 0;
  transform: scale(0.4);
  animation: twinkle ease-in-out infinite;
  will-change: transform, opacity;
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  45%      { opacity: 0.55; transform: scale(1); }
  55%      { opacity: 0.5; transform: scale(1); }
}

/* ============================================================
   Side rail (desktop personalization)
   ============================================================ */
.rail {
  position: fixed;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  display: none;                /* mobile: hidden */
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 16px 10px;
  background: rgba(255, 253, 247, 0.6);
  border: 1px solid var(--ring);
  border-radius: 22px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}
.rail__brandmark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  text-decoration: none;
  box-shadow: var(--shadow-glow);
  transition: transform 0.4s var(--ease-spring);
}
.rail__brandmark:hover { transform: rotate(-12deg) scale(1.08); }
.rail__paw { font-size: 20px; }
.rail__links { display: flex; flex-direction: column; gap: 12px; }
.rail__links a {
  position: relative;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--text);
  background: transparent;
  transition: background 0.3s, color 0.3s, transform 0.3s var(--ease-spring);
}
.rail__links a:hover {
  background: var(--accent);
  color: #fff;
  transform: translateX(3px);
}
.rail__links a[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) scale(0.9);
  transform-origin: left center;
  white-space: nowrap;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease-spring);
}
.rail__links a:hover[data-tip]::after { opacity: 1; transform: translateY(-50%) scale(1); }

/* ============================================================
   Stage / hero
   ============================================================ */
.stage {
  position: relative;
  z-index: 5;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  /* Let pointer events fall through to the canvas, EXCEPT on interactive bits */
  pointer-events: none;
}
.stage a,
.stage button,
.stage input,
.stage .hero { pointer-events: auto; }

.hero {
  width: 100%;
  max-width: var(--maxw);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 30px 22px 34px;
  border-radius: 30px;
  background: rgba(255, 253, 247, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px) saturate(115%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

/* Logo is the page's hero — give it the most presence. */
.logo {
  width: min(420px, 90%);
  height: auto;
  margin: 4px 0 2px;
  filter: drop-shadow(0 10px 24px rgba(73, 70, 65, 0.14));
  animation: logoBob 6s ease-in-out infinite;
}
@keyframes logoBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* "Coming Soon" — refined secondary line, not the headline. */
.coming {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 5vw, 1.75rem);
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4em;
}
.coming__word { display: inline-flex; }
.coming__word--accent { color: var(--accent-deep); font-style: italic; }
.coming__char {
  display: inline-block;
  animation: charWave 3.6s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.07s);
  will-change: transform;
}
@keyframes charWave {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

.tagline {
  margin: 0;
  max-width: 30ch;
  font-size: clamp(0.98rem, 3.6vw, 1.12rem);
  line-height: 1.55;
  color: var(--text-soft);
  font-weight: 500;
}
.br-md { display: none; }

/* ============================================================
   Waitlist form
   ============================================================ */
.waitlist {
  width: 100%;
  max-width: 420px;
  margin-top: 4px;
}
.waitlist__field {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--ring);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s, border-color 0.3s;
}
.waitlist__field:focus-within {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 4px rgba(250, 193, 182, 0.35);
}
.waitlist__field input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  padding: 0 14px;
  outline: none;
}
.waitlist__field input::placeholder { color: #b3ad9f; }
.waitlist__msg {
  min-height: 1.2em;
  margin: 10px 2px 0;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: center;
  transition: color 0.3s;
}
.waitlist__msg.is-ok { color: #4a8a5c; }
.waitlist__msg.is-err { color: #c46a5c; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  --bg-btn: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  padding: 13px 22px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s, background 0.3s, color 0.3s;
}
.btn:active { transform: scale(0.96); }

.btn--primary {
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn__paw { transition: transform 0.4s var(--ease-spring); }
.btn--primary:hover .btn__paw { transform: translateX(3px) rotate(14deg); }

.ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}
.btn--insta {
  color: #fff;
  background: linear-gradient(115deg, #f9a58c, #e88aa6 55%, #c98bd1);
  box-shadow: 0 8px 22px rgba(216, 138, 166, 0.4);
}
.btn--insta:hover { transform: translateY(-2px) scale(1.02); }
.btn--insta strong { font-weight: 700; }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--ring);
}
.btn--ghost:hover {
  border-color: var(--accent-deep);
  color: var(--accent-deep);
  transform: translateY(-2px);
}

/* ============================================================
   Footer
   ============================================================ */
.foot {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-soft);
  font-weight: 500;
}
.foot__dot { opacity: 0.5; }

/* ============================================================
   WebGL fallback grid (shown only when no WebGL)
   ============================================================ */
.fallback-grid {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  padding: 24px;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  align-content: center;
  justify-items: center;
  opacity: 0.5;
  pointer-events: none;
}
.fallback-grid.is-on { display: grid; }
.fallback-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  border: 2px solid #fff;
  box-shadow: var(--shadow-md);
  animation: tileFloat 7s ease-in-out infinite;
}
@keyframes tileFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-10px) rotate(1deg); }
}

/* ============================================================
   Loader
   ============================================================ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  gap: 18px;
  background: var(--bg);
  transition: opacity 0.6s ease, visibility 0.6s;
}
.loader__paw {
  font-size: 46px;
  animation: pawPulse 1.1s ease-in-out infinite;
}
@keyframes pawPulse {
  0%, 100% { transform: scale(0.9) rotate(-6deg); opacity: 0.6; }
  50%      { transform: scale(1.1) rotate(6deg); opacity: 1; }
}
.loader__bar {
  position: absolute;
  bottom: 18%;
  width: min(220px, 50vw);
  height: 6px;
  border-radius: 999px;
  background: var(--bg-deep);
  overflow: hidden;
}
.loader__bar span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: var(--accent-deep);
  animation: loadSlide 1.2s ease-in-out infinite;
}
@keyframes loadSlide {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
body:not([data-loading]) .loader {
  opacity: 0;
  visibility: hidden;
}

/* ============================================================
   Reveal-on-load
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
}
body.is-ready [data-reveal] {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease-spring), transform 0.7s var(--ease-spring);
  transition-delay: calc(var(--r, 0) * 0.09s);
}

/* ============================================================
   Custom paw cursor trail layer
   ============================================================ */
.cursor-paw {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  font-size: 16px;
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 0;
  will-change: transform, opacity;
}

/* ============================================================
   Responsive — tablet & up
   ============================================================ */
@media (min-width: 720px) {
  :root { --maxw: 540px; }
  .br-md { display: inline; }
  .rail { display: flex; }
  .hero {
    padding: 40px 40px 44px;
    gap: 20px;
  }
  /* On PC keep the Instagram + email CTAs on a single row (like before). */
  .ctas { flex-wrap: nowrap; }
  .ctas .btn { padding: 12px 18px; font-size: 0.92rem; }
}

@media (min-width: 1024px) {
  :root { --maxw: 560px; }
  .stage { padding: 40px; }
}

/* Larger screens: float the hero slightly higher so products breathe */
@media (min-width: 1280px) and (min-height: 760px) {
  .hero { transform: translateY(-2vh); }
}

/* ---- Narrow phones: stack the waitlist so the email never truncates
        and both targets are big & easy to tap. ---- */
@media (max-width: 440px) {
  .waitlist__field {
    flex-direction: column;
    border-radius: 20px;
    padding: 8px;
    gap: 8px;
  }
  .waitlist__field input {
    width: 100%;
    text-align: center;
    padding: 13px 12px;
  }
  .waitlist__field .btn--primary {
    width: 100%;
    justify-content: center;
    padding: 14px;
  }
}

/* ============================================================
   Accessibility — reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .logo, .coming__char, .blob { animation: none !important; }
  body.is-ready [data-reveal] { transition: none; }
}
