/* Showcase and demo app pages. The phone walkthrough is pure CSS: every part runs on the same 13 s timeline,
   so the steps on the side light up in sync with what happens on the screen. */

.demo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 12px; }
.demo-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; transition: transform .2s, box-shadow .2s; }
.demo-card:hover { box-shadow: 0 10px 30px rgba(22, 24, 29, .08); }
.demo-card strong { font-size: 1.25rem; letter-spacing: -.01em; }
.demo-card > span:not(.eyebrow) { color: #3b3f47; }
.demo-card .demo-card-go { margin-top: 8px; color: var(--link); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.demo-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.demo-ctas .btn { gap: 6px; }

/* Stage: phone + steps */
.stage { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center; margin-top: 8px; }
.demo-steps { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.dst { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; color: var(--muted); animation: 13s linear infinite; }
.dst span { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #ecebe5; color: var(--ink); font-family: var(--mono); font-size: .85rem; }
.dst1 { animation-name: st1; } .dst2 { animation-name: st2; } .dst3 { animation-name: st3; } .dst4 { animation-name: st4; }
@keyframes st1 { 0%, 18% { color: var(--ink); border-color: var(--ink); box-shadow: 4px 4px 0 var(--lime); } 20%, 100% { color: var(--muted); border-color: var(--line); box-shadow: none; } }
@keyframes st2 { 0%, 18% { color: var(--muted); border-color: var(--line); box-shadow: none; } 20%, 40% { color: var(--ink); border-color: var(--ink); box-shadow: 4px 4px 0 var(--lime); } 42%, 100% { color: var(--muted); border-color: var(--line); box-shadow: none; } }
@keyframes st3 { 0%, 40% { color: var(--muted); border-color: var(--line); box-shadow: none; } 42%, 64% { color: var(--ink); border-color: var(--ink); box-shadow: 4px 4px 0 var(--lime); } 66%, 100% { color: var(--muted); border-color: var(--line); box-shadow: none; } }
@keyframes st4 { 0%, 64% { color: var(--muted); border-color: var(--line); box-shadow: none; } 66%, 96% { color: var(--ink); border-color: var(--ink); box-shadow: 4px 4px 0 var(--lime); } 98%, 100% { color: var(--muted); border-color: var(--line); box-shadow: none; } }

/* Phone */
.phone { width: 300px; height: 560px; padding: 12px; border-radius: 40px; background: #16181d; box-shadow: 0 30px 60px rgba(22, 24, 29, .22); }
.phone-screen { position: relative; height: 100%; border-radius: 30px; overflow: hidden; background: #f4f3ef; animation: ph-screen 13s linear infinite; }
.ph-chat, .ph-shop { position: absolute; inset: 0; padding: 18px 14px; display: flex; flex-direction: column; gap: 10px; font-size: .84rem; line-height: 1.45; }
.ph-chat { animation: ph-chat 13s cubic-bezier(.6, 0, .3, 1) infinite; }
.ph-shop { background: #f6f2eb; animation: ph-shop 13s cubic-bezier(.6, 0, .3, 1) infinite; }
.ph-head { text-align: center; font-weight: 700; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.ph-msg { max-width: 86%; padding: 10px 12px; border-radius: 16px; }
.ph-msg small { display: block; font-size: .7rem; font-weight: 700; opacity: .65; margin-bottom: 2px; }
.ph-user { align-self: flex-end; background: var(--link); color: #fff; border-bottom-right-radius: 4px; animation: ph-user 13s ease infinite; }
.ph-ai { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; animation: ph-ai 13s ease infinite; }
.ph-link { position: relative; display: block; margin-top: 6px; color: var(--link); text-decoration: underline; word-break: break-all; font-family: var(--mono); font-size: .72rem; }
.ph-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; animation: ph-typing 13s linear infinite; }
.ph-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: ph-dot 1s ease-in-out infinite; }
.ph-typing i:nth-child(2) { animation-delay: .15s; } .ph-typing i:nth-child(3) { animation-delay: .3s; }
.ph-tap { position: absolute; width: 44px; height: 44px; border-radius: 50%; background: rgba(49, 87, 255, .35); border: 2px solid var(--link); pointer-events: none; }
/* Taps sit inside their target, so they land on it at any phone size. */
.ph-tap1, .ph-tap2 { left: calc(50% - 22px); top: calc(50% - 22px); }
.ph-tap1 { animation: ph-tap1 13s ease-out infinite; }
.ph-shop-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid #e5ded2; padding-bottom: 8px; }
.ph-shop-head b { font-family: "Palatino Linotype", "Book Antiqua", "Iowan Old Style", "Noto Serif", serif; font-size: 1.3rem; } .ph-shop-head em { font-style: normal; color: #c98a4b; }
.ph-shop-head span { font-size: .66rem; color: var(--muted); }
.ph-title { margin: 6px 0 0; font-family: "Palatino Linotype", "Book Antiqua", "Iowan Old Style", "Noto Serif", serif; font-size: 1.3rem; line-height: 1.2; }
.ph-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ph-items img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: #ece5d8; }
.ph-total { margin: 0; font-weight: 700; }
.ph-btn { position: relative; display: block; text-align: center; padding: 12px; border-radius: 999px; background: #1f1d1a; color: #f6f2eb; font-weight: 700; }
.ph-tap2 { animation: ph-tap2 13s ease-out infinite; }
.ph-receipt { position: absolute; left: 14px; right: 14px; bottom: 18px; display: grid; justify-items: center; gap: 4px; padding: 18px 14px; border-radius: 18px; background: #fff; border: 1px solid #e5ded2; box-shadow: 0 16px 40px rgba(31, 29, 26, .16); text-align: center; animation: ph-receipt 13s cubic-bezier(.3, 1.4, .5, 1) infinite; }
.ph-receipt strong { font-size: 1.15rem; color: #2f6b45; }
.ph-receipt span:last-child { font-size: .75rem; color: var(--muted); }
.ph-check { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #e5f1e8; color: #2f6b45; font-size: 1.3rem; font-weight: 800; }

@keyframes ph-screen { 0% { opacity: 0; } 2%, 95% { opacity: 1; } 99%, 100% { opacity: 0; } }
@keyframes ph-user { 0%, 3% { opacity: 0; transform: translateY(10px); } 7%, 100% { opacity: 1; transform: none; } }
@keyframes ph-typing { 0%, 11% { opacity: 0; } 13%, 19% { opacity: 1; } 21%, 100% { opacity: 0; } }
@keyframes ph-dot { 0%, 100% { transform: none; opacity: .4; } 50% { transform: translateY(-3px); opacity: 1; } }
@keyframes ph-ai { 0%, 19% { opacity: 0; transform: translateY(10px); } 24%, 100% { opacity: 1; transform: none; } }
@keyframes ph-tap1 { 0%, 31% { opacity: 0; transform: scale(.4); } 34% { opacity: 1; transform: scale(1); } 38%, 100% { opacity: 0; transform: scale(1.7); } }
@keyframes ph-chat { 0%, 40% { transform: none; } 46%, 100% { transform: translateX(-100%); } }
@keyframes ph-shop { 0%, 40% { transform: translateX(100%); } 46%, 100% { transform: none; } }
@keyframes ph-tap2 { 0%, 58% { opacity: 0; transform: scale(.4); } 61% { opacity: 1; transform: scale(1); } 65%, 100% { opacity: 0; transform: scale(1.7); } }
@keyframes ph-receipt { 0%, 66% { opacity: 0; transform: translateY(30px) scale(.96); } 71%, 100% { opacity: 1; transform: none; } }


/* Prompts */
.prompts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 14px; }
.prompt-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.prompt-card h3 { margin: 0; }
.prompt-text { margin: 0; padding: 14px; border-radius: 10px; background: #f3f2ec; border-left: 3px solid var(--link); font-size: .95rem; }
.prompt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.prompt-expect { margin: 0; font-size: .88rem; color: var(--muted); }
.prompt-expect b { color: var(--ink); }
.demo-notes ul { padding-left: 20px; display: grid; gap: 8px; }

/* Share content tracks within each card row, including wrapped titles and buttons. */
@supports (grid-template-rows: subgrid) {
  .demo-card { display: grid; grid-row: span 5; grid-template-rows: subgrid; min-width: 0; }
  .prompt-card { display: grid; grid-row: span 4; grid-template-rows: subgrid; min-width: 0; }
  .prompt-actions { align-content: start; }
  .demo-card-go { align-self: start; }
}

@media (max-width: 760px) {
  .stage { grid-template-columns: 1fr; justify-items: center; gap: 24px; }
  .phone { width: 280px; height: 530px; }
  .prompts { grid-template-columns: 1fr; }
}

/* Reduced motion: show the result, not the movement. */
@media (prefers-reduced-motion: reduce) {
  .phone *, .dst, .phone-screen { animation: none !important; }
  .ph-chat, .ph-tap, .ph-typing { display: none; }
  .ph-shop, .ph-receipt { transform: none; opacity: 1; }
}

/* Screenshots in a browser frame */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.browser { margin: 0; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(22, 24, 29, .12); }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #ecebe5; border-bottom: 1px solid var(--line); }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: #d3d1c9; }
.browser-bar i:first-child { background: #f2685e; } .browser-bar i:nth-child(2) { background: #f5bd4f; } .browser-bar i:nth-child(3) { background: #5ec454; }
.browser-bar span { margin-left: 8px; flex: 1; padding: 2px 10px; border-radius: 999px; background: #fff; color: var(--muted); font: .72rem var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser img { display: block; width: 100%; height: auto; }
.browser-card { margin: -6px -6px 12px; box-shadow: none; transition: transform .3s; }
.browser-card img { aspect-ratio: 8 / 5; object-fit: cover; }
.demo-card { overflow: hidden; }

/* Demo hero: text and screenshots side by side */
.demo-hero-in { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.demo-shots { position: relative; display: block; padding: 0 40px 40px 0; }
.demo-shots .browser { transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.demo-phone-shot { position: absolute; right: 0; bottom: 0; width: 30%; height: auto; border-radius: 22px; border: 6px solid #16181d; box-shadow: 0 18px 40px rgba(22, 24, 29, .25); transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.demo-shots:hover .browser { transform: translateY(-4px) rotate(-.6deg); }
.demo-shots:hover .demo-phone-shot { transform: translateY(-10px) rotate(2deg); }

/* Step buttons: click to jump to that moment */
.demo-steps li { list-style: none; }
.dst { width: 100%; text-align: left; font: inherit; font-weight: 600; cursor: pointer; transition: transform .15s, border-color .15s; }
.dst:hover { transform: translateX(4px); border-color: var(--ink); color: var(--ink); }
.dst:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.stage-controls { display: flex; gap: 8px; margin: 4px 0 10px; }
.ctl { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--ink); background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; transition: background .15s, color .15s, transform .15s; }
.ctl:hover { background: var(--ink); color: var(--lime); transform: translateY(-1px); }
.ctl .ui-icon { width: 16px; height: 16px; }
.ctl-play .i-play { display: none; }
.stage.is-paused .ctl-play .i-play { display: inline; }
.stage.is-paused .ctl-play .i-pause { display: none; }

/* Prompt buttons: lift on hover; copy turns green with a check when done */
.prompt-actions .btn { gap: 6px; transition: transform .15s, box-shadow .15s, background .15s, color .15s, border-color .15s; }
.prompt-actions .btn .ui-icon { width: 16px; height: 16px; }
.prompt-actions .btn:hover { transform: translateY(-2px); box-shadow: 3px 3px 0 var(--lime); }
.prompt-actions .btn:active { transform: translateY(0); box-shadow: none; }
.open-btn:hover { background: var(--ink); color: #fff; }
.copy-btn .i-check { display: none; }
.copy-btn.is-done { background: var(--ok); border-color: var(--ok); color: #fff; box-shadow: none; }
.copy-btn.is-done .i-copy { display: none; }
.copy-btn.is-done .i-check { display: inline; animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.prompt-card.is-copied .prompt-text { animation: flash 1s ease; }
@keyframes pop { from { transform: scale(.3); } to { transform: none; } }
@keyframes flash { 0% { background: #dff3d0; } 100% { background: #f3f2ec; } }
.prompt-card { transition: border-color .2s, box-shadow .2s; }
.prompt-card:hover { border-color: #cfccc2; box-shadow: 0 10px 26px rgba(22, 24, 29, .06); }

@media (max-width: 860px) {
  .demo-hero-in { grid-template-columns: 1fr; gap: 24px; }
  .demo-shots { padding: 0 24px 24px 0; }
}

/* Three columns on wide screens; the featured app (LAP for Blender) takes two. */
@media (min-width: 900px) {
  .demo-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .demo-card.is-featured { grid-column: span 2; }
  .demo-card.is-featured strong { font-size: 1.5rem; }
}
.demo-card.is-featured { border-color: #c7cdf2; box-shadow: 0 0 0 1px #c7cdf2; }
