/* OXT Community Stacks. Large, plain and readable first: most visitors
   are not here for the web site, they are here to press Play. Light and
   dark follow the system. The colours are the OpenXTalk family's, as on
   OXT-Beyond's site and the extensions page: its cream and night, its
   orange, and Beyond's fire on the Play buttons. */
:root{
  --bg:#fbf7f1;--panel:#fff;--ink:#18212e;--muted:#556275;--line:#e7dfd3;
  --accent:#c2410c;--accent-ink:#fff;--accent-hover:#9a3412;--link:#9a3412;
  --badge:#f3ece0;--badge-ink:#4a3b22;--quiet:#e8f1ea;--quiet-ink:#234a30;
  --shadow:0 1px 2px rgba(27,35,48,.06),0 6px 20px rgba(27,35,48,.07);
  --fire:linear-gradient(135deg,#ffc24d,#ff7700 55%,#ff3d00);--fire-ink:#1a1206;--eyebrow:#0f766e;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root{
    --bg:#0d1420;--panel:#141d2c;--ink:#e8edf4;--muted:#9aa8ba;--line:#223047;
    --accent:#ff8a1f;--accent-ink:#1a1206;--accent-hover:#ffa64d;--link:#ffb066;
    --badge:#1b2638;--badge-ink:#e6d9c3;--eyebrow:#4fd1c5;--quiet:#1d3528;--quiet-ink:#bfe3cb;
    --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.35);
    color-scheme:dark;
  }
}
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);
  font:18px/1.6 system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,"Helvetica Neue",sans-serif}
a{color:var(--link);text-underline-offset:.15em}
a:hover{text-decoration-thickness:2px}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px;border-radius:4px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
h1{font-size:clamp(1.7rem,4vw,2.4rem);line-height:1.2;margin:0 0 .6rem;letter-spacing:-.01em;text-wrap:balance}
h2{font-size:1.3rem;line-height:1.3;margin:2rem 0 .5rem}
p{margin:.6rem 0}
.small{font-size:.92rem;color:var(--muted)}
.skip{position:absolute;left:1rem;top:-4rem;z-index:10;padding:.6rem 1rem;border-radius:10px;background:var(--accent);
  color:var(--accent-ink);font-weight:700;text-decoration:none}
.skip:focus{top:.6rem}
main:focus{outline:none}
button{font:inherit;cursor:pointer}

.top{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem 1.5rem;
  padding:.8rem clamp(1rem,4vw,2.5rem);border-bottom:1px solid var(--line);background:var(--panel)}
.brand{display:flex;align-items:center;gap:.6rem;color:var(--ink);text-decoration:none;font-weight:700;font-size:1.15rem}
.top nav{display:flex;flex-wrap:wrap;align-items:center;gap:.3rem 1.2rem}
.top nav a{font-weight:600;padding:.4rem .1rem;color:var(--ink);text-decoration:none;border-bottom:3px solid transparent}
.top nav a:hover{border-bottom-color:var(--line)}
.top nav a[aria-current="page"]{border-bottom-color:var(--accent)}
.top nav a.cta{padding:.4rem .95rem;border:2px solid var(--accent);border-radius:999px;color:var(--link)}
.top nav a.cta:hover,.top nav a.cta[aria-current="page"]{background:var(--accent);color:var(--accent-ink)}
main{max-width:72rem;margin:0 auto;padding:clamp(1.2rem,4vw,2.5rem) clamp(1rem,4vw,2.5rem) 3rem}
footer{border-top:1px solid var(--line);padding:1.2rem clamp(1rem,4vw,2.5rem);color:var(--muted);font-size:.92rem;text-align:center}

.hero{max-width:46rem;margin-bottom:1.2rem}
.eyebrow{display:flex;align-items:center;gap:.6rem;margin:0 0 .7rem;color:var(--eyebrow);
  font:600 .72rem/1 ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;letter-spacing:.13em;text-transform:uppercase}
.eyebrow::before{content:"";width:1.6rem;height:1px;background:currentColor}
.hero p{font-size:1.1rem}

/* Finding a stack: the search box, the tag buttons and how many show */
.filters{margin:0 0 1.4rem}
.find label{display:block;font-weight:600;margin-bottom:.3rem}
.find .field{position:relative;max-width:28rem}
.find input{width:100%;font:inherit;padding:.6rem 2.8rem .6rem 2.6rem;border:2px solid var(--line);border-radius:12px;
  background:var(--panel) no-repeat .8rem 50%/1.1rem;color:var(--ink);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2388909c' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m20 20-4.8-4.8'/%3E%3C/svg%3E")}
.find input:focus{border-color:var(--accent);outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 30%,transparent)}
.find input::-webkit-search-cancel-button{display:none}
.find .clear{position:absolute;right:.35rem;top:50%;transform:translateY(-50%);width:2.2rem;height:2.2rem;border:0;border-radius:50%;
  background:none;color:var(--muted);font-size:1.5rem;line-height:1}
.find .clear:hover{background:var(--badge);color:var(--ink)}
.chips{display:flex;flex-wrap:wrap;gap:.45rem;margin:.9rem 0 0}
.chip{min-height:40px;padding:.3rem .9rem;border:2px solid var(--line);border-radius:999px;background:var(--panel);color:var(--ink);
  font-weight:600;font-size:.95rem}
.chip .n{color:var(--muted);font-weight:500;margin-left:.15rem}
.chip:hover{border-color:var(--accent)}
.chip[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--bg)}
.chip[aria-pressed="true"] .n{color:inherit;opacity:.75}
.count{margin:.8rem 0 0;color:var(--muted);font-size:.95rem}
.none{text-align:center;padding:2.5rem 1rem;border:2px dashed var(--line);border-radius:16px}
.none p{font-size:1.15rem;margin-top:0}
.ghost{display:inline-block;font-weight:700;text-decoration:none;min-height:44px;padding:.55rem 1.2rem;border-radius:999px;
  border:2px solid var(--line);background:var(--panel);color:var(--ink)}
.ghost:hover{border-color:var(--accent)}

.cards{list-style:none;margin:0;padding:0;display:grid;gap:1.4rem;grid-template-columns:repeat(auto-fill,minmax(17.5rem,1fr))}
.card{display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--line);border-radius:16px;
  padding:0 1.1rem 1.1rem;box-shadow:var(--shadow);overflow:hidden;transition:transform .15s ease,box-shadow .15s ease}
.card:hover{transform:translateY(-2px);box-shadow:0 2px 4px rgba(27,35,48,.08),0 12px 28px rgba(27,35,48,.12)}
.card .body{flex:1;display:flex;flex-direction:column}
.card h3{font-size:1.25rem;line-height:1.3;margin:.9rem 0 0}
.card h3 a{color:var(--ink);text-decoration:none}
.card h3 a:hover{text-decoration:underline}
.by{margin:.1rem 0 .3rem;color:var(--muted)}
.what{margin:.2rem 0 .6rem;flex:1;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden}
.shotlink{display:block;margin:0 -1.1rem;overflow:hidden}
.card .shot{transition:transform .25s ease}
.card:hover .shot{transform:scale(1.03)}
.shot{display:block;width:100%;aspect-ratio:16/10;object-fit:cover;background:var(--badge);border-bottom:1px solid var(--line)}
.shot.none{background:linear-gradient(135deg,var(--badge),var(--line));display:grid;place-items:center}
.shot.none span{font-size:3.2rem;font-weight:800;color:var(--muted);opacity:.6}
.shot.large{border:1px solid var(--line);border-radius:14px}

.badges{list-style:none;margin:.2rem 0 .9rem;padding:0;display:flex;flex-wrap:wrap;gap:.4rem}
.badge{font-size:.85rem;font-weight:600;padding:.2rem .65rem;border-radius:999px;background:var(--badge);color:var(--badge-ink)}
.badge.quiet{background:var(--quiet);color:var(--quiet-ink)}

.play{display:block;text-align:center;font-weight:700;font-size:1.15rem;text-decoration:none;
  min-height:48px;padding:.65rem 1.4rem;border-radius:999px;background:var(--fire);color:var(--fire-ink);
  box-shadow:0 6px 18px rgba(255,122,0,.25);transition:box-shadow .15s ease,filter .15s ease}
.play:hover{filter:brightness(1.06) saturate(1.05);box-shadow:0 10px 24px rgba(255,122,0,.35)}
.play:focus-visible{outline-color:var(--ink)}
.play span[aria-hidden]{font-size:.85em;margin-right:.2rem}
.play.big{display:inline-block;font-size:1.35rem;min-width:11rem;padding:.8rem 2rem}

/* A stack's own page */
.crumbs{font-size:.95rem;color:var(--muted);margin:-.4rem 0 1.2rem}
.crumbs a{font-weight:600}
.lead{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:1.4rem 2.4rem;align-items:center;margin-bottom:1.5rem}
.shotlink.large{margin:0;border-radius:14px}
.intro .badges{margin:.5rem 0 1.1rem}
.actions{display:flex;flex-wrap:wrap;align-items:center;gap:.7rem 1rem;margin-bottom:.6rem}
.cols{display:grid;grid-template-columns:minmax(0,1fr) 17rem;gap:1rem 2.6rem;align-items:start}
.cols h2:first-child{margin-top:.5rem}
.about p{font-size:1.08rem}
.note{font-size:.95rem;padding:.7rem 1rem;border-left:4px solid var(--accent);background:var(--panel);border-radius:0 10px 10px 0}
.facts{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:1rem 1.2rem;margin-top:1.4rem}
.facts dl{margin:0;display:grid;grid-template-columns:auto 1fr;gap:.35rem 1rem;font-size:.95rem}
.facts dt{color:var(--muted)}
.facts dd{margin:0;font-weight:600;overflow-wrap:anywhere}
.tags{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:.3rem}
.tags a{display:inline-block;font-size:.85rem;font-weight:600;padding:.05rem .6rem;border-radius:999px;border:1px solid var(--line);
  text-decoration:none}
.tags a:hover{border-color:var(--accent)}
.more{margin-top:3rem;padding-top:1rem;border-top:1px solid var(--line)}
.cards.small{grid-template-columns:repeat(auto-fill,minmax(15rem,1fr))}
@media (max-width:48rem){
  .lead,.cols{grid-template-columns:1fr}
  .facts{margin-top:.5rem}
}
.plain{padding-left:1.2rem}
.plain li{margin:.45rem 0}

.source pre{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:.9rem 1rem;overflow:auto;
  font:.88rem/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;tab-size:3;white-space:pre}
.source section{margin-top:1.6rem}
.source h2{margin-bottom:0}

.doc{max-width:44rem}
.doc li{margin:.5rem 0}
.steps{counter-reset:step;list-style:none;padding:0}
.steps>li{counter-increment:step;position:relative;padding:.2rem 0 .6rem 3.2rem;margin:.8rem 0}
.steps>li::before{content:counter(step);position:absolute;left:0;top:0;width:2.3rem;height:2.3rem;border-radius:50%;
  display:grid;place-items:center;font-weight:700;background:var(--accent);color:var(--accent-ink)}

/* The page a stack plays on: a slim bar, and the stack has the rest */
body.playing{display:flex;flex-direction:column;height:100vh;height:100dvh;background:#000;overflow:hidden}
.bar{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:.3rem 1.2rem;padding:.45rem .9rem;
  background:var(--panel);border-bottom:1px solid var(--line);font-size:1rem}
.bar .back{font-weight:700}
.bar .now{flex:1 1 10rem;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bar .now span{color:var(--muted)}
.bar button{font:inherit;font-weight:600;min-height:40px;padding:.3rem .9rem;border:2px solid var(--line);border-radius:10px;
  background:none;color:var(--ink);cursor:pointer}
.bar button:hover{border-color:var(--accent)}
#stack{flex:1 1 auto;width:100%;min-height:0;border:0;background:#000}
@media (max-width:34rem){.bar .more{display:none}}

/* Phones: a card is a picture beside its words, so more fit on a screen */
@media (max-width:34rem){
  .top{padding:.6rem 1rem .2rem}
  .brand span{font-size:1.05rem}
  /* the menu is one row under the name, Share a stack in it; a row
     longer than the phone scrolls sideways rather than wrapping */
  .top nav{flex-wrap:nowrap;justify-content:space-between;gap:.6rem;font-size:.9rem;
    overflow-x:auto;scrollbar-width:none;margin:0 -1rem;padding:0 1rem;width:calc(100% + 2rem)}
  .top nav::-webkit-scrollbar{display:none}
  .top nav a{flex:none;white-space:nowrap}
  .top nav a.cta{padding:.15rem .65rem;margin:.25rem 0}
  /* a stack's page: Play and Read the scripts fill the width, one above
     the other, easy to hit with a thumb */
  .actions .play,.actions .ghost{flex:1 1 100%;text-align:center}
  .card .by{font-size:.9rem;margin-bottom:.15rem}
  .cards{gap:.9rem}
  .card{display:grid;grid-template-columns:7.5rem 1fr;grid-template-areas:"shot body" "play play";
    gap:0 .9rem;padding:.8rem}
  .card .shotlink{grid-area:shot;margin:0;border-radius:10px}
  .card .shot{aspect-ratio:1;border:0;height:100%}
  .card .body{grid-area:body}
  .card h3{margin-top:0;font-size:1.1rem}
  .card .what{font-size:.95rem;-webkit-line-clamp:2;line-clamp:2}
  .card .badges{margin:.1rem 0 .6rem}
  .card .badge{font-size:.78rem}
  .card .play{grid-area:play;margin-top:.2rem}
}
@media (prefers-reduced-motion:reduce){
  .card,.card .shot{transition:none}
  .card:hover,.card:hover .shot{transform:none}
}

/* For beginners: three steps, folded away until asked for */
details>summary{cursor:pointer;font-weight:700}
.newhere{max-width:46rem;margin:0 0 1.4rem;padding:.8rem 1.1rem;background:var(--panel);border:1px solid var(--line);border-radius:14px}
.newhere[open]{padding-bottom:1rem}
.three{counter-reset:three;list-style:none;padding:0;margin:.8rem 0 0;display:grid;gap:.7rem}
.three>li{counter-increment:three;position:relative;padding-left:2.6rem;min-height:2rem}
.three>li::before{content:counter(three);position:absolute;left:0;top:.05rem;width:1.9rem;height:1.9rem;border-radius:50%;
  display:grid;place-items:center;font-weight:700;font-size:.95rem;background:var(--badge);color:var(--badge-ink)}

/* For developers: what a stack is made of and the lines behind its labels */
.dev{margin:1.6rem 0;padding:.8rem 1.1rem;background:var(--panel);border:1px solid var(--line);border-radius:14px}
.dev h4{margin:1rem 0 .3rem;font-size:1rem}
.lines{list-style:none;padding:0;margin:0;font-size:.92rem}
.lines li{padding:.35rem 0;border-top:1px solid var(--line)}
.lines code,.dev code{font:.85rem/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;overflow-wrap:anywhere}

/* The scripts page: a list of scripts and numbered lines a link can point to */
.toc{margin:1rem 0;padding:.8rem 1.1rem;background:var(--panel);border:1px solid var(--line);border-radius:14px}
.toc ol{margin:.6rem 0 0;padding-left:1.4rem;columns:2 18rem}
.toc li{margin:.15rem 0;break-inside:avoid}
.source pre{counter-reset:ln;padding-left:0}
.source .ln{display:block;counter-increment:ln;padding-left:4.2em;position:relative;scroll-margin-top:30vh}
.source .ln::before{content:counter(ln);position:absolute;left:0;width:3.2em;text-align:right;color:var(--muted);opacity:.7;
  user-select:none;-webkit-user-select:none}
.source .ln:target{background:color-mix(in srgb,var(--accent) 22%,transparent)}
.inshort{margin:1.2rem 0 .4rem;padding:.9rem 1.2rem 1.1rem;background:var(--panel);border:1px solid var(--line);
  border-left:4px solid var(--accent);border-radius:0 14px 14px 0}
.inshort p{margin:0}

/* libraries: a card with no picture and no Play, and a page with no box */
.cards.libs{margin-top:1.2rem}
.card.lib{padding-top:1.1rem}
.library .intro{margin-bottom:1.6rem}
.library .lines code{white-space:pre-wrap;word-break:break-word}
