/* Sketchbook quote overlay — scoped scene from spruce-works-design-vibe.html.
   Does not restyle the main customer hub. */

#quoteDecisionOverlay {
  --ink: #1a1612;
  --paper: #efe6d2;
  --paper-2: #e8dcc4;
  --paper-deep: #d9c9a8;
  --red: #7a1515;
  --gold: #c9a86c;
  --cream: #f5e6d8;
  --typewriter: "Special Elite", ui-monospace, monospace;
  --display: "Libre Baskerville", Georgia, serif;
  --house-scale: 1.05;
  --pencil: #2a241e;
  --graphite: #4a423a;
  --brick: #b56b52;
  --mortar: rgba(42, 36, 30, 0.48);
  --wood: #5c4030;
  --glass: #e8dcc8;
  --t-spin: 2.4s;
  --t-morph: 2.9s;
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: grid;
  place-items: center;
  padding: 18px 12px 24px;
  /* Overflow + a live 3D cover flattens into a cream sheet on iPhone Safari. */
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#quoteDecisionOverlay[hidden] {
  display: none;
}

body.quote-decision-open {
  overflow: hidden;
}

.quote-scene-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(201, 168, 108, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(122, 21, 21, 0.1), transparent 50%),
    linear-gradient(180deg, #2a2218 0%, #1a1510 40%, #12100c 100%);
}

.quote-scene-book {
  position: relative;
  width: min(560px, 94vw);
  z-index: 1;
}

.quote-scene-book .book-back {
  position: absolute;
  inset: -5px -7px -7px -11px;
  background:
    repeating-linear-gradient(118deg, transparent 0 2px, rgba(42, 36, 30, 0.06) 2px 3px),
    linear-gradient(160deg, #6b4228 0%, #5a3620 55%, #4a2c1a 100%);
  border-radius: 3px 10px 10px 4px;
  box-shadow: 0 44px 100px rgba(0, 0, 0, 0.55);
  z-index: 0;
  pointer-events: none;
}

.quote-scene-book .book-spine {
  position: absolute;
  left: -8px;
  top: -2px;
  bottom: -3px;
  width: 14px;
  background: linear-gradient(90deg, #3a2416 0%, #5c3a22 38%, #2e1c12 100%);
  border-radius: 3px 0 0 3px;
  box-shadow: inset -1px 0 0 rgba(242, 235, 224, 0.12);
  z-index: 2;
  pointer-events: none;
}

.quote-scene-book .book-spine::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 10%;
  bottom: 10%;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(201, 168, 108, 0.45), transparent);
  border-radius: 1px;
}

.quote-scene-book .book-edge {
  position: absolute;
  right: -6px;
  top: 10px;
  bottom: 10px;
  width: 6px;
  background: repeating-linear-gradient(180deg, #f2ebe0 0 2px, #d9c9a8 2px 3px, #cfc0a4 3px 4px);
  border-radius: 0 2px 2px 0;
  z-index: 2;
  pointer-events: none;
}

.quote-scene-book .book-ribbon {
  position: absolute;
  right: 18%;
  top: -10px;
  width: 10px;
  height: 42px;
  background: linear-gradient(180deg, #7a1515, #5c1010);
  clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%);
  z-index: 3;
  pointer-events: none;
}

.quote-scene-page {
  width: 100%;
  background:
    radial-gradient(ellipse at 18% 8%, rgba(255, 255, 255, 0.4), transparent 42%),
    radial-gradient(ellipse at 88% 92%, rgba(122, 21, 21, 0.04), transparent 40%),
    linear-gradient(165deg, var(--paper) 0%, var(--paper-2) 55%, var(--paper-deep) 100%);
  border-radius: 2px 8px 8px 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  padding: 22px 22px 20px;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.quote-scene-sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

.quote-scene-sun {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 54px;
  height: 54px;
  opacity: 0;
  transform: scale(0.82) rotate(-8deg);
  animation: quoteSunIn 0.7s cubic-bezier(0.2, 0.9, 0.2, 1) calc(var(--t-morph) + 0.35s) forwards;
}

.quote-scene-sun svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.quote-scene-cloud {
  position: absolute;
  opacity: 0;
}

.quote-scene-cloud svg {
  display: block;
  width: 100%;
  height: 100%;
}

.quote-scene-cloud--a {
  width: 88px;
  height: 42px;
  top: 10px;
  left: 8px;
  animation: quoteCloudIn 0.7s ease calc(var(--t-morph) + 0.5s) forwards;
}

.quote-scene-cloud--b {
  width: 62px;
  height: 32px;
  top: 28px;
  left: 38%;
  animation: quoteCloudIn 0.7s ease calc(var(--t-morph) + 0.75s) forwards;
}

.quote-scene-house-stage {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: min(280px, 78vw);
  height: calc(190px * var(--house-scale) + 8px);
  margin: 0 auto 8px;
  position: relative;
  z-index: 1;
}

.quote-scene-house-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.quote-scene-house {
  width: 220px;
  height: 190px;
  position: relative;
  transform: scale(var(--house-scale));
  transform-origin: center bottom;
}

.quote-scene-house > * {
  position: absolute;
}

.quote-scene-ground {
  left: 10px;
  right: 10px;
  bottom: 18px;
  height: 6px;
  background:
    repeating-linear-gradient(90deg, var(--pencil) 0 4px, var(--graphite) 4px 6px, var(--pencil) 6px 12px, transparent 12px 14px);
  background-color: var(--pencil);
  border-radius: 2px 3px 1px 2px;
  opacity: 0;
  animation: quoteBaseToGround 0.4s ease var(--t-morph) forwards;
}

.quote-scene-wall {
  left: 48px;
  bottom: 28px;
  width: 124px;
  height: 78px;
  background: #2a241c;
  border: 2.5px solid var(--pencil);
  border-radius: 2px 3px 1px 2px;
  opacity: 0;
  transform: scaleY(0.15);
  transform-origin: bottom;
  overflow: hidden;
  z-index: 2;
  animation:
    quoteBuildUp 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) 0.35s forwards,
    quoteScreenToWall 0.45s ease calc(var(--t-morph) + 0.05s) forwards;
}

.quote-scene-bricks {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, transparent 0 10px, var(--mortar) 10px 11px),
    repeating-linear-gradient(90deg, var(--brick) 0 17px, var(--mortar) 17px 18px, #c47860 18px 35px, var(--mortar) 35px 36px);
  animation: quoteBrickReveal 0.45s ease calc(var(--t-morph) + 0.05s) forwards;
}

.quote-scene-browser {
  position: absolute;
  inset: 5px 5px 6px;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1.5px solid var(--pencil);
  border-radius: 2px 3px 2px 1px;
  opacity: 0;
  transform: scale(0.92);
  transform-origin: top center;
  animation: quoteBrowserIn 0.35s ease 0.7s forwards, quoteFadeOut 0.35s ease calc(var(--t-morph) + 0.05s) forwards;
  overflow: hidden;
  z-index: 3;
}

.quote-scene-browser-bar {
  height: 12px;
  background: var(--paper-deep);
  border-bottom: 1px solid var(--pencil);
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 5px;
}

.quote-scene-browser-bar i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--pencil);
  opacity: 0.55;
}

.quote-scene-browser-bar i:nth-child(1) { background: var(--red); opacity: 0.85; }
.quote-scene-browser-bar i:nth-child(2) { background: var(--gold); opacity: 0.9; }

.quote-scene-addr {
  margin: 3px 4px 0;
  height: 11px;
  background: #fffdf7;
  border: 1px solid var(--pencil);
  border-radius: 1px 2px 1px 2px;
  display: flex;
  align-items: center;
  padding: 0 4px;
  overflow: hidden;
}

.quote-scene-addr-text {
  font-family: var(--typewriter);
  font-size: 8px;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
}

.quote-scene-addr-caret {
  display: inline-block;
  width: 1px;
  height: 7px;
  margin-left: 1px;
  background: var(--ink);
  animation: quoteBlink 0.45s step-end infinite, quoteCursorHide 0.01s linear var(--t-morph) forwards;
}

.quote-scene-browser-body {
  flex: 1;
  margin: 3px 4px 4px;
  background: var(--cream);
  border: 1px solid rgba(26, 22, 18, 0.25);
}

.quote-scene-roof {
  left: 36px;
  bottom: 102px;
  width: 148px;
  height: 62px;
  opacity: 0;
  transform: translateY(-18px) scale(0.9);
  transform-origin: center bottom;
  animation: quoteRoofDrop 0.45s cubic-bezier(0.2, 0.9, 0.2, 1.1) calc(var(--t-morph) + 0.1s) forwards;
  z-index: 3;
  pointer-events: none;
}

.quote-scene-roof svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.quote-scene-chimney {
  left: 142px;
  bottom: 120px;
  width: 18px;
  height: 36px;
  background: #d4c2a6;
  border: 2px solid var(--pencil);
  border-radius: 1px 2px 1px 1px;
  opacity: 0;
  transform: translateY(10px) rotate(1deg);
  animation: quoteChimneyIn 0.35s ease calc(var(--t-morph) + 0.3s) forwards;
  z-index: 2;
}

.quote-scene-chimney::after {
  content: "";
  position: absolute;
  left: -4px;
  top: -6px;
  right: -4px;
  height: 8px;
  background: var(--pencil);
  border-radius: 1px 2px 0 0;
}

.quote-scene-door {
  left: 96px;
  bottom: 30px;
  width: 28px;
  height: 46px;
  background: linear-gradient(180deg, #6b4a38 0%, var(--wood) 55%, #4a3226 100%);
  border: 2px solid var(--pencil);
  border-radius: 2px 1px 1px 2px;
  opacity: 0;
  transform: scaleY(0.1);
  transform-origin: bottom;
  animation: quoteBuildUp 0.35s ease calc(var(--t-morph) + 0.4s) forwards;
  z-index: 4;
}

.quote-scene-door::after {
  content: "";
  position: absolute;
  right: 5px;
  top: 52%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  border: 1.2px solid var(--pencil);
}

.quote-scene-win {
  width: 28px;
  height: 28px;
  background: linear-gradient(160deg, rgba(245, 230, 216, 0.95) 0%, var(--glass) 100%);
  border: 2.5px solid var(--pencil);
  border-radius: 2px 1px 2px 1px;
  opacity: 0;
  z-index: 4;
}

.quote-scene-win::before,
.quote-scene-win::after {
  content: "";
  position: absolute;
  background: var(--pencil);
}

.quote-scene-win::before {
  left: 50%;
  top: 1px;
  bottom: 1px;
  width: 2px;
  transform: translateX(-50%);
}

.quote-scene-win::after {
  top: 50%;
  left: 1px;
  right: 1px;
  height: 2px;
  transform: translateY(-50%);
}

.quote-scene-win-l {
  left: 60px;
  bottom: 62px;
  animation: quoteWinPop 0.3s ease calc(var(--t-morph) + 0.55s) forwards;
}

.quote-scene-win-r {
  left: 132px;
  bottom: 62px;
  animation: quoteWinPop 0.3s ease calc(var(--t-morph) + 0.7s) forwards;
}

.quote-scene-shrub {
  width: 42px;
  height: 30px;
  bottom: 16px;
  border-radius: 20px 20px 8px 8px;
  background: #546344;
  border: 2px solid var(--pencil);
  opacity: 0;
  transform-origin: center bottom;
  z-index: 5;
}

.quote-scene-shrub-l {
  left: 14px;
  animation: quoteShrubPop 0.35s cubic-bezier(0.2, 1.1, 0.3, 1) calc(var(--t-morph) + 0.85s) forwards;
}

.quote-scene-shrub-r {
  right: 14px;
  left: auto;
  animation: quoteShrubPop 0.35s cubic-bezier(0.2, 1.1, 0.3, 1) calc(var(--t-morph) + 0.95s) forwards;
}

.quote-scene-front {
  position: relative;
  z-index: 2;
  text-align: center;
}

.quote-scene-eyebrow {
  margin: 0 0 6px;
  font-family: var(--typewriter);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
}

.quote-scene-title {
  margin: 0 0 10px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.35rem, 4vw, 1.7rem);
  line-height: 1.15;
  color: var(--ink);
}

.quote-scene-amount {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.1rem, 7vw, 2.8rem);
  letter-spacing: -0.03em;
  color: var(--ink);
}

.quote-scene-visit {
  margin: 0 0 12px;
  font-family: var(--typewriter);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink);
}

.quote-scene-specials {
  display: grid;
  gap: 8px;
  text-align: left;
  margin: 0 auto 16px;
  max-width: 28rem;
  font-family: var(--typewriter);
  font-size: 0.82rem;
  color: var(--ink);
}

.quote-scene-specials[hidden],
.quote-scene-specials:empty {
  display: none;
}

.quote-scene-specials p {
  margin: 0 0 4px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quote-scene-specials ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.quote-scene-specials li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
}

.quote-scene-specials--out {
  padding: 8px 10px;
  background: rgba(243, 228, 200, 0.7);
  border: 1px dashed rgba(90, 63, 28, 0.35);
}

.quote-scene-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quote-scene-btn {
  min-height: 48px;
  border-radius: 999px;
  font-family: var(--typewriter);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.quote-scene-btn--accept {
  background: var(--red);
  border: 1px solid #2a090d;
  color: var(--cream);
  box-shadow: 0 10px 22px rgba(122, 21, 21, 0.28);
}

.quote-scene-btn--decline {
  background: var(--paper);
  border: 2px solid var(--pencil);
  color: var(--ink);
}

.quote-scene-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.quote-scene-cover {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  /* Stay untransformed and unpainted while the quote is open. A live
     rotateY(-108deg) cover flattens into a cream sheet on iPhone Safari. */
  transform: none;
  visibility: hidden;
  opacity: 0;
  z-index: 40;
  pointer-events: none;
  border-radius: 2px 8px 8px 2px;
  text-decoration: none;
  color: var(--cream);
}

.quote-scene-book.is-closing .quote-scene-cover,
.quote-scene-book.is-shut .quote-scene-cover {
  visibility: visible;
  opacity: 1;
}

.quote-scene-book.is-closing .quote-scene-cover {
  animation: quoteBookClose 1.55s cubic-bezier(0.42, 0.02, 0.18, 1) forwards;
}

.quote-scene-book.is-shut .quote-scene-cover {
  transform: none;
  pointer-events: auto;
}

.quote-scene-cover-face {
  position: absolute;
  inset: 0;
  border-radius: 2px 8px 8px 2px;
}

.quote-scene-cover-inside {
  display: none;
}

.quote-scene-cover-outside {
  background:
    repeating-linear-gradient(118deg, transparent 0 2px, rgba(42, 36, 30, 0.07) 2px 3px),
    linear-gradient(165deg, #c4a06a 0%, #a8844e 48%, #8a6a3c 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 24px 32px;
  text-align: center;
  box-shadow: inset 0 0 0 1.5px rgba(42, 36, 30, 0.45), inset 0 0 0 5px rgba(242, 235, 224, 0.08);
}

.quote-scene-cover-mark {
  margin: 0;
  font-family: var(--typewriter);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(242, 235, 224, 0.82);
}

.quote-scene-cover-title {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  line-height: 1.05;
  color: #f5e6d8;
}

.quote-scene-cover-copy {
  margin: 0;
  max-width: 18ch;
  font-family: var(--typewriter);
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(242, 235, 224, 0.92);
}

.quote-scene-cover-link {
  margin: 8px 0 0;
  font-family: var(--typewriter);
  font-size: 1.05rem;
  color: #f5e6d8;
  border-bottom: 1.5px dashed rgba(242, 235, 224, 0.7);
  padding-bottom: 3px;
}

.quote-scene-cover-count {
  margin: 4px 0 0;
  font-family: var(--typewriter);
  font-size: 0.78rem;
  color: rgba(242, 235, 224, 0.78);
}

@keyframes quoteSunIn { to { opacity: 1; transform: rotate(-5deg); } }
@keyframes quoteCloudIn { to { opacity: 0.9; } }
@keyframes quoteBuildUp { to { opacity: 1; transform: scaleY(1); } }
@keyframes quoteBrickReveal { to { opacity: 1; } }
@keyframes quoteFadeOut { to { opacity: 0; visibility: hidden; } }
@keyframes quoteBaseToGround { to { opacity: 1; } }
@keyframes quoteScreenToWall {
  to {
    bottom: 24px;
    background: #d4c2a6;
  }
}
@keyframes quoteBrowserIn { to { opacity: 1; transform: scale(1); } }
@keyframes quoteBlink { 50% { opacity: 0; } }
@keyframes quoteCursorHide { to { opacity: 0; } }
@keyframes quoteRoofDrop { to { opacity: 1; transform: none; } }
@keyframes quoteChimneyIn { to { opacity: 1; transform: rotate(1deg); } }
@keyframes quoteWinPop { to { opacity: 1; } }
@keyframes quoteShrubPop { to { opacity: 1; transform: none; } }
@keyframes quoteBookClose {
  0% { transform: scaleX(0); }
  100% { transform: none; }
}

@media (max-width: 640px) {
  #quoteDecisionOverlay { --house-scale: 0.82; padding: 10px 8px 16px; }
  .quote-scene-page { padding: 16px 14px 14px; }
  .quote-scene-house-stage { height: calc(190px * var(--house-scale) + 4px); }
}

@media (prefers-reduced-motion: reduce) {
  #quoteDecisionOverlay *,
  #quoteDecisionOverlay *::before,
  #quoteDecisionOverlay *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition: none !important;
  }
  .quote-scene-sun,
  .quote-scene-cloud,
  .quote-scene-ground,
  .quote-scene-wall,
  .quote-scene-bricks,
  .quote-scene-roof,
  .quote-scene-chimney,
  .quote-scene-door,
  .quote-scene-win,
  .quote-scene-shrub {
    opacity: 1 !important;
    transform: none !important;
  }
  .quote-scene-wall {
    bottom: 24px;
    background: #d4c2a6;
    transform: scaleY(1) !important;
  }
  .quote-scene-browser { opacity: 0 !important; visibility: hidden !important; }
  .quote-scene-book.is-closing .quote-scene-cover,
  .quote-scene-book.is-shut .quote-scene-cover {
    animation: none;
    transform: none;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }
}
