/* Shared look for the four "Try Yield yourself" demos.
   Every demo renders into #canvas, which shared.js sizes and scales so the
   layout never drops below a sensible minimum and never scrolls the page. */
:root {
  --yg: #07543F; --yg2: #0A6B50; --ydeep: #043A2B; --cream: #F3EFE6;
  --ink: #15171A; --ink2: #3D4148; --muted: #71757C; --line: #E7E5DF;
  --bg: #F6F5F1; --card: #FFFFFF; --soft: #F1F0EB; --mint: #E7F1EC; --mint-line: #CBE1D5;
  --brand: #1E4B39; --brand2: #2A6650;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); }
body { position: fixed; inset: 0; }
body { font-family: var(--sans); color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
#canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; overflow: hidden; background: var(--bg); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
svg.i { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
/* The demo scrolls these itself. They are not scrollable by the visitor, so a mouse wheel
   or a swipe over the iframe scrolls the host page instead of getting caught in here. */
.scroll { overflow: hidden; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }

/* ---------- Agency website chrome ---------- */
.nav { height: 56px; display: flex; align-items: center; gap: 28px; padding: 0 64px 0 24px; background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 5; flex: none; }
.logo { font-family: var(--serif); font-size: 22px; color: var(--brand); white-space: nowrap; letter-spacing: .01em; }
.logo em { font-style: italic; color: var(--brand2); }
.nav nav { display: flex; gap: 22px; font-size: 14px; color: var(--ink2); }
.nav .grow { flex: 1; }
.nav .cta { font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--brand); color: var(--brand); white-space: nowrap; }
.m .nav { padding: 0 56px 0 16px; height: 52px; }
.m .nav nav, .m .nav .cta { display: none; }
.m .logo { font-size: 20px; }

/* ---------- Fake pointer ---------- */
#cursor { position: absolute; left: 0; top: 0; z-index: 50; pointer-events: none; opacity: 0;
  transition: transform .8s cubic-bezier(.45,.05,.25,1), opacity .3s; }
#cursor.on { opacity: 1; }
#cursor .arrow { width: 24px; height: 24px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
#cursor .tap { position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border-radius: 50%; background: rgba(7,84,63,.35); transform: scale(0); opacity: 0; }
#cursor.press .tap { animation: tap .5s ease-out; }
@keyframes tap { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(1.7); opacity: 0; } }
.m #cursor .arrow { display: none; }
.m #cursor::before { content: ''; position: absolute; left: -12px; top: -12px; width: 24px; height: 24px; border-radius: 50%; background: rgba(20,20,20,.25); border: 2px solid rgba(255,255,255,.95); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.pressed { transform: scale(.96) !important; transition: transform .12s !important; }

/* ---------- Restart + end screen ---------- */
#restart { position: absolute; z-index: 55; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: var(--ink2); display: grid; place-items: center; font-size: 15px;
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.10); transition: transform .2s; }
#restart:hover { transform: rotate(-40deg); }
.m #restart { top: 10px; right: 10px; }
#end { position: absolute; inset: 0; z-index: 60; background: var(--yg); color: var(--cream);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 28px;
  opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility 0s .9s; }
#end.on { opacity: 1; visibility: visible; transition: opacity .9s ease; }
#end::before { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.10), transparent 60%); pointer-events: none; }
#end > * { position: relative; opacity: 0; transform: translateY(12px); transition: opacity .7s, transform .7s; }
#end.on > * { opacity: 1; transform: none; }
#end.on > :nth-child(1) { transition-delay: .35s; }
#end.on > :nth-child(2) { transition-delay: .5s; }
#end.on > :nth-child(3) { transition-delay: .65s; }
#end.on > :nth-child(4) { transition-delay: .9s; }
#end.on > :nth-child(5) { transition-delay: 1.1s; }
#end .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: #BFE3D2; }
#end h2 { font-family: var(--serif); font-weight: 500; font-size: 46px; line-height: 1.08; margin: 16px 0; max-width: 17ch; letter-spacing: -.01em; }
#end p { font-size: 17px; line-height: 1.6; max-width: 46ch; margin: 0 0 30px; color: rgba(243,239,230,.88); }
#end .again { display: inline-flex; align-items: center; gap: 8px; background: var(--cream); color: var(--yg); font-weight: 600; font-size: 15px; padding: 12px 22px; border-radius: 999px; transition: transform .2s, box-shadow .2s; }
#end .again:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.2); }
#end .mark { position: absolute; bottom: 22px; font-family: var(--serif); font-size: 20px; color: rgba(243,239,230,.7); }
.m #end h2 { font-size: 32px; }
.m #end p { font-size: 15px; margin-bottom: 24px; }

/* ---------- Typing ---------- */
.caret { display: inline-block; width: 2px; height: 1.15em; background: currentColor; vertical-align: -.2em; margin-left: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.w { opacity: 0; transition: opacity .3s; }
.w.on { opacity: 1; }
.ph { color: #9A9DA3; }

/* ---------- Chat panel (demos 2 and 3) ---------- */
.chat { display: flex; flex-direction: column; background: #fff; min-height: 0; height: 100%; }
.ch-head { flex: none; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 60px 0 20px; background: var(--brand); color: #fff; }
.ch-head .av { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.14); display: grid; place-items: center; font-family: var(--serif); font-size: 18px; }
.ch-head b { display: block; font-size: 15px; font-weight: 600; }
.ch-head small { display: block; font-size: 12px; opacity: .75; margin-top: 1px; }
.ch-head .ctx { margin-left: auto; font-size: 11.5px; background: rgba(255,255,255,.14); border-radius: 999px; padding: 5px 10px; white-space: nowrap; opacity: 0; transition: opacity .4s; }
.ch-head .ctx.on { opacity: 1; }
.ch-body { flex: 1; min-height: 0; padding: 20px 22px 8px; scroll-behavior: auto; }
.ch-foot { flex: none; padding: 10px 16px 16px; }
.ch-input { display: grid; grid-template-columns: 1fr auto; row-gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 10px 16px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: border-color .2s, box-shadow .2s; }
.ch-input.focus { border-color: var(--brand2); box-shadow: 0 0 0 3px rgba(42,102,80,.12); }
.ch-input .txt { grid-column: 1 / 3; grid-row: 1; font-size: 14.5px; line-height: 1.45; min-height: 21px; }
.ch-input::before { content: ''; grid-column: 1; grid-row: 2; height: 28px; margin-left: -4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='13' fill='%23F1F0EB'/%3E%3Cpath d='M14 9v10M9 14h10' stroke='%2371757C' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") 0 50% / 28px 28px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371757C' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M19 10a7 7 0 0 1-14 0M12 19v3'/%3E%3C/svg%3E") 40px 50% / 17px 17px no-repeat; }
.ch-input .send { grid-column: 2; grid-row: 2; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 15px; flex: none; }
.msg { margin: 0 0 18px; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg.u { display: flex; justify-content: flex-end; }
.msg.u > div { max-width: 82%; background: var(--brand); color: #fff; border-radius: 18px 18px 4px 18px; padding: 11px 15px; font-size: 14.5px; line-height: 1.5; }
.msg.b { font-size: 14.5px; line-height: 1.6; color: var(--ink); }
.msg.b .who { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--brand2); margin-bottom: 6px; }
.msg.b .who .dot { width: 20px; height: 20px; border-radius: 6px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 11px; }
.msg.b p { margin: 0 0 10px; }
.msg.b p:last-child { margin-bottom: 0; }
.msg.b b { font-weight: 600; }
.msg.note { text-align: center; font-size: 12px; color: var(--muted); }
.dots { display: inline-flex; gap: 4px; padding: 6px 0; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: #B5B9BE; animation: dot 1.1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }
.fadein { animation: rise .45s ease both; }
.m .ch-head { height: 56px; padding: 0 54px 0 14px; }
.m .ch-body { padding: 16px 14px 6px; }
.m .ch-foot { padding: 8px 10px 12px; }
.m .msg.b, .m .msg.u > div, .m .ch-input .txt { font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- The Yield panel: slides up over the agency's own site ---------- */
.ysite { position: absolute; inset: 0; display: flex; flex-direction: column; background: #fff; }
.ysite .hero { flex: 1; position: relative; overflow: hidden; }
.ysite .hero .bg { position: absolute; inset: 0; background: url(img/hero.jpg) center 40% / cover; }
.ysite .hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,22,18,.30), rgba(10,22,18,.55)); }
.yscrim { position: absolute; inset: 0; z-index: 20; background: rgba(12,18,16,.5); opacity: 0; visibility: hidden; transition: opacity .6s, visibility 0s .6s; }
.yscrim.on { opacity: 1; visibility: visible; transition: opacity .6s; }
.ypanel { position: absolute; left: 0; right: 0; bottom: 0; top: 56px; z-index: 21; background: #fff; border-radius: 18px 18px 0 0; overflow: hidden; display: flex;
  transform: translateY(102%); transition: transform .75s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -14px 44px rgba(0,0,0,.28); }
.ypanel.up { transform: none; }
.yp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); position: relative; }
.yp-top { flex: none; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); }
.yp-top .mk { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 15px; flex: none; }
.yp-top b { font-size: 15px; font-weight: 600; }
.yp-top .x { margin-left: auto; color: var(--muted); font-size: 18px; display: grid; place-items: center; }
.yp-chat { flex: 0 0 36%; min-width: 300px; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.yp-chat .ch-head { padding-right: 20px; }
.m .ypanel { top: 52px; border-radius: 16px 16px 0 0; }
.m .yp-top { height: 48px; padding: 0 12px; }
