/* CRAZIFY visual preview — stand-ins for assets that were not in the handoff package,
   plus a phone-width frame so the mobile-only site can be reviewed on a desktop. */

:root {
  --paper: #F9EFE7;
  --ink: #111111;
  --orange: #e85d1c;
  --purple: #5939a3;
  --brush: "Permanent Marker", "Fredoka", cursive;
  --sans: "Outfit", "Fredoka", "Segoe UI", sans-serif;
}

.stage { container-type: inline-size; }

.preview-ribbon-unused {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  padding: 5px 10px;
  text-align: center;
  font: 600 11px/1.3 var(--sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff8f2;
  background: rgba(17, 17, 17, 0.82);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* Desktop: show the mobile page in a phone-width column */
@media (min-width: 640px) {
  html, body { background: #efe6da; }
  .viewport-frame {
    max-width: 430px;
    margin: 28px auto 48px;
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(60, 35, 15, 0.22), 0 0 0 1px rgba(60, 35, 15, 0.08);
    overflow: hidden;
  }
  .modal-sheet, .placement-editor-sheet { max-width: 430px; }
}

/* ---------- Stage 1: CTA face (painted crop was not in the package) ---------- */
.cta-face-css {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  background: var(--orange);
  color: #fff;
  font: 700 3.6cqw/1 "Fredoka", sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-radius: 999px;
  box-shadow: 0 3px 0 rgba(120, 40, 10, 0.35), 0 8px 18px rgba(232, 93, 28, 0.25);
  transform: rotate(-1.5deg);
  white-space: nowrap;
}
.cta-face-css svg { width: 1em; height: 1em; }
#stage-01 .cta-crop.cta-face-css {
  position: absolute;
  left: calc(var(--nx) * 100%);
  top: calc(var(--ny) * 100%);
  width: calc(var(--nw) * 100%);
  height: calc(var(--nh) * 100%);
  z-index: 30;
  pointer-events: none;
}

/* ---------- Stage 2B: heading (background image was not in the package) ---------- */
#stage-02b.stage-02b-direct { padding-bottom: 6cqw; }
#stage-02b .result-heading {
  width: 100%;
  padding: 9cqw 7cqw 5cqw;
  text-align: left;
  pointer-events: none;
}
.h-brush {
  margin: 0;
  font: 400 11.5cqw/0.98 var(--brush);
  color: var(--ink);
  letter-spacing: -0.01em;
}
.h-brush span { color: var(--orange); }
#stage-02b .h-sub {
  margin: 3cqw 0 0;
  font: 500 3.9cqw/1.35 var(--sans);
  color: #3a2a22;
}

/* ---------- Case guide: whole stage is a stand-in (base image + button crops missing) ---------- */
#stage-case-guide.guide-standin {
  aspect-ratio: auto;
  height: auto;
  overflow: hidden;
  line-height: normal;
  background: var(--paper);
}
.guide-inner {
  position: relative;
  z-index: 3;
  padding: 10cqw 6cqw 8cqw;
  display: flex;
  flex-direction: column;
  gap: 5cqw;
}
.guide-title { font-size: 10.5cqw; }
.guide-sub {
  margin: -2cqw 0 1cqw;
  font: 500 3.9cqw/1.35 var(--sans);
  color: #3a2a22;
}
.guide-card {
  position: relative;
  display: grid;
  grid-template-columns: 30cqw 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 4cqw;
  row-gap: 1.6cqw;
  padding: 4cqw;
  border: 1.5px dashed rgba(17, 17, 17, 0.55);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.35);
}
.guide-card:nth-child(odd) { transform: rotate(-0.4deg); }
.guide-card:nth-child(even) { transform: rotate(0.35deg); }
.guide-art {
  grid-row: 1 / span 3;
  align-self: center;
  position: relative;
  height: 44cqw;
  display: flex;
  align-items: center;
  justify-content: center;
}
.guide-phone {
  position: relative;
  width: 21cqw;
  height: 42cqw;
  border-radius: 4.2cqw;
  background:
    radial-gradient(120% 90% at 30% 10%, rgba(255,255,255,0.35), transparent 40%),
    linear-gradient(160deg, #3b6ea8 0%, #c97b3a 45%, #1f2a44 100%);
  box-shadow: 0 10px 22px rgba(40, 24, 16, 0.25);
}
.guide-phone::before {
  content: "";
  position: absolute;
  left: 2cqw; top: 2cqw;
  width: 7cqw; height: 7cqw;
  border-radius: 2cqw;
  background: #15120f;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}
.guide-art-clear .guide-phone { outline: 1.2cqw solid rgba(255,255,255,0.55); outline-offset: -0.2cqw; }
.guide-art-tough .guide-phone { outline: 1.6cqw solid #1b1b1b; outline-offset: 0.2cqw; }
.guide-art-magsafe .guide-phone { outline: 1.6cqw solid #1b1b1b; outline-offset: 0.2cqw; }
.guide-ring {
  position: absolute;
  width: 13cqw; height: 13cqw;
  border-radius: 50%;
  border: 1.1cqw solid rgba(255,255,255,0.7);
  box-shadow: 0 0 0 0.6cqw rgba(0,0,0,0.25);
  top: 44%;
}
.guide-name {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2cqw;
  font: 400 6cqw/1.05 var(--brush);
  color: var(--ink);
}
.guide-price { font: 700 4.2cqw/1 "Fredoka", sans-serif; color: var(--orange); white-space: nowrap; }
.guide-desc {
  margin: 0;
  font: 500 3.6cqw/1.4 var(--sans);
  color: #3a2a22;
}
#stage-case-guide.guide-standin .case-guide-cta {
  position: relative;
  left: auto; top: auto;
  width: 100%;
  height: auto;
  min-height: 44px;
  margin: 0.5cqw 0 0;
  padding: 0 4cqw;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font: 700 3.5cqw/1 "Fredoka", sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2cqw;
  box-sizing: border-box;
  box-shadow: 0 3px 0 rgba(40, 24, 60, 0.35);
  transition: transform 140ms ease, filter 140ms ease, background-color 140ms ease;
}
#stage-case-guide.guide-standin .case-guide-cta .chev {
  width: 2.4cqw; height: 2.4cqw;
  border-right: 2px solid #fff; border-top: 2px solid #fff;
  transform: rotate(45deg);
}
#stage-case-guide.guide-standin .case-guide-cta.is-selected { background: var(--ink); }

/* ---------- Stage 3B: keep the preview column readable ---------- */
.printful-mockup-status { font-size: 3cqw !important; }
.printful-mockup-note { font-size: 2.7cqw !important; }

/* ---------- Stage 4: CTA face + clipped canvas ---------- */
#stage-04 { aspect-ratio: 1152 / 1290; }
#stage-04 .clean-canvas { height: auto; object-fit: fill; }
#stage-04 .cta-face-make {
  width: 100%;
  min-height: 44px;
  padding: 2.4cqw 0;
  font-size: 3.4cqw;
  transform: none;
  border-radius: 14px;
}

/* ---------- Footer (stands in for the removed testimonial strip) ---------- */
.site-footer {
  position: relative;
  z-index: 2;
  padding: 28px 24px 36px;
  text-align: center;
  background: var(--paper);
  border-top: 1px dashed rgba(17, 17, 17, 0.35);
  font-family: var(--sans);
  color: #3a2a22;
}
.footer-brand { margin: 0 0 6px; font: 400 26px/1 var(--brush); color: var(--ink); }
.footer-line { margin: 0 0 4px; font-size: 13px; line-height: 1.4; }
.footer-small { font-size: 11px; opacity: 0.7; }

/* When a product mockup is ready, show only it (not the local placement canvas as well) */
.printful-mockup-wrap[data-state="ready"] .placement-local-canvas,
.printful-mockup-wrap[data-state="ready"] .placement-local-label { display: none !important; }
#stage-04 .summary-divider { display: none; }
#stage-04 .cta-face-make { padding: 1.9cqw 0; font-size: 3.1cqw; }
#stage-04 .hit-cta { top: 55%; }
#stage-case-guide.guide-standin .case-guide-cta { font-size: 3.1cqw; white-space: nowrap; letter-spacing: 0.02em; }

/* fine-tuning from the user walk-through */
#stage-03b .native-select { font-size: 11px; padding: 0 20px 0 9px; background-position: right 8px center; }

/* ---- round 2 fixes ---- */
/* 2. message example panels: live crops that see-saw */
#stage-03a .seesaw-panel {
  position: absolute;
  left: calc(var(--nx) * 100%); top: calc(var(--ny) * 100%);
  width: calc(var(--nw) * 100%); height: calc(var(--nh) * 100%);
  object-fit: fill; pointer-events: none; user-select: none; z-index: 20;
}
#stage-03a .seesaw-left { transform-origin: 100% 100%; animation: cz-seesaw-l 3.8s ease-in-out infinite; }
#stage-03a .seesaw-right { transform-origin: 0% 100%; animation: cz-seesaw-r 3.8s ease-in-out infinite; }
@keyframes cz-seesaw-l { 0%,100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.2deg) translateY(-1.2%); } }
@keyframes cz-seesaw-r { 0%,100% { transform: rotate(1.2deg) translateY(-1.2%); } 50% { transform: rotate(-1.6deg); } }
/* 3. case guide name/price: never overflow the card */
.guide-name { flex-wrap: wrap; font-size: 5.4cqw; }
.guide-price { font-size: 3.9cqw; }
.guide-card { grid-template-columns: 27cqw 1fr; }
/* 4. stage 3B: moved painted heading + readable multi-line status */
#stage-03b .moved-heading {
  position: absolute;
  left: calc(var(--nx) * 100%); top: calc(var(--ny) * 100%);
  width: calc(var(--nw) * 100%); height: calc(var(--nh) * 100%);
  object-fit: fill; pointer-events: none; z-index: 20;
}
#stage-03b .printful-mockup-status, #stage-03b .printful-mockup-note, #stage-03b .placement-local-label { line-height: 1.3; }
#stage-03b .printful-mockup-wrap { top: 21%; height: 76%; }
/* 5. stage 4: approval and CTA below the monkey, two lines max */
#stage-04 .approval { top: 35%; width: 84%; }
#approval-label { font-size: clamp(8px, 2.15vw, 9.5px); }
#stage-04 .hit-cta { top: 58%; }
#stage-04 .cta-face-make { padding: 1.5cqw 0; font-size: 2.9cqw; }
/* footer links */
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 10px 0 8px; }
.footer-links a { color: #111; font: 600 12px/1 var(--sans); text-decoration: none; border-bottom: 1.5px solid rgba(17,17,17,0.35); padding-bottom: 2px; }
.footer-links a:hover { color: var(--orange); border-color: var(--orange); }
/* while a placement preview or mockup is shown, the painted demo phones step aside */
#stage-03b:has(.placement-local-canvas:not([hidden])) > .clean-canvas { visibility: hidden; }

/* ---- round 3 ---- */
/* 1. less air between the result buttons and the case guide */
#stage-02b.stage-02b-direct { padding-bottom: 0; }
.guide-inner { padding-top: 5cqw; }
/* 3. case guide: grid children may shrink; smaller purple buttons */
.guide-card > * { min-width: 0; }
.guide-name { font-size: 5.2cqw; }
.guide-price { font-size: 3.6cqw; }
#stage-case-guide.guide-standin .case-guide-cta { min-height: 40px; height: 10.5cqw; font-size: 2.8cqw; padding: 0 3cqw; margin-top: 0.8cqw; }
/* 4. idle status sentence sits under the painted phones, not on them */
#stage-03b .printful-mockup-wrap[data-state="idle"] { justify-content: flex-end; padding-bottom: 0; }
#stage-03b:has(.placement-local-canvas:not([hidden])) .printful-mockup-wrap[data-state="idle"] { justify-content: flex-start; }
/* 5. stage-4 live text in the site's own font */
#stage-04 .summary-model, #stage-04 .summary-case, #stage-04 .summary-price, #stage-04 .live-credit, #approval-label {
  font-family: "Fredoka", "Outfit", sans-serif;
}
#approval-label { font-weight: 500; letter-spacing: 0.005em; }
#stage-04 .summary-model, #stage-04 .summary-price { font-weight: 700; }
/* 6. footer */
.site-footer { text-align: left; padding: 26px 20px 36px; }
.footer-brand { text-align: center; }
.footer-tag { margin: 0 0 12px; text-align: center; font: 500 13px/1.4 var(--sans); color: #3a2a22; }
.footer-links { justify-content: center; margin: 0 0 18px; }
.footer-sec { border-top: 1px dashed rgba(17,17,17,0.3); padding: 10px 0; }
.footer-sec:last-of-type { border-bottom: 1px dashed rgba(17,17,17,0.3); margin-bottom: 16px; }
.footer-sec summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; font: 400 20px/1.2 var(--brush); color: var(--ink); padding: 4px 0; }
.footer-sec summary::-webkit-details-marker { display: none; }
.footer-sec summary::after { content: "+"; font: 700 20px/1 "Fredoka", sans-serif; color: var(--orange); transition: rotate 200ms ease; }
.footer-sec[open] summary::after { rotate: 45deg; }
.footer-sec p, .footer-sec dd { margin: 0 0 10px; font: 400 13px/1.5 var(--sans); color: #2a1f1a; }
.footer-sec dl { margin: 6px 0 0; }
.footer-sec dt { margin: 8px 0 2px; font: 600 13px/1.3 "Fredoka", sans-serif; color: var(--ink); }
.footer-sec strong { font-weight: 600; color: var(--ink); }
.footer-mail { color: var(--orange); font-weight: 600; text-decoration: none; border-bottom: 1.5px solid currentColor; }
.fill-in { background: #fff3c4; border-radius: 4px; padding: 0 4px; }
.footer-line { text-align: center; }

/* ---- originals restored ---- */
.preview-ribbon-unused { top: auto; bottom: 10px; left: auto; right: 10px; border-radius: 999px; padding: 6px 10px; font-size: 10px; opacity: 0.85; }
#stage-02b.stage-02b-direct { padding-bottom: 0; }
#stage-02b .result-actions { margin-bottom: 0; }
#stage-04 .hit-cta { top: 57.9%; }
#stage-04 .approval { top: 30%; width: 85.7%; }

/* ---- round 4 ---- */
#stage-02b.stage-02b-direct { padding-bottom: 5cqw; }
#stage-02b .result-actions { position: relative; z-index: 60; }

/* hidden means hidden — display:block on canvas/img used to override the attribute */
#stage-03b .printful-mockup-wrap [hidden] { display: none !important; }

/* clipped bottoms blend into the page paper */
#stage-04::after { height: 14px !important; }
#stage-02b.stage-02b-direct::after, #stage-04::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 28px; z-index: 3; pointer-events: none;
  background: linear-gradient(to bottom, rgba(249,239,231,0), #F9EFE7);
}
