/* ============================================================
   KIBO Search page (src/pages/platform/ai-search.astro), loaded only on
   that page, after public/home/tokens.css and public/home/home.css (which give
   it the buttons, --kh-blue / --kh-sky and the closing band).
   Brand colors: src/styles/tokens.css. Sections in page order; each group
   names its component in src/components/sections/search/.
   Breakpoints: 1340 (FAQ stacks), 900, 880 (rails stack), 760, 640, 480.
   ============================================================ */

.ks-page {
  --ks-gutter: 32px;
  --ks-section-y: 104px;
  --ks-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ks-ease-faq: cubic-bezier(.45, 0, .2, 1);
  --ks-glow:
    radial-gradient(58% 68% at 14% 16%, rgba(17,85,204,.52) 0%, rgba(17,85,204,0) 62%),
    radial-gradient(46% 60% at 88% 10%, rgba(74,134,232,.38) 0%, rgba(74,134,232,0) 66%),
    radial-gradient(70% 78% at 70% 98%, rgba(17,85,204,.44) 0%, rgba(17,85,204,0) 60%);
  width: 100%;
  overflow-x: clip;
  color: var(--kibo-dark-grey);
}
.ks-page h1, .ks-page h2, .ks-page h3, .ks-page p, .ks-page li, .ks-page button { text-wrap: balance; }
.ks-page img { max-width: 100%; }
.ks-page [hidden] { display: none !important; }
.ks-wrap { max-width: 1280px; margin: 0 auto; }
.ks-page em { font-style: normal; color: var(--kibo-yellow); }

.ks-section { padding: var(--ks-section-y) var(--ks-gutter); }
.ks-section--blue { background: var(--kh-blue); }
.ks-section--grey { background: var(--kibo-light-grey); }
.ks-section--glow { position: relative; overflow: hidden; background-color: var(--kibo-dark-grey); background-image: var(--ks-glow); color: var(--kibo-white); }
.ks-section--divider { border-top: 1px solid rgba(255,255,255,.08); }

.ks-h2 { margin: 0; font-family: var(--font-base); font-weight: 600; font-size: 31px; line-height: 1.12; letter-spacing: -.01em; max-width: 860px; color: var(--kibo-dark-grey); }
.ks-h2--white { color: var(--kibo-white); }
.ks-h2--light { font-weight: 400; }
.ks-h2--light strong { font-weight: 600; }

/* Buttons: the homepage's .kh-psec-btn (home.css), at the homepage's size */
.ks-page .kh-psec-btn { display: inline-flex; align-items: center; gap: 9px; font-size: 16px; padding: 12px 22px; text-decoration: none; white-space: nowrap; flex-shrink: 0; }

/* ==== Hero (SearchHero.astro); its animated backdrop is styled in home.css ==== */
.ks-hero { position: relative; overflow: hidden; background: var(--kibo-dark-grey); color: var(--kibo-white); }
.ks-hero__in { position: relative; z-index: 2; max-width: 1280px; margin: 0 auto; padding: 92px var(--ks-gutter) 96px; }
.ks-hero__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 56px; align-items: center; min-height: 400px; }
.ks-hero__copy { display: flex; flex-direction: column; gap: 26px; }
.ks-hero h1 { margin: 0; font-family: var(--font-base); font-weight: 600; font-size: clamp(38px, 4.6vw, 56px); line-height: 1.04; letter-spacing: -0.02em; color: var(--kibo-white); }
.ks-hero__lede { margin: 0; font-size: 19px; line-height: 1.35; max-width: 620px; color: var(--kibo-white); }
.ks-video { position: relative; aspect-ratio: 16 / 9; border-radius: 5px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ks-video__in { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ks-video__play { width: 72px; height: 72px; border-radius: 50%; background: var(--kibo-yellow); display: flex; align-items: center; justify-content: center; }
.ks-video__play svg { fill: var(--kibo-dark-grey); }
.ks-video__label { font-size: 14px; font-weight: 500; }

/* ==== Customer strip (SearchCustomers.astro) ==== */
@keyframes ks-marq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ks-customers { background: var(--kibo-light-grey); padding: 56px 0 60px; overflow: hidden; }
.ks-customers__h { margin: 0 auto 36px; padding: 0 var(--ks-gutter); max-width: 900px; text-align: center; font-family: var(--font-base); font-weight: 400; font-size: 22px; line-height: 1.3; color: var(--kibo-dark-grey); }
.ks-customers__h strong { font-weight: 600; }
.ks-marquee { width: 100%; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent 0, var(--kibo-black) 8%, var(--kibo-black) 92%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, var(--kibo-black) 8%, var(--kibo-black) 92%, transparent 100%); }
.ks-marquee__track { display: flex; align-items: center; gap: 56px; width: max-content; animation: ks-marq 160s linear infinite reverse; }
.ks-marquee__track:hover { animation-play-state: paused; }
.ks-marquee__set, .ks-marquee__item { display: flex; align-items: center; gap: 56px; flex-shrink: 0; }
.ks-marquee__item img { width: auto; max-width: 180px; object-fit: contain; filter: brightness(0); opacity: .72; }
/* logo heights (customers.logos.*.height; the site base CSS sets img height to auto) */
.ks-marquee__item .ks-logo-h16 { height: 16px; }
.ks-marquee__item .ks-logo-h18 { height: 18px; }
.ks-marquee__item .ks-logo-h20 { height: 20px; }
.ks-marquee__item .ks-logo-h22 { height: 22px; }
.ks-marquee__item .ks-logo-h24 { height: 24px; }
.ks-marquee__item .ks-logo-h26 { height: 26px; }
.ks-marquee__item .ks-logo-h28 { height: 28px; }
.ks-marquee__item .ks-logo-h30 { height: 30px; }
.ks-marquee__item .ks-logo-h32 { height: 32px; }
.ks-marquee__item .ks-logo-h34 { height: 34px; }
.ks-marquee__item .ks-logo-h36 { height: 36px; }
.ks-marquee__item .ks-logo-h38 { height: 38px; }
.ks-marquee__item .ks-logo-h40 { height: 40px; }

/* ==== Problem statement (SearchProblem.astro) ==== */
.ks-problem { display: flex; flex-direction: column; gap: 40px; }
.ks-xlist { margin: -20px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 18px; line-height: 1.42; color: var(--kibo-white); }
.ks-xlist li { display: flex; align-items: flex-start; gap: 12px; }
.ks-xmark { flex-shrink: 0; margin-top: 7px; }
.ks-xmark path { stroke: var(--kibo-yellow); stroke-width: 2.25; stroke-linecap: round; }
.ks-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ks-stat { position: relative; overflow: hidden; background: var(--kibo-dark-grey); border-radius: 5px; padding: 36px 34px; min-height: 216px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; }
.ks-stat__bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: brightness(1) contrast(1.1); pointer-events: none; }
.ks-stat--a .ks-stat__bg { background-image: url('/home/patterns/hex-01.svg'); }
.ks-stat--b .ks-stat__bg { background-image: url('/home/patterns/hex-04.svg'); }
.ks-stat__shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(135deg, rgba(46,52,62,.95) 0%, rgba(46,52,62,.7) 35%, rgba(46,52,62,0) 75%); }
.ks-stat__graphic { position: relative; width: 100%; max-width: 358px; height: auto; display: block; margin-bottom: 18px; }
.ks-stat__text { position: relative; margin: 0; font-weight: 400; font-size: 22px; line-height: 1.3; color: var(--kibo-white); }
.ks-stat__num { color: var(--kibo-yellow); font-weight: 600; }
/* stat graphics */
.ks-cube-y { fill: var(--kibo-yellow); stroke: var(--kibo-yellow); stroke-width: .6; stroke-linejoin: round; }
.ks-cube-b { fill: var(--kh-sky); stroke: var(--kh-sky); stroke-width: .6; stroke-linejoin: round; }
.ks-cube-empty { fill: none; stroke: var(--kibo-white); stroke-width: .6; stroke-dasharray: 1.2 1.2; stroke-linejoin: round; }
.ks-g-line { stroke: var(--kibo-white); stroke-width: 1.5; }
.ks-g-faint { stroke: rgba(255,255,255,.5); stroke-width: 1.5; }
.ks-g-pill { fill: var(--kibo-dark-grey); stroke: var(--kibo-white); stroke-width: 1.5; }
.ks-g-blue { fill: none; stroke: var(--kh-sky); stroke-width: 1.5; }
.ks-g-yellow { fill: none; stroke: var(--kibo-yellow); stroke-width: 1.5; }
.ks-g-text { fill: var(--kibo-white); font-family: var(--font-base); font-size: 17.4px; font-weight: 500; }

/* ==== Tab rails (SearchRail.astro) ==== */
.ks-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 32px; margin-bottom: 56px; }
.ks-rail { display: grid; grid-template-columns: 400px minmax(0, 1fr); align-items: stretch; }
.ks-rail__tabs { display: flex; flex-direction: column; justify-content: flex-start; gap: 2px; padding: 0 32px 24px 0; }
.ks-rail__tabs--caps { padding-top: 24px; }
.ks-rail__tab { display: block; text-align: left; border: 0; background: transparent; cursor: pointer; padding: 18px 22px; border-radius: 5px; font-family: var(--font-base); font-size: 16px; font-weight: 400; line-height: 1.24; color: var(--kibo-white); transition: background .5s var(--ks-ease), color .5s; }
.ks-rail__tab[aria-selected="true"] { background: var(--kibo-yellow); color: var(--kibo-dark-grey); }
.ks-rail__tab:focus-visible { outline: 2px solid var(--kibo-yellow); outline-offset: 2px; }
.ks-rail__panel { position: relative; overflow: hidden; background: rgba(46,52,62,.78); border: 1px solid rgba(255,255,255,.2); border-radius: 5px; padding: 56px 48px 44px; display: grid; gap: 22px; align-content: start; min-height: 400px; }
.ks-rail__panel--caps { min-height: 420px; }
.ks-rail__icon { position: absolute; top: 56px; left: 48px; z-index: 1; display: block; color: var(--kibo-white); pointer-events: none; }
.ks-rail__icon > span { display: block; }
.ks-rail__content { grid-area: 1 / 1; display: grid; gap: 22px; align-content: start; visibility: hidden; }
.ks-rail__content.is-active { visibility: visible; }
.ks-rail__space { display: block; height: 56px; }
.ks-rail__content h3 { margin: 0; font-family: var(--font-base); font-weight: 600; font-size: 27px; line-height: 1.14; letter-spacing: -.02em; max-width: 26ch; color: var(--kibo-white); }
.ks-rail__lead { margin: 0; font-size: 19px; line-height: 1.42; font-weight: 600; max-width: 52ch; color: var(--kibo-yellow); }
.ks-rail__body { margin: 0; font-size: 19px; line-height: 1.42; max-width: 56ch; color: var(--kibo-white); text-wrap: pretty; }

/* Phone accordion (SearchRail.astro), shown at 880px and below */
.ks-acc { display: none; }
.ks-acc__item { border: 1px solid rgba(255,255,255,.2); border-radius: 5px; overflow: hidden; background: rgba(46,52,62,.78); scroll-margin-top: 140px; }
.ks-acc__h { margin: 0; font: inherit; }
.ks-acc__btn {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%;
  padding: 18px 20px; border: 0; background: transparent; cursor: pointer; text-align: left;
  font-family: var(--font-base); font-size: 16px; font-weight: 400; line-height: 1.24; color: var(--kibo-white);
  transition: background .4s var(--ks-ease), color .4s var(--ks-ease);
}
.ks-acc__btn::after { content: ''; flex-shrink: 0; width: 8px; height: 8px; margin: -4px 4px 0 0; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .3s var(--ks-ease); }
.ks-acc__btn[aria-expanded="true"] { background: var(--kibo-yellow); color: var(--kibo-dark-grey); }
.ks-acc__btn[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: 4px; }
.ks-acc__btn:focus-visible { outline: 2px solid var(--kibo-yellow); outline-offset: 2px; }
.ks-acc__panel { display: grid; gap: 16px; padding: 28px 20px 30px; color: var(--kibo-white); }
.ks-acc__title { margin: 4px 0 0; font-family: var(--font-base); font-weight: 600; font-size: 23px; line-height: 1.14; letter-spacing: -.02em; color: var(--kibo-white); }

/* Icons (SearchIcon.astro): 1.5px line at any size, yellow hexagon */
@keyframes ks-hex-spin { to { transform: rotate(360deg); } }
.ks-icon { display: block; overflow: visible; }
.ks-icon * { vector-effect: non-scaling-stroke; }
.ks-hex { fill: var(--kibo-yellow); stroke: none; }
.ks-fill-line { fill: currentColor; stroke: none; }
.ks-fill-ground { fill: var(--kibo-dark-grey); }
.ks-icon--spin .ks-hex { transform-box: fill-box; transform-origin: center; animation: ks-hex-spin 14s linear infinite; }

/* ==== Platform cards (SearchPlatform.astro) ==== */
.ks-plat { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 20px; margin-top: 56px; }
.ks-plat__card { border: 1.5px solid transparent; border-radius: 5px; background: var(--kibo-dark-grey); color: var(--kibo-white); padding: 26px 24px 32px; display: flex; flex-direction: column; gap: 16px; transition: box-shadow .25s var(--ks-ease); }
.ks-plat__card:hover { box-shadow: 0 16px 40px rgba(0,0,0,.25); }
.ks-plat__card:hover .ks-icon--spin .ks-hex { animation-duration: 3.5s; }
.ks-plat__icon { height: 100px; display: flex; align-items: center; justify-content: center; color: var(--kibo-white); }
.ks-plat__card h3 { margin: 0; font-family: var(--font-base); font-weight: 600; font-size: 18px; line-height: 1.2; text-wrap: pretty; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--kibo-white); }
.ks-plat__card p { margin: 0; font-size: 14.5px; line-height: 1.55; color: rgba(255,255,255,.85); }
.ks-badge { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: var(--kibo-yellow); color: var(--kibo-dark-grey); border-radius: 60px; padding: 3px 9px; }

/* ==== FAQ (SearchFaq.astro): a row of panels, one open ==== */
.ks-faq { margin: 28px 0 0; display: flex; gap: 4px; align-items: stretch; height: 540px; overflow: hidden; }
.ks-faq__item {
  flex: 1 1 0px; min-width: 0; will-change: flex-grow; position: relative; overflow: hidden; cursor: pointer;
  border: 1px solid rgba(255,255,255,.18); border-radius: 4px; background: var(--kibo-dark-grey); color: var(--kibo-white);
  transition: flex-grow .7s var(--ks-ease-faq), background .5s var(--ks-ease-faq), border-color .5s var(--ks-ease-faq);
}
.ks-faq__item.is-open { flex-grow: 2; background: var(--kibo-link); border-color: var(--kibo-link); }
.ks-faq__item:focus-visible { outline: 2px solid var(--kibo-yellow); outline-offset: 2px; }
.ks-faq__face { position: absolute; top: 0; left: 0; bottom: 0; width: 260px; padding: 22px 18px; display: flex; flex-direction: column; justify-content: center; gap: 16px; opacity: 0; pointer-events: none; transition: opacity .45s var(--ks-ease-faq) .2s; }
.ks-faq__item.is-open .ks-faq__face { opacity: 1; }
.ks-faq__q { font-size: 19px; line-height: 25px; font-weight: 400; text-wrap: balance; }
.ks-faq__a { font-size: 14px; line-height: 21px; font-weight: 400; color: var(--kibo-white); text-wrap: pretty; }
.ks-faq__rail { position: absolute; top: 0; left: 0; bottom: 0; width: 100%; padding: 24px 12px; display: flex; align-items: center; justify-content: flex-start; opacity: 1; pointer-events: none; transition: opacity .35s var(--ks-ease-faq); }
.ks-faq__item.is-open .ks-faq__rail { opacity: 0; }
.ks-faq__title { display: block; white-space: pre; min-height: 126px; font-size: 14px; line-height: 21px; font-weight: 500; color: var(--kibo-white); text-align: left; }

/* ==== Resource tiles (SearchResources.astro) ==== */
.ks-res { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ks-res__tile { position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 300px; padding: 56px 40px 40px; background: var(--kibo-light-grey) url('/search/patterns/resource-tile-blog.svg') right bottom / cover no-repeat; text-decoration: none; color: var(--kibo-dark-grey); border: 1px solid rgba(46,52,62,.3); border-radius: 5px; overflow: hidden; }
.ks-res__tile:hover { color: var(--kibo-dark-grey); }
.ks-res__icon { display: flex; align-items: flex-end; height: 72px; margin-left: -14px; color: var(--kibo-dark-grey); }
.ks-res__bar { stroke: var(--kibo-yellow); stroke-width: 3; }
.ks-res__type { font-size: 17px; line-height: 22px; }
.ks-res__type strong { font-weight: 600; }
.ks-res__title { font-size: 21px; line-height: 27px; text-wrap: balance; }

/* ==== Closing band: the homepage's FinalCTA (home.css .kh-finalcta) ==== */
.ks-page .kh-finalcta h2 { font-size: 31px; line-height: 1.12; }
.ks-page .kh-finalcta p { font-size: 19px; line-height: 1.4; max-width: 56ch; color: var(--kibo-white); }

/* =================== Responsive =================== */

/* FAQ becomes a stacked accordion */
@media (max-width: 1340px) {
  .ks-faq { flex-direction: column; height: auto; }
  .ks-faq__item { flex: none; min-height: 56px; }
  .ks-faq__item.is-open { flex-grow: 0; }
  .ks-faq__item.is-open .ks-faq__face { position: relative; width: auto; }
  .ks-faq__item:not(.is-open) .ks-faq__face { display: none; }
  .ks-faq__item.is-open .ks-faq__rail { display: none; }
  .ks-faq__item:not(.is-open) .ks-faq__rail { position: relative; width: auto; padding: 18px 20px; align-items: center; }
  .ks-faq__title { min-height: 0; white-space: normal; }
}

@media (max-width: 900px) {
  .ks-stats { grid-template-columns: 1fr; }
}

/* Rails become an accordion (SearchRail.astro .ks-acc) */
@media (max-width: 880px) {
  .ks-rail { display: none; }
  .ks-acc { display: grid; gap: 8px; }
  .ks-head { margin-bottom: 36px; }
}

@media (max-width: 760px) {
  .ks-res { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .ks-page { --ks-gutter: 20px; --ks-section-y: 72px; }
  .ks-hero__in { padding-top: 64px; padding-bottom: 72px; }
  .ks-hero__grid { gap: 40px; min-height: 0; }
  .ks-hero__lede, .ks-rail__body, .ks-rail__lead, .ks-page .kh-finalcta p { font-size: 17px; }
  .ks-acc__title { font-size: 21px; }
  .ks-h2, .ks-page .kh-finalcta h2 { font-size: 27px; }
  .ks-customers__h { font-size: 19px; }
  .ks-stat { padding: 28px 24px; }
  .ks-stat__text { font-size: 19px; }
  .ks-res__tile { min-height: 240px; padding: 40px 28px 32px; }
  .ks-page .kh-finalcta { padding: 72px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ks-marquee__track, .ks-icon--spin .ks-hex { animation: none !important; }
  .ks-faq__item, .ks-rail__tab, .ks-faq__face, .ks-faq__rail, .ks-acc__btn, .ks-acc__btn::after { transition: none !important; }
  .ks-page .kh-psec-btn--primary::before { transition: none !important; }
}
