/* Short interaction responses, with a quiet shared breath in the hero. */
/* Static keyframes live in definitions.css, outside responsive rule changes. */
.card { transition: none; will-change: auto; }
.card:hover { transform: none; box-shadow: none; }
.card:hover .card-art { transform: none; }
.card:hover .card-art img { transform: none; }
.card-art, .shot, .gthumb, .thumb, .mini-shots a {
  transition: transform var(--motion-settle) var(--motion-ease), box-shadow var(--motion-settle) var(--motion-ease), border-color var(--brand-motion-feedback), background var(--brand-motion-feedback);
}
.card-art { transform-origin: 50% 50%; will-change: auto; }
.card-art img { transition: transform var(--motion-settle) var(--motion-ease); will-change: auto; }
.card-foot span:last-child { transition: transform var(--motion-settle) var(--motion-ease); }
.card:focus-within .card-art { box-shadow: 4px 5px 0 var(--game-accent), 6px 7px 0 var(--ink); }
.card:focus-within h3, .card:hover h3 { color:var(--text); }
.stage-img { animation: none; }
.stage-previous { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.zoom-btn { z-index: 1; }

@media (prefers-reduced-motion: no-preference) {
  .motion-arrival.is-seen { animation: studio-arrives var(--motion-settle) var(--arrival-delay,0ms) var(--motion-ease) backwards; }
  .motion-arrival:focus-within { animation: none; }
  .mast-mark { transform-origin: 50% 85%; }
  .studio-brand:focus-visible .mast-mark { animation: mascot-hello var(--motion-settle) var(--motion-ease); }
  .card:focus-within .card-art { transform: none; }
  .card:has(:focus-visible) .card-foot span:last-child { transform: translateX(4px); }
  .shot:focus-visible, .mini-shots a:focus-visible { transform: translateY(-3px); }
  .thumb:focus-visible { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .studio-brand:hover .mast-mark { animation: mascot-hello var(--motion-settle) var(--motion-ease); }
  .card:hover .card-art {
    transform: none;
  }
  .card:hover .card-art img { transform: scale(1.025); }
  .card:hover .card-foot span:last-child { transform: translateX(4px); }
  .shot:hover, .mini-shots a:hover { transform: translateY(-3px); }
  .crew:has(.btn:hover) img { translate: 0 -4px; rotate: 3deg; }
  .crew img { transition: translate var(--motion-settle) var(--motion-ease), rotate var(--motion-settle) var(--motion-ease); }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) and (min-width: 701px) {
  .mascot-motion {
    transform-box: view-box; transform-origin: 375px 514px;
    transform: rotate(calc(var(--art-x,0) * .9deg));
    transition: transform var(--motion-settle) var(--motion-ease);
  }
  .stage, .slide-media { transition: transform var(--motion-settle) var(--motion-ease); }
  .stage.is-aimed, .slide-media.is-aimed {
    transform: perspective(1200px) rotateX(calc(var(--art-y,0) * -.8deg)) rotateY(calc(var(--art-x,0) * 1deg));
  }
}
@media (hover: none) {
  .card:hover .card-art { box-shadow: 4px 5px 0 var(--game-accent), 6px 7px 0 var(--ink); }
  .card:hover h3 { color:var(--text); }
  .shot:hover, .thumb:hover, .gthumb:hover, .mini-shots a:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mascot-motion, .mascot-shadow, .stage, .slide-media { transform: none !important; }
  .card:focus-within .card-art, .card:hover .card-art { transform: none; }
  .card:hover .card-art img, .card-foot span:last-child, .crew img { translate: none; }
}

/* Transform-only breaths share a clock and leave a quiet rest between cycles. */
.crack-breath, .crack-word { display: inline-block; transform-origin: 50% 80%; }
/* A regular horizontal band carries through the hero into the games heading. */
.hero-matrix { --matrix-alpha:.6; --matrix-engaged-alpha:.46; --sparkle-peak-alpha:1; --sparkle-floor:.37; --breathe-floor:.62; --star-idle-opacity:.85; --sparkle-energy-growth:1.5; }
/* The static fallback follows the live ink's broad eased exit. */
.hero-matrix,.hero-field-canvas { position:absolute; inset:0 0 auto; width:100%; height:calc(100% + 96px); z-index:-2; pointer-events:none; overflow:hidden; mask-image:linear-gradient(to bottom,#000 0,#000 32%,rgba(0,0,0,.904) 45%,rgba(0,0,0,.673) 58%,rgba(0,0,0,.369) 72%,rgba(0,0,0,.125) 85%,rgba(0,0,0,.022) 94%,transparent 100%); }
.hero-matrix.is-canvas .matrix-strand { display:none; }
.hero-matrix.is-canvas { visibility:hidden; mask:none; }
/* Start with the quiet canvas; compatibility contours only appear when their
   renderer is selected. Shader preparation never exposes the legacy SVG. */
html.js .hero-matrix:not([data-ink-renderer="svg"]):not([data-ink-renderer="canvas"]) .matrix-strand { visibility:hidden; }
.hero-ink-canvas { opacity:0; }
.hero-ink-canvas.is-ink-live { opacity:1; transition:opacity 480ms linear; }
.hero-yolk-canvas { opacity:0; }
.hero-yolk-canvas.is-yolk-live { opacity:1; transition:opacity 320ms ease-out; }
@media (prefers-reduced-motion:reduce) {
  .hero-ink-canvas.is-ink-live,.hero-yolk-canvas.is-yolk-live { transition:none; }
}
.hero-matrix.is-canvas .matrix-dot { animation:none!important; transition:none!important; }
@media (max-width:700px) {
  .hero-matrix:not([data-star-density="full"]) .matrix-dot { translate:0 var(--compact-shift,0px); }
  .hero-matrix:not([data-star-density="full"]) .sparkle-detail { display:none; }
}
[data-theme="night"] .hero-matrix { --matrix-alpha:.12; --matrix-engaged-alpha:.46; --sparkle-peak-alpha:.48; --sparkle-floor:.175; }
[data-theme="night"] .hero-matrix .matrix-strand { opacity:.09; }
[data-theme="night"] .matrix-dot.is-engaged { --matrix-alpha:.46; }
.brand-motion :is(.hero-matrix,.hero-field-canvas) { z-index:-1; height:100%; mask-image:linear-gradient(to bottom,#000,#000 65%,transparent); }
/* Live opacity already includes the exit; do not mask it a second time. */
.hero-field-canvas.hero-yolk-canvas { mask-image:none; }
/* At 3x the touch bitmap already has antialiased contours. Each texel
   covers two physical pixels; a second smoothing pass resamples the strip. */
@media (max-width:680px) and (hover:none) and (pointer:coarse) and (resolution:3dppx) {
  .studio-page .has-star-brush .hero-yolk-canvas { image-rendering:pixelated; }
}
.brand-motion.launch { background:var(--canvas-start); border-radius:20px; }
.matrix-dot {
  fill:var(--matrix-rest);
  fill-opacity:var(--star-idle-opacity);
  opacity:calc(var(--dot-alpha,.5) * var(--matrix-alpha) * var(--copy-clearance,1));
}
.matrix-dot.is-engaged { --matrix-alpha:var(--matrix-engaged-alpha); --star-idle-opacity:1; }
/* Keep the resting breath cheap: resolve the three pigment mixes only while
   there is visible ink. The controller uses the same .008 paint cutoff. */
.matrix-dot.is-inked {
  --sparkle-peak-alpha:var(--matrix-engaged-alpha);
  --matrix-wave:color-mix(in srgb,var(--matrix-crest) var(--liquid-heat,0%),var(--matrix-hover));
  fill:color-mix(in srgb,var(--matrix-wave) var(--liquid-energy,0%),var(--matrix-rest));
}
.studio-page .launch-inner { pointer-events:none; }
.studio-page .launch-copy { pointer-events:auto; }
/* Only exposed backdrop has a horizontal brush. Text, mascot and controls
   sit above it with their native touch behavior. Zoom restores free panning. */
.star-brush-zone { display:none; }
.has-star-brush > .star-brush-zone { display:block; position:absolute; inset:0; z-index:-1; touch-action:pan-y pinch-zoom; }
.has-star-brush .launch-art,.studio-page .has-star-brush .launch-copy { pointer-events:none; }
.has-star-brush .mascot-motion { pointer-events:visiblePainted; }
.studio-page .has-star-brush .launch-copy > :is(h1,p,a) { pointer-events:auto; }
.launch-cue { display:inline-block; transform-origin:50% 80%; }

/* Reserve the full headline from first paint. CSS finishes the reveal even if
   the deferred behavior script is unavailable. All motion has a finite end. */
@media (prefers-reduced-motion: no-preference) {
  html.js:not(.hero-intro-done):not([data-brand-preview]) .studio-page .launch-cue {
    animation:launch-cue-enter var(--brand-motion-intro-word) var(--motion-ease) both;
  }
  html.js:not(.hero-intro-done):not([data-brand-preview]) .studio-page [data-launch-cue="ready"] { animation-delay:var(--brand-motion-intro-ready); }
  html.js:not(.hero-intro-done):not([data-brand-preview]) .studio-page [data-launch-cue="set"] { --cue-tilt:5deg; animation-delay:var(--brand-motion-intro-set); }
  html.js:not(.hero-intro-done):not([data-brand-preview]) .studio-page [data-launch-cue="crack"] { --cue-tilt:-3deg; animation-delay:var(--brand-motion-intro-crack); }
  html.js:not(.hero-intro-done):not([data-brand-preview]) .studio-page .mascot-egg { --egg-hop:-24px; --egg-windup:6px; animation:egg-spring var(--brand-motion-splash) cubic-bezier(.3,.1,.3,1) var(--brand-motion-intro-crack) backwards; }
  html.js:not(.hero-intro-done):not([data-brand-preview]) .studio-page .crack-word { animation:crack-spring var(--brand-motion-splash) cubic-bezier(.3,.1,.3,1) var(--brand-motion-intro-crack) backwards; }
  html.js:not(.hero-intro-done):not([data-brand-preview]) .studio-page :is(.keg-back,.keg-front,.ink-mask-recoil) { animation:keg-recoil var(--brand-motion-splash) var(--motion-ease) var(--brand-motion-intro-crack) backwards; }
  html.js:not(.hero-intro-done):not([data-brand-preview]) .studio-page .shadow-contact { animation:keg-contact var(--brand-motion-splash) cubic-bezier(.3,.1,.3,1) var(--brand-motion-intro-crack) backwards; }
  html.js.hero-intro-waiting:not(.hero-intro-done):not([data-brand-preview]) .studio-page :is(.launch-cue,.mascot-egg,.crack-word,.keg-back,.keg-front,.ink-mask-recoil,.shadow-contact) { animation-play-state:paused; }
}

/* A brief accent peeks out from behind the cover; the image keeps its own clip. */
.grid > .card { isolation: isolate; }
@media (min-width: 350px) {
  .grid > .card::before {
    content: ""; position: absolute; z-index: -1; pointer-events: none;
    top: -21px; right: 12px; width: min(34%,90px); height: 44px;
    background: var(--game-accent); opacity: 0;
    mask: url("/img/brand/brew-splash.svg") center / 100% 100% no-repeat;
    transform-origin: 50% 100%;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .launch .egg-breath { transform-box: fill-box; transform-origin: 50% 100%; animation: egg-breathe var(--brand-motion-idle) ease-in-out infinite paused; }
  .launch :is(.keg-breath,.ink-mask-breath) { transform-box:view-box; transform-origin:76px 138px; animation:keg-breathe var(--brand-motion-idle) ease-in-out infinite paused; }
  .launch .ground-breath { transform-box:fill-box; transform-origin:50% 50%; animation:ground-breathe var(--brand-motion-idle) ease-in-out infinite paused; }
  .launch .shadow-ambient { transform-box:fill-box; transform-origin:center; animation:ink-shadow-breathe var(--brand-motion-idle) ease-in-out infinite paused; }
  .crack-breath { animation: crack-breathe var(--brand-motion-idle) ease-in-out infinite paused; }
  .launch.is-idling :is(.egg-breath,.keg-breath,.ink-mask-breath,.ground-breath,.shadow-ambient,.crack-breath), .type-motion-grid:has(.launch.is-idling) .crack-breath { animation-play-state: running; }
  .matrix-dot {
    animation:none;
    transition:opacity 180ms ease-out;
  }
  .launch:has(.launch-art.is-splashing, .hero-matrix.is-playing) :is(.egg-breath,.keg-breath,.ink-mask-breath,.ground-breath,.shadow-ambient),
  :is(.launch,.type-motion-grid):has(.launch-art.is-splashing, .hero-matrix.is-playing) .crack-breath { animation-play-state: paused; }
  .grid > .card.is-splashing:is(:hover, :focus-within)::before { animation: card-splash 740ms var(--motion-ease); }
  .grid > .card.is-splashing.is-touch-splash::before { animation: card-touch-splash var(--brand-motion-touch) var(--motion-ease); }
  .mascot-egg { transform-box: fill-box; transform-origin: 50% 100%; }
  :is(.keg-back,.keg-front,.ink-mask-recoil) { transform-box: view-box; transform-origin: 64px 132px; }
  .shadow-contact { transform-box:fill-box; transform-origin:center; }
  .launch-art.is-splashing .mascot-egg { animation: egg-spring var(--brand-motion-splash) cubic-bezier(.3,.1,.3,1); }
  :is(.launch,.type-motion-grid):has(.launch-art.is-splashing) .crack-word { animation:crack-spring var(--brand-motion-splash) cubic-bezier(.3,.1,.3,1); }
  .launch-art.is-splashing :is(.keg-back,.keg-front), .launch:has(.launch-art.is-splashing) .ink-mask-recoil { animation: keg-recoil var(--brand-motion-splash) var(--motion-ease); }
  .launch-art.is-splashing .shadow-contact { animation:keg-contact var(--brand-motion-splash) cubic-bezier(.3,.1,.3,1); }
  .g-media::before, .crew-mascot::before { transform-origin: 50% 80%; }
  .g-media.is-splashing::before, .crew-mascot.is-splashing::before { animation: splash-settle 700ms var(--motion-ease); }
  .g-media.is-touch-splash::before { animation-duration: var(--brand-motion-touch); }
  .chapter.is-splashing .splash-word::after { animation: splash-underline 650ms var(--motion-ease); transform-origin: left center; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 349px) {
  /* Compact horizontal cards use their rim; no splash near the title. */
  .grid > .card.is-touch-splash .card-art { animation: card-touch-rim var(--brand-motion-touch) var(--motion-ease); }
}
@media (prefers-reduced-motion: reduce) {
  .mascot-egg, .keg-back, .keg-front, .keg-breath, .ground-breath, .shadow-ambient, .shadow-contact, .crack-word { transform: none !important; }
}
