/* BrainBerry feature-video player + features playlist. Uses the site's tokens from styles.css. */

/* icon tile, like .pillar-mark */
.bbf-ic{width:var(--s);height:var(--s);border-radius:calc(var(--s) * .3);display:grid;place-items:center;flex:none;overflow:hidden}
.bbf-ic svg{width:50%;height:50%}
.bbf-ic img{width:78%;height:78%;object-fit:contain}

/* —————— player —————— */
.bbp{position:relative;background:var(--paper);border:2px solid var(--border);border-radius:var(--radius-card);box-shadow:var(--shadow-card);overflow:hidden;outline:none}
.bbp:focus-visible{box-shadow:0 0 0 4px var(--berry-light),var(--shadow-card)}
.bbp-screen{position:relative;aspect-ratio:16/9;background:var(--cream);overflow:hidden}
.bbp-screen iframe{position:absolute;inset:0;width:100%;height:100%;border:0;display:block}
.bbp-hit{position:absolute;inset:0;z-index:2;cursor:pointer}

/* teed up: a big play button with the feature name */
.bbp-poster{position:absolute;inset:0;z-index:3;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;pointer-events:none;opacity:0;transition:opacity .25s}
.bbp.is-teed .bbp-poster{opacity:1;background:rgba(42,16,32,.18)}
.bbp.is-paused .bbp-poster{opacity:1}
.bbp.is-paused .bbp-title{display:none}
.bbp-big{width:84px;height:84px;border-radius:50%;background:var(--berry);color:#fff;display:grid;place-items:center;box-shadow:0 6px 0 var(--berry-deep);transition:transform .18s}
.bbp-big svg{width:38px;height:38px;margin-left:5px}
.bbp-screen:hover .bbp-big{transform:scale(1.06)}
.bbp-title{background:var(--paper);color:var(--ink);font-weight:900;font-size:18px;padding:8px 18px;border-radius:var(--radius-pill);box-shadow:0 4px 0 rgba(43,16,32,.12)}

/* the "Next" card in the last 5 seconds */
.bbp-next{position:absolute;right:16px;bottom:16px;z-index:4;max-width:calc(100% - 32px);display:flex;align-items:center;gap:12px;padding:10px 18px 10px 10px;background:var(--paper);border:2px solid var(--border);border-radius:18px;box-shadow:0 5px 0 rgba(43,16,32,.12);text-align:left;opacity:0;transform:translateY(14px) scale(.96);pointer-events:none;transition:opacity .35s,transform .35s cubic-bezier(.3,1.4,.5,1)}
.bbp.show-next .bbp-next{opacity:1;transform:none;pointer-events:auto}
.bbp-next:hover{border-color:var(--berry)}
.bbp-nic{position:relative;display:grid;flex:none}
.bbp-nplay{position:absolute;inset:0;display:grid;place-items:center;border-radius:14px;background:rgba(42,16,32,.38);color:#fff}
.bbp-nplay svg{width:22px;height:22px}
.bbp-ntx small{display:block;font-weight:800;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--berry)}
.bbp-ntx{min-width:0}
.bbp-ntx b{display:block;font-weight:900;font-size:16px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* a 9:16 video is narrow: the name wraps instead of pushing the card wider than the video */
.bbp.is-tall .bbp-next{right:8px;bottom:8px;max-width:calc(100% - 16px);padding:6px 12px 6px 6px;gap:8px}
.bbp.is-tall .bbp-ntx b{white-space:normal;font-size:13px;line-height:1.2}

/* 1.5-second countdown between videos */
.bbp-count{position:absolute;inset:0;display:none;align-items:center;justify-content:center;gap:24px;background:rgba(42,16,32,.62);color:#fff}
.bbp.is-counting .bbp-count{display:flex}
.bbp.is-counting .bbp-hit{z-index:6;background:transparent}
.bbp-count .bbp-ctx{position:relative;z-index:7}
.bbp-pie{width:96px;height:96px;flex:none}
.bbp-pie-bg{fill:rgba(255,255,255,.16);stroke:#fff;stroke-width:4}
.bbp-pie-fill{fill:#fff}
.bbp-ctx small{display:block;font-weight:800;font-size:12px;letter-spacing:.1em;text-transform:uppercase;opacity:.85}
.bbp-ctx b{display:block;font-weight:900;font-size:clamp(20px,2.4vw,28px);margin:2px 0 12px}
.bbp-now{background:var(--paper);color:var(--berry);font-weight:900;font-size:14px;padding:9px 18px;border-radius:14px;box-shadow:0 4px 0 rgba(0,0,0,.25)}

/* the voiceover line, in its own strip so it never covers the video */
.bbp-cap{display:flex;align-items:center;justify-content:center;height:44px;padding:0 14px;overflow:hidden;border-top:2px solid var(--border);background:var(--paper)}
.bbp-cap p{position:relative;flex:none;margin:0;white-space:nowrap;font-weight:800;font-size:16px;color:var(--ink-soft)}
.bbp-cap span{border-radius:5px;transition:background .1s,color .1s}
.bbp-cap span.said{color:var(--ink)}
.bbp-cap span.say{background:#ffb93b;color:var(--ink);box-shadow:0 0 0 2px #ffb93b}

/* control bar */
.bbp-bar{display:flex;align-items:center;gap:6px;padding:10px 14px;border-top:2px solid var(--border);background:var(--paper)}
.bbp-btn{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;color:var(--ink);flex:none;transition:background .15s}
.bbp-btn:hover{background:var(--berry-light);color:var(--berry)}
.bbp-btn:disabled{opacity:.35;pointer-events:none}
.bbp-pp{background:var(--berry);color:#fff;box-shadow:0 3px 0 var(--berry-deep)}
.bbp-pp:hover{background:var(--berry);color:#fff;filter:brightness(1.08)}
.bbp-name{font-weight:900;font-size:15px;margin-left:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:34%}
.bbp-track{flex:1;padding:10px 0;margin:0 6px;min-width:40px;cursor:pointer;touch-action:none}
.bbp-rail{height:8px;border-radius:99px;background:var(--berry-light);overflow:hidden}
.bbp-track i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--berry),var(--juice));border-radius:inherit;transition:width .15s linear}
.bbp-time{font:500 13px 'JetBrains Mono',monospace;color:var(--ink-soft);white-space:nowrap}
.bbp-speed{min-width:48px;height:32px;padding:0 8px;flex:none;border-radius:10px;font-weight:800;font-size:13px;color:var(--ink);transition:background .15s,color .15s}
.bbp-speed:hover{background:var(--berry-light);color:var(--berry)}
.bbp-speed.is-slow{background:var(--berry-light);color:var(--berry)}

/* the 9:16 cut on a phone held upright, kept short enough to see the controls */
.bbp.is-tall .bbp-screen{aspect-ratio:9/16;width:min(100%,calc((100vh - 216px) * 9 / 16));width:min(100%,calc((100svh - 216px) * 9 / 16));margin:0 auto}
/* ...except on the phone widths that get the 9:16 cut: there it fills the card, never with bars beside it */
@media (orientation:portrait) and (max-width:480px){.bbp.is-tall:not(.is-full) .bbp-screen{width:100%}}

/* full screen: the video fills the screen with the bar underneath */
.bbp.is-full{display:flex;flex-direction:column;border:0;border-radius:0;background:#000}
.bbp.is-full .bbp-screen{flex:1;aspect-ratio:auto;background:#000}
.bbp.is-full .bbp-screen iframe{width:min(100%,calc((100vh - 108px) * 16 / 9));height:auto;aspect-ratio:16/9;margin:auto;position:absolute;inset:0}
.bbp.is-full.is-tall .bbp-screen{width:100%;aspect-ratio:auto;margin:0}
.bbp.is-full.is-tall .bbp-screen iframe{width:min(100%,calc((100vh - 108px) * 9 / 16));aspect-ratio:9/16}

@media (max-width:640px){
  .bbp-name{display:none}
  .bbp-cap p{font-size:14px}
  .bbp-bar{gap:4px;padding:8px 10px}
  .bbp-next{right:8px;bottom:8px;padding:6px 12px 6px 6px;gap:8px}
  .bbp-ntx b{font-size:13px}
  .bbp-big{width:60px;height:60px}.bbp-big svg{width:28px;height:28px}
  .bbp-title{font-size:14px}
  .bbp-pie{width:64px;height:64px}
  .bbp-count{gap:14px}
  .bbp-ctx b{margin-bottom:8px}
}

/* —————— home: the hero text on its own, centred, with the video straight under it —————— */
.hero.hero-solo{padding:36px 0 28px}
.hero-solo .hero-grid{grid-template-columns:1fr;text-align:center;justify-items:center}
.hero-solo h1.hero-title{font-size:clamp(36px,5vw,62px)}
.hero-solo .hero-sub{margin:16px auto 0;max-width:680px;font-size:18px}
.bbv-sec{padding:0 0 64px}
.bbv-top{max-width:1000px;margin:0 auto 12px;display:flex;justify-content:flex-end}
.bbv-top .btn{padding:8px 16px;font-size:14px}
.bbv-player{max-width:1000px;margin:0 auto}
.bbv-foot{display:flex;flex-direction:column;align-items:center;margin-top:22px}
.bbv-foot .hero-trust{justify-content:center;margin-top:18px}
.bbv-social{font-weight:800;font-size:18px;color:var(--ink);text-align:center}
.bbv-btns{display:flex;justify-content:center;flex-wrap:wrap;gap:12px;margin-top:14px}

/* —————— /features —————— */
.fx-head{padding-top:36px;padding-bottom:40px}
.fx-head .sec-head{margin-bottom:0}
.fx-layout{display:grid;gap:28px;align-items:start;padding-top:0}
.fx-list{list-style:none;display:grid;gap:12px;grid-template-columns:repeat(auto-fill,minmax(260px,1fr))}
.fx-item{position:relative}
.fx-card{width:100%;height:100%;display:flex;align-items:flex-start;gap:14px;padding:14px;background:var(--paper);border:2px solid var(--border);border-radius:18px;text-align:left;transition:border-color .2s,box-shadow .2s,transform .18s}
.fx-card:hover{transform:translateY(-2px);border-color:var(--juice)}
.fx-txt{flex:1;min-width:0}
.fx-txt b{display:block;font-weight:900;font-size:16px;color:var(--ink)}
.fx-txt p{font-size:13.5px;margin-top:3px}
.fx-play{width:36px;height:36px;border-radius:50%;flex:none;display:grid;place-items:center;background:var(--berry-light);color:var(--berry);align-self:center}
.fx-play svg{width:16px;height:16px;margin-left:2px}
.fx-pill{display:none;margin-bottom:6px}
.fx-nexttx{display:none;margin-top:6px;font-weight:800;font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--berry)}
.fx-item.is-now .fx-card{border-color:var(--berry);box-shadow:0 5px 0 var(--berry);background:#fff7fa}
.fx-item.is-now .fx-pill{display:inline-flex}
.fx-item.is-now .fx-play{background:var(--berry);color:#fff}
.fx-item.is-next .fx-nexttx{display:block}
.fx-pill .dot{width:7px;height:7px;border-radius:99px;background:var(--berry)}
.fx-item.is-now.is-live .fx-pill .dot{animation:fxPulse 1.2s ease-in-out infinite}
@keyframes fxPulse{50%{opacity:.25}}

/* the category tabs */
.fx-bar{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px;margin-top:24px}
.fx-tabs{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
.fx-tab{padding:9px 18px;border:2px solid var(--border);border-radius:var(--radius-pill);background:var(--paper);color:var(--ink);font-weight:800;font-size:15px;transition:border-color .15s,background .15s,color .15s}
.fx-tab:hover{border-color:var(--juice)}
.fx-tab[aria-selected="true"]{background:var(--berry);border-color:var(--berry);color:#fff}
.bbf-em{font-size:calc(var(--s) * .5);line-height:1}

/* search across every category */
.fx-search{display:flex;align-items:center;gap:8px;max-width:100%}
.fx-sbtn{width:44px;height:44px;flex:none;display:grid;place-items:center;border:2px solid var(--border);border-radius:50%;background:var(--paper);color:var(--ink);transition:border-color .15s,background .15s,color .15s}
.fx-sbtn:hover{border-color:var(--juice)}
.fx-sbtn[aria-expanded="true"]{background:var(--berry);border-color:var(--berry);color:#fff}
.fx-search input{width:260px;min-width:0;height:44px;padding:0 16px;border:2px solid var(--border);border-radius:var(--radius-pill);background:var(--paper);color:var(--ink);font:inherit;font-weight:700;font-size:16px}
.fx-search input:focus{outline:none;border-color:var(--berry)}
.fx-cat{display:none;margin-bottom:2px;font-weight:800;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--berry)}
.fx-list.is-search .fx-cat{display:block}
.fx-player{scroll-margin-top:84px}
.fx-none{padding:18px;font-weight:800;color:var(--ink-soft);text-align:center;grid-column:1/-1}

/* the social media link under the list */
.fx-social{text-align:center;padding-top:48px;padding-bottom:0}
.fx-social p{font-weight:800;font-size:18px;color:var(--ink)}
.fx-social-links{display:flex;justify-content:center;flex-wrap:wrap;gap:12px;margin-top:14px}

/* small screens: the list sits under the video, so results go above it until one is picked */
@media (max-width:999px){.fx-list.is-browsing{order:-1}}

/* large screens: the video on the left, the list on the right */
@media (min-width:1000px){
  .fx-layout{grid-template-columns:minmax(0,1fr) 360px}
  .fx-player{position:sticky;top:96px}
  .fx-list{grid-template-columns:1fr;max-height:calc(100vh - 140px);overflow:auto;padding:4px 6px 10px 2px}
}
@media (prefers-reduced-motion:reduce){.fx-card,.bbp-next{transition:none}}

/* hold the home player's space until bb-player.js fills it, so the page below doesn't jump:
   the screen (16:9, or 9:16 on an upright phone) plus the caption strip and control bar */
.bbv-player:empty{background:var(--paper);border:2px solid var(--border);border-radius:var(--radius-card)}
.bbv-player:empty::before{content:'';display:block;aspect-ratio:16/9;background:var(--cream)}
.bbv-player:empty::after{content:'';display:block;height:106px}
@media (max-width:640px){.bbv-player:empty::after{height:102px}}
@media (orientation:portrait) and (max-width:480px){.bbv-player:empty::before{aspect-ratio:9/16}}

/* Features page: a plain-text summary of every feature under the video list */
.fx-about{margin-top:56px}
.fx-about h2{text-align:center;font-size:clamp(28px,3.6vw,40px)}
.fx-about-sub{text-align:center;color:var(--ink-soft);font-size:17px;max-width:640px;margin:12px auto 28px}
.fx-about-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}
.fx-about-item{background:var(--paper);border:2px solid var(--border);border-radius:var(--radius-card);padding:18px 20px}
.fx-about-item h3{font-size:18px;margin:0 0 6px}
.fx-about-item p{margin:0;color:var(--ink-soft);font-size:15px;line-height:1.5}
