/* Build on Slatebox: /developers/ and the pages under it, /open-source/, /enterprise/ and /plans/.
   Loaded after /style.css, /assets/hub.css and /assets/product/replay.css. Nothing here changes the shared sheets.

   .pf-duo        a dark pane (code or a terminal) beside the replay it drives
   .pf-pane       the pane itself: a bar with a file name, then a scroller with the lines
   .pf-code       a still block of code or a command, inside a card or a section
   .pf-tools      the list of tool, command or route names
   .pf-table      a comparison table that stays readable on a phone
   .pf-free       the Pro credits on /plans/, as a table that stacks on a phone
   .pf-compare    self-hosted and Slatebox Cloud side by side on /plans/ (#compare), stacked on a phone
   .pf-doc        a quiet page frame around an embedded slate
   .sh-more       "Play it as a presentation" under the hero replay of /enterprise/ (selfhost-deck.js) */

/* ---- The pane beside a replay ---- */
.pf-duo { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1fr); align-items: stretch; gap: clamp(8px,.8vw,12px); min-width: 0 }
.pf-duo.even { grid-template-columns: minmax(0,1fr) minmax(0,1fr) }
.pf-pane { --pf-bg: #1b3128; --pf-ink: #eef2e4; --pf-soft: #a9bcab; position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #3d584b; border-radius: 10px; background: var(--pf-bg); color: var(--pf-ink) }
.pf-pane-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: .6rem; height: 2.75rem; padding: 0 .9rem; background: #16281f; border-bottom: 1px solid #3d584b; color: var(--pf-soft); font: 600 .78rem/1 ui-monospace,Menlo,monospace; white-space: nowrap }
.pf-pane-bar b { overflow: hidden; color: var(--pf-ink); font-weight: 600; text-overflow: ellipsis }
.pf-scroll { flex: 1 1 0; height: 0; min-height: 0; margin: 0; padding: .85rem 0 1rem; overflow: auto; scrollbar-width: thin; scrollbar-color: #4d6759 transparent; font: 500 clamp(12px,.87vw,12.5px)/1.58 ui-monospace,Menlo,Consolas,monospace; tab-size: 2 }
.pf-scroll:focus-visible { outline: 3px solid #f4ce84; outline-offset: -3px }
.pf-scroll code { display: block; width: max-content; min-width: 100%; font: inherit; white-space: pre }
.pf-pane[data-wrap] .pf-scroll code { width: auto; white-space: pre-wrap; overflow-wrap: anywhere }
.pf-block { display: block; padding: 0 .9rem 0 calc(.9rem - 3px); border-left: 3px solid transparent }
.pf-scroll code:not(:has(.pf-block)) { padding: 0 .9rem }
.pf-block[data-show="later"] { opacity: .5 }
.pf-block[data-show="on"] { border-left-color: #f4ce84; background: #f4ce8424 }
.pf-block.is-quiet { color: var(--pf-soft) }
.pf-c { color: #a9bcab }
.pf-s { color: #f4ce84 }
.pf-k { color: #9fd6bd }
.pf-m { color: #c9dcff }
.pf-n { color: #f1b8a5 }
.pf-f { color: #9fd6bd }
.pf-v { color: #c9dcff }
.pf-prompt { color: var(--pf-soft); user-select: none }
.pf-out { display: block; color: #cfdac9 }
.pf-out[hidden] { display: none }
.pf-block:not(:has(.pf-typed)) .pf-out::before { content: "→ "; color: #f4ce84 }
.pf-block[data-typing] .pf-typed::after { content: ""; display: inline-block; width: .5em; height: 1.05em; margin-left: 1px; vertical-align: text-bottom; background: #f4ce84 }
@media (prefers-reduced-motion: no-preference) { .pf-block { transition: opacity .25s, background-color .2s } }
/* Without scripting the pane prints the whole script and the replay shows its written account. */
@media (scripting: none) {
  .pf-duo { grid-template-columns: minmax(0,1fr) }
  .pf-scroll { flex: none; height: auto; max-height: 30rem }
}

/* ---- Still code, in a card or a section ---- */
.pf-code { min-width: 0; margin: 0; overflow: hidden; border: 1px solid #3d584b; border-radius: 8px; background: #1b3128; color: #eef2e4 }
.pf-code figcaption { padding: .5rem .8rem; background: #16281f; border-bottom: 1px solid #3d584b; color: #a9bcab; font: 600 .75rem/1.3 ui-monospace,Menlo,monospace }
.pf-code pre { margin: 0; padding: .8rem .85rem .9rem; overflow: auto; scrollbar-width: thin; scrollbar-color: #4d6759 transparent; font: 500 .78rem/1.58 ui-monospace,Menlo,Consolas,monospace }
.pf-code pre:focus-visible { outline: 3px solid #f4ce84; outline-offset: -3px }
.pf-code code { font: inherit; white-space: pre }
.pf-code strong { color: #f4ce84; font-weight: 600 }
.pf-code em { color: #a9bcab; font-style: normal }
.hub-page :not(pre) > code { padding: .08em .32em; border-radius: 4px; background: color-mix(in srgb, currentColor 9%, transparent); font: 500 max(.88em,12px)/1.4 ui-monospace,Menlo,Consolas,monospace; overflow-wrap: anywhere }
/* A card whose canvas sits beside its code: the pair stacks when the card is narrow. */
.pf-pair { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr)); align-items: center; gap: clamp(8px,1vw,14px) }
.pf-pair > * { min-width: 0 }
.hub-card-media > .pf-code, .hub-card-media > .stage + .pf-code, .hub-card-media > .pf-code + .stage { margin-top: clamp(8px,1vw,14px) }
.hub-card-media > .pf-code:first-child { margin-top: 0 }
.hub-card-media > .replay { width: 100% }
.hub-card.wide .hub-card-media { align-content: center }
.hub-card.lead .hub-card-media { flex: 1.9 }
.hub-card.flip.wide .hub-card-media { order: 0; border-left: 0; border-right: 1px solid var(--s-line) }
.hub-card .hub-card-copy > ul:not([class]) { margin: 0; padding-left: 1.1rem; color: var(--s-soft); font-size: .95rem }
/* A card that shares a row with a taller one: its canvas area takes the extra height. */
.hub-card.fill .hub-card-media { flex: 1; display: grid; align-content: center }
.pf-code.wrap code { white-space: pre-wrap; overflow-wrap: anywhere }
/* The one install command, under the lead on /enterprise/ */
.hub-hero-copy .pf-code.hub-command { max-width: 24rem; margin: clamp(14px,1.6vw,22px) 0 0 }
.hub-hero-copy .pf-code.hub-command pre { font-size: clamp(.9rem,1.1vw,1rem) }
/* A linked card is covered by its link. The replay's buttons, and any other link, stay above it. */
.hub-card .rp-controls { position: relative; z-index: 1 }
.hub-card .pf-also { position: relative; z-index: 1 }
.pf-also { font-size: .92rem }
.pf-also a { font-weight: 600 }

/* ---- Names: the exec surfaces, the client methods, the commands, the routes ---- */
.pf-tools { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none }
.pf-tools li { padding: .22rem .55rem; border: 1px solid var(--s-line); border-radius: 6px; background: color-mix(in srgb, var(--s-card) 70%, transparent); font: 500 .78rem/1.5 ui-monospace,Menlo,Consolas,monospace }
.pf-groups { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,250px),1fr)); gap: clamp(1rem,2.4vw,2.6rem); margin: 0 }
.pf-groups > div { padding-top: .9rem; border-top: 1px solid var(--s-line) }
.pf-groups dt { margin-bottom: .7rem; font: 700 clamp(1.3rem,1.8vw,1.7rem)/1.08 "Archivo Narrow","Arial Narrow",sans-serif; letter-spacing: -.025em }
.pf-groups dd { margin: 0 }
.pf-groups dd > p { margin-top: .7rem; color: var(--s-soft); font-size: .95rem }

/* ---- Tables ---- */
.pf-table { width: 100%; border-collapse: collapse; font-size: .97rem; text-align: left }
.pf-table caption { margin-bottom: .9rem; color: var(--s-soft); font: 600 .82rem/1.4 ui-monospace,Menlo,monospace; text-align: left }
.pf-table :is(th,td) { padding: .85rem 1rem .9rem 0; border-top: 1px solid var(--s-line); vertical-align: top }
.pf-table tr:last-child :is(th,td) { border-bottom: 1px solid var(--s-line) }
.pf-table thead th { border-top: 0; padding-bottom: .7rem; font: 700 clamp(1.3rem,1.8vw,1.7rem)/1.08 "Archivo Narrow","Arial Narrow",sans-serif; letter-spacing: -.025em; vertical-align: bottom }
.pf-table tbody th { width: 30%; font-weight: 600 }
.pf-table td small { display: block; color: var(--s-soft); font-size: .85rem }
.pf-table .yes { font-weight: 600 }
.pf-table .no { color: var(--s-soft) }
.pf-table-note { max-width: 72ch; margin-top: 1.1rem; color: var(--s-soft); font-size: .9rem }
.hub-split .pf-table-note { max-width: none }
@media (max-width: 800px) {
  /* Short cells stay a table on a phone: the row's name, then one narrow column per plan. */
  .pf-table.tight { table-layout: fixed; font-size: .88rem }
  .pf-table.tight tbody th { width: 46% }
  .pf-table.tight :is(th,td) { padding: .7rem .5rem .7rem 0 }
  .pf-table.tight thead th { font-size: 1.15rem }
  .pf-table.tight thead th:first-child { width: 46%; font-size: .82rem; font-family: ui-monospace,Menlo,monospace; letter-spacing: 0 }
  /* Each row becomes a small block: the row's name, then one line per column with the column's name in front. */
  .pf-table.stack, .pf-table.stack :is(tbody,tr,th,td) { display: block; width: auto }
  .pf-table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
  :is(.pf-free,.pf-compare).stack caption { display: block; width: auto }
  .pf-table.stack tr { padding: .85rem 0 .9rem; border-top: 1px solid var(--s-line) }
  .pf-table.stack tr:last-child { border-bottom: 1px solid var(--s-line) }
  .pf-table.stack :is(th,td) { padding: 0; border: 0 !important }
  .pf-table.stack tbody th { margin-bottom: .35rem; font: 700 1.3rem/1.1 "Archivo Narrow","Arial Narrow",sans-serif; letter-spacing: -.02em }
  .pf-table.stack td { display: grid; grid-template-columns: 5.2rem minmax(0,1fr); gap: .6rem; padding: .16rem 0 }
  .pf-table.stack td::before { content: attr(data-col); color: var(--s-soft); font: 600 .75rem/1.9 ui-monospace,Menlo,monospace }
  /* Long cells: the column's name sits above its words, so both get the full width. */
  .pf-compare.stack td { display: block; padding: .3rem 0 .2rem }
  .pf-compare.stack td::before { display: block }
  .pf-compare code { overflow-wrap: anywhere }
}

/* ---- Pricing ---- */
.pf-everything { font-size: clamp(.98rem,1.05vw,1.06rem) }
.pf-hide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
.pf-free tbody th { width: 28% }
.pf-compare tbody th { width: 20% }
.pf-compare td { width: 40% }
@media (min-width: 801px) { .pf-compare code { white-space: nowrap } }
.pf-compare-start { margin-top: clamp(1.4rem,2.4vw,2rem) }
.pf-free + .pf-table-note p + p { margin-top: .5rem }
/* Slatebox Pro on /plans/: the two prices as cards, then the way to get it, then the credits table */
.pro-prices { display: grid; grid-template-columns: repeat(2,minmax(0,15rem)) minmax(0,1fr); align-items: stretch; gap: clamp(12px,1.4vw,22px); margin-bottom: clamp(1.8rem,3vw,3rem) }
.pro-price { grid-column: auto }
.pro-price .hub-card-copy { flex: 1; gap: .4rem }
.pro-price[data-interval="year"] { border-color: var(--hub-deep); box-shadow: 0 18px 34px -26px #17281f8c }
.pro-price[data-interval="year"] .hub-chip { align-self: flex-start; background: var(--hub-deep); border-color: var(--hub-deep); color: #fff }
.pro-get { display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 1rem; padding: .2rem 0 .4rem clamp(0rem,1.4vw,1.4rem) }
.pro-get p { max-width: 38ch; color: var(--s-soft); font-size: .95rem }
/* each price card has its own button, so the app opens the pay sheet on the plan picked (/pro?plan=monthly|yearly) */
.pv-buy { align-self: stretch; justify-content: space-between; margin-top: auto; padding: .75rem .9rem; gap: .5rem; font-size: .95rem; white-space: nowrap }
/* on a phone the two prices stack, so each button has the card's full width */
@media (max-width: 480px) { .pro-prices:not(.biz-prices) { grid-template-columns: 1fr } }
.pro-price .hub-card-copy .pv-buy { color: #fff }
.pro-get { justify-content: flex-end; gap: .6rem }
.pf-free-groups { margin-top: .4rem }
@media (max-width: 760px) {
  .pro-prices { grid-template-columns: repeat(2,minmax(0,1fr)) }
  .pro-get { grid-column: 1 / -1; padding-left: 0 }
}
.pf-promise { display: grid; gap: 1rem; max-width: 72ch }
.pf-promise p { color: var(--s-soft) }
.pf-promise a { font-weight: 600 }

/* ---- Prices on /plans/: Slatebox Pro and Slatebox Business share the card grid above ----
   .pv-price  the price, large     .pv-month  the line under it     .biz-terms  what Business includes */
.pv-price { margin-top: .5rem; color: var(--s-ink) !important; font-size: 1.05rem !important }
.pv-price b { font: 700 clamp(2.3rem,3.3vw,3.2rem)/1 "Archivo Narrow","Arial Narrow",sans-serif; letter-spacing: -.03em }
.pv-month { font: 600 .8rem/1.4 ui-monospace,Menlo,monospace !important }
.biz-prices .pro-price { background: var(--s-card) }
.biz-terms dt { font-size: clamp(1.2rem,1.6vw,1.5rem) }

/* ---- A page around an embedded slate ---- */
.pf-doc { min-width: 0; margin: 0; padding: clamp(.8rem,1.4vw,1.2rem); border: 1px solid #b9c2b3; border-radius: 8px; background: #fff; color: #26382d }
.pf-doc > b { display: block; font: 700 1.15rem/1.2 "Helvetica Neue",Arial,sans-serif }
.pf-doc > span { display: block; margin: .3rem 0 .7rem; color: #506356; font-size: .85rem }
.pf-doc .stage { border-radius: 4px }

/* ---- Odds and ends ---- */
/* The shared sheet styles every paragraph in a split or a tab panel. A replay's own lines keep the runner's look. */
.hub-split .replay p, .hub-tabpanel .replay p, .hub-split .stage-body > p, .hub-tabpanel .stage-body > p { max-width: none; margin-top: 0 }
.hub-split .replay .rp-status, .hub-tabpanel .replay .rp-status { color: var(--rp-ink) }
.hub-split .replay .rp-label, .hub-tabpanel .replay .rp-label { color: var(--rp-soft) }
.hub-split .stage-body > p, .hub-tabpanel .stage-body > p { color: inherit }
.pf-quote { margin: 1.2rem 0 0; padding: 0 0 0 1rem; border-left: 3px solid var(--s-line); font-size: .95rem }
.pf-quote footer { margin-top: .35rem; font: 500 .78rem/1.4 ui-monospace,Menlo,monospace }
.pf-license { margin: 0 auto; font: 700 clamp(1.7rem,3vw,3rem)/1.08 "Archivo Narrow","Arial Narrow",sans-serif; letter-spacing: -.03em; text-wrap: balance }
.pf-links { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; margin-top: 1.4rem }
.pf-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600 }
.hub-statement .pf-links { justify-content: center }
.hub-section[data-tone="ink"] .pf-code, .hub-section[data-tone="ink"] .pf-pane { border-color: #4d6759; background: #16281f }
.hub-section[data-tone="ink"] .pf-code figcaption { background: #10201a }
.hub-rows i { font-style: normal }
#create-a-slate { scroll-margin-top: clamp(3rem,6vw,6.5rem) }
.pf-after { margin-top: 1.3rem; color: var(--s-soft); font-size: .95rem }
.hub-section > .pf-after { max-width: 72ch }   /* on its own under a full-width block: a reading measure */
.pf-after a { font-weight: 600 }
.hub-steps .pf-code { margin-top: .9rem }
.hub-split .pf-code { margin-top: 1.2rem }
.hub-split .hub-points code, .hub-facts code { overflow-wrap: anywhere }
.hub-steps li { min-width: 0 }
.hub-hero-copy .hub-crumbs { display: flex; flex-wrap: wrap }
/* Step chips in a card or beside a pane: one row of words is enough. */
.pf-duo .replay { --rp-label-narrow: 3.06rem }

@media (max-width: 1100px) {
  .pf-duo { grid-template-columns: minmax(0,1fr) }
  .pf-duo .pf-scroll { flex: none; height: 11.4rem }
}
@media (max-width: 800px) {
  .hub-page .stage .stage-body[style*="--stage-ratio-narrow"] { aspect-ratio: var(--stage-ratio-narrow) }
  .pf-duo .pf-scroll { height: 8.3rem; padding-block: .6rem; font-size: .75rem }
  /* Stacked over the canvas, the pane is a caption strip: only the lit block shows, so the calls the canvas is
     answering are always in view. The box keeps its height, so nothing below it moves. At rest, with nothing lit, the whole script scrolls in it. */
  .pf-duo .pf-pane:has(.pf-block[data-show="on"]) .pf-block:not([data-show="on"]) { display: none }
  .pf-pane-bar { height: 2.3rem }
  .hub-card.flip.wide .hub-card-media { border-right: 0 }
  .pf-code pre { font-size: .75rem }
}

/* ---- Under the hero replay of /enterprise/: "Play it as a presentation" (assets/hubs/platform/selfhost-deck.js) ----
   One line: the button, and what it opens. Hidden without scripting. The player opens in a dialog. */
.sh-more { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 10px 0 0; color: #4a544e; font: 14px/1.4 system-ui, sans-serif }
.sh-more[hidden] { display: none }
.sh-live { min-height: 40px; padding: 0 1rem; border: 0; border-radius: 99px; background: linear-gradient(90deg, #ff2e93, #ff9e2c); color: #12001f; font: 600 14px/1 system-ui, sans-serif; cursor: pointer }
.sh-live:hover, .sh-live:focus-visible { outline: none; box-shadow: 0 0 0 2px #12001f, 0 0 0 4px #ff2e93 }
.sh-player { --w: min(94vw, 1280px, (100dvh - 150px) * 16 / 9); width: var(--w); max-width: none; max-height: none; padding: 0; overflow: hidden; border: 1px solid #ff2e9388; border-radius: 12px; background: #0f1112; color: #f4f1ff }
.sh-player::backdrop { background: #050607d9; backdrop-filter: blur(3px) }
.sh-player-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px }
.sh-player-head b { font: 600 1rem/1.2 system-ui, sans-serif }
.sh-player-head span { flex: 1; min-width: 0; color: #ff2e93; font: 600 12.5px/1.3 ui-monospace, Menlo, monospace; text-transform: uppercase; letter-spacing: .04em }
.sh-player-close { margin-left: auto; min-height: 40px; padding: 0 1rem; border: 1px solid #ff2e93; border-radius: 99px; background: #ff2e93; color: #0f1112; font: 600 .85rem/1 system-ui, sans-serif; cursor: pointer }
.sh-player-close:hover, .sh-player-close:focus-visible { background: #0f1112; color: #ff2e93 }
.sh-player iframe { display: block; width: 100%; height: calc(var(--w) * 9 / 16 + 58px); border: 0; background: #0f1112 }
@media (max-width: 800px) {
  .sh-player { width: 100vw; height: 100dvh; border: 0; border-radius: 0; display: none; flex-direction: column }
  .sh-player[open] { display: flex }
  .sh-player-head span { display: none }
  .sh-player iframe { flex: 1; height: auto; min-height: 0 }
}

/* ---- /enterprise/ on a phone: the hero replay right under the lead, so it is on the first screen and starts there.
   The copy's own parts become the hero's rows; the command, the button and the fine print follow the replay. */
@media (max-width: 800px) {
  .hub-hero:has(#hero-replay) { display: flex; flex-direction: column }
  .hub-hero:has(#hero-replay) .hub-hero-copy { display: contents }
  .hub-hero:has(#hero-replay) .hub-hero-copy > * { margin-inline: var(--pad) }
  .hub-hero:has(#hero-replay) .hub-kicker { margin-top: 1.4rem }
  .hub-hero:has(#hero-replay) .hub-lead { margin-bottom: 1.1rem }
  .hub-hero:has(#hero-replay) .hub-hero-stage { order: 1; padding-top: 10px; padding-bottom: 12px }
  .hub-hero:has(#hero-replay) :is(.hub-command, .hub-actions, .hub-fine) { order: 2 }
  .hub-hero:has(#hero-replay) .hub-fine { margin-bottom: 1.4rem }
}
