/* Idle transforms are independent of the one-shot entrance transforms. */
@keyframes record-float {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  50% { translate: var(--float-drift, 0px) calc(-1 * var(--float-lift)); rotate: var(--float-tilt, 0deg); }
}

@keyframes record-vinyl {
  to { transform: rotate(1turn); }
}

@keyframes record-halo {
  50% { transform: translate(-7%, 5%) scale(1.12); }
}

@keyframes record-pop {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Inset navigation and raised surfaces carry the depth even at rest. */
:root[data-theme='studio'] {
  --record-nav-offset: 12px;
  scroll-padding-top: calc(var(--record-header-height) + var(--record-nav-offset));
}

#root .record-header {
  top: var(--record-nav-offset);
  width: calc(100% - 32px);
  max-width: 1440px;
  margin: var(--record-nav-offset) auto 0;
  border: 1px solid var(--record-line);
  border-radius: 22px;
  background: #f6f7e7e8;
  backdrop-filter: blur(20px) saturate(130%);
  box-shadow: 0 16px 38px -18px var(--record-shadow), inset 0 1px #fffc;
}

#root .record-header > .record-header-inner { padding-inline: clamp(16px, 2.2vw, 32px); }
#root .record-header .record-nav { gap: clamp(3px, .8vw, 13px); }
#root .record-header .record-nav a { padding-inline: 10px; border-radius: 12px; }
#root .record-header .record-nav a:is(:hover, [aria-current='location']) { background: var(--record-tint); }
#root .record-header-quote, #root .record-menu-toggle { border-radius: 13px; }

#root :is(#services article, #about .glass-panel, #credits .studio-tile, #achievements .studio-tile, .xs-card, .mbz-steps article, .mbz-form) {
  border-radius: 22px;
  border-color: var(--record-line);
  box-shadow: 0 22px 48px -20px var(--record-shadow), inset 0 1px #fffc;
  background-image: linear-gradient(145deg, #f1f5e0, transparent 56%);
}

#root :is(.xs-feature, .xs-bespoke) {
  border-radius: 24px;
  box-shadow: 0 26px 52px -24px #0009, inset 0 1px #fff3df0b;
}

#root .mbz-contact-aside {
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid var(--record-line);
  border-radius: 22px;
  background: linear-gradient(145deg, #eef3d6, #dce7ca);
  box-shadow: 0 24px 48px -22px var(--record-shadow), inset 0 1px #fffc;
}

#root .record-portrait {
  border-radius: 26px;
  border-color: #a4ba8b;
  box-shadow: 0 38px 65px -20px #233a27a6, 0 10px 22px #233a2745;
}

#root .record-credits {
  padding: 18px 24px;
  margin-bottom: 24px;
  border: 1px solid #e6ceb026;
  border-radius: 18px;
  background: linear-gradient(125deg, #282119, #191612);
  box-shadow: 0 15px 32px -16px #0009, inset 0 1px #fff3df08;
}

#root :is(.record-actions .record-button, .xs-primary, .mbz-primary) {
  border-radius: 14px;
  box-shadow: 0 7px 18px -9px var(--record-shadow), inset 0 1px #fffff430;
}

#root .xa-layout { gap: 28px; }
#root .xa-list { gap: 12px; }
#root .xa-player {
  border-radius: 24px;
  border-color: var(--record-line);
  box-shadow: 0 30px 55px -28px var(--record-shadow), inset 0 1px #fff;
}
#root .xa-demo {
  border-radius: 16px;
  box-shadow: 0 10px 20px -12px var(--record-shadow), inset 0 1px #fffff4;
}
#root .xa-demo[aria-pressed='true'] { box-shadow: 0 14px 24px -14px var(--record-shadow), inset 0 1px #fffff4; }

/* The record peeks out behind the portrait, with the light as a separate layer. */
#root #home { isolation: isolate; overflow: clip; }
.record-hero { position: relative; isolation: isolate; }
.record-hero::before, .record-hero::after {
  content: '';
  position: absolute;
  z-index: -1;
  pointer-events: none;
  aspect-ratio: 1;
  border-radius: 50%;
}

.record-hero::before {
  width: min(51vw, 740px);
  inset: -12% -5% auto auto;
  background: radial-gradient(circle, #d5e6a77a, #aec17a36 40%, transparent 70%);
}

.record-hero::after {
  width: clamp(160px, 25vw, 400px);
  inset: 15% -1.6% auto auto;
  border: 1px solid #c5d59f80;
  background:
    radial-gradient(circle, #233e2b 0 2%, #a0b771 2.3% 21%, transparent 21.5%),
    repeating-radial-gradient(circle, transparent 0 4px, #bfce9a50 5px, transparent 6px 9px),
    conic-gradient(from 30deg, #2d442d, #16281d, #6e8252, #1a2f22, #2d442d);
}

.record-portrait {
  margin-inline-end: clamp(15px, 3vw, 48px);
  box-shadow: 0 25px 55px #0005;
}

.record-profiles { align-items: center; gap: 6px; }
.record-motion-toggle {
  min-height: 44px;
  margin-inline-start: 6px;
  color: var(--record-muted);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: .25em;
}

@media (prefers-reduced-motion: no-preference) {
  #root [data-float] {
    --float-lift: 10px;
    animation: record-float var(--float-period, 8s) var(--float-phase, 0s) ease-in-out infinite;
    animation-play-state: paused;
  }

  #root .record-portrait[data-float] { --float-lift: 18px; }
  #root .record-actions[data-float] { --float-lift: 3px; }
  #root .xa-demo[data-float] { --float-lift: 4px; }
  #root .xa-player[data-float] { --float-lift: 6px; }

  #root .record-hero::before { animation: record-halo 11s ease-in-out infinite paused; }
  #root .record-hero::after { animation: record-vinyl 23s linear infinite paused; }
  #root .xs-pack-front { --float-lift: 11px; animation: record-float 7.8s -1s ease-in-out infinite paused; }
  #root .xs-pack-back { --float-lift: 8px; animation: record-float 9.4s -3s ease-in-out infinite paused; }

  html:not([data-motion-suspended]) #root [data-float][data-motion-visible],
  html:not([data-motion-suspended]) #root .record-hero[data-motion-visible]::before,
  html:not([data-motion-suspended]) #root .record-hero[data-motion-visible]::after,
  html:not([data-motion-suspended]) #root .xs-feature-art[data-motion-visible] .xs-pack {
    animation-play-state: running;
  }

  #root [data-float]:is(:focus-within, :active),
  #root .xs-feature-art:not([data-motion-visible]) .xs-wave i,
  #root .xa-player:not([data-motion-visible]) .xa-bars i,
  html[data-motion-suspended] #root :is(.xs-wave i, .xa-bars i) {
    animation-play-state: paused !important;
  }

  #root :is(.xs-dialog[open], #record-mobile-menu:not([hidden]), .mbz-draft-panel:not([hidden])) {
    animation: record-pop 230ms cubic-bezier(.23, 1, .32, 1) both;
  }

  #root :is(.record-button, .record-menu-toggle, .record-profiles a, .xa-demo, .xa-switch button, .xs-primary, .xs-save, .xs-shortlist, .mbz-primary) {
    transition: scale 180ms cubic-bezier(.23, 1, .32, 1), background-color 180ms ease, border-color 180ms ease;
  }

  #root :is(.record-button, .record-menu-toggle, .record-profiles a, .xa-demo, .xa-switch button, .xs-primary, .xs-save, .xs-shortlist, .mbz-primary):active {
    scale: .97;
  }

  @media (hover: hover) and (pointer: fine) {
    #root [data-float]:hover { animation-play-state: paused !important; }
    #root :is(.record-button, .record-profiles a, .xa-switch button, .xs-primary, .mbz-primary):hover { scale: 1.025; }
    #root [data-depth] {
      transform: perspective(1000px) rotateX(var(--surface-x, 0deg)) rotateY(var(--surface-y, 0deg));
      transition: transform 420ms cubic-bezier(.2, .75, .25, 1), border-color 220ms ease;
    }
    #root [data-depth][data-tilting] { transition-duration: 140ms, 220ms; border-color: var(--record-control-line); }
    html[data-motion-suspended] #root [data-depth] { transform: none; transition: none; }
  }

  @media (max-width: 760px) {
    #root [data-float] { --float-lift: 4px; }
    #root .record-portrait[data-float] { --float-lift: 10px; }
    #root .record-actions[data-float] { --float-lift: 2px; }
    #root .xa-player[data-float] { --float-lift: 4px; }
  }
}

@media (max-width: 1040px) {
  :root[data-theme='studio'] { --record-nav-offset: 10px; }
  #root .record-header { width: calc(100% - 24px); border-radius: 18px; }
  #root .record-header > .record-header-inner { padding-inline: 12px; gap: 10px; }
  #root #record-mobile-menu {
    inset: calc(100% + 10px) 0 auto;
    max-height: calc(100dvh - var(--record-header-height) - 44px);
    padding: 12px;
    border: 1px solid var(--record-line);
    border-radius: 20px;
    background: #f6f7e7fa;
    box-shadow: 0 20px 40px -10px var(--record-shadow), inset 0 1px #fffc;
  }
}

@media (max-width: 760px) {
  #root .record-credits { padding: 10px 16px 16px; }
  #root .record-portrait { border-radius: 20px; }
  #root .xa-layout { gap: 20px; }
  #root .mbz-contact-aside { padding: 20px; }
  .record-hero::before { width: 95%; inset: auto -9% -6% auto; }
  .record-hero::after { width: clamp(112px, 37vw, 245px); inset: auto -2% 6% auto; }
  .record-portrait { margin-inline-end: clamp(12px, 5vw, 28px); }
}
