/* WagPost v3 — typography & layout overrides (palette: original warm cream from styles.css) */

/* Accent retheme: warm terracotta replaces sage everywhere the vars are used */
:root {
  --sage: #d9764f;
  --sage-deep: #b85c39;
  --sage-soft: #f2cdb9;
}
.btn-primary:hover { box-shadow: 0 8px 28px rgba(217, 118, 79, 0.35); }
.cta-form input:focus { box-shadow: 0 0 0 4px rgba(217, 118, 79, 0.16); }
.mock-badge { background: rgba(217, 118, 79, 0.14); }
.btn-outline:hover { background: rgba(217, 118, 79, 0.06); }

body.story-body { line-height: 1.5; background: var(--cream); }

/* ---------- Logos: show real artwork, not black silhouettes ---------- */
.nav-logo-img, .brand-mark, .cta-mark, .mock-logo { filter: none; opacity: 1; }
.footer-logo {
  filter: none;
  background: #faf6ef;
  padding: 8px 14px;
  border-radius: 10px;
  box-sizing: content-box;
}

/* ---------- Proof strip: the differentiator ---------- */
.proof-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1.5rem, 5vw, 4.5rem);
  padding: 1.4rem clamp(1.25rem, 4vw, 3rem);
  background: var(--cream);
  border-top: 1px solid rgba(42, 38, 34, 0.07);
  border-bottom: 1px solid rgba(42, 38, 34, 0.07);
}
.proof-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.proof-item svg { color: var(--sage-deep); flex-shrink: 0; }

/* ---------- The Ink: live pen-writing demo ---------- */
.chapter-ink { background: var(--paper); padding: clamp(4rem, 10vw, 7rem) clamp(1.25rem, 4vw, 3rem); }
.ink-scene {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 860px) { .ink-scene { grid-template-columns: 1fr; } }
.ink-points {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.ink-points li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.ink-points li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--sage-deep);
  font-weight: 700;
}
.ink-paper {
  background: #fffdf9;
  border: 1px solid rgba(42, 38, 34, 0.08);
  border-radius: 10px;
  box-shadow: 0 24px 48px rgba(42, 38, 34, 0.10), 0 2px 8px rgba(42, 38, 34, 0.05);
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem) 1.5rem;
}
.ink-lines {
  position: relative;
  border-bottom: 1.5px solid rgba(42, 38, 34, 0.12);
  padding: 0.5rem 0 0.9rem;
}
.ink-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ink-stroke {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}
.ink-main { stroke: #1f2b56; stroke-width: 2.4; }
.ink-under { stroke: #1f2b56; stroke-width: 3.6; opacity: 0.28; } /* ink bleed */
.ink-nib { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .ink-stroke { stroke-dashoffset: 0 !important; }
  .ink-nib { display: none; }
}
.ink-caption {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
  .ink-stroke { stroke-dashoffset: 0; }
  .ink-nib { display: none; }
}

/* ---------- Hide chapter rail + chapter labels ---------- */
.chapter-rail, .chapter-label { display: none !important; }

/* ---------- Typography: tighter, calmer ---------- */
.hero-title, .section-title, .script {
  font-family: 'Shantell Sans', cursive;
  font-weight: 500;
  color: var(--ink);
}
.hero-title {
  font-size: clamp(2.05rem, 4.1vw, 3.05rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
}
.hero-lede {
  font-size: clamp(0.98rem, 1.5vw, 1.08rem);
  line-height: 1.5;
  max-width: 26rem;
  margin: 0.9rem 0 1.5rem;
}
.hero-kicker { margin-bottom: 0.9rem; }
.section-title {
  font-size: clamp(1.7rem, 3.2vw, 2.35rem);
  line-height: 1.06;
  margin-bottom: 0.6rem;
}
.hero-line-em, .cta-title { color: var(--sage-deep); }
.eyebrow { letter-spacing: 0.16em; }
.section-sub { line-height: 1.5; font-size: 1rem; }
.eyebrow { margin-bottom: 0.55rem; }
.story-text { line-height: 1.6; font-size: 1rem; }
.quote { line-height: 1.55; }
.cta-sub { line-height: 1.55; }
.ritual-step h3 { line-height: 1.1; }

/* ---------- Continuous background: no break nav → hero → marquee ---------- */
.nav { background: transparent; }
.nav.scrolled {
  background: rgba(250, 246, 239, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(125, 144, 128, 0.12);
}
.chapter-hero {
  background: linear-gradient(180deg, #fbf7ef 0%, #f5ede0 58%, var(--cream) 100%);
}
.hero-table, .hero-vignette { display: none; }
.moments { background: var(--cream); border-top: none; }
.chapter-story { background: linear-gradient(180deg, var(--cream) 0%, var(--paper) 100%); }
.chapter-how { background: linear-gradient(180deg, var(--paper) 0%, #f5eee1 100%); }
.chapter-gallery { background: linear-gradient(180deg, #f5eee1 0%, var(--cream) 100%); }
.chapter-clinics { background: linear-gradient(180deg, var(--cream) 0%, var(--paper) 100%); }
.chapter-voices { background: linear-gradient(180deg, var(--paper) 0%, #f5eee1 100%); }
.chapter-pricing { background: linear-gradient(180deg, #f5eee1 0%, var(--cream) 100%); }
.chapter-cta { background: linear-gradient(180deg, var(--cream) 0%, #f3ebe0 100%); }

/* ---------- Hero layout: keep the fan inside the first fold ---------- */
.chapter-hero {
  min-height: 100svh;
  max-height: none;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(84px, 12vh, 120px) clamp(1.25rem, 4vw, 3rem) 0;
  box-sizing: border-box;
}
.hero-inner {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  align-items: start;
  justify-items: center;
  gap: clamp(0.75rem, 2vh, 1.75rem);
}
.hero-copy { text-align: center; margin: 0; max-width: 42rem; }
.hero-lede { margin: 0.9rem auto 1.5rem; }
.hero-cta-row { justify-content: center; }

/* ---------- Hero card arc (fan on a wheel; sways + rotates on scroll) ---------- */
.hero-arc {
  --arc-r: clamp(500px, 92vh, 820px);
  position: relative;
  width: 100%;
  align-self: stretch;
  height: 100%;
  min-height: 220px;
  max-height: 48svh;
  overflow: visible;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 7%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 7%, #000 100%);
}
.arc-wheel {
  position: absolute;
  left: 50%;
  bottom: calc(115px - var(--arc-r));
  width: 0;
  height: 0;
  will-change: transform;
}
.arc-card {
  position: absolute;
  left: 0;
  top: 0;
  width: 186px;
  height: 258px;
  margin: -129px 0 0 -93px;
  transform: rotate(var(--a)) translateY(calc(-1 * var(--arc-r)));
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 16px 34px rgba(44, 53, 47, 0.16), 0 2px 6px rgba(44, 53, 47, 0.07);
  will-change: opacity;
}
.arc-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
}
@media (max-width: 1100px) {
  .arc-card { width: 150px; height: 208px; margin: -104px 0 0 -75px; }
  .arc-wheel { bottom: calc(90px - var(--arc-r)); }
}
@media (max-width: 720px) {
  .hero-arc { min-height: 200px; max-height: 36svh; }
  .arc-card { width: 120px; height: 166px; margin: -83px 0 0 -60px; }
  .arc-wheel { bottom: calc(70px - var(--arc-r)); }
}

/* ---------- Ritual compose: tilted front peek + full-width writing panel ---------- */
.ritual-card, .ritual-card-inner, .ritual-face.ritual-compose { overflow: visible; }
.ritual-compose { background: transparent; }
.compose-peek {
  position: absolute;
  left: -38%;
  top: 4%;
  width: 58%;
  height: auto;
  transform: rotate(-10deg);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(44, 53, 47, 0.22);
  filter: none;
  opacity: 1;
}
.ritual-compose-overlay {
  position: absolute;
  inset: 0;
  width: auto;
  background: #ffffff;
  border-radius: inherit;
  border-left: none;
  border-right: none;
  padding: clamp(0.9rem, 2.2vh, 1.5rem) clamp(0.9rem, 1.8vw, 1.4rem);
  display: block;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(44, 53, 47, 0.14);
}
.ritual-compose-overlay p {
  font-family: 'Caveat', cursive;
  font-size: clamp(1rem, 1.9vh, 1.3rem);
  line-height: 1.3;
  color: var(--ink);
  white-space: pre-line;
  margin: 0;
}
.ritual-compose-overlay .compose-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--sage);
  vertical-align: -0.15em;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

/* ---------- Ritual send: the card slips INSIDE the envelope ---------- */
.ritual-send { background: linear-gradient(180deg, #faf5ea, #f3ecdd); }
.send-scene { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.env {
  position: absolute;
  left: 50%;
  bottom: 12%;
  width: 62%;
  aspect-ratio: 200/130;
  transform: translateX(-50%);
  perspective: 700px;
}
.env-back {
  position: absolute;
  inset: 0;
  background: #f6f1e6;
  border: 2.5px solid #2c352f;
  border-radius: 6px;
  z-index: 1;
}
/* mask: clips the card at the envelope opening so it visibly goes inside */
.send-mask {
  position: absolute;
  left: -22%;
  width: 144%;
  top: -125%;
  height: 143%;
  overflow: hidden;
  z-index: 2;
  pointer-events: none;
}
.ritual-face .send-mask img.send-mini {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: -2%;
  width: 34%;
  height: auto;
  object-fit: unset;
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(44, 53, 47, 0.2);
  transform: translate(-50%, -80%) rotate(-6deg);
  transform-origin: 50% 100%;
}
.env-rim-shadow {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 14%;
  height: 11%;
  background: linear-gradient(180deg, rgba(44, 53, 47, 0.30), transparent);
  border-radius: 4px 4px 50% 50%;
  opacity: 0;
  z-index: 3;
}
.env-front { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; z-index: 4; }
.env-flap {
  position: absolute;
  left: 0;
  top: 1%;
  width: 100%;
  height: 64%;
  z-index: 6;
  transform-origin: 50% 4%;
  transform: rotateX(165deg);
}
.env-sent {
  position: absolute;
  left: 50%;
  bottom: 3%;
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  font-family: 'Caveat', cursive;
  font-size: clamp(1rem, 2vh, 1.3rem);
  color: var(--sage-deep);
  z-index: 5;
  white-space: nowrap;
}
/* Timeline: env in -> card drops & slips in -> rim shadow -> tilt -> flap -> pop -> fly off -> note */
.env-stamp {
  position: absolute;
  top: 7%;
  right: 5%;
  width: 17%;
  z-index: 7;
  opacity: 0;
  transform: rotate(4deg) scale(1.6);
}
.ritual-card[data-face="send"] .env-stamp { animation: wag-stamp-in 0.35s cubic-bezier(0.2, 0, 0.3, 1.4) 2.3s forwards; }
@keyframes wag-stamp-in {
  from { opacity: 0; transform: rotate(4deg) scale(1.6); }
  to   { opacity: 1; transform: rotate(4deg) scale(1); }
}
.ritual-card[data-face="send"] .env { animation: wag-env-in 0.5s var(--ease) both, wag-env-center 0.8s var(--ease) 2.95s forwards; }
.ritual-card[data-face="send"] .send-mini { animation: wag-card-slip 1.4s cubic-bezier(0.45, 0, 0.35, 1) 0.25s forwards; }
.ritual-card[data-face="send"] .env-rim-shadow { animation: wag-rim-in 0.45s ease-out 1s forwards; }
.ritual-card[data-face="send"] .env-flap { animation: wag-flap-close 0.5s ease-out 1.75s forwards; }
.ritual-card[data-face="send"] .env-sent { animation: wag-sent-in 0.6s var(--ease) 3.5s forwards; }
@keyframes wag-env-in {
  from { transform: translateX(-50%) translateY(26px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}
@keyframes wag-env-center {
  0%   { transform: translateX(-50%) translateY(0) scale(1); }
  40%  { transform: translateX(-38%) translateY(-70%) rotate(4deg) scale(0.82); }
  100% { transform: translateX(-16%) translateY(-125%) rotate(9deg) scale(0.62); }
}
@keyframes wag-card-slip {
  0%   { transform: translate(-50%, -80%) rotate(-6deg); }
  45%  { transform: translate(-50%, -22%) rotate(-2deg); }
  100% { transform: translate(-50%, 108%) rotate(0deg); }
}
@keyframes wag-rim-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes wag-env-tilt {
  0% { transform: translateX(-50%) rotate(0deg); }
  35% { transform: translateX(-50%) rotate(-2.2deg) translateY(3px); }
  100% { transform: translateX(-50%) rotate(0deg); }
}
@keyframes wag-flap-close {
  from { transform: rotateX(165deg); }
  to   { transform: rotateX(0deg); }
}
@keyframes wag-env-pop {
  0% { transform: translateX(-50%) scale(1); }
  40% { transform: translateX(-50%) scale(1.06) rotate(-1.5deg); }
  100% { transform: translateX(-50%) scale(1); }
}
@keyframes wag-env-fly {
  0%   { transform: translateX(-50%) translateY(0) rotate(0deg); opacity: 1; }
  30%  { transform: translateX(-48%) translateY(6%) rotate(2deg); }
  100% { transform: translateX(-20%) translateY(-190%) rotate(12deg) scale(0.85); opacity: 1; }
}
@keyframes wag-sent-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .ritual-card[data-face="send"] .env { animation: none; }
  .ritual-card[data-face="send"] .send-mini { animation: none; transform: translate(-50%, 108%); }
  .ritual-card[data-face="send"] .env-flap { animation: none; transform: rotateX(0deg); }
  .ritual-card[data-face="send"] .env-rim-shadow { animation: none; opacity: 1; }
  .ritual-card[data-face="send"] .env-sent { animation: none; opacity: 1; transform: translateX(-50%); }
}

@media (max-height: 700px) {
  .hero-scroll { display: none; }
}

/* ---------- Scroll reveals for section headers ---------- */
.rev {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}
.rev.is-rev { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rev { opacity: 1; transform: none; transition: none; }
}
