/* Erase My Reputation: opening sequence. An eraser rubs out 1-star reviews,
   then a negative search result, then wipes the curtain off the site.
   Once per session; skip on click/scroll/key; never for reduced motion. */
@property --e { syntax: "<percentage>"; inherits: false; initial-value: -8%; }

html.emr-lock { overflow: hidden; }
html.emr-seen #emr-intro, html.emr-seen .ei-dust { display: none; }
@media (prefers-reduced-motion: reduce) { #emr-intro { display: none; } }

#emr-intro {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 35%, #17181b 0%, #0b0c0e 60%, #070708 100%);
  color: #0d0d0d; font-family: "Source Sans 3", system-ui, sans-serif;
  /* the final sweep erases the curtain itself */
  -webkit-mask-image: linear-gradient(100deg, transparent var(--e), #000 calc(var(--e) + 9%));
          mask-image: linear-gradient(100deg, transparent var(--e), #000 calc(var(--e) + 9%));
}
#emr-intro .stage { position: relative; width: min(92vw, 560px); height: min(78vh, 520px); }
@media (min-width: 900px) and (min-height: 700px) { #emr-intro .stage { zoom: 1.25; } }
@media (min-width: 1300px) and (min-height: 820px) { #emr-intro .stage { zoom: 1.4; } }

/* cards */
.ei-card { position: absolute; inset: 0; margin: auto; height: fit-content; background: #fff; border-radius: 16px; padding: 22px 22px 14px;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.06);
  opacity: 0; transform: translateY(18px) scale(.98); transition: opacity .55s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
.ei-card.on { opacity: 1; transform: none; }
.ei-card.off { opacity: 0; transform: translateY(-14px) scale(.98); }
.ei-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #ececec; }
.ei-title { font-weight: 600; font-size: 15px; color: #202124; }
.ei-score { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #5f6368; }
.ei-score b { font-size: 26px; font-weight: 600; color: #202124; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* stars: filled width is driven by --fill */
.ei-stars { position: relative; display: inline-block; font-size: 15px; letter-spacing: 1px; line-height: 1; color: #dadce0; }
.ei-stars::before { content: "★★★★★"; }
.ei-stars i { position: absolute; inset: 0 auto 0 0; width: var(--fill, 20%); overflow: hidden; color: var(--sc, #e8710a); font-style: normal; white-space: nowrap; transition: width 1.1s cubic-bezier(.16,1,.3,1), color .6s; }
.ei-stars i::before { content: "★★★★★"; }
.ei-score .ei-stars { font-size: 18px; }

.ei-review { display: grid; grid-template-columns: 34px 1fr; gap: 10px 12px; padding: 13px 0; border-bottom: 1px solid #f1f1f1; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent var(--e), #000 calc(var(--e) + 7%)); mask-image: linear-gradient(90deg, transparent var(--e), #000 calc(var(--e) + 7%));
  transition: max-height .55s cubic-bezier(.6,0,.2,1), padding .55s cubic-bezier(.6,0,.2,1), opacity .3s; max-height: 140px; }
.ei-review.gone { max-height: 0; padding: 0; opacity: 0; border-color: transparent; }
.ei-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 14px; }
.ei-name { font-size: 14px; font-weight: 600; color: #202124; }
.ei-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 12.5px; color: #70757a; }
.ei-text { grid-column: 2; font-size: 14px; line-height: 1.45; color: #3c4043; margin: 0; }
.ei-clean { padding: 18px 0 8px; font-size: 14px; color: #188038; display: flex; align-items: center; gap: 8px; opacity: 0; transition: opacity .5s; }
.ei-clean.on { opacity: 1; }

/* search */
.ei-search { display: flex; align-items: center; gap: 10px; border: 1px solid #dfe1e5; border-radius: 999px; padding: 10px 16px; font-size: 15px; color: #202124; box-shadow: 0 1px 6px rgba(32,33,36,.12); }
.ei-search svg { flex: none; }
.ei-results { padding-top: 6px; }
.ei-res { padding: 13px 2px; overflow: hidden; max-height: 120px; transition: max-height .55s cubic-bezier(.6,0,.2,1), padding .55s cubic-bezier(.6,0,.2,1), opacity .3s, transform .6s cubic-bezier(.16,1,.3,1);
  -webkit-mask-image: linear-gradient(90deg, transparent var(--e), #000 calc(var(--e) + 7%)); mask-image: linear-gradient(90deg, transparent var(--e), #000 calc(var(--e) + 7%)); }
.ei-res.gone { max-height: 0; padding: 0; opacity: 0; }
.ei-res .u { font-size: 12.5px; color: #4d5156; }
.ei-res .h { margin: 3px 0 4px; font-size: 18px; line-height: 1.25; color: #1a0dab; }
.ei-res.bad .h { color: #b3261e; }
.ei-res .s { margin: 0; font-size: 13.5px; line-height: 1.45; color: #4d5156; }
.ei-res.new { opacity: 0; transform: translateY(10px); max-height: 0; padding: 0; }
.ei-res.new.in { opacity: 1; transform: none; max-height: 120px; padding: 13px 2px; }
.ei-res.new .h::after { content: "  ✓"; color: #188038; font-size: 15px; }

/* the eraser */
.ei-eraser { position: absolute; left: 0; top: 0; width: 120px; height: 52px; z-index: 5; pointer-events: none; transform-origin: 18% 82%;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,.45)); opacity: 0; transition: opacity .35s; will-change: transform; }
.ei-eraser.on { opacity: 1; }
.ei-dust { position: fixed; inset: 0; z-index: 10000; pointer-events: none; }

/* lockup at the end */
.ei-lock { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; color: #fff; opacity: 0; transition: opacity .6s; text-align: center; }
.ei-lock.on { opacity: 1; }
.ei-lock .wm { font-size: clamp(28px, 6vw, 44px); font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.ei-lock .wm em { font-style: normal; color: #d4af37; }
.ei-lock .ei-tag { font: 400 15px/1.4 "Source Sans 3", sans-serif; letter-spacing: 0; text-transform: none; color: rgba(255,255,255,.62); }
.ei-skip { position: absolute; right: 20px; bottom: 18px; z-index: 6; font: 500 12px/1 "Source Sans 3", sans-serif; letter-spacing: .02em; color: rgba(255,255,255,.55); background: none; border: 0; cursor: pointer; padding: 10px; }
.ei-skip:hover, .ei-skip:focus-visible { color: #fff; }

/* ---- chat surface (Holmby Lane intro pattern, own skin) ---- */
#emr-intro .ei-chat { height: 100%; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.ei-chead { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid #ececec; font-size: 13.5px; font-weight: 600; color: #3c4043; }
.ei-cdot { width: 8px; height: 8px; border-radius: 50%; background: #34a853; box-shadow: 0 0 0 3px rgba(52,168,83,.15); }
.ei-thread { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; padding: 14px 18px 8px; overflow: hidden; }
.ei-msg { display: none; }
.ei-msg.on { display: flex; animation: eiUp .38s cubic-bezier(.16,1,.3,1) both; }
@keyframes eiUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ei-u { justify-content: flex-end; }
.ei-u .bub { max-width: 82%; background: #f1f3f4; color: #202124; border-radius: 18px 18px 4px 18px; padding: 9px 14px; font-size: 14.5px; line-height: 1.4; }
.ei-a { gap: 10px; align-items: flex-start; }
.ei-bot { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #0d0d0d; position: relative; margin-top: 2px; }
.ei-bot::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #d4af37; }
.ei-body { flex: 1; min-width: 0; }
.ei-think { display: none; gap: 5px; padding: 9px 0; }
.ei-a.thinking .ei-think { display: inline-flex; }
.ei-think i { width: 7px; height: 7px; border-radius: 50%; background: #9aa0a6; animation: eiDot 1s infinite ease-in-out; }
.ei-think i:nth-child(2) { animation-delay: .15s; } .ei-think i:nth-child(3) { animation-delay: .3s; }
@keyframes eiDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ei-ans { display: none; }
.ei-a.said .ei-ans { display: block; animation: eiUp .45s cubic-bezier(.16,1,.3,1) both; }
.ei-say { margin: 3px 0 8px; font-size: 14.5px; line-height: 1.45; color: #202124; }
.ei-say.ei-big { font-size: 17px; font-weight: 600; margin-top: 2px; }
.ei-box { border: 1px solid #ececec; border-radius: 12px; padding: 4px 14px 6px; }
.ei-box .ei-head { padding: 9px 0 8px; }
.ei-box .ei-score b { font-size: 21px; }
.ei-box .ei-review { padding: 9px 0; grid-template-columns: 28px 1fr; gap: 6px 10px; }
.ei-box .ei-av { width: 28px; height: 28px; font-size: 12px; }
.ei-box .ei-text { font-size: 13px; }
.ei-box .ei-res { padding: 9px 0 7px; border-top: 1px solid #f1f1f1; }
.ei-box .ei-res .h { font-size: 15px; margin: 2px 0 0; }
.ei-box .ei-clean { padding: 8px 0 4px; }
.ei-input { margin: 6px 14px 14px; border: 1px solid #e3e3e3; border-radius: 999px; padding: 10px 10px 10px 16px; display: flex; align-items: center; justify-content: space-between; color: #9aa0a6; font-size: 14px; }
.ei-send { width: 26px; height: 26px; border-radius: 50%; background: #0d0d0d; }
@media (max-width: 480px) { .ei-u .bub, .ei-say { font-size: 13.5px; } .ei-box .ei-text { font-size: 12.5px; } }
.ei-box .ei-review.gone, .ei-box .ei-res.gone { padding: 0; border-color: transparent; }
