/* ===========================================================
   Aifit — genre showcase (SpaceX-style full-bleed panels)
   =========================================================== */
.genres { display: flex; flex-direction: column; }
/* SpaceX-style: each panel fills the viewport (below the sticky header) and
   gently snaps into place while scrolling */
html { scroll-snap-type: y proximity; }
.gpanel { position: relative; display: flex; align-items: flex-end; min-height: calc(100vh - 4.8rem); min-height: calc(100svh - 4.8rem); scroll-snap-align: start; scroll-margin-top: 4.8rem; overflow: hidden; color: #fff; background: #241E36; }
.gpanel image-slot { display: block; position: absolute; inset: 0; z-index: 0; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes gpanel-kb1 { from { transform: scale(1.07) translate(1.1%, 0.7%); } to { transform: scale(1.16) translate(-1.1%, -0.7%); } }
  @keyframes gpanel-kb2 { from { transform: scale(1.15) translate(-1%, 0.9%); } to { transform: scale(1.06) translate(1%, -0.9%); } }
  .gpanel image-slot { animation: gpanel-kb1 20s ease-in-out infinite alternate; will-change: transform; }
  .gpanel:nth-child(even) image-slot { animation-name: gpanel-kb2; animation-duration: 24s; }
}
.gpanel image-slot::part(empty) { background: linear-gradient(140deg, #3a3450, #221d31); color: rgba(255,255,255,.5); }
.gpanel-scrim { position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, rgba(24,20,34,.85) 0%, rgba(24,20,34,.34) 42%, rgba(24,20,34,.12) 70%, rgba(24,20,34,.22) 100%); }
.gpanel-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; transform: translateZ(0); will-change: transform; }
/* mobile (tall portrait panels): the 16:9 panel videos get cropped left/right.
   Shift the focal point per panel so the subject stays in frame. Pet: keep the
   dog's face centred (it sits centre-right in the source). */
@media (max-width: 768px) {
  .gpanel--pet .gpanel-video { object-position: 58% 50%; }
  .gpanel--technology .gpanel-video { object-position: 52% 50%; }
  /* shukatsu corridor: symmetric vanishing point — keep centred on mobile */
  .gpanel--shukatsu .gpanel-video { object-position: 50% 50%; }
}
.gpanel-wrap { position: relative; z-index: 3; width: 100%; padding-block: clamp(2rem, 5.5vh, 3.6rem); }
.gpanel-tx { display: flex; flex-direction: column; align-items: flex-start; gap: 0.55rem; max-width: 52rem; }
.gpanel-kicker { font-size: 0.68rem; font-weight: 800; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.gpanel-title { font-family: var(--mincho); font-weight: 600; font-size: clamp(1.6rem, 3.8vw, 2.8rem); line-height: 1.45; color: #fff; text-shadow: 0 3px 22px rgba(0,0,0,.55); letter-spacing: .03em; }
.gpanel--ai .gpanel-title { white-space: nowrap; }
@media (max-width: 760px) { .gpanel--ai .gpanel-title { white-space: normal; } }
.gpanel-sub { font-size: clamp(0.85rem, 1.4vw, 0.98rem); color: rgba(255,255,255,.88); line-height: 1.9; text-shadow: 0 2px 14px rgba(0,0,0,.5); text-wrap: pretty; }
.gpanel-brand { display: inline-flex; align-items: center; gap: 0.65em; font-family: var(--mincho); font-weight: 600; font-size: clamp(1rem, 1.6vw, 1.25rem); letter-spacing: 0.22em; color: var(--gold); text-shadow: 0 2px 14px rgba(0,0,0,.5); }
.gpanel-brand::before, .gpanel-brand::after { content: ""; width: 1.7em; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.gpanel-brand::after { background: linear-gradient(90deg, var(--gold), transparent); }
.gpanel-num { font-family: var(--mincho); font-style: normal; font-weight: 800; font-size: 2em; line-height: 1; color: var(--gold); margin: 0 0.06em; vertical-align: -0.12em; }
.gpanel-link { display: inline-flex; align-items: center; gap: 0.45em; margin-top: 0.7rem; font-size: 0.88rem; font-weight: 700; color: #fff; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; padding: 0.65em 1.5em; backdrop-filter: blur(4px); background: rgba(255,255,255,.08); transition: background .3s, color .3s, border-color .3s, transform .3s; }
.gpanel-link .ic { width: 1em; height: 1em; transition: transform .3s; }
.gpanel:hover .gpanel-link { background: #fff; color: var(--purple-deep); border-color: #fff; transform: translateY(-2px); }
.gpanel:hover .gpanel-link .ic { transform: translateX(3px); }
.gpanel-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.9rem; }
.gpanel-chip { font-size: 0.72rem; font-weight: 700; letter-spacing: .03em; color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.34); border-radius: 999px; padding: 0.34em 0.9em; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.gpanel--ai .gpanel-chip { background: rgba(124,107,166,.34); border-color: rgba(255,255,255,.42); }

/* photo-less panels (Technology / AI) */
.gpanel--plain { background:
  radial-gradient(70% 80% at 82% 20%, rgba(194,165,94,.22), transparent 65%),
  radial-gradient(60% 70% at 12% 88%, rgba(124,107,166,.4), transparent 70%),
  linear-gradient(135deg, #241E36, #3A2F55 62%, #463768); }
.gpanel--plain .gpanel-scrim { background: linear-gradient(to top, rgba(24,20,34,.5), transparent 55%); }
.gpanel--plain::after { content: "Aifit"; position: absolute; right: 4%; bottom: -0.14em; z-index: 0; font-family: var(--mincho); font-weight: 700; font-size: clamp(6rem, 17vw, 14rem); line-height: 1; color: rgba(255,255,255,.05); pointer-events: none; }

/* focus the consultant on the right in the After Support photo */
.gpanel--after image-slot::part(image) { object-position: 82% 50%; }

/* brighter source photos on these panels need a stronger veil */
.gpanel--technology .gpanel-scrim, .gpanel--ai .gpanel-scrim {
  background: linear-gradient(to top, rgba(24,20,34,.88) 0%, rgba(24,20,34,.5) 45%, rgba(24,20,34,.3) 100%); }

/* inset photo card (After Support) */
.gpanel-inset { position: absolute; right: clamp(4%, 8vw, 10%); top: 50%; transform: translateY(-55%); width: min(44%, 30rem); border-radius: 18px; overflow: hidden; box-shadow: 0 40px 80px -36px rgba(0,0,0,.8); border: 1px solid rgba(255,255,255,.16); z-index: 2; pointer-events: none; }
.gpanel-inset img { width: 100%; display: block; }

/* realistic smartphone mock on the AI panel */
.gphone { position: absolute; right: clamp(4%, 9vw, 12%); top: 50%; transform: translateY(-52%) rotate(2deg); z-index: 2; width: min(42%, 17rem); aspect-ratio: 9/18.5; background: #14111d; border-radius: 38px; padding: 10px; box-shadow: 0 50px 90px -36px rgba(0,0,0,.85), inset 0 0 0 2px rgba(255,255,255,.09); pointer-events: none; container-type: inline-size; }
.gphone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 28%; height: 9px; border-radius: 999px; background: #14111d; z-index: 3; }
.gphone-screen { width: 100%; height: 100%; border-radius: 29px; overflow: hidden; background: #F6F3EC; display: flex; flex-direction: column; }
.gphone-head { display: flex; align-items: center; gap: 3cqw; padding: 8.5cqw 5.3cqw 3.5cqw; background: #fff; border-bottom: 1px solid var(--line-soft); }
.gphone-ava { width: 11cqw; height: 11cqw; border-radius: 50%; background: #2E5F51; color: #fff; font-weight: 800; font-size: 4.2cqw; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.gphone-who { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.gphone-who b { font-size: 4.7cqw; color: var(--ink); white-space: nowrap; }
.gphone-who small { display: inline-flex; align-items: center; gap: 0.35em; font-size: 3.5cqw; color: var(--muted); font-weight: 600; white-space: nowrap; }
.gphone-who small i { width: 0.5em; height: 0.5em; border-radius: 50%; background: #3DBE6C; }
.gphone-body { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; gap: 3.2cqw; padding: 4.7cqw 4.1cqw; overflow: hidden; }
.gphone-time { align-self: center; font-size: 3.4cqw; color: var(--muted); font-weight: 600; }
.gphone .bub { font-size: 4.4cqw; line-height: 1.7; padding: 0.7em 1em; border-radius: 14px; max-width: 86%; box-shadow: 0 6px 14px -8px rgba(60,48,96,.3); }
.gphone .bub--user { align-self: flex-end; color: #fff; background: #2E5F51; border-bottom-right-radius: 5px; }
.gphone .bub--ai { align-self: flex-start; color: var(--ink); background: #fff; border-bottom-left-radius: 5px; }
.gphone .bub--typing { display: inline-flex; gap: 4px; padding: 0.8em 0.95em; }
.gphone .bub--typing i { width: 1.8cqw; height: 1.8cqw; border-radius: 50%; background: #2E5F51; opacity: .4; }
.gphone-input { display: flex; align-items: center; gap: 3cqw; margin: 0 3.5cqw 5cqw; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0.5em 0.5em 0.5em 1em; }
.gphone-input span { flex: 1; font-size: 3.6cqw; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gphone-input b { width: 8.8cqw; height: 8.8cqw; border-radius: 50%; background: #2E5F51; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 4.4cqw; flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .gphone { animation: gphone-float 6s ease-in-out infinite; }
  @keyframes gphone-float { 0%, 100% { transform: translateY(-52%) rotate(2deg); } 50% { transform: translateY(-55%) rotate(2deg); } }
  .gphone .bub--typing i { animation: gphone-typing 1.2s ease-in-out infinite; }
  .gphone .bub--typing i:nth-child(2) { animation-delay: .18s; }
  .gphone .bub--typing i:nth-child(3) { animation-delay: .36s; }
  @keyframes gphone-typing { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
}
@media (max-width: 700px) {
  /* AI panel: float the phone at the top-centre so the headline/body sit
     fully below it and never run under the mock */
  .gphone { left: 50%; right: auto; top: 3%; transform: translateX(-50%) rotate(2deg); width: auto; height: 42%; animation: none; }
}
/* keep the panel text clear of the phone at tablet/laptop widths */
@media (min-width: 701px) {
  .gpanel--ai .gpanel-tx, .gpanel--after .gpanel-tx { max-width: min(44rem, 48%); }
}
@media (max-width: 700px) {
  .gpanel-inset { right: 6%; top: 13%; transform: none; width: 70%; }
}

@media (max-width: 700px) {
  .gpanel { min-height: calc(100vh - 4.2rem); min-height: calc(100svh - 4.2rem); scroll-margin-top: 4.2rem; }
}

/* hero photo drifts like the panels */
@media (prefers-reduced-motion: no-preference) {
  .hero { overflow: hidden; }
  .hero .hero-photo { animation: gpanel-kb2 26s ease-in-out infinite alternate; will-change: transform; }
}
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* mobile: browser toolbars resize the viewport while scrolling, which makes
   snap stops land offset from the panel tops — disable snapping there */
@media (max-width: 1180px) {
  html { scroll-snap-type: none; }
}
