/* ============================================================
   Mumu's Story — vet clinic scroll experience
   All body copy = [CLIENT COPY] placeholders (.ph)
   ============================================================ */

:root {
  --bg: #10142e;
  --ink: #f5f1e8;
  --muted: #b8b3d4;
  --gold: #ffc46b;
  --coral: #ff6b57;
  --coral-2: #ff8a5c;
  --glass: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.14);
  --ph-line: rgba(255, 255, 255, 0.26);
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  line-height: 1.6;
  transition: background-color 0.6s ease;
}

/* ---------- fixed layers ---------- */
#scene {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
#dim {
  position: fixed; inset: 0;
  background: #07050f;
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}
#vignette {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(5, 3, 15, 0.55) 100%);
  z-index: 1;
  pointer-events: none;
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  z-index: 20;
  background: linear-gradient(to bottom, rgba(8, 6, 20, 0.55), transparent);
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
  opacity: 0.92;
}
.topnav { display: flex; align-items: center; gap: 1.2rem; }
.navlink {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.navlink:hover { color: var(--ink); }
@media (max-width: 600px) { .navlink { display: none; } }

/* ---------- dot nav ---------- */
.dots {
  position: fixed; right: 1.1rem; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 0.85rem;
  z-index: 20;
}
.dots a {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  position: relative;
  transition: background 0.25s, transform 0.25s, border-color 0.25s;
}
.dots a.active {
  background: var(--gold);
  border-color: var(--gold);
  transform: scale(1.25);
}
.dots a::after {
  content: attr(data-label);
  position: absolute; right: 1.4rem; top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--ink);
  background: rgba(10, 8, 24, 0.85);
  border: 1px solid var(--line);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.dots a:hover::after { opacity: 1; }
@media (max-width: 760px) { .dots { display: none; } }

/* ---------- panels ---------- */
main { position: relative; z-index: 2; }

.panel {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(4.5rem, 8vh, 6rem) clamp(1.25rem, 7vw, 7rem);
  position: relative;
}
/* hero: text lives in the top band, above the character */
#hero.panel {
  align-items: flex-start;
  padding-top: clamp(5rem, 9vh, 7rem);
  justify-content: center;
  text-align: center;
}

/* cinematic chapters: taller sections with a sticky stage, so every 3D beat
   plays out across extra scroll and can't be skipped in one flick */
.panel.cine {
  display: block;
  min-height: var(--dwell, 160svh);
  padding: 0;
}
.panel.cine > .hold {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(4.5rem, 8vh, 6rem) clamp(1.25rem, 7vw, 7rem);
}
.layout-right.cine > .hold  { justify-content: flex-end; }
.layout-left.cine > .hold   { justify-content: flex-start; }
.layout-center.cine > .hold { justify-content: center; text-align: center; }
#legacy.panel.cine > .hold {
  align-items: flex-start;
  padding-top: clamp(5rem, 9vh, 7rem);
}

.layout-left   { justify-content: flex-start; }
.layout-right  { justify-content: flex-end; }
.layout-center { justify-content: center; text-align: center; }

.content { max-width: 34rem; }
.content.wide { max-width: 46rem; }
.content.center { display: flex; flex-direction: column; align-items: center; }

/* keep side-column text clear of the centered 3D subjects on narrower screens */
@media (max-width: 1100px) {
  .layout-left .content, .layout-right .content { max-width: 26rem; }
}

@media (max-width: 760px) {
  .panel { align-items: flex-end; padding-bottom: 10vh; }
  .panel.cine { padding-bottom: 0; }
  .panel.cine > .hold { align-items: flex-end; padding-bottom: 10vh; justify-content: center; }
  #legacy.panel.cine > .hold { align-items: flex-start; padding-bottom: 0; }
  #breed.panel, #cta.panel { align-items: center; padding-bottom: clamp(4.5rem, 8vh, 6rem); }
  .layout-left, .layout-right { justify-content: center; }
  /* compact placeholder copy keeps the text bands short on phones,
     which lets the 3D subjects sit higher (eye level) */
  h1.ph { font-size: 1.15rem; }
  h2.ph { font-size: 1.05rem; }
  p.ph { font-size: 0.86rem; }
}

/* ---------- typography ---------- */
.kicker {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
h1, h2 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.18;
  margin-bottom: 1rem;
}
h2.display {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
}
.sub { font-size: 1.1rem; }
.body { font-size: 1.02rem; }
.hint { margin-bottom: 1.6rem; }
.micro { font-size: 0.78rem; margin-top: 1.6rem; }

/* ---------- placeholder styling (CLIENT COPY slots) ---------- */
.ph {
  border: 1.5px dashed var(--ph-line);
  border-radius: 14px;
  padding: 0.55em 0.85em;
  color: var(--muted);
  font-style: italic;
  background: rgba(255, 255, 255, 0.04);
}
h1.ph, h2.ph {
  font-size: clamp(1.45rem, 3.4vw, 2.3rem);
  font-weight: 600;
  font-style: italic;
}
p.ph { font-size: 0.98rem; }

/* short viewports: tighter top band so the 3D stage keeps room */
@media (max-height: 850px) {
  #hero.panel, #legacy.panel.cine > .hold { padding-top: clamp(5rem, 10vh, 7rem); }
  #hero h1.ph, #legacy h2.ph { font-size: clamp(1.15rem, 2.6vw, 1.65rem); }
  #hero .sub.ph, #legacy .body.ph { font-size: 0.9rem; }
}
.asset-note {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.5rem;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  padding: 0.85em 1.7em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  letter-spacing: 0.01em;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--coral), var(--coral-2));
  color: #fff;
  box-shadow: 0 8px 28px rgba(255, 107, 87, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(255, 107, 87, 0.5);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-small { padding: 0.6em 1.25em; font-size: 0.88rem; }
.btn-big { padding: 1em 2.2em; font-size: 1.1rem; }

/* ---------- scroll cue ---------- */
.scroll-cue {
  position: absolute; bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
.chev {
  width: 12px; height: 12px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg);
  animation: cue 1.6s ease-in-out infinite;
}
@keyframes cue {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 1; }
  50%      { transform: rotate(45deg) translate(5px, 5px); opacity: 0.4; }
}
@media (prefers-reduced-motion: reduce) { .chev { animation: none; } }

/* ---------- breed finder ---------- */
#breed-form {
  display: flex;
  gap: 0.75rem;
  width: min(34rem, 100%);
  margin: 0 auto;
}
.field-wrap { position: relative; flex: 1; }
#breed-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--glass);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 0.85em 1.4em;
  outline: none;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s;
}
#breed-input:focus { border-color: var(--gold); }
#breed-input::placeholder { color: rgba(184, 179, 212, 0.6); }

#breed-suggest {
  position: absolute;
  top: calc(100% + 8px); left: 0; right: 0;
  list-style: none;
  background: rgba(14, 11, 32, 0.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  max-height: 230px;
  overflow-y: auto;
  backdrop-filter: blur(14px);
  z-index: 5;
  text-align: left;
}
#breed-suggest li {
  padding: 0.65em 1.2em;
  cursor: pointer;
  font-size: 0.95rem;
}
#breed-suggest li:hover, #breed-suggest li.hl { background: rgba(255, 196, 107, 0.14); color: var(--gold); }

@media (max-width: 560px) {
  #breed-form { flex-direction: column; }
}

/* ---------- breed result card ---------- */
.breed-card[hidden] { display: none; }
.breed-card {
  display: flex;
  gap: 1.6rem;
  align-items: center;
  width: min(44rem, 100%);
  margin: 0 auto;
  text-align: left;
  background: rgba(20, 16, 44, 0.62);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(1.2rem, 3vw, 2rem);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.card-visual {
  flex: 0 0 160px;
  text-align: center;
}
.card-visual svg {
  width: 140px; height: 140px;
  --tint: #c9b8ff;
  background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.09), transparent 70%);
  border-radius: 50%;
}
.card-visual .face  { fill: var(--tint); }
.card-visual .snout { fill: rgba(255, 255, 255, 0.75); }
.card-visual .ear   { fill: color-mix(in srgb, var(--tint) 70%, #1a1433); }
.card-visual .eye, .card-visual .nose { fill: #241d3e; }
.card-visual .mouth { stroke: #241d3e; stroke-width: 2; stroke-linecap: round; }

.card-body { flex: 1; min-width: 0; }
.card-body h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.9rem;
  color: var(--gold);
}
.card-rows .row { margin-bottom: 0.85rem; }
.card-rows dt {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.card-rows dd.ph { font-size: 0.92rem; }
.card-actions {
  display: flex; gap: 0.8rem; flex-wrap: wrap;
  margin-top: 1.3rem;
}
@media (max-width: 640px) {
  .breed-card { flex-direction: column; }
  .card-visual { flex-basis: auto; }
  .card-body { width: 100%; }
}

/* ---------- consultation form ---------- */
.consult-form {
  display: flex; flex-direction: column; gap: 0.8rem;
  width: min(26rem, 100%);
  margin-top: 1.6rem;
}
.consult-form input {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--glass);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0.85em 1.2em;
  outline: none;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s;
}
.consult-form input:focus { border-color: var(--gold); }
.consult-form input::placeholder { color: rgba(184, 179, 212, 0.6); }
.consult-form .btn { margin-top: 0.4rem; }

.foot {
  margin-top: 2.4rem;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- toast ---------- */
#toast {
  position: fixed;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 16, 44, 0.92);
  border: 1px solid var(--gold);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.8em 1.6em;
  font-size: 0.95rem;
  z-index: 50;
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
