/* The live demo: a working copy of the app inside a phone. */
.demo-copy { display: grid; gap: 18px; align-self: center; min-width: 0; }
.demo-copy .plain { list-style: none; padding: 0; display: grid; gap: 8px; color: var(--soft); font-size: var(--t-sm); max-width: 34em; }
.demo-copy .plain li { padding-left: 18px; position: relative; }
.demo-copy .plain li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: #F6D98B; }
.demo-wait { color: var(--soft); font-size: var(--t-sm); }
#demo > .phone-sim { grid-column: 2; grid-row: 1; }

.phone-sim { --ink: #0B0D2E; --card: rgba(255, 255, 255, .07); --line: rgba(255, 255, 255, .14); --gold: #F6D98B; --txt: #F3F1FF; --mute: #B9B6DA;
  width: clamp(268px, 24vw, 340px); display: grid; gap: 12px; justify-self: center; }
.ph-frame { position: relative; aspect-ratio: 9 / 18.6; background: #03040F; border-radius: 40px; padding: 9px; box-shadow: 0 30px 70px rgba(0, 0, 0, .55), inset 0 0 0 2px #2a2d5c; }
.ph-notch { position: absolute; z-index: 5; top: 16px; left: 50%; translate: -50% 0; width: 26%; height: 17px; border-radius: 10px; background: #03040F; }
.ph-screen { position: relative; height: 100%; border-radius: 32px; overflow: hidden; color: var(--txt); font: 400 14px/1.4 var(--sans, system-ui);
  background: radial-gradient(120% 60% at 80% 0%, #2B3290 0%, transparent 60%), linear-gradient(#171B55, #0B0D2E); display: flex; flex-direction: column; }
.ph-status { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px 4px; font-size: 12px; color: var(--mute); flex: none; min-height: 34px; }
.ph-chip { padding: 3px 9px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 11px; color: var(--gold); }
.ph-view { flex: 1; overflow-y: auto; padding: 8px 18px 22px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: none; }
.ph-view::-webkit-scrollbar { display: none; }
.ph-view[hidden] { display: none; }
.ph-hero { font: 400 26px/1.1 var(--serif); letter-spacing: -.02em; margin: 14px 0 6px; text-wrap: balance; }
.ph-title { font: 400 22px/1.15 var(--serif); margin: 2px 0; }
.ph-h { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); margin-top: 8px; font-weight: 600; }
.ph-sub { color: var(--mute); font-size: 12px; text-align: center; }
.ph-sub#ph-prog-topic { text-align: left; font-style: italic; }
.ph-fine { color: var(--mute); font-size: 11px; line-height: 1.45; }
.ph-btn { appearance: none; border: 0; cursor: pointer; font: 600 15px/1 var(--sans, system-ui); padding: 15px 18px; border-radius: 16px; width: 100%; color: var(--txt); transition: transform .15s, filter .15s; }
.ph-btn:hover { filter: brightness(1.08); } .ph-btn:active { transform: scale(.98); }
.ph-btn:disabled { opacity: .45; cursor: default; }
.ph-primary { background: linear-gradient(135deg, #F6D98B, #E9B96A); color: #231A05; }
.ph-subtle { background: var(--card); border: 1px solid var(--line); }
.ph-back { appearance: none; background: none; border: 0; color: var(--gold); font: 500 15px/1 var(--sans, system-ui); cursor: pointer; padding: 6px 0; text-align: left; width: max-content; }
.ph-sample { appearance: none; text-align: left; cursor: pointer; color: var(--txt); display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; margin-top: 6px;
  background: linear-gradient(135deg, rgba(246, 217, 139, .16), rgba(246, 217, 139, .04)); border: 1px solid rgba(246, 217, 139, .4); font: inherit; }
.ph-sample small { display: block; color: var(--gold); font-size: 10px; letter-spacing: .14em; font-weight: 700; }
.ph-sample b { display: block; font-weight: 600; font-size: 14px; line-height: 1.25; }
.ph-sample em { font-style: normal; color: var(--mute); font-size: 11px; }
.ph-play { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--gold); position: relative; }
.ph-play::after { content: ""; position: absolute; left: 15px; top: 11px; border-left: 12px solid #231A05; border-block: 8px solid transparent; }
.ph-lib { list-style: none; padding: 0; display: grid; gap: 8px; }
.ph-lib button { appearance: none; width: 100%; text-align: left; font: inherit; color: var(--txt); cursor: pointer; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; display: grid; gap: 2px; }
.ph-lib small { color: var(--mute); font-size: 11px; }
.ph-field { display: grid; gap: 6px; }
.ph-field small { font-size: 10px; letter-spacing: .12em; color: var(--mute); font-weight: 600; }
.ph-field textarea { width: 100%; resize: none; font: 400 15px/1.35 var(--sans, system-ui); color: var(--txt); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.ph-field textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.ph-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-pills button, .ph-pill-btn { appearance: none; cursor: pointer; font: 500 13px/1 var(--sans, system-ui); color: var(--txt); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; }
.ph-pills button[aria-checked="true"], .ph-pills button.on { background: var(--gold); color: #231A05; border-color: var(--gold); font-weight: 600; }
.ph-btn:focus-visible, .ph-pills button:focus-visible, .ph-pill-btn:focus-visible, .ph-back:focus-visible, .ph-sample:focus-visible, .ph-lib button:focus-visible, .ph-playbig:focus-visible, .ph-icon:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* surprise */
.ph-roll { min-height: 168px; display: grid; place-items: center; }
.ph-drawers { display: flex; gap: 8px; }
.ph-drawers[hidden] { display: none; }
.ph-drawers i { width: 54px; height: 76px; border-radius: 12px; background: linear-gradient(#3A42A8, #1E2468); border: 1px solid var(--line); animation: ph-float 1.1s ease-in-out infinite; }
.ph-drawers i:nth-child(2) { animation-delay: .15s; } .ph-drawers i:nth-child(3) { animation-delay: .3s; }
@keyframes ph-float { 50% { transform: translateY(-9px); } }
.ph-card { display: grid; gap: 6px; padding: 16px; border-radius: 18px; background: var(--card); border: 1px solid rgba(246, 217, 139, .45); animation: ph-in .5s ease both; width: 100%; }
.ph-card[hidden] { display: none; }
.ph-card small { color: var(--gold); letter-spacing: .12em; font-size: 10px; font-weight: 700; }
.ph-card b { font: 400 19px/1.2 var(--serif); }
.ph-card span { color: var(--mute); font-size: 12px; }
.ph-card em { font-style: normal; font-size: 12px; color: var(--gold); }
@keyframes ph-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* progress */
.ph-steps { list-style: none; padding: 0; display: grid; gap: 7px; }
.ph-steps li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--mute); }
.ph-steps li::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); box-sizing: border-box; }
.ph-steps li.doing { color: var(--txt); } .ph-steps li.doing::before { border-color: var(--gold); border-top-color: transparent; animation: ph-spin .9s linear infinite; }
.ph-steps li.done { color: var(--txt); } .ph-steps li.done::before { background: var(--gold) center / 10px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 5.2l2.2 2.2L8.5 2.6' fill='none' stroke='%23231A05' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); border-color: var(--gold); }
.ph-steps li span { margin-left: auto; font-size: 11px; color: var(--mute); }
@keyframes ph-spin { to { rotate: 360deg; } }
.ph-chapters { list-style: none; padding: 0; display: grid; gap: 4px; font-size: 12px; color: var(--mute); }
.ph-chapters li { animation: ph-in .4s ease both; }

/* player */
.ph-player { padding: 0; position: relative; gap: 0; overflow: hidden; }
#ph-viz { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .9; }
.ph-ptop { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 6px 14px; z-index: 1; }
.ph-vizname { font-size: 11px; color: var(--mute); }
.ph-icon { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--gold); width: 34px; height: 34px; border-radius: 50%; font-size: 15px; cursor: pointer; }
.ph-pbody { position: relative; z-index: 1; margin-top: auto; padding: 14px 18px 22px; display: grid; gap: 8px; background: linear-gradient(transparent, rgba(11, 13, 46, .92) 28%); }
.ph-pbody h3 { font: 400 21px/1.15 var(--serif); }
.ph-pblurb { color: var(--mute); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ph-sample-note { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(246, 217, 139, .13); border: 1px solid rgba(246, 217, 139, .4); }
.ph-sample-note[hidden] { display: none; }
.ph-sample-note span { font-size: 9px; letter-spacing: .1em; color: var(--gold); font-weight: 700; }
.ph-sample-note button { appearance: none; background: var(--gold); color: #231A05; border: 0; border-radius: 999px; font: 600 11px/1 var(--sans, system-ui); padding: 7px 10px; cursor: pointer; }
#ph-seek { width: 100%; accent-color: var(--gold); margin: 4px 0 0; }
.ph-times { display: flex; justify-content: space-between; font-size: 11px; color: var(--mute); font-variant-numeric: tabular-nums; }
.ph-ctl { display: flex; align-items: center; justify-content: space-between; }
.ph-playbig { appearance: none; border: 0; cursor: pointer; width: 62px; height: 62px; border-radius: 50%; background: var(--gold); position: relative; }
.ph-playbig::after { content: ""; position: absolute; left: 25px; top: 19px; border-left: 20px solid #231A05; border-block: 12px solid transparent; }
.ph-playbig.on::after { left: 21px; top: 20px; width: 20px; height: 22px; border: 0; background: linear-gradient(90deg, #231A05 0 36%, transparent 36% 64%, #231A05 64%); }
.ph-ctl .ph-pill-btn { min-width: 62px; }
.ph-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: grid; gap: 10px; padding: 16px 18px 20px; background: #12154a; border-top: 1px solid var(--line); border-radius: 22px 22px 0 0; animation: ph-in .3s ease both; }
.ph-sheet[hidden] { display: none; }
.ph-confirm { position: absolute; z-index: 6; inset: 9px; border-radius: 32px; background: rgba(3, 4, 15, .72); display: flex; align-items: flex-end; }
.ph-confirm[hidden] { display: none; }
.ph-confirm > div { width: 100%; display: grid; gap: 10px; padding: 18px; background: #14184D; border-radius: 26px 26px 32px 32px; border-top: 1px solid var(--line); color: var(--txt); font: 400 14px/1.4 var(--sans, system-ui); }
.ph-confirm b { font: 400 20px/1.15 var(--serif); }
.ph-confirm p { margin: 0; color: var(--mute); }
.ph-caption { text-align: center; max-width: 30em; margin: 0 auto; }

@media (max-width: 900px) {
  .demo-copy { display: contents; }
  .demo-copy .plain, .demo-copy .langs, .demo-copy > p { grid-column: 1 / -1; }
  #demo > .phone-sim { grid-column: 1 / -1; grid-row: auto; width: min(92vw, 340px); margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .ph-drawers i, .ph-steps li.doing::before, .ph-card, .ph-chapters li, .ph-sheet { animation: none; }
}
