/* AI Buddy · "How we think about building with AI." (#think, data-sec="think")
   One window: headline, lead and the three video cards are in the layout from the start and fit the window together.
   Nothing here depends on scroll position; the entrance is the shared one (assets/kit.js, [data-scene] / [data-u] / [data-words]).

   Layout   .think-head     headline + lead
            .think-row      the three cards; a three column grid on a wide page, a swipe row on a narrow one
                            (the .swp cue under it is driven by the shell script through data-swp=".think-row")
            .think-card     one video, a link to it on YouTube: .think-th (the video's thumbnail, .think-img, under .think-play),
                            .think-t title, .think-yt
   Sizes    the shared ones from sections.css (--u, --fs-h2, --fs-sub); the thumbnail keeps the 16:10 frame
            (YouTube's picture is 16:9, so a sliver is cut at each side)
   States   .is-armed / .is-in from kit.js (entrance only): the head, then the row with its cards a beat apart
            :hover lifts the thumbnail and underlines the title */

.think-row{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(16px,2cqw,28px);
  margin-top:clamp(28px,calc(var(--u) * 3.6),64px);
}

/* one card */
.think-card{display:block;color:var(--ink-hi);text-decoration:none;border-radius:16px}
.think-card:focus-visible{outline:2px solid var(--v2);outline-offset:6px}
.think-th{
  position:relative;display:block;aspect-ratio:16/10;overflow:hidden;border-radius:16px;
  background:#0e0e12;border:1px solid rgba(255,255,255,.09);
  transition:transform .7s var(--ease),border-color .5s;
}
.think-th::before{content:"";position:absolute;left:8%;right:8%;top:0;height:1px;background:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.55),rgba(255,255,255,0));opacity:.12;pointer-events:none}
.think-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.think-play{
  position:absolute;left:50%;top:50%;width:64px;height:64px;margin:-32px 0 0 -32px;border-radius:50%;
  display:grid;place-items:center;background:rgba(12,12,16,.62);border:1px solid rgba(255,255,255,.45);   /* dark, so it holds on a bright picture */
  transition:transform .6s var(--ease),background .4s,border-color .4s;
}
.think-play svg{width:18px;height:18px;margin-left:3px;fill:#fff}
.think-play::after{content:"";position:absolute;inset:-1px;border-radius:50%;border:1px solid var(--v2);opacity:0}
.think-t{margin:18px 0 0;font-size:clamp(17px,calc(var(--u) * 1.1),20px);font-weight:400;line-height:1.35;letter-spacing:-.01em;color:var(--ink-hi)}
.think-t span{background:linear-gradient(currentColor,currentColor) 0 100%/0 1px no-repeat;transition:background-size .6s var(--ease)}
.think-yt{display:block;margin-top:10px;font-style:normal;font-size:11px;line-height:1.3;letter-spacing:.34em;color:#9d9da6}

/* hover (pointer only) */
.think-card:hover .think-th{transform:translateY(-6px);border-color:rgba(180,140,255,.5)}
.think-card:hover .think-play{transform:scale(1.14);background:var(--v);border-color:var(--v)}
.think-card:hover .think-play::after{animation:ring 1.2s var(--ease) infinite}   /* ring: keyframes in site.css */
.think-card:hover .think-t span{background-size:100% 1px}

/* entrance: the row is one part (on a narrow page most cards are off to the side, so they could never be "seen" one by one);
   its cards follow each other 90 ms apart where sibling-index() exists, else together */
.is-armed .think-row[data-u]{transform:none}
.is-armed .think-row .think-card{opacity:0;transform:translate3d(0,14px,0)}
.is-armed .think-row.is-in .think-card{opacity:1;transform:none;transition:opacity .5s var(--ease),transform .6s var(--ease);transition-delay:calc((sibling-index() - 1) * 90ms)}

/* narrow page (phones, and the phone preview): a swipe row that bleeds to the page edges, one card and a bit of the next */
@container (max-width:900px){
  .think-row{
    grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:84%;gap:14px;
    overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;
    margin-inline:calc(-1 * var(--g));padding:6px var(--g) 18px;scroll-padding-inline:var(--g);
  }
  .think-row::-webkit-scrollbar{display:none}
  .think-card{scroll-snap-align:center}
  .think-card:hover .think-th{transform:none}
}
