/* "Things I have built". Tokens only outside the device frames; the demos keep their own colours inside. */
.bt{margin-top:clamp(40px,7vw,96px);padding:0 var(--gutter) clamp(40px,7vw,96px);scroll-margin-top:72px;overflow-x:clip}

/* header row: the title, then previous / "2 of 4" / next */
.bt-nav{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.bt-title{margin:0;font:400 1.5rem/1.2 var(--display);color:var(--dim)}
.bt-step{display:flex;align-items:center;gap:10px}
.bt-cur{margin:0;min-width:4.2em;text-align:center;font:900 1.25rem/1 var(--display);color:var(--tan);font-variant-numeric:tabular-nums}
.bt-arrow{width:44px;height:44px;border-radius:50%;border:1px solid var(--rule);background:none;color:var(--line);cursor:pointer;display:grid;place-items:center;padding:0;transition:border-color .2s,color .2s}
.bt-arrow:hover:not(:disabled){border-color:var(--tan);color:var(--tan)}
.bt-arrow:focus-visible,.bt-strip:focus-visible{outline:2px solid var(--tan);outline-offset:3px}
.bt-arrow:disabled{color:var(--dim);opacity:.4;cursor:default}

/* the carousel: a native snap strip with the active card centred and its neighbours peeking. Vertical scroll is never captured. */
.bt{container-type:inline-size;--bw:calc(100cqw + 2 * var(--gutter));--cw:min(1080px,calc(var(--bw) - 260px));--gap:24px;--ch:clamp(400px,calc(100svh - 165px),620px);--sh:calc(var(--ch) - 40px)}
.bt-strip{display:flex;gap:var(--gap);align-items:stretch;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:none;
  margin:12px calc(-1 * var(--gutter)) 0;padding:6px calc((var(--bw) - var(--cw)) / 2) 14px;outline-offset:-2px}
.bt-strip::-webkit-scrollbar{display:none}
.bt-panel{flex:0 0 var(--cw);min-width:0;height:var(--ch);scroll-snap-align:center;scroll-snap-stop:always;display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:clamp(16px,2.4vw,36px);
  padding:20px;border:1px solid var(--rule);border-radius:22px;background:color-mix(in srgb,var(--sheet-2) 70%,transparent);
  opacity:.42;transform:scale(.9);transition:opacity .35s,transform .35s,border-color .35s}
.bt-panel.on{opacity:1;transform:none;border-color:color-mix(in srgb,var(--tan) 38%,var(--rule))}
.bt-panel:not(.on){cursor:pointer}

/* stage: the same box on every card, the device centred in it */
.bt-stage{height:var(--sh);display:flex;align-items:center;justify-content:center;min-width:0;min-height:0}
.bt-dev{position:relative;background:color-mix(in srgb,var(--sheet) 50%,black);border:1px solid color-mix(in srgb,var(--line) 24%,transparent);box-shadow:0 28px 48px -26px color-mix(in srgb,black 70%,transparent);overflow:hidden;display:flex;flex-direction:column}
/* one true phone ratio for both phones: the SCREEN is 9:19.5, the bezel is added around it */
.bt-dev-phone{--bz:max(7px,calc(var(--sh) * .026));height:var(--sh);width:calc((var(--sh) - 2 * var(--bz)) * 9 / 19.5 + 2 * var(--bz));max-width:100%;border-radius:calc(var(--bz) * 3.6);padding:var(--bz)}
.bt-dev-phone .bt-screen{border-radius:calc(var(--bz) * 2.7)}
.bt-cam{position:absolute;top:15px;left:50%;width:7px;height:7px;margin-left:-3.5px;border-radius:50%;background:color-mix(in srgb,var(--sheet) 30%,black);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--line) 16%,transparent);z-index:2;pointer-events:none}
.bt-dev-window{width:min(100%,calc((var(--sh) - 30px) * 1.6));border-radius:12px}
.bt-dev-window .bt-screen{flex:none;aspect-ratio:16/10}
.bt-dev-window.bt-port{width:min(100%,calc((var(--sh) - 30px) * 4 / 5.4))}
.bt-dev-window.bt-port .bt-screen{aspect-ratio:4/5.4}
.bt-bar{flex:none;height:30px;display:flex;align-items:center;padding:0 12px;border-bottom:1px solid var(--rule);position:relative}
.bt-dts{display:flex;gap:6px}
.bt-dts i{width:9px;height:9px;border-radius:50%;background:var(--dim);opacity:.55}
.bt-wtitle{position:absolute;left:0;right:0;text-align:center;font:500 12px/1 var(--body);color:var(--dim);pointer-events:none}
.bt-screen{position:relative;flex:1;min-height:0;overflow:hidden;background:var(--sheet-2)}
.bt-screen>*:not(.bt-ph){max-width:100%}
.bt-host{position:absolute;inset:0}
.bt-host>*{width:100%;height:100%}
.bt-ph[hidden]{display:none}
.bt-ph{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;text-align:center;padding:16px;color:var(--dim);font:400 14px/1.4 var(--body)}
.bt-ph b{font:900 24px/1.1 var(--display);color:var(--line)}

/* AI Sidekick demo, inside the phone: (1) the screen fills the phone's real shape instead of a fixed 9:16 and the lower controls move down by the extra height;
   (2) once the live character is running, the still photo of the character underneath is hidden, otherwise two Sunnys show; (3) no "Sunny AI" tag. */
.bt-screen .skd-screen{touch-action:pan-x pan-y;aspect-ratio:auto;height:100%;container-type:size}
.bt-screen .skd-talk,.bt-screen .skd-state,.bt-screen .skd-chat{margin-top:calc(100cqh - 100cqw * 16 / 9)}
.bt-screen .skd-stage.is-live .skd-still{opacity:0;transition:opacity .5s .45s}
.bt-screen .skd-pill{display:none}

/* info: header, description, facts, links, demo controls, always in this order */
.bt-info{display:flex;flex-direction:column;min-width:0;min-height:0;gap:12px}
.bt-hd{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:12px;align-items:baseline}
.bt-no{font:900 1rem/1 var(--display);color:var(--tan);font-variant-numeric:tabular-nums}
.bt-name{margin:0;font:900 clamp(1.6rem,2.4vw,2.2rem)/1.1 var(--display);color:var(--line)}
.bt-status{grid-column:2;margin-top:6px;color:var(--dim);font-size:14px;line-height:1.35}
.bt-what{margin:0;font-size:clamp(16px,1.25vw,18px);line-height:1.42}
.bt-dl{margin:0;display:grid;gap:10px}
.bt-dl>div{display:grid;grid-template-columns:6.2em minmax(0,1fr);gap:10px;padding-top:10px;border-top:1px solid var(--rule)}
.bt-dl dt{color:var(--dim);font-size:14px}
.bt-dl dd{margin:0;font-size:15px;line-height:1.4}
.bt-stack{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:2px 12px}
.bt-skill{all:unset;cursor:pointer;color:var(--line);text-decoration:underline dotted var(--tan);text-underline-offset:4px}
.bt-skill:hover{color:var(--tan)}
.bt-skill:focus-visible{outline:2px solid var(--tan);outline-offset:3px;border-radius:4px}
.bt-links{margin:0;display:flex;flex-wrap:wrap;gap:4px 18px;min-height:1.4em;font-size:15px}
.bt-links a{color:var(--line);text-underline-offset:4px}
.bt-links a:hover{color:var(--tan)}
.bt-cap{display:flex;align-items:center;gap:12px;margin-top:auto;min-height:44px}
.bt-hint{margin:0;color:var(--dim);font-size:13px;line-height:1.4}
.bt-pp{flex:none;min-height:44px;padding:0 16px;border-radius:22px;border:1px solid var(--rule);background:none;color:var(--line);font:500 14px/1 var(--body);cursor:pointer}
.bt-pp:hover{border-color:var(--tan);color:var(--tan)}
.bt-pp[hidden]{display:none}

/* narrow: one column inside the card, the card nearly the full width with its neighbours peeking */
@media (max-width:899px){
  .bt{--cw:calc(var(--bw) - 56px);--gap:12px;--ch:auto;--sh:clamp(260px,35svh,300px)}
  .bt-panel{grid-template-columns:minmax(0,1fr);grid-template-rows:auto 1fr;height:auto;padding:16px;border-radius:20px}
  .bt-info{gap:12px}
  .bt-no{display:none}
  .bt-hd{grid-template-columns:minmax(0,1fr)}
  .bt-status{grid-column:1}
}
/* a phone held upright: the card has to fit one screen under the header row, so the facts are set as short runs,
   each label leading its own line, instead of a column of labels that halves the width and doubles the lines */
@media (max-width:899px) and (orientation:portrait){
  /* the stage keeps the narrow height on every card: a window demo lays itself out for its width and crops under about 195 px */
  .bt-title{font-size:1.35rem}
  .bt-step{gap:6px}
  .bt-cur{min-width:3.4em}
  .bt-panel{gap:12px;padding:14px 16px 16px}
  .bt-info{gap:10px}
  .bt-name{font-size:1.5rem}
  .bt-status{margin-top:2px}
  .bt-what{font-size:15px;line-height:1.4}
  .bt-dl{gap:8px}
  .bt-dl>div{display:block;padding-top:8px}
  .bt-dl dt{display:inline;margin-right:.6em}
  .bt-dl dd{display:inline;line-height:1.45}
  .bt-dl .bt-stack,.bt-dl .bt-stack li{display:inline}
  .bt-dl .bt-stack li{margin-right:12px}
  .bt-links:empty{display:none}
}
/* touch: every control gets a 44px hit area; the visual size stays */
@media (pointer:coarse){
  .bt-stack li{display:flex;align-items:center;min-height:44px}
  .bt-skill{display:inline-flex;align-items:center;min-height:44px}
  .bt-links a{display:inline-flex;align-items:center;min-height:44px}
  .bt-hint{font-size:14px}
}
/* phone held sideways: the card is as tall as what is left, stage left and facts right, scrolling inside their column */
@media (orientation:landscape) and (max-height:500px){
  .bt{scroll-margin-top:8px;margin-top:24px;--cw:calc(var(--bw) - 120px);--ch:calc(100svh - 120px);--sh:calc(var(--ch) - 32px)}
  .bt-panel{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);height:var(--ch);padding:16px}
  .bt-info{overflow:hidden auto} /* no overscroll containment: a sideways swipe on the text moves the carousel, and a scroll that reaches the end of the facts carries on down the page */
  .bt-no{display:inline}.bt-hd{grid-template-columns:auto minmax(0,1fr)}.bt-status{grid-column:2}
}
@media (prefers-reduced-motion:reduce){.bt-panel{transition:none}.bt-screen .skd-stage.is-live .skd-still{transition:none}}
