/* Homepage "live theatre" (assets/theatre.js): the sample sites, live, in a browser frame or a phone.
   Homepage tokens (home.css :root). Mobile first; no zooming motion, only fades. */
.th { padding-bottom: clamp(72px, 8vw, 120px); }
.th .head { margin-bottom: 0; }
.th__ctl { display: flex; align-items: center; gap: 10px 16px; margin-top: clamp(24px, 2.6vw, 34px); }
/* the nine trades: chips that wrap on wide screens and become a swipe row on phones */
.th-chips { position: relative; display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.th-chips button { min-height: 40px; padding: 0 15px; border: 0; border-radius: 999px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-d); color: var(--dim); font: 500 14.5px/1 var(--sans); cursor: pointer; white-space: nowrap; transition: color .25s, background-color .25s, box-shadow .25s; }
.th-chips button:hover { color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-d2); }
.th-chips button[aria-pressed="true"] { background: var(--fg); color: var(--ink); box-shadow: none; }
.th__ctl .th-tabs { flex: none; align-self: flex-start; }
.th-tabs { display: inline-flex; gap: 4px; padding: 5px; border-radius: 14px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-d); }
.th-tabs button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: none; color: var(--dim); font: 500 15px/1 var(--sans); cursor: pointer; white-space: nowrap; transition: color .25s, background-color .25s; }
.th-tabs button[aria-pressed="true"] { background: var(--fg); color: var(--ink); }
.th-tabs--sm button { padding: 0 13px; font-size: 14px; }
.th__note { display: none; align-items: center; gap: 8px; margin: 0 0 0 auto; font: 500 12px/1.3 var(--mono); letter-spacing: .03em; color: var(--dim); }
.th__note i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--volt); box-shadow: 0 0 8px rgb(198 255 61 / .8); }
.th__stage { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; margin-top: 16px; align-items: start; }
.th-side { display: grid; gap: 0; }

/* the browser frame */
.th-dev { position: relative; min-width: 0; border-radius: 18px; background: #141417; box-shadow: 0 0 0 1px var(--line-d2), 0 60px 120px -50px #000; overflow: hidden; }
.th-dev__bar { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--line-d); }
.th-dev__bar > i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: rgb(255 255 255 / .16); }
.th-dev__url { min-width: 0; margin-left: 8px; padding: 5px 11px; border-radius: 8px; background: rgb(255 255 255 / .06); font: 500 11.5px/1 var(--mono); color: #cfcfca; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-dev__view { position: relative; height: min(70vh, 700px); overflow: hidden; background: #fff; }
.th-dev__view iframe { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border: 0; background: #fff; opacity: 0; transform-origin: 0 0; transition: opacity .5s ease; }
.th-dev__view iframe.is-on { opacity: 1; }
.th-dev__wait { position: absolute; inset: 0; display: grid; place-items: end center; padding-bottom: 22px; background: #141417; }
.th-dev__wait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.th-dev__wait > span { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 999px; background: rgb(11 11 13 / .82); color: var(--fg); font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.th-dev__wait .th-busy { display: none; }
.th-dev__wait.is-busy .th-busy { display: inline-flex; }
.th-dev__wait.is-busy .th-busy i { width: 7px; height: 7px; border-radius: 50%; background: var(--volt); animation: thPulse 1.2s ease-in-out infinite; }
.th-dev__wait.is-busy > :not(.th-busy):not(img) { display: none; }
.th-load { display: none; }
.is-save .th-load { display: inline-flex; min-height: 44px; border: 0; cursor: pointer; }
.js .th-open { display: none; } /* the link to the sample is the no-JS fallback */
html:not(.js) .th__ctl { display: none; } /* no JS: the tabs would do nothing; the poster and the list of links stay */
@keyframes thPulse { 50% { opacity: .3; } }
/* touch: the veil keeps a scrolling thumb on the homepage until they choose to try the site */
.th-veil { position: absolute; inset: 0; z-index: 2; display: grid; place-items: end center; padding-bottom: 22px; background: linear-gradient(transparent 60%, rgb(9 9 11 / .35)); cursor: pointer; }
.th-veil button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--volt); color: var(--ink); font: 600 15px/1 var(--sans); cursor: pointer; box-shadow: 0 12px 30px -10px rgb(0 0 0 / .6); }

/* the phone: the same live page at phone width, in a phone */
.is-phone .th-dev { justify-self: center; width: min(100%, 392px); padding: 10px; border-radius: 46px; background: linear-gradient(160deg, #2b2b31, #141417 40%, #1d1d22); }
/* the phone: a plain top bezel */
.is-phone .th-dev__bar { height: 14px; padding: 0; border: 0; justify-content: center; }
.is-phone .th-dev__bar > i, .is-phone .th-dev__url { display: none; }
.is-phone .th-dev__view { height: min(72vh, 780px); border-radius: 36px; }
@media (min-width: 1001px) { .th__stage.is-phone { grid-template-columns: 392px minmax(0, 380px); justify-content: center; gap: clamp(40px, 6vw, 96px); align-items: center; } }

/* what it does for the owner: jumps the live page there (links to the sample without JS) */
.th-moves__k { margin: 0 0 8px; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim-2); }
.th-moves { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.th-moves a { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 14px 14px 14px 12px; border-radius: 14px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-d); color: var(--fg); text-decoration: none; transition: box-shadow .25s, background-color .25s; }
.th-moves a:hover, .th-moves a[aria-current="true"] { background: var(--ink-3); box-shadow: inset 0 0 0 1.5px rgb(198 255 61 / .55); }
.th-moves em { font: 500 11px/1.65 var(--mono); font-style: normal; color: var(--volt); }
.th-moves b { display: block; font-weight: 600; font-size: 15px; line-height: 1.3; }
.th-moves small { display: block; margin-top: 3px; color: var(--dim); font-size: 13.5px; line-height: 1.45; }
.th__foot { display: grid; gap: 4px; margin-top: 18px; }
.th__foot .btn { width: 100%; white-space: normal; text-align: center; line-height: 1.2; padding-block: 10px; }
.th__more { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; color: var(--fg); font-weight: 560; font-size: 15px; text-decoration: underline; text-decoration-color: rgb(244 244 241 / .3); text-underline-offset: 4px; }
.th__more:hover { text-decoration-color: var(--volt); }
.th__fn { margin-top: 22px; max-width: 90ch; }
.th__fn a { color: var(--fg); }

@media (max-width: 1000px) {
  .th__stage { grid-template-columns: minmax(0, 1fr); }
  .th-side { margin-top: 4px; }
  .th__foot { grid-template-columns: auto auto; justify-content: start; align-items: center; gap: 8px 20px; }
  .th__foot .btn { width: auto; }
  /* the list becomes a swipe row that runs to the screen edges */
  .th-moves { grid-auto-flow: column; grid-auto-columns: minmax(230px, 72%); overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -24px; padding: 0 24px 4px; scroll-padding-inline: 24px; scrollbar-width: none; }
  .th-moves::-webkit-scrollbar { display: none; }
  .th-moves li { scroll-snap-align: start; } .th-moves li, .th-moves a { height: 100%; }
}
@media (max-width: 640px) {
  .th__ctl { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 18px; }
  .th-chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 0 16px; scroll-padding-inline: 16px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .th-chips::-webkit-scrollbar { display: none; }
  .th__ctl .th-tabs { align-self: flex-start; }
  .th .h2 .hl::before { content: none; } /* phones: "by trade" runs on, muted, so the title stays two lines */
  .th__ctl .th-tabs button { min-height: 38px; }
  .th-dev__view { height: 60vh; }
  .th__foot { grid-template-columns: 1fr; justify-items: stretch; gap: 2px; margin-top: 14px; }
  .th__foot .btn { width: 100%; }
  .th__fn:not(:has(.th__us)) { display: none; } /* phones: the chips already list every trade (market copies keep the US-examples line) */
  .th-moves { margin-inline: -16px; padding: 0 16px 4px; scroll-padding-inline: 16px; grid-auto-columns: minmax(230px, 78%); }
  .th__stage:not(.is-phone) .th-dev__view { height: auto; aspect-ratio: 4 / 3; } /* desktop on a phone: a laptop-shaped window, not a 2000px-tall one */
  .is-phone .th-dev { padding: 8px; border-radius: 40px; }
  .is-phone .th-dev__view { height: 56vh; border-radius: 32px; }
  .th__foot .btn { width: 100%; }
  .th-dev__bar > i { display: none; } .th-dev__url { margin-left: 0; } /* room for the whole address */
}
@media (prefers-reduced-motion: reduce) { .th-dev__view iframe, .th-tabs button, .th-moves a { transition: none; } .th-dev__wait.is-busy .th-busy i { animation: none; } }
