/* ==========================================================================
   Home sections — views/sections/*.php (Faz 8)
   Theme-aware through tokens only; small [data-theme] shape overrides at the end of each block.
   Content is visible without JS; [data-reveal] only animates in when JS runs (js/site/modules/reveal.js).
   ========================================================================== */

.home-section { position: relative; }
.section-head__action { flex-shrink: 0; }
[data-theme="film"] .chapter__num::before { content: attr(data-roman) ". "; }
[data-theme="aurora"] .home-section .section-head > div { display: flex; flex-direction: column; align-items: center; }
[data-theme="aurora"] :is(.faq, .studio) .section-head { align-items: flex-start; text-align: left; }
[data-theme="aurora"] :is(.faq, .studio) .section-head > div { align-items: flex-start; }
[data-theme="film"] .chapter__num { font-size: 0; }
[data-theme="film"] .chapter__num::before { font-size: var(--step--1); color: var(--color-accent); letter-spacing: .2em; }

/* ---------- Scroll reveal ---------- */
.reveal-ready [data-reveal] { transition: opacity .9s var(--ease-out), transform 1s var(--ease-out), filter .9s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal-ready [data-reveal]:not(.is-revealed) { opacity: 0; transform: translateY(28px); }
[data-theme="aurora"].reveal-ready [data-reveal]:not(.is-revealed) { filter: blur(8px); }
[data-theme="film"].reveal-ready [data-reveal]:not(.is-revealed) { transform: none; }

/* ---------- Dialog (showreel, certificate lightbox) ---------- */
.media-dialog { width: min(1100px, 94vw); max-height: 90vh; padding: 0; border: 1px solid var(--color-line); border-radius: var(--radius-lg); background: #000; color: var(--color-text); overflow: visible; }
.media-dialog::backdrop { background: rgba(0, 0, 0, .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.media-dialog__frame { aspect-ratio: 16 / 9; width: 100%; border-radius: inherit; overflow: hidden; }
.media-dialog--doc .media-dialog__frame { aspect-ratio: auto; height: min(80vh, 900px); background: var(--color-surface); }
.media-dialog__frame iframe, .media-dialog__frame video, .media-dialog__frame img { display: block; width: 100%; height: 100%; border: 0; object-fit: contain; background: #000; }
.media-dialog__close { position: absolute; top: -52px; right: 0; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--color-surface-2); color: var(--color-text); }
.media-dialog__close:hover { background: var(--color-accent); color: var(--color-accent-ink); }
.media-dialog[open] { animation: dialog-in .45s var(--ease-out); }
@keyframes dialog-in { from { opacity: 0; transform: scale(.96); } }
[data-theme="film"] .media-dialog { border-radius: 2px; }

/* ---------- 1. Showreel (Container Scroll adaptation) ---------- */
.showreel__stage { perspective: 1200px; }
.showreel__screen {
  --tilt: 18deg; --scale: .92;
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-lg);
  border: 1px solid var(--color-line); background: radial-gradient(ellipse at 30% 20%, color-mix(in srgb, var(--color-accent) 18%, transparent), transparent 55%), var(--color-surface);
  box-shadow: 0 60px 120px -40px rgba(0, 0, 0, .9), 0 0 0 8px color-mix(in srgb, var(--color-text) 3%, transparent);
  transform: rotateX(var(--tilt)) scale(var(--scale)); transform-origin: center top; will-change: transform;
}
.showreel__preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.showreel__preview--empty { background: repeating-linear-gradient(90deg, transparent 0 60px, color-mix(in srgb, var(--color-text) 3%, transparent) 60px 61px); }
.showreel__screen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent 45%); pointer-events: none; }
.showreel__rec { position: absolute; top: 20px; right: 24px; z-index: 1; display: inline-flex; align-items: center; gap: 8px; }
.showreel__tc { position: absolute; left: 24px; bottom: 20px; z-index: 1; color: var(--color-muted); }
.showreel__play {
  position: absolute; inset: 0; z-index: 2; margin: auto; display: grid; place-items: center; width: 104px; height: 104px; border-radius: 50%;
  background: color-mix(in srgb, var(--color-text) 12%, transparent); border: 1px solid color-mix(in srgb, var(--color-text) 30%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--color-text); transition: transform .5s var(--ease-out), background-color .3s;
}
.showreel__play .icon { width: 34px; height: 34px; margin-left: 4px; }
.showreel__play:hover { transform: scale(1.08); background: var(--color-accent); color: var(--color-accent-ink); }
.showreel__caption { margin-top: var(--space-6); }
[data-theme="film"] .showreel__screen { border-radius: 2px; box-shadow: 0 0 0 1px var(--color-line), 0 40px 80px -30px #000; }
[data-theme="film"] .showreel__preview { filter: grayscale(.35) contrast(1.1); }

/* ---------- 2. Voice demos ---------- */
.voice-demos { overflow: hidden; }
.voice-demos__wave { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 55%; z-index: -1; opacity: .5; pointer-events: none; }
.voice-demos__wave path { fill: color-mix(in srgb, var(--color-accent) 5%, transparent); animation: wave-drift 16s ease-in-out infinite alternate; transform-origin: center; }
.voice-demos__wave path + path { fill: color-mix(in srgb, var(--color-aux-1) 5%, transparent); animation-duration: 22s; animation-direction: alternate-reverse; }
@keyframes wave-drift { from { transform: translateX(-3%) scaleY(.9); } to { transform: translateX(3%) scaleY(1.15); } }
.demo-card__bars i { transition: transform .5s var(--ease-out), background-color .3s; transform-origin: center; }
.demo-card:hover .demo-card__bars i { animation: bar-wave 1.2s ease-in-out infinite; animation-delay: calc(var(--n, 0) * -40ms); }
@keyframes bar-wave { 50% { transform: scaleY(.55); } }
.demo-card.is-current { border-color: color-mix(in srgb, var(--color-accent) 55%, transparent); }
.demo-card__playing { display: none; color: var(--color-accent); }
.demo-card.is-current .demo-card__playing { display: inline-flex; }

/* ---------- 3. Services bento ---------- */
.services__group { margin: var(--space-6) 0 var(--space-4); color: var(--color-muted); letter-spacing: .16em; text-transform: uppercase; font-size: .75rem; }
.bento { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(200px, auto); gap: var(--space-4); perspective: 1000px; }
.bento__cell { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-5); padding: 28px; transform-style: preserve-3d;
  transform: rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)); transition: transform .5s var(--ease-out), border-color .3s; }
.bento__cell--big { grid-column: span 2; grid-row: span 2; background: radial-gradient(ellipse at 80% 0%, color-mix(in srgb, var(--color-accent) 16%, transparent), transparent 60%), var(--color-surface); }
.bento__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: color-mix(in srgb, var(--color-accent) 12%, transparent); color: var(--color-accent); transition: transform .6s var(--ease-out); transform: translateZ(30px); }
.bento__cell:hover .bento__icon { transform: translateZ(40px) rotate(-8deg) scale(1.1); }
.bento__num { position: absolute; top: 22px; right: 24px; color: var(--color-muted); }
.bento__title { font: var(--display-weight) var(--step-2)/1.05 var(--font-display); text-transform: var(--display-transform); letter-spacing: var(--display-tracking); transform: translateZ(20px); }
.bento__cell--big .bento__title { font-size: var(--step-4); }
.bento__text { margin-top: 10px; color: var(--color-muted); font-size: .9375rem; max-width: 36ch; }
.bento--visual { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); grid-auto-rows: minmax(170px, auto); }
[data-theme="film"] .bento__icon { border-radius: 2px; }

/* ---------- 4. Works (horizontal gallery) ---------- */
.works__viewport { overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: thin; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); padding-bottom: 12px; }
.works__viewport.is-pinned { overflow: visible; }
.works__track { list-style: none; display: flex; gap: var(--space-5); width: max-content; }
.work-card { width: clamp(280px, 38vw, 520px); scroll-snap-align: start; }
.work-card[hidden] { display: none; }
.work-card__link { display: block; }
.work-card__media { position: relative; margin: 0 0 16px; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-lg); background: var(--color-surface); border: 1px solid var(--color-line); }
.work-card__media img, .work-card__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out), opacity .5s; }
.work-card__video { opacity: 0; }
.work-card.is-previewing .work-card__video { opacity: 1; }
.work-card__link:hover img { transform: scale(1.05); }
.work-card__placeholder { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(5rem, 12vw, 9rem); color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--color-text) 20%, transparent);
  background: radial-gradient(ellipse at 30% 20%, color-mix(in srgb, var(--color-accent) 16%, transparent), transparent 60%); }
.work-card__meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.work-card__title { font-size: var(--step-2); transition: color .2s; }
.work-card__link:hover .work-card__title { color: var(--color-accent); }
.work-card__text { margin-top: 6px; color: var(--color-muted); max-width: 44ch; }
[data-theme="film"] .work-card__media { border-radius: 2px; }
[data-theme="film"] .work-card__media img { filter: grayscale(.4); }
[data-theme="film"] .work-card__link:hover img { filter: none; }

/* ---------- 5. Stats ---------- */
.stats__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); }
.stats__item { display: flex; flex-direction: column-reverse; gap: 8px; padding: 28px 0; border-top: 1px solid var(--color-line); }
.stats__value { margin: 0; font-size: var(--step-6); line-height: .9; font-variant-numeric: tabular-nums; }
.stats__suffix { color: var(--color-accent); }
.stats__label { color: var(--color-muted); }
[data-theme="aurora"] .stats__value { background: linear-gradient(135deg, var(--color-text), var(--color-aux-1)); -webkit-background-clip: text; background-clip: text; color: transparent; padding: .1em 0; }
[data-theme="aurora"] .stats__suffix { -webkit-text-fill-color: var(--color-accent); }

/* ---------- 6. Studio ---------- */
.studio__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.studio__media { position: relative; margin: 0; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius-lg); background: radial-gradient(ellipse at 50% 20%, color-mix(in srgb, var(--color-accent) 20%, transparent), var(--color-surface) 70%); }
.studio__media img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.85); }
.studio__placeholder { display: grid; place-items: center; height: 100%; color: var(--color-accent); }
.studio__placeholder .icon { width: 30%; height: 30%; opacity: .35; }
.studio__badge { position: absolute; left: 20px; top: 20px; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--radius-pill); background: rgba(0, 0, 0, .55); color: #fff; font-size: .75rem; }
.studio__copy .section-head { margin-bottom: var(--space-5); }
.studio__text { color: var(--color-muted); font-size: var(--step-1); max-width: 42ch; }
.studio__eq-title { margin: var(--space-6) 0 var(--space-3); color: var(--color-muted); font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; }
.studio__eq { list-style: none; display: grid; gap: 2px; }
.studio__eq li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--color-line); }
[data-theme="film"] .studio__media { border-radius: 2px; }

/* ---------- 7. Timeline (Aceternity Timeline adaptation) ---------- */
.timeline__intro { margin-bottom: var(--space-6); }
.timeline__body { position: relative; padding-left: 64px; }
.timeline__line { position: absolute; left: 20px; top: 8px; bottom: 8px; width: 2px; background: var(--color-line); border-radius: 2px; overflow: hidden; }
.timeline__line span { position: absolute; inset: 0; transform-origin: top; transform: scaleY(var(--progress, 1));
  background: linear-gradient(to bottom, transparent, var(--color-accent) 12%, var(--color-aux-1)); box-shadow: 0 0 18px var(--color-accent); }
.js .timeline__line span { --progress: 0; }
.timeline__list { list-style: none; display: grid; gap: var(--space-6); }
.timeline__item { position: relative; display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.timeline__dot { position: absolute; left: -64px; top: 4px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--color-bg); border: 1px solid var(--color-line-strong); color: var(--color-accent); }
.timeline__dot .icon { width: 18px; height: 18px; }
.timeline__when { position: sticky; top: calc(var(--nav-h) + 40px); padding-top: 12px; color: var(--color-muted); font-size: .8125rem; letter-spacing: .08em; }
.timeline__card { padding: 22px 24px; }
.timeline__title { font-size: var(--step-1); line-height: 1.25; font-family: var(--font-body); font-weight: 600; text-transform: none; letter-spacing: 0; }
.timeline__org { margin-top: 4px; }
.timeline__text { margin-top: 10px; color: var(--color-muted); }
.timeline__open { margin-top: 14px; }
[data-theme="film"] .timeline__dot { border-radius: 2px; }

/* ---------- 8. Testimonials + logos (Infinite Moving Cards / LogoLoop) ---------- */
.marquee { --gap: var(--space-5); overflow: hidden; mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { list-style: none; display: flex; gap: var(--gap); width: max-content; }
.marquee.is-running .marquee__track { animation: marquee-x var(--duration, 60s) linear infinite; }
.marquee[data-marquee-reverse].is-running .marquee__track { animation-direction: reverse; }
.marquee:hover .marquee__track, .marquee:focus-within .marquee__track { animation-play-state: paused; }
@keyframes marquee-x { to { transform: translateX(calc(-50% - var(--gap) / 2)); } }
.quote-card { width: min(420px, 80vw); display: flex; flex-direction: column; gap: 18px; padding: 28px; }
.quote-card__rating { color: var(--color-accent); letter-spacing: .2em; }
.quote-card__text { margin: 0; font: italic 400 var(--step-1)/1.45 var(--font-serif); }
.quote-card__who { display: flex; align-items: center; gap: 12px; margin-top: auto; font-size: .9375rem; }
.quote-card__who img, .quote-card__initial { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.quote-card__initial { display: grid; place-items: center; background: var(--color-surface-2); color: var(--color-accent); font-weight: 700; }
.marquee--logos { margin-top: var(--space-7); --gap: clamp(40px, 6vw, 88px); }
.logo-item { display: flex; align-items: center; height: 56px; }
.logo-item img { height: 40px; width: auto; filter: grayscale(1) brightness(1.6); opacity: .55; transition: filter .3s, opacity .3s; }
.logo-item span { color: var(--color-muted); font-size: var(--step-2); transition: color .3s; }  /* no opacity: text logos must keep AA contrast */
.logo-item:hover img { filter: none; opacity: 1; }
.logo-item:hover span { color: var(--color-text); }

/* ---------- 9. Social ---------- */
.social__grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: var(--space-4); align-items: stretch; }
.social__card { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 16px; padding: 36px;
  background: radial-gradient(ellipse at 20% 0%, color-mix(in srgb, #E1306C 20%, transparent), transparent 60%), radial-gradient(ellipse at 100% 100%, color-mix(in srgb, var(--color-accent) 16%, transparent), transparent 60%), var(--color-surface); }
.social__avatar { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: linear-gradient(135deg, #F58529, #DD2A7B 50%, #8134AF); color: #fff; }
.social__avatar .icon { width: 30px; height: 30px; }
.social__handle { max-width: 100%; font-size: clamp(1.25rem, 2.1vw, 2rem); overflow-wrap: anywhere; text-transform: none; }
.social__motto { color: var(--color-muted); font: italic 400 var(--step-1)/1.4 var(--font-serif); }
.social__feed { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.social__feed li, .social__feed a { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-md); }
.social__feed img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.social__feed a:hover img { transform: scale(1.06); }
.social__hover { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .45); color: #fff; opacity: 0; transition: opacity .3s; }
.social__feed a:hover .social__hover, .social__feed a:focus-visible .social__hover { opacity: 1; }
.social__grid:not(:has(.social__feed)) { grid-template-columns: minmax(0, 560px); }

/* ---------- 10. FAQ ---------- */
.faq__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.faq__grid .section-head { position: sticky; top: calc(var(--nav-h) + 40px); }
[data-theme="aurora"] .faq__grid .section-head { align-items: flex-start; text-align: left; }
.faq__item { border-bottom: 1px solid var(--color-line); }
.faq__q { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 0; cursor: pointer; list-style: none; font-size: var(--step-1); font-weight: 600; }
.faq__q::-webkit-details-marker { display: none; }
.faq__q:hover { color: var(--color-accent); }
.faq__icon { position: relative; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--color-line-strong); }
.faq__icon::before, .faq__icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.5px; background: currentColor; transform: translate(-50%, -50%); transition: transform .4s var(--ease-out); }
.faq__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq__item[open] .faq__icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq__a { overflow: hidden; }
.faq__a p { padding-bottom: 22px; color: var(--color-muted); max-width: 62ch; }

/* ---------- 11. CTA ---------- */
.cta { overflow: hidden; text-align: center; padding-block: clamp(120px, 18vw, 240px); }
.cta__sparkles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.cta::before { content: ""; position: absolute; inset: 0; z-index: -2; background: radial-gradient(ellipse 60% 55% at 50% 60%, color-mix(in srgb, var(--color-accent) 14%, transparent), transparent 70%); }
.cta__inner { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.cta__inner .eyebrow { display: inline-flex; align-items: center; gap: 10px; }
.cta__title { max-width: 14ch; font-size: clamp(3rem, 9vw, 8.5rem); padding: .14em .04em .1em; margin: -.14em 0 -.1em; }
.shiny {
  background: linear-gradient(110deg, var(--color-text) 35%, var(--color-accent) 48%, var(--color-aux-1) 52%, var(--color-text) 65%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s linear infinite;
}
@keyframes shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.cta__lead { margin-inline: auto; }
.cta__text { color: var(--color-muted); max-width: 52ch; }
.cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: var(--space-5); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio__grid, .faq__grid, .social__grid { grid-template-columns: minmax(0, 1fr); }
  .faq__grid .section-head { position: static; }
  .studio__media { aspect-ratio: 16 / 10; }
  .social__feed { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .bento__cell--big { grid-column: auto; grid-row: auto; }
  .timeline__body { padding-left: 52px; }
  .timeline__dot { left: -52px; width: 36px; height: 36px; }
  .timeline__line { left: 17px; }
  .timeline__item { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .timeline__when { position: static; padding-top: 6px; }
  .showreel__play { width: 72px; height: 72px; }
  .social__feed { grid-template-columns: repeat(2, 1fr); }
  .work-card { width: 82vw; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-ready [data-reveal]:not(.is-revealed) { opacity: 1; transform: none; filter: none; }
  .showreel__screen { --tilt: 0deg; --scale: 1; }
  .voice-demos__wave path, .shiny, .marquee.is-running .marquee__track, .demo-card:hover .demo-card__bars i { animation: none; }
  .marquee { overflow-x: auto; }
  .bento__cell { transform: none; }
  .js .timeline__line span { --progress: 1; }
}
